There’s multiple online and offline BUG meetings this month; go if you can.
How is Swift language support? If nil, is there a way to code bounty sponsor it to be ported?
My continuous journey into toolchains, in the second quarter of 2022
This is the fifth post in my toolchains adventures series. Please check the previous posts in the toolchains category for more context about this journey.
In Pkgsrc land, I updated mold to the 1.2, 1.2.1, and 1.3 versions, and pax-utils to the 1.3.4 one. I also added a z3 option to our llvm and clang packages to allow building them against the Z3 theorem prover. When both lang/llvm and lang/clang are built with the z3 option enabled, the Z3 constraint solver is activated for the Clang static analyzer. This option is not enabled by default. I wrote a blog post showing how to use Z3 as an external solver and to do refutation to filter out false positives.
While I mention static analysis, I’ve been extremely impressed with the progress of the GCC’s static analysis framework. It was introduced in GCC 10, and a major rewrite occurred in GCC 11. It now generates significantly less false positives, and found some valid memory leaks on error paths in libansilove 1.30, which the Clang static analyzer didn’t catch.
Regarding the NetBSD base system, I started evaluating what it would take to upstream our local binutils patches. The version we have in NetBSD’s src repository is binutils 2.34 (released in February 2020), and diffing our tree with the release tarball results in a 4310 lines diff, touching 163 files with 1404 insertions and 186 deletions.
For each of these changes, we need to dig into version control history to find why they were needed in the first place, verify if they are still needed, and if so potentially rework them to meet upstream coding standards. This requires an understanding of the problem domain to be able to explain the rationale behind the changes while submitting patches and writing relevant commit messages.
While some of those patches are NetBSD specific, we still need to ensure we are not breaking other operating systems. Ultimately, vanilla binutils should be able to produce working binaries on NetBSD without requiring any local patches. Once this goal is reached, we need to ensure it keeps building, investigate test suite failures, and setup buildbots for continuous builds on key architectures.
On the LLVM side, I managed to do a couple of commits as well to add
libclang_rt.profile{{.*}}.a
tests for both OpenBSD and NetBSD in the
Clang driver test suite.
Lastly, I also wrote a couple of blog posts about various topics:
That’s all for now, happy Summer 2022 everyone!
LLVM commits:
2022-06-27 | aa89bb3 | [Driver][test] Add libclang_rt.profile{{.*}}.a tests for NetBSD |
2022-06-26 | 2ff4fb6 | [Driver][test] Add libclang_rt.profile{{.*}}.a tests for OpenBSD |
2022-06-24 | a129a37 | [clang] Update Clang version from 14 to 15 in scan-build.1 |
Hello.
I working on some embedded project and i planning to use NetBSD as integrated operating system.
So situation is next:
1 - For my project i need to cut NetBSD environment - cut out compiler i.e.
2 - Main development environment is Linux.
3 - Controlling suite (my software which i need to execute) written in c++17.
Based on the above, tell me if it is possible to implement my project, if yes then can you give me links to information which can be useful for me.
Dear NetBSD: I like KALSR. I have NetBSD 6x from 2020 on a raedeon box. With KALSR. The software I am about to talk to you about has BSD make files. I know the FreeBSD devs use Macs exclusively; so I want to ask you too to gauge your response and to see if you belong in this now bifurcated world: With Astra-Linux on the Russian-Misogynistic-Racist side of the world, and Mac OSX and it's App Store on the enlightened Forward Thinking Pro-Equality side of the world. While Astra-Linux and OpenBSD allow any racist misogynist to publish on it, Mac OS now requires app signatures only given by Apple for the M1 and M2 apple silicon and can revoke those Privileges from misogynists and anti-trans-rights transphobes when it is appropriate. Needless to say: Russian males will not be getting any app store or M1 and M2 keys any time soon
Yea: it "be" like that now, as one might say. Where does NetBSD and it's people fit in all of this?
Installed Mac Ports on OSX High Sierra
> sudo port install gcc11 libsdl2 openssl glfw libsdl2_gfx libsdl2_image libsdl2_mixer libsdl2_net libsdl2_ttf
and added the libs to the compile options: and that made the object code finally compile and not error out:
> CPUOPTIMIZATIONS?=-fcommon -fno-math-errno -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fno-trapping-math -D_THREAD_SAFE -I/opt/local/include/SDL2 -L/opt/local/lib -lSDL2
But it won't produce a binary:
Build more but didn't link:
> "_volume", referenced from:
> _M_Draw in menu.o
> _M_Menu_Options_AdjustSliders in menu.o
> ld: symbol(s) not found for architecture x86_64
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
> make[2]: *** [darkplaces-sdl] Error 1
> make[1]: *** [bin-debug] Error 2
> make: *** [sdl-debug] Error 2
Errors:
Won't link and won't thusly create the binary.
This is the makefile.inc:
this is the makefile (no extension)
Can someone help? (Please don't suggest upgrading the OS, nor buying a new mac)
On a headless Ubuntu 22.04 machine, I'd like to start a headless installation of NetBSD 9.2 in VirtualBox.
I have a prepared virtual machine with a set of blank disk images attached, as well as with the bootable NetBSD installation CD attached to the CDROM drive.
My idea was to perform the installation over the serial port, using minicom
, but I'm unable to get the installation to switch over to use the serial console.
I'm starting the machine with
VBoxManage startvm netbsd --type=headless
Then I try to get it to switch over the console to the serial port:
VBoxManage controlvm netbsd keyboardputfile boot.conf
... where boot.conf
is a file containing a line of text saying consdev com0
, which is what you would type on the NetBSD boot prompt to switch to the serial console.
I know NetBSD's serial console is set up to use 9600 8N1, which is what I have minicom
configured to use, and I have set up the serial port on the virtual machine like so:
UART 1: I/O base: 0x03f8, IRQ: 4, attached to pipe (server) '/tmp/netbsd.pipe', 16550A
I start minicom
using
minicom -D 'unix#/tmp/netbsd.pipe'
I successfully use the serial console on another virtual machine in an identical way, and I can see the status in minicom
switch from "Offline" to "Online" as soon as the NetBSD machine turns on, but there is no output in minicom
.
Can anyone see what the issue is and how I would go about fixing it? I know the alternative would be to PXE boot the machine, but I was hoping to be able to avoid doing that (as I don't netboot anything else at the moment).
Solid state drives are complicated. TRIM is an operation in the SATA command set that can be used to mark specific blocks of a SSD unused, which helps the SSD retain good performance when large amounts of data have been deleted. It requires operating system support. macOS actually didn't support TRIM for quite a long time, so there's at least some drives available in the wild that cope well with not being regularly TRIMed.
NetBSD 7.0 added a fdiscard
system call, which allows portions of a device or file to be TRIMed.
A discard
mount option for the FFS file system has also been available for some time:
discard Use DISCARD/TRIM commands if disk and driver support
it.
EXPERIMENTAL - negatively influences filesystem
performance by increasing fragmentation, causes free
block map inconsistency on unclean shutdown, and is
incompatible with log. If log option is also used,
discard is automatically disabled.
(per the mount(8) manual page)
The state of the art has changed over the years, and various SSD manufacturers now recommend occasional routine use of the TRIM command. So the drawbacks of mounting with discard
probably aren't worthwhile.
In February 2022, mrg committed a blkdiscard(8) command to NetBSD that utilizes the fdiscard
system call to a device or file.
According to this mailing list thread about blkdiscard, at least the wd
disk driver (used for SATA-ish drives), dk
(used for GPT partitions), and ld
support fdiscard
. cgd
doesn't know about fdiscard
yet, so all of this might not be effective on encrypted partitions, yet.
Before (re-)installing NetBSD it's now possible to drop to a shell and TRIM a complete drive to re-initialize it before installation:
# blkdiscard -v /dev/rwd0d
(This will wipe the drive!)
It's also possible to write a blank file, then use blkdiscard
to mark sections of your drive unused:
# dd if=/dev/zero of=./testfile bs=4m count=10000
# blkdiscard -v ./testfile
This could be performed as a routine maintenance task, e.g. by cron(8).
macOS has its "osascript" with "display notification", Linux has its "notify-send". Both are the most native way to generate DE notifications. What is the most native way to generate desktop notification in BSD unixes?
Notes on using the Z3 constraint solver with the Clang Static Analyzer
As far as static analyzers are concerned, one of the most important point to consider is filtering out false positives as much as possible, in order for the reports to be actionable.
This is an area on which Coverity did an excellent job, and likely a major reason why they got so popular within the open source community, despite being a closed-source product.
LLVM has the LLVM_ENABLE_Z3_SOLVER build option, which allows building LLVM against the Z3 constraint solver.
It is documented as follow:
LLVM_ENABLE_Z3_SOLVER:BOOL
If enabled, the Z3 constraint solver is activated for the Clang static analyzer.
A recent version of the z3 library needs to be available on the system.
The option is enabled in the Debian 11 package (clang-tools-11), but not in Fedora 36 or Ubuntu 22.04 ones. I added a build option (not enabled by default) to the llvm and clang packages in Pkgsrc, and successfully built Z3 enabled packages on NetBSD.
For Pkgsrc users, add the following in mk.conf, and build lang/clang:
PKG_OPTIONS.llvm= z3
PKG_OPTIONS.clang= z3
There are two ways of using Z3 with the Clang Static Analyzer, and to demonstrate them, let’s reuse the small demo snippet from the SMT-Based Refutation of Spurious Bug Reports in the Clang Static Analyzer paper.
unsigned int func(unsigned int a) {
unsigned int *z = 0;
if ((a & 1) && ((a & 1) ^1))
return *z; // unreachable
return 0;
}
For each method, we can use Clang directly on a given translation unit or use scan-build.
The first way is using Z3 as an external constraint solver:
$ clang --analyze -Xanalyzer -analyzer-constraints=z3 main.c
$ scan-build -constraints z3 clang -c main.c
scan-build: Using '/usr/lib/llvm-11/bin/clang' for static analysis
scan-build: Analysis run complete.
scan-build: Removing directory '/tmp/scan-build-2022-06-21-171854-18215-1' because it contains no reports.
scan-build: No bugs found.
This is a lot slower than the default, and the commit which documented the feature mentions a ~15x slowdown over the built-in constraint solver.
The second way is using the default range based solver but having Z3 do refutation to filter out false positives, which is a lot faster:
$ clang --analyze -Xanalyzer -analyzer-config -Xanalyzer crosscheck-with-z3=true main.c
$ scan-build -analyzer-config crosscheck-with-z3=true clang -c main.c
scan-build: Using '/usr/lib/llvm-11/bin/clang' for static analysis
scan-build: Analysis run complete.
scan-build: Removing directory '/tmp/scan-build-2022-06-21-171924-18226-1' because it contains no reports.
scan-build: No bugs found.
Again, no bugs found. How boring.
We can verify what happens if we run the analyzer without involving Z3 at all:
$ clang --analyze main.c
main.c:5:9: warning: Dereference of null pointer (loaded from variable 'z') [core.NullDereference]
return *z; // unreachable
^~
1 warning generated.
We get a false positive, because the default constraint solver cannot reason about bitwise operations (among other things), and report an unreachable NULL pointer dereference.
This week’s BSD Now is depressingly honest in the title; no puns. Along with the normal links, there’s a Beastie Bit this week for Networks From Scratch.
Howdy. Is anyone able to help me out with an installation issue?
No matter what I do, I can’t get the NetBSD installer to work on this old mid-2011 iMac A1311. Reading the boot(8) man pages didn’t work. Tried all the different boot flags, disabled Radeon graphics, uefi image, boot image, all lead to a blank screen after all the hardware detection.
Currently have FreeBSD 13.1 installed with no issues.
Thanks in advanced.
-netrunner
Backblaze publishes drive reliability data at scale, but what about a random person on the Internet with his small homelab setup? For all my talk about drives over the years, I’ve never shared my own broad experience.
These are the drive manufacturers I’ve had since 2017, with failures defined as having multiple ZFS scrubs detecting bad sectors, or the drive outright failing to turn on.
The odd-numbered Seagate was an external unit I originally intended to shuck, but ended up being scratchspace for Clara’s Mac which is still going strong. I also haven’t bought a Toshiba since the IDE days, if only because nobody has ever had much stock in Australia or Singapore, though I’d be tempted to try.
There’s no variable control here whatsoever. Two of the HGST drives were in my Debian Xen test boxes with XFS and DRBD over InfiniBand, but the rest were in various FreeBSD towers with OpenZFS, including a Microserver up at my dad’s place I do ZFS send/receives of family photos up to. Two WD drives were also briefly in a NetBSD box when I was testing version 9.0’s ZFS support.
Therefore, these stats are almost completely pointless! I just thought it was interesting that while my experience with Seagate broadly correlates with what others have said, the former industry darling HGST has stung me too. The sounds of their 8 TB drives failing harkened back to the IBM DeathStar days.
I’m weird and ended up always running personal drives in ZFS mirrors or RAID1. It just makes buying and replacing drives easier, especially when you can only afford a new drive every few months. In that way, a dead drive is an inconvenience rather than a disaster while I deal with warranties, returns, and replacements. But it’s still a pain, which is why I value reliable drives.
I haven’t been impressed with WD’s SMR shenanigans, but they earned my trust when it comes to reliability. Maybe I can ask work one day if we can publish some of our larger cluster data next time we do a fleet upgrade.
By Ruben Schade in Sydney, 2022-06-14.
A bit short cause I ran out of time.
Trying to get this nsxiv script to work on NetBSD. However, as the author states in the README
:
These are usually met on most modern Linux distributions. If your system is strictly POSIX, this script will fail to work.
So, I figure maybe it's not possible, but no harm in asking if anyone has any ideas.
I managed to circumvent the find
error by replacing -printf "%P\0"
with -print0
, That's a start I guess.
The Script:
#!/usr/bin/env sh
tmpdir="$(mktemp -d)" || {
printf "%s: %s\n" "${0##*/}" "could not create temporary directory"
exit 1
}
trap 'rm -rf -- "$tmpdir"' TERM INT EXIT
find '.' -mindepth 1 -maxdepth 1 \( -type f -o -type l \) -print0 \
| xargs -r0 -n 20 -P 64 file -00 -L --mime-type -- \
| xargs -r0 -n 2 sh -c '
case "$2" in
video/*) printf "%s\0" "$1";;
esac
' -- \
| sort -z \
| xargs -r0 -I FILE ffmpegthumbnailer -i FILE -o "$tmpdir/FILE.jpg" -m -t 50% -s 384 -q 10
{ nsxiv -0otp -- "$tmpdir"; rm -rf -- "${tmpdir:?}" > /dev/null; } \
| sed -z 's|.jpg$||;s|^.*/||' \
| xargs -r0 -I FILE xdg-open ./FILE
The errors are as expected:
sort: unknown option -- z
xargs: sh terminated by SIGPIPE
xargs: (null) terminated by SIGPIPE
sed: unknown option -- z
nsxiv: No valid image file given, aborting
The author has written a slightly more POSIX version that now provides caching of thumbnails
I have a RHEL 8.6 machine, and I'm setting up a samba file server using port 1445 so I can start the server as a non-root user. The server is working locally, as I can run smbclient -p 1445 //localhost/share
to connect to it. I am also running a QEMU NetBSD 8.2 VM, and I'm attempting to connect to the samba share using the following:
mount_smbfs -I <machine IP> //[email protected]<machine IP>:1445 mount_dir/
However, I get a "connection refused" error when I try to access it.
If I remove smb ports = 1445
from the configuration file and start the Samba daemon as root, I can connect to it from NetBSD, but I'd like to be able to host a working Samba server as non-root.
I thought perhaps if I mapped port 139 on NetBSD to 1445 on RHEL with QEMU, that would solve things (using the -net user,hostfwd=tcp::1445-:139
to QEMU), but I haven't had any luck there.
I do notice that if I do an nmap localhost
when starting the Samba server as non-root, port 1445 doesn't show up as being open.
What might be going on here?
I just noticed Joyent is distributing binary packages for NetBSD current (9.99.9*). Is this something recent or did I fail to notice this earlier? I always had the assumption there wasn't any binary packages available for current and that I had no choice but to compile everything with pkgsrc-current.
This definitely makes it more accessible to play with NetBSD-daily HEAD images! 🎉😁
While trying to build the earmv6hf package of lang/perl5 on a amd64 system, configure breaks because a test program fails compilation:
=> Bootstrap dependency digest>=20211023: found digest-20220214
===> Skipping vulnerability checks.
===> Configuring for perl-5.34.1
/usr/bin/find /usr/pkgsrc/lang/perl5/work.earmv6hf/perl-5.34.1 -name "*.orig" -type f -exec rm -f {} \;
=> Replacing Perl interpreter in cpan/Config-Perl-V/V.pm cpan/Getopt-Long/lib/Getopt/Long.pm cpan/version/lib/version.pm dist/ExtUtils-ParseXS/lib/ExtUtils/xsubpp ext/ExtUtils-Miniperl/lib/ExtUtils/Miniperl.pm ext/File-DosGlob/lib/File/DosGlob.pm lib/unicore/mktables.
INFO: [replace-interpreter] Nothing changed in cpan/Config-Perl-V/V.pm.
INFO: [replace-interpreter] Nothing changed in cpan/Getopt-Long/lib/Getopt/Long.pm.
INFO: [replace-interpreter] Nothing changed in cpan/version/lib/version.pm.
INFO: [replace-interpreter] Nothing changed in dist/ExtUtils-ParseXS/lib/ExtUtils/xsubpp.
INFO: [replace-interpreter] Nothing changed in ext/ExtUtils-Miniperl/lib/ExtUtils/Miniperl.pm.
INFO: [replace-interpreter] Nothing changed in ext/File-DosGlob/lib/File/DosGlob.pm.
INFO: [replace-interpreter] Nothing changed in lib/unicore/mktables.
First let's make sure your kit is complete. Checking...
Would you like to see the instructions? [n]
Locating common programs...
Checking compatibility between /usr/pkgsrc/lang/perl5/work.earmv6hf/.tools/bin/echo and builtin echo (if any)...
Symbolic links are supported.
Checking how to test for symbolic links...
You can test for symbolic links with 'test -h'.
Checking for cross-compile
No targethost for running compiler tests against defined, running locally
Good, your tr supports [:lower:] and [:upper:] to convert case.
Using [:upper:] and [:lower:] to convert case.
aix esix4 lynxos sco_2_3_2
aix_3 fps midnightbsd sco_2_3_3
aix_4 freebsd minix sco_2_3_4
altos486 freemint mips solaris_2
amigaos gnu mirbsd stellar
atheos gnukfreebsd mpc sunos_4_0
aux_3 gnuknetbsd ncr_tower sunos_4_1
bitrig greenhills netbsd super-ux
bsdos haiku newsos4 svr4
catamount hpux nonstopux svr5
convexos i386 openbsd ti1500
cxux interix opus ultrix_4
cygwin irix_4 os2 umips
darwin irix_5 os390 unicos
dcosx irix_6 os400 unicosmk
dec_osf irix_6_0 posix-bc unisysdynix
dos_djgpp irix_6_1 qnx utekv
dragonfly isc riscos uwin
dynix isc_2 sco vos
dynixptx linux-android sco_2_3_0
epix linux sco_2_3_1
Which of these apply, if any? [Policy netbsd]
Operating system name? [netbsd]
Operating system version? [9.99.96]
Installation prefix to use? (~name ok) [/usr/pkg]
AFS does not seem to be running...
What installation prefix should I use for installing files? (~name ok)
[/usr/pkg]
Build a threading Perl? [y]
Use which C compiler? [armv6--netbsdelf-eabihf-gcc]
Checking for GNU cc in disguise and/or its version number...
Now, how can we feed standard input to your C preprocessor...
Directories to use for library searches? [/lib /usr/lib /usr/pkg/lib]
What is the file extension used for shared libraries? [so]
Make shared library basenames unique? [n]
Build Perl for SOCKS? [n]
Try to use long doubles if available? [n]
Checking for optional libraries...
What libraries to us#include <stdio.h>
int main() { printf("Ok\n"); return(0); }
I used the command:
armv6--netbsdelf-eabihf-gcc -o try -O2 -fPIC -D_FORTIFY_SOURCE=2 -pthread -I/usr/include -O2 -fPIC -D_FORTIFY_SOURCE=2 -pthread -I/usr/include -I/usr/pkg/include -pthread -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/lib try.c -lm -lcrypt -lpthread
./try
and I got the following output:
sh: Cannot execute ELF binary ./try
The program compiled OK, but exited with status 2.
You have a problem. Shall I abort Configure [y]
Ok. Stopping Configure.
*** Error code 1
Stop.
make[1]: stopped in /usr/pkgsrc/lang/perl5
*** Error code 1
Stop.
make: stopped in /usr/pkgsrc/lang/perl5
e? [-lm -lcrypt -lpthread]
What optimizer/debugger flag should be used?
[-O2 -fPIC -D_FORTIFY_SOURCE=2 -pthread -I/usr/include]
Any additional cc flags?
[-O2 -fPIC -D_FORTIFY_SOURCE=2 -pthread -I/usr/include -I/usr/pkg/include]
Let me guess what the preprocessor flags are...
Any additional ld flags (NOT including libraries)?
[ -pthread -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/lib]
Checking your choice of C compiler and flags for coherency...
I've tried to compile and run the following simple program:
#include <stdio.h>
int main() { printf("Ok\n"); return(0); }
I used the command:
armv6--netbsdelf-eabihf-gcc -o try -O2 -fPIC -D_FORTIFY_SOURCE=2 -pthread -I/usr/include -O2 -fPIC -D_FORTIFY_SOURCE=2 -pthread -I/usr/include -I/usr/pkg/include -pthread -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/lib try.c -lm -lcrypt -lpthread
./try
and I got the following output:
sh: Cannot execute ELF binary ./try
The program compiled OK, but exited with status 2.
You have a problem. Shall I abort Configure [y]
Ok. Stopping Configure.
*** Error code 1
Stop.
make[1]: stopped in /usr/pkgsrc/lang/perl5
*** Error code 1
Stop.
make: stopped in /usr/pkgsrc/lang/perl5
Unfortunately, configure doesn't show what's going on, and I can't find it in any log file, so I recreated this test, which results in compiler errors because the test refers to files /usr/lib/crt0.o, /usr/lib/crtbegin.o and /usr/lib/libm.so.0 which are x86_64 and should be earmv6hf.
I can succesfully finish the test by symlinking to the correct files which are in /usr/obj/destdir.evbarm/usr/lib and adding the option -L /usr/obj/destdir.evbarm/lib to the gcc command.
My question is, how do I tell make that it should use the earmv6hf versions of the dynamic libraries for such tests, so I can build the perl5 package on a PC?
In the output above is mentioned:
No targethost for running compiler tests against defined, running locally
, which obviously has to do with this...
The Nixers link will keep you busy for a while if this isn’t enough here.
This week’s BSD Now talks about NetBSD and ZFS, among other things. I’ll point out an interesting link in the Beastie Bits, a way of exploring /usr/games.
The Register ran a story about FreeBSD 13.1, which contained a thought-provoking section about the practical differences between Linux and FreeBSD. Rather than distilling each into a set of features, or treating it like another Linux distro, the author Liam Proven makes a broader case based on their history:
The other thing to point out is a more subtle difference, and one we’ve found that BSD types don’t really get. Linux is a native PC OS: it was first developed on x86 PCs, and only later ported to other architectures. It feels at home on a PC. It uses standard PC partition types, it happily co-exists with other OSes, it uses native screen resolutions and control keys and other things as a matter of course.
FreeBSD, like the other BSDs, is different. It is not native to the PC, and while it runs fine, it expects a substantial primary partition to itself, inside which it builds its own partitioning system. Its console runs in plain VGA mode, and simple things like Ctrl-left and Ctrl-right don’t work to edit the command line.
I see where he’s coming from, though it’s worth pointing out:
FreeBSD and NetBSD also first started on the PC via 386BSD, as he writes later. Like Linux, it runs natively on i386/amd64, ARM, and other architectures. I think he means that BSD was ported, as opposed to having been written on the PC. I’m willing to chalk this up to semantics.
It’s reasonable to expect a primary OS to use an entire drive, unless you want to dual-boot. FreeBSD also “happily co-exists with other OSs” with a boot loader (it’s how I started using it). FreeBSD also has kernel PV drivers for running in Xen guests, and can run as a Xen and bhyve hypervisor.
FreeBSD also installs to a standard PC partition, or it couldn’t boot. Primary partitions can also replace BSD slices if you prefer, though the former limit you just as they do with Linux and DOS. Linux equally has LUKS, btrfs, and OpenZFS (ne. ZFS on Linux) that have their own datasets in lieu of standard partitions. These distinctions are moot in the world of UEFI and GPT.
FreeBSD booted with EFI usually uses the full screen resolution. VESA can be configured for other systems, otherwise it falls back to PC native VGA. As another example, Solaris usually booted with full screen resolution by default, and that OS definitely didn’t start on Intel!
But let’s get to the good stuff. Niggling technical issues aside, does Linux feel like you’re using a PC OS, and does FreeBSD make your machine feel more like a big iron UNIX box from back in the day? Liam writes:
When you run Linux on a non-PC machine, such as a Raspberry Pi, it makes the computer act a bit like a PC. When you run FreeBSD on a PC, it makes a PC act a bit more like a Sun workstation or a DEC minicomputer.
I’ll admit, I hadn’t thought about it that explicitly before. I’ve written before about how I think BSD is more Unix-like than Linux, which certain Hacker News readers lambasted me for in the past. But it’s true; as Linux moves further away (with systemd the prototypical example), the BSDs have remained closer to the “Unix Philosophy”. It’s up to you whether you think that makes them inflexible, or if they’ve avoided reinventing Unix poorly, as Henry Spencer warned.
FreeBSD itself answered this question many years ago on its art page, with banners like the one below. Why settle for a PC OS like Linux, when you can have a workstation?
I take the point that Linux, being written for and tightly coupled to the PC, has the potential to be more PC-like in general usage. But I don’t think I’ve encountered any user-facing examples after using both OSs for many years. I’d be keen to hear if your experience differs, because there might still be something to this.
That said, I do think it’s awesome that I can have a little DEC-like machine humming away in the corner of my room delivering my Plex, bhyve VMs, file shares, Minecraft server, and VPN gateway. Nobody my age during the minicomputer era could have afforded one! Things will really come around full circle when I finally buy a PiDP-11 panel kit that’s powered by a Raspberry Pi, upon which I install FreeBSD.
I appreciate Liam giving me food for thought about this. As Michael Dexter pointed out on The Bird Site, it’s far better to have sites talking about this than wrapping release announcements with ads and calling it a day.
By Ruben Schade in Sydney, 2022-06-02.
The NetBSD Foundation has finalized the list of projects for this year’s Google Summer of Code. The contributors and projects are the following:
The community bonding period has already started (from May 20) and it will last until June 12. During this time, the contributors are expected to coordinate with their mentors and community.
This will be immediately followed by the coding period from June 13 to September 4. After which, the contributors are expected to submit their final work, evaluate their mentors, and get evaluated by their mentors as well. Results will be announced on September 20.
For more information about the Google Summer of Code 2022 kindly refer to the official GSoC website.
We would like to express our gratitude to Google for organizing the yearly GSoC, and to The NetBSD Foundation mentors and administrators for their efforts and hardwork!
Let us welcome all the contributors to our growing NetBSD community!
A question from Mark C. in email this morning, among all the rude explanations about what .gitignore files are:
What percentage of time do you spend on your computers? Is it Linux mostly and some Mac? What makes you choose one over the other? Love your blog!
Thank you! I needed that :).
It’s interesting how computers and our perceptions have changed over time. I mostly used Mac laptops and Windows desktops growing up, because the Mac was the fun tool with good Wi-Fi, and Windows was for the serious desktop machine. Thesedays the Mac is my work machine, and the fun desktop at home runs FreeBSD and Linux.
I only arrived back on the Linux desktop recently in the context of games, thanks to all the work Valve and Wine have put into Windows compatibility (though I’ve since switched back to Fedora Workstation). Otherwise it’s FreeBSD and NetBSD, the former because the tooling is awesome and I prefer OpenZFS, and the latter because I still harbour a soft spot for its clean design and community.
For the sake of completeness, my vintage machines run a combination of old, pointless OSs like DOS, Windows for Workgroups, and Commodore Basic. My aim is to eventually have my childhood Pentium 1 also booting BeOS and OS/2, but they’ve proven more challenging than I expected with my IDE to CF adaptors, and even my new SCSI to SD.
I’m not sure what exact ratios each OS would have, but I’ll bet if I added all those up as percentages, I’d get 100 :).
By Ruben Schade in Sydney, 2022-05-19.
All,
Recently, I've been trying to get the Solaris 8 versions of xterm
and xauth
working on NetBSD from an ssh
client with X11 forwarding, but both binaries seem to generate segmentation violations immediately. I ran a ktrace
on both programs to try to figure out what happened, and the last few lines of output for both programs look like this:
...
571 1 xclock compat_20_getfsstat(0xedefa018, 0xefffede4) Err#2 ENOENT
571 1 xclock compat_50_getrusage(0xedefa000, 0x1000) = 0
571 1 xclock #115 (obsolete vtrace)(0, 0x1000, 0x7, 0x80000102, 0xffffffff, 0) = -303063040
571 1 xclock compat_50_getrusage(0xedee4000, 0x1000) = 0
571 1 xclock break(0x25850) = 0
571 1 xclock break(0x27850) = 0
571 1 xclock break(0x27850) = 0
571 1 xclock break(0x29850) = 0
571 1 xclock break(0x29850) = 0
571 1 xclock break(0x2b850) = 0
571 1 xclock compat_43_otruncate(0x5, 0xeffff3a0) = 0
571 1 xclock shmdt(0x2, 0x2, 0) = 3
571 1 xclock modctl(0x3, 0x6, 0x1, 0xeffff39c, 0x4) = 0
571 1 xclock modctl(0x3, 0xffff, 0x8, 0xeffff398, 0x4) = 0
571 1 xclock break(0x2b850) = 0
571 1 xclock break(0x2d850) = 0
571 1 xclock open("/emul/svr4/etc/netconfig", 0, 0x1b6) = 4
571 1 xclock #217 (unimplemented)(0x4, 0xefffebb0) = 0
571 1 xclock ioctl(0x4, _IO('T',0x1,0), 0xefffeb3c) Err#-4
571 1 xclock read(0x4, 0x2b9a4, 0x400) = 1024
"#pragma ident\t"@(#)netconfig\t1.16\t99/10/25 SMI"\n#\n# The "Network Configuration" File.\n#\n# Each entry is of the form:\n#\n# <network_id> <semantics> <fl"
571 1 xclock SIGSEGV SIG_DFL
I noticed that the ioctl
call is failing; could this be a reason for failure here?
I also ran ktrace
on the NetBSD versions of xclock
and xterm
to see if there were any similarities, and the most similar samples of output I could find were the following:
...
604 1 xclock __stat50("/etc/nsswitch.conf", 0xefffeed8) = 0
604 1 xclock open("/etc/nsswitch.conf", 0x400000, 0x1b6) = 3
604 1 xclock __fstat50(0x3, 0xefffeb70) = 0
604 1 xclock read(0x3, 0xed61d000, 0x4000) = 621
"#\t$NetBSD: nsswitch.conf,v 1.6 2009/10/25 00:17:06 tsarna Exp $\n#\n# nsswitch.conf(5) -\n#\tname service switch configuration file\n#\n\n\n# These are the default"
604 1 xclock read(0x3, 0xed61d000, 0x4000) = 0
...
604 1 xclock open("/etc/hosts", 0x400000, 0x1b6) = 3
604 1 xclock __fstat50(0x3, 0xefffcc38) = 0
604 1 xclock read(0x3, 0xed61d000, 0x4000) = 831
"#\t$NetBSD: hosts,v 1.9 2013/11/24 07:20:01 dholland Exp $\n#\n# Host name database.\n#\n# This file contains addresses and aliases for local hosts whose names\n# n"
604 1 xclock read(0x3, 0xed61d000, 0x4000) = 0
""
604 1 xclock close(0x3) = 0
Because of this, I suspect the reason might lie in some of the Solaris 8 files that I copied over to the NetBSD virtual machine (e.g. /etc/netconfig
), but I'm unsure. Could these files be the reason why none of the Solaris 8 X11 binaries function correctly on NetBSD?
I’ve got this rock64, which is an aarch64 board comparable to a Raspberry Pi 3 B+ with 4 gigs of ram. For years I’ve wanted to put a distribution on here that doesn’t have a premade image available, mainly because out of all the options on that page I don’t actually like any of them. Well, except NetBSD, but NetBSD doesn’t have GPU drivers for it. Problem is, everything I do want to use provides rootfs tarballs and tells you to figure it out. To do that I’ve got to get a Linux kernel, track down the device trees so it knows what hardware it has, and then wrangle u-boot into actually booting the whole thing. I figured that would be the hard part; little did I know the depths that Single Board Computer Hell would reach.
Unlike x86, ARM is far, far from a standardised platform. The end result of this is that unless you can find tailor-made images specific for your particular ARM board, you’re gonna have to do a lot of manual labour to install an operating system that should work.
I still consider XTreeGold some of the best utility software ever written, and it still makes using my vintage PCs a joy. I’ve been looking again if there are modern equivalents, especially for exploring file systems and performing batch tasks.
Here’s what I have so far:
Midnight Commander mimics the orginal Norton Commander for DOS, with a text editor and familiar blue interface. I love that this exists, though I’ll admit I keep it around mostly for nostalgia.
Ranger arguably spawned the current next-gen console file managers, and its where I’ve stuck around. It uses a column interface like the macOS Finder which makes visualising directory trees easy, and I still think it’s the easiest to configure.
nnn is a multi-modal file manager with numbered tabs, file icons, and even a disk usage visualiser. I need to give it more of a look.
fff is is the most recent one I’ve looked at. It’s genuinely impressive how much functionality and performance has been wrung out of pure bash scripts.
lf feels like a snappier Ranger with a broad subset of its features included in a single binary file. I could see myself installing this on servers, and using Ranger on the desktop.
Let me know if you have other suggestions, I may be slightly obsessed with the concept right now.
By Ruben Schade in Sydney, 2022-05-17.
Edit: This question has also been posted on SuperUser.
All,
Recently, I've been trying to get the Solaris 8 versions of xterm
and xauth
working on NetBSD from an ssh
client with X11 forwarding, but both binaries seem to generate segmentation violations immediately. I ran a ktrace
on both programs to try to figure out what happened, and the last few lines of output for both programs look like this:
...
571 1 xclock compat_20_getfsstat(0xedefa018, 0xefffede4) Err#2 ENOENT
571 1 xclock compat_50_getrusage(0xedefa000, 0x1000) = 0
571 1 xclock #115 (obsolete vtrace)(0, 0x1000, 0x7, 0x80000102, 0xffffffff, 0) = -303063040
571 1 xclock compat_50_getrusage(0xedee4000, 0x1000) = 0
571 1 xclock break(0x25850) = 0
571 1 xclock break(0x27850) = 0
571 1 xclock break(0x27850) = 0
571 1 xclock break(0x29850) = 0
571 1 xclock break(0x29850) = 0
571 1 xclock break(0x2b850) = 0
571 1 xclock compat_43_otruncate(0x5, 0xeffff3a0) = 0
571 1 xclock shmdt(0x2, 0x2, 0) = 3
571 1 xclock modctl(0x3, 0x6, 0x1, 0xeffff39c, 0x4) = 0
571 1 xclock modctl(0x3, 0xffff, 0x8, 0xeffff398, 0x4) = 0
571 1 xclock break(0x2b850) = 0
571 1 xclock break(0x2d850) = 0
571 1 xclock open("/emul/svr4/etc/netconfig", 0, 0x1b6) = 4
571 1 xclock #217 (unimplemented)(0x4, 0xefffebb0) = 0
571 1 xclock ioctl(0x4, _IO('T',0x1,0), 0xefffeb3c) Err#-4
571 1 xclock read(0x4, 0x2b9a4, 0x400) = 1024
"#pragma ident\t"@(#)netconfig\t1.16\t99/10/25 SMI"\n#\n# The "Network Configuration" File.\n#\n# Each entry is of the form:\n#\n# <network_id> <semantics> <fl"
571 1 xclock SIGSEGV SIG_DFL
I noticed that the ioctl
call is failing; could this be a reason for failure here?
I also ran ktrace
on the NetBSD versions of xclock
and xterm
to see if there were any similarities, and the most similar samples of output I could find were the following:
...
604 1 xclock __stat50("/etc/nsswitch.conf", 0xefffeed8) = 0
604 1 xclock open("/etc/nsswitch.conf", 0x400000, 0x1b6) = 3
604 1 xclock __fstat50(0x3, 0xefffeb70) = 0
604 1 xclock read(0x3, 0xed61d000, 0x4000) = 621
"#\t$NetBSD: nsswitch.conf,v 1.6 2009/10/25 00:17:06 tsarna Exp $\n#\n# nsswitch.conf(5) -\n#\tname service switch configuration file\n#\n\n\n# These are the default"
604 1 xclock read(0x3, 0xed61d000, 0x4000) = 0
...
604 1 xclock open("/etc/hosts", 0x400000, 0x1b6) = 3
604 1 xclock __fstat50(0x3, 0xefffcc38) = 0
604 1 xclock read(0x3, 0xed61d000, 0x4000) = 831
"#\t$NetBSD: hosts,v 1.9 2013/11/24 07:20:01 dholland Exp $\n#\n# Host name database.\n#\n# This file contains addresses and aliases for local hosts whose names\n# n"
604 1 xclock read(0x3, 0xed61d000, 0x4000) = 0
""
604 1 xclock close(0x3) = 0
Because of this, I suspect the reason might lie in some of the Solaris 8 files that I copied over to the NetBSD virtual machine (e.g. /etc/netconfig
), but I'm unsure. Could these files be the reason why none of the Solaris 8 X11 binaries function correctly on NetBSD?
Long-time readers of my rambling would remember I ran Fedora on my laptops for many years. FreeBSD’s Wi-Fi and suspend/resume support was patchy enough that I kept it on the desktop, and Fedora just worked. I also like to keep my toes in a few camps to see how things are progressing on the other side of the fence, and to keep my Linux skills up.
I stopped using Fedora around the time I made the switch on the server side to Debian for Linux workloads. I figured I’d make my life easier by running the same Linux family everywhere.
People categorise Linux distributions based on their package managers, because it’s such an important interface and probably among the first things people use when configuring a system. But the philosophies behind their designs peek through in other ways too, from configuration locations to file systems.
Over time I got work Macs, and FreeBSD became good enough on my laptops. But then Steam and Proton got me back into the Linux desktop again… I can’t understate how much fun it is having access to PC games and GPUs again without needing to touch Windows.
Ubuntu had been fine for this, but its use of Snaps over Flatpaks (or even just package repos) and a few other wrinkles have made it feel decidedly less Debian-y than I remember. It’s hard to quantify, but it felt flaky.
After distro hopping more times than I care to admit, I tried Fedora again after a few friends and people I trust reported positive experiences with Workstation and the immutable Silverblue. It just worked again, save for some Nvidia adventures which I don’t fault Linux distro maintainers for. I even did an update from 35 to 36, and I haven’t had a system upgrade outside the BSD ecosystem go so smoothly.
There are broader questions about the direction Linux is taking, some of which I think is warranted, and others that make me relish my time in FreeBSD, NetBSD, and illumos. But for a desktop game machine I mostly dual-boot into to play Steam games and Minecraft, I’m remembering why I liked using this. If you’re a desktop Linux user in 2022, it’s probably the best experience you’ll get.
By Ruben Schade in Sydney, 2022-05-14.
I recently discovered that it’s surprisingly easy to customize the NetBSD boot loader banner, simply by adding some directives in the boot.cfg configuration file.
Here is the relevant part of the boot.cfg(5) manual page:
banner The text from banner lines is displayed instead of the standard
welcome text by the boot loader. Up to 12 lines can be defined.
No special character sequences are recognised, so to specify a
blank line, a banner line with no value should be given.
Back in 2014, I published some NetBSD ASCII logos to be used as motd or as /etc/issue, but they are higher than 12 lines so using them would either require raising the allowed lines limit (likely not a good idea), or resizing them. I then remembered I had requested some Amiga style logos for Linux and *BSD, which were released by h7 in Break’s second artpack in 2013.
So we can simply append this in /boot.cfg:
banner= _______ ______ ___ _________ ____ __________
banner=__ _____/ // _/___ __/ \_____\__ /_/ _//______\___ /\_______
banner=--/ _ \ // _/ \\ _/ |/_ /\______ / |/ / \- -- -
banner=_/ \ \ \ // \ |_/ / |/ \ / \ /
banner=\______/ /\_____\_____\______/\____ // : ____/____ /\/
banner= \ \_____/ \ \ \ \ \ \_____/ \______/\ \ \_____/ \
banner=h7\_____\ \ /\___________\_____\/\__\ \ \ \ \______\ \dS!
banner=------ - \____\/ - --( n e t b s d )-- - \____\/ \_____\/ - --- \____\/ -------
And enjoy some stylish Amiga ASCII art after the next reboot:
_______ ______ ___ _________ ____ __________
__ _____/ // _/___ __/ \_____\__ /_/ _//______\___ /\_______
--/ _ \ // _/ \\ _/ |/_ /\______ / |/ / \- -- -
_/ \ \ \ // \ |_/ / |/ \ / \ /
\______/ /\_____\_____\______/\____ // : ____/____ /\/
\ \_____/ \ \ \ \ \ \_____/ \______/\ \ \_____/ \
h7\_____\ \ /\___________\_____\/\__\ \ \ \ \______\ \dS!
------ - \____\/ - --( n e t b s d )-- - \____\/ \_____\/ - --- \____\/ -------
1. Boot normally
2. Boot single user
3. Drop to boot prompt
Choose an option; RETURN for default; SPACE to stop countdown.
Option 1 will be chosen in 2 seconds.
Lastly, here is the PNG version converted with Ansilove, in full Topaz glory:
All,
I'm trying to set up SSH X11 forwarding from a NetBSD 8.2 VM (running via QEMU) to a Ubuntu 20.04 host. When I attempt to ssh -X
into the machine, the $DISPLAY
variable is not set and I get an error message: "X11 forwarding request failed on channel 0". The following are pertinent environment details:
xauth
is installed on the NetBSD 8.2 VM and it works properlyForwardX11 yes
in the /etc/ssh/ssh_config
file on both NetBSD as well as the Ubuntu hostXAuthLocation /usr/X711/bin/xauth
in the ssh_config
file on NetBSD.If I run ssh -v
, then the relevant X11 output I get is the following:
Authenticated to localhost ([127.0.0.1]:10022).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: exec
debug1: client_input_global_request: rtype [email protected] want_reply 0
debug1: Requesting X11 forwarding with authentication spoofing.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
X11 forwarding request failed on channel 0
what could be possible reasons for this?
All,
In continuing my efforts of trying to get Solaris 8 programs to function on NetBSD, I'm now attempting to get vncserver
from (Tight VNC) to work (I'd link the github page, but the source of the vncserver
perl script is slightly different than the one I'm using - though I feel uneasy about dumping all of this code here, I'll paste the source below the question). I've noticed that the system("xauth ...")
line is hanging, and I discovered that it's using the xauth
binary from Solaris 8. This binary hangs even when running it directly (e.g. ./xauth
), so do I need to obtain a NetBSD version of xauth
and change those lines for vncserver
to work?
source code for the vncserver
perl script from Solaris 8 (relevant line is 151)
#!/emul/svr4/usr/bin/perl
#
# Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
# USA.
#
#
# vncserver - wrapper script to start an X VNC server.
#
#
# First make sure we're operating in a sane environment.
#
&SanityCheck();
#
# Global variables. You may want to configure some of these for your site.
#
$geometry = "1024x768";
$depth = 8;
$desktopName = "X";
$vncClasses = "/opt/sfw/vnc/classes";
$vncUserDir = "$ENV{HOME}/.vnc";
$xauthorityFile = "$ENV{HOME}/.Xauthority";
$defaultXStartup
= ("#!/bin/sh\n\n".
"xrdb \$HOME/.Xresources\n".
"xsetroot -solid grey\n".
"xterm -geometry 80x24+10+10 -ls -title \"\$VNCDESKTOP Desktop\" &\n".
"twm &\n");
chop($host = `uname -n`);
# Check command line options
&ParseOptions("-geometry",1,"-depth",1,"-pixelformat",1,"-name",1,"-kill",1,
"-help",0,"-h",0,"--help",0);
&Usage() if ($opt{'-help'} || $opt{'-h'} || $opt{'--help'});
&Kill() if ($opt{'-kill'});
# Uncomment this line if you want default geometry, depth and pixelformat
# to match the current X display:
# &GetXDisplayDefaults();
if ($opt{'-geometry'}) {
$geometry = $opt{'-geometry'};
}
if ($opt{'-depth'}) {
$depth = $opt{'-depth'};
$pixelformat = "";
}
if ($opt{'-pixelformat'}) {
$pixelformat = $opt{'-pixelformat'};
}
&CheckGeometryAndDepth();
if ($opt{'-name'}) {
$desktopName = $opt{'-name'};
}
# Create the user's vnc directory if necessary.
if (!(-e $vncUserDir)) {
if (!mkdir($vncUserDir,0755)) {
die "$prog: Could not create $vncUserDir.\n";
}
}
# Make sure the user has a password.
($z,$z,$mode) = stat("$vncUserDir/passwd");
if (!(-e "$vncUserDir/passwd") || ($mode & 077)) {
warn "\nYou will require a password to access your desktops.\n\n";
system("vncpasswd $vncUserDir/passwd");
if (($? >> 8) != 0) {
exit 1;
}
}
print "Found pass\n";
# Find display number.
if ((@ARGV > 0) && ($ARGV[0] =~ /^:(\d+)$/)) {
print "If check one\n";
$displayNumber = $1;
shift(@ARGV);
if (!&CheckDisplayNumber($displayNumber)) {
die "A VNC server is already running as :$displayNumber\n";
}
} elsif ((@ARGV > 0) && ($ARGV[0] !~ /^-/)) {
print "If check two\n";
&Usage();
} else {
print "If check three\n";
$displayNumber = &GetDisplayNumber();
}
print "Got display number\n";
$vncPort = 5900 + $displayNumber;
$desktopLog = "$vncUserDir/$host:$displayNumber.log";
unlink($desktopLog);
print "Unlinked $desktopLog\n";
# Make an X server cookie - use as the seed the sum of the current time, our
# PID and part of the encrypted form of the password. Ideally we'd use
# /dev/urandom, but that's only available on Linux.
print "Making cookie...\n";
srand(time+$$+unpack("L",`cat $vncUserDir/passwd`));
print "random number generator seeded...\n";
$cookie = "";
$i = 0;
for (1..16) {
print "another loop iteration...$i\n";
$cookie .= sprintf("%02x", int(rand(256)));
$i++;
}
print "hi\n";
$command = "xauth -f $xauthorityFile add $host:$displayNumber . $cookie";
print $command;
system("xauth -f $xauthorityFile add $host:$displayNumber . $cookie");
print "added cookie to authority file\n";
system("xauth -f $xauthorityFile add $host/unix:$displayNumber . $cookie");
print "Added cookie to host/unix in authority file\n";
print "X server cookie generated\n";
# Now start the X VNC Server
$cmd = "Xvnc :$displayNumber";
$cmd .= " -desktop " . "edString($desktopName);
$cmd .= " -httpd $vncClasses";
$cmd .= " -auth $xauthorityFile";
$cmd .= " -geometry $geometry" if ($geometry);
$cmd .= " -depth $depth" if ($depth);
$cmd .= " -pixelformat $pixelformat" if ($pixelformat);
$cmd .= " -rfbwait 120000";
$cmd .= " -rfbauth $vncUserDir/passwd";
$cmd .= " -rfbport $vncPort";
print "Vncserver started\n";
# Add font path and color database stuff here, e.g.:
#
# $cmd .= " -fp /usr/lib/X11/fonts/misc/,/usr/lib/X11/fonts/75dpi/";
# $cmd .= " -co /usr/lib/X11/rgb";
#
foreach $arg (@ARGV) {
$cmd .= " " . "edString($arg);
}
$cmd .= " >> " . "edString($desktopLog) . " 2>&1";
# Run $cmd and record the process ID.
$pidFile = "$vncUserDir/$host:$displayNumber.pid";
print "running $cmd...\n";
system("$cmd & echo \$! >$pidFile");
# Give Xvnc a chance to start up
sleep(3);
warn "\nNew '$desktopName' desktop is $host:$displayNumber\n\n";
# Create the user's xstartup script if necessary.
if (!(-e "$vncUserDir/xstartup")) {
warn "Creating default startup script $vncUserDir/xstartup\n";
open(XSTARTUP, ">$vncUserDir/xstartup");
print XSTARTUP $defaultXStartup;
close(XSTARTUP);
chmod 0755, "$vncUserDir/xstartup";
}
# Run the X startup script.
warn "Starting applications specified in $vncUserDir/xstartup\n";
warn "Log file is $desktopLog\n\n";
# If the unix domain socket exists then use that (DISPLAY=:n) otherwise use
# TCP (DISPLAY=host:n)
if (-e "/tmp/.X11-unix/X$displayNumber") {
$ENV{DISPLAY}= ":$displayNumber";
} else {
$ENV{DISPLAY}= "$host:$displayNumber";
}
$ENV{VNCDESKTOP}= $desktopName;
system("$vncUserDir/xstartup >> " . "edString($desktopLog) . " 2>&1 &");
exit;
###############################################################################
#
# CheckGeometryAndDepth simply makes sure that the geometry and depth values
# are sensible.
#
sub CheckGeometryAndDepth
{
if ($geometry =~ /^(\d+)x(\d+)$/) {
$width = $1; $height = $2;
if (($width<1) || ($height<1)) {
die "$prog: geometry $geometry is invalid\n";
}
while (($width % 4)!=0) {
$width = $width + 1;
}
while (($height % 2)!=0) {
$height = $height + 1;
}
$geometry = "${width}x$height";
} else {
die "$prog: geometry $geometry is invalid\n";
}
if (($depth < 8) || ($depth > 32)) {
die "Depth must be between 8 and 32\n";
}
}
#
# GetDisplayNumber gets the lowest available display number. A display number
# n is taken if something is listening on the VNC server port (5900+n) or the
# X server port (6000+n).
#
sub GetDisplayNumber
{
print "Getting display number...\n";
foreach $n (1..99) {
print "Checking display number $n....\n";
if (&CheckDisplayNumber($n)) {
return $n+0; # Bruce Mah's workaround for bug in perl 5.005_02
}
}
die "$prog: no free display number on $host.\n";
}
#
# CheckDisplayNumber checks if the given display number is available. A
# display number n is taken if something is listening on the VNC server port
# (5900+n) or the X server port (6000+n).
#
sub CheckDisplayNumber
{
local ($n) = @_;
socket(S, $AF_INET, $SOCK_STREAM, 0) || die "$prog: socket failed: $!\n";
eval 'setsockopt(S, &SOL_SOCKET, &SO_REUSEADDR, pack("l", 1))';
if (!bind(S, pack('S n x12', $AF_INET, 6000 + $n))) {
close(S);
return 0;
}
close(S);
socket(S, $AF_INET, $SOCK_STREAM, 0) || die "$prog: socket failed: $!\n";
eval 'setsockopt(S, &SOL_SOCKET, &SO_REUSEADDR, pack("l", 1))';
if (!bind(S, pack('S n x12', $AF_INET, 5900 + $n))) {
close(S);
return 0;
}
close(S);
if (-e "/tmp/.X$n-lock") {
warn "\nWarning: $host:$n is taken because of /tmp/.X$n-lock\n";
warn "Remove this file if there is no X server $host:$n\n";
return 0;
}
if (-e "/tmp/.X11-unix/X$n") {
warn "\nWarning: $host:$n is taken because of /tmp/.X11-unix/X$n\n";
warn "Remove this file if there is no X server $host:$n\n";
return 0;
}
return 1;
}
#
# GetXDisplayDefaults uses xdpyinfo to find out the geometry, depth and pixel
# format of the current X display being used. If successful, it sets the
# options as appropriate so that the X VNC server will use the same settings
# (minus an allowance for window manager decorations on the geometry). Using
# the same depth and pixel format means that the VNC server won't have to
# translate pixels when the desktop is being viewed on this X display (for
# TrueColor displays anyway).
#
sub GetXDisplayDefaults
{
local (@lines, @matchlines, $width, $height, $defaultVisualId, $i,
$red, $green, $blue);
$wmDecorationWidth = 4; # a guess at typical size for window manager
$wmDecorationHeight = 24; # decoration size
return if (!defined($ENV{DISPLAY}));
@lines = `xdpyinfo 2>/dev/null`;
return if ($? != 0);
@matchlines = grep(/dimensions/, @lines);
if (@matchlines) {
($width, $height) = ($matchlines[0] =~ /(\d+)x(\d+) pixels/);
$width -= $wmDecorationWidth;
$height -= $wmDecorationHeight;
$geometry = "${width}x$height";
}
@matchlines = grep(/default visual id/, @lines);
if (@matchlines) {
($defaultVisualId) = ($matchlines[0] =~ /id:\s+(\S+)/);
for ($i = 0; $i < @lines; $i++) {
if ($lines[$i] =~ /^\s*visual id:\s+$defaultVisualId$/) {
if (($lines[$i+1] !~ /TrueColor/) ||
($lines[$i+2] !~ /depth/) ||
($lines[$i+4] !~ /red, green, blue masks/))
{
return;
}
last;
}
}
return if ($i >= @lines);
($depth) = ($lines[$i+2] =~ /depth:\s+(\d+)/);
($red,$green,$blue)
= ($lines[$i+4]
=~ /masks:\s+0x([0-9a-f]+), 0x([0-9a-f]+), 0x([0-9a-f]+)/);
$red = hex($red);
$green = hex($green);
$blue = hex($blue);
if ($red > $blue) {
$red = int(log($red) / log(2)) - int(log($green) / log(2));
$green = int(log($green) / log(2)) - int(log($blue) / log(2));
$blue = int(log($blue) / log(2)) + 1;
$pixelformat = "rgb$red$green$blue";
} else {
$blue = int(log($blue) / log(2)) - int(log($green) / log(2));
$green = int(log($green) / log(2)) - int(log($red) / log(2));
$red = int(log($red) / log(2)) + 1;
$pixelformat = "bgr$blue$green$red";
}
}
}
#
# quotedString returns a string which yields the original string when parsed
# by a shell.
#
sub quotedString
{
local ($in) = @_;
$in =~ s/\'/\'\"\'\"\'/g;
return "'$in'";
}
#
# removeSlashes turns slashes into underscores for use as a file name.
#
sub removeSlashes
{
local ($in) = @_;
$in =~ s|/|_|g;
return "$in";
}
#
# Usage
#
sub Usage
{
die("\nusage: $prog [:<number>] [-name <desktop-name>] [-depth <depth>]\n".
" [-geometry <width>x<height>]\n".
" [-pixelformat rgbNNN|bgrNNN]\n".
" <Xvnc-options>...\n\n".
" $prog -kill <X-display>\n\n");
}
#
# Kill
#
sub Kill
{
$opt{'-kill'} =~ s/(:\d+)\.\d+$/$1/; # e.g. turn :1.0 into :1
if ($opt{'-kill'} =~ /^:\d+$/) {
$pidFile = "$vncUserDir/$host$opt{'-kill'}.pid";
} else {
if ($opt{'-kill'} !~ /^$host:/) {
die "\nCan't tell if $opt{'-kill'} is on $host\n".
"Use -kill :<number> instead\n\n";
}
$pidFile = "$vncUserDir/$opt{'-kill'}.pid";
}
if (! -r $pidFile) {
die "\nCan't find file $pidFile\n".
"You'll have to kill the Xvnc process manually\n\n";
}
$SIG{'HUP'} = 'IGNORE';
chop($pid = `cat $pidFile`);
warn "Killing Xvnc process ID $pid\n";
system("kill $pid");
unlink $pidFile;
exit;
}
#
# ParseOptions takes a list of possible options and a boolean indicating
# whether the option has a value following, and sets up an associative array
# %opt of the values of the options given on the command line. It removes all
# the arguments it uses from @ARGV and returns them in @optArgs.
#
sub ParseOptions
{
local (@optval) = @_;
local ($opt, @opts, %valFollows, @newargs);
while (@optval) {
$opt = shift(@optval);
push(@opts,$opt);
$valFollows{$opt} = shift(@optval);
}
@optArgs = ();
%opt = ();
arg: while (defined($arg = shift(@ARGV))) {
foreach $opt (@opts) {
if ($arg eq $opt) {
push(@optArgs, $arg);
if ($valFollows{$opt}) {
if (@ARGV == 0) {
&Usage();
}
$opt{$opt} = shift(@ARGV);
push(@optArgs, $opt{$opt});
} else {
$opt{$opt} = 1;
}
next arg;
}
}
push(@newargs,$arg);
}
@ARGV = @newargs;
}
#
# Routine to make sure we're operating in a sane environment.
#
sub SanityCheck
{
local ($cmd);
#
# Get the program name
#
($prog) = ($0 =~ m|([^/]+)$|);
#
# Check we have all the commands we'll need on the path.
#
cmd:
foreach $cmd ("uname","xauth","Xvnc","vncpasswd") {
for (split(/:/,$ENV{PATH})) {
if (-x "$_/$cmd") {
next cmd;
}
}
die "$prog: couldn't find \"$cmd\" on your PATH.\n";
}
#
# Check the HOME environment variable is set
#
if (!defined($ENV{HOME})) {
die "$prog: The HOME environment variable is not set.\n";
}
#
# Find socket constants. 'use Socket' is a perl5-ism, so we wrap it in an
# eval, and if it fails we try 'require "sys/socket.ph"'. If this fails,
# we just guess at the values. If you find perl moaning here, just
# hard-code the values of AF_INET and SOCK_STREAM. You can find these out
# for your platform by looking in /usr/include/sys/socket.h and related
# files.
#
chop($os = `uname`);
chop($osrev = `uname -r`);
eval 'use Socket';
if ([email protected]) {
eval 'require "sys/socket.ph"';
if ([email protected]) {
if (($os eq "SunOS") && ($osrev !~ /^4/)) {
$AF_INET = 2;
$SOCK_STREAM = 2;
} else {
$AF_INET = 2;
$SOCK_STREAM = 1;
}
} else {
$AF_INET = &AF_INET;
$SOCK_STREAM = &SOCK_STREAM;
}
} else {
$AF_INET = &AF_INET;
$SOCK_STREAM = &SOCK_STREAM;
}
}
I have a gcc
2.95.1 binary installed on a Solaris 8 VM. For an experiment, I'm trying to get it working in a NetBSD environment. However, I can't run the compilation phase on any program that involves #include
directives, as the binary doesn't seem to be looking for libraries even without the -I
flag specified. The example that I'm trying to test out now is a simple Hello World:
#include <stdio.h>
#include <stdlib.h>
int main() {
printf("Hello World!\n");
exit(0);
}
Running gcc -I some_random_directory -v -o hello_world.o -c hello_world.c
on the Solaris 8 machine produced this:
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.1/specs
gcc version 2.95.1 19990816 (release)
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.1/cpp -lang-c -v -I some_random_directory -D__GNUC__=2 -D__GNUC_MINOR__=95 -Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4 -D__sparc__ -D__sun__ -D__unix__ -D__svr4__ -D__SVR4 -D__sparc -D__sun -D__unix -Asystem(unix) -Asystem(svr4) -D__GCC_NEW_VARARGS__ -Acpu(sparc) -Amachine(sparc) hello_world.c /var/tmp/ccA6aEZ8.i
GNU CPP version 2.95.1 19990816 (release) (sparc)
#include "..." search starts here:
#include <...> search starts here:
some_random_directory
/usr/local/include
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.1/../../../../sparc-sun-solaris2.8/include
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.1/include
/usr/include
End of search list.
The following default directories have been omitted from the search path:
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.1/../../../../include/g++-3
End of omitted list.
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.1/cc1 /var/tmp/ccA6aEZ8.i -quiet -dumpbase hello_world.c -version -o /var/tmp/ccUTCLhe.s
GNU C version 2.95.1 19990816 (release) (sparc-sun-solaris2.8) compiled by GNU C version 2.95.1 19990816 (release).
Running the same compilation command using the Solaris 8 gcc
on NetBSD produced this:
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.1/specs
gcc version 2.95.1 19990816 (release)
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.1/cpp -lang-c -v -I some_random_directory -D__GNUC__=2 -D__GNUC_MINOR__=95 -Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4 -D__sparc__ -D__sun__ -D__unix__ -D__svr4__ -D__SVR4 -D__sparc -D__sun -D__unix -Asystem(unix) -Asystem(svr4) -D__GCC_NEW_VARARGS__ -Acpu(sparc) -Amachine(sparc) hello_world.c /var/tmp/ccFedUPd.i
GNU CPP version 2.95.1 19990816 (release) (sparc)
#include "..." search starts here:
#include <...> search starts here:
.
.
.
.
.
End of search list.
The following default directories have been omitted from the search path:
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.1/../../../../include/g++-3
End of omitted list.
hello_world.c:1: stdio.h: No such file or directory
hello_world.c:2: stdlib.h: No such file or directory
At first, I thought gcc
was just ignoring the -I
flag, but the other search locations aren't showing up in the second output either. What might be going on here?
I'm attempting to setup a (32-bit) NetBSD 9.2 virtual machine with QEMU so that I can run SPARC binaries on it, specifically those that were compiled on Solaris machines (currently I've compiled a short C program on Solaris 8 and am trying to run it on NetBSD). During this endeavor, one website I was directed to is here. Specifically, step #4 of that page references a /usr/share/examples/emul/svr4
directory, which I cannot locate on my NetBSD instance. The only subdirectory within the .../emul
directory is linux
.
I largely followed the steps outlined here to install NetBSD.
I'm curious as to what specific packages/configuration settings are required in order to get the .../emul/svr4
directory to appear...
In this post, we’ll look at implementing a simple character device driver as a kernel module in NetBSD. Once it is loaded, userspace processes will be able to
write
an arbitrary byte string to the device, and on every successiveread
expect a cryptographically-secure pseudorandom permutation of the original byte string.
IF you’ve always wanted to learn how to write a NetBSD driver, here’s a great starting point.
My continuous journey into toolchains, in the first quarter of 2022
This is the fourth post in my toolchains adventures series. Please check the previous posts in the toolchains category for more context about this journey.
In Pkgsrc land, I packaged and imported pax-utils, and updated mold to the 1.0.1, 1.0.2, 1.0.3, 1.1, and 1.1.1 versions. Since version 1.0.2, mold can now link NetBSD object files thanks to work done by [email protected]
I also committed upstream fix for CVE-2021-45078 in binutils to fix an out-of-bounds write, and imported our NetBSD/aarch64 support patches for ld from the NetBSD’s src repository. This fixes the build on NetBSD/aarch64. I then updated the package to the 2.38 version which was released in February.
I don’t have much to report on the LLVM side, I only made two documentation related commits this quarter. However, I have a few things I plan to look at, so I should hopefully have more to report next time.
Besides that, I’ve been mostly busy reading different material, and adding a lot of new resources to toolchains.net.
That’s all for now, happy Spring 2022 everyone!
LLVM commits:
2022-03-23 | 45c6738 | [compiler-rt] Remove forgotten mention of SVN modules, LLVM now uses Git |
2022-03-21 | bc01d8f | [compiler-rt] Remove mentions of AuroraUX in code comments and docs |
do we need to develop ... innovate?
/dev/entropy
a accounting, - non-blocking, high availability-cryptographic unix-type character device that has its own interactive interface to allow programmatic assertions, to allow the definition of pools of entropy of various designated sources, which were previously added to aid the remixing of entropy pool - with specialized software and specific hardware peripherals, dongles, even the conversions of cryptographic functions to hardware
/dev/entropy is capable of persisting keep-state information of elements that are defined in the cryptographic subsystem, such as the details of designated entropy pools, its mode of operation for mixture from sources, it's access information. All information that is needed to keep coherency of a system - secured process of re-entry interpretation.
/dev/entropy will be a non-blocking character device, 2. that allow and assure high availability and early readiness of encapsulated information, to prevent boot time regression of a system, to prevent dangling of boot time processes - with a specific interface that may allow programmed interaction to assert to running configurations of the cryptographic subsystem. Why: The Dutch intelligence community has some formal recommendation towards information transformation for the post-quantum era. Asymmetric encryption would at least benefit to harden a datastore.
Why: because /dev/random looks less elegant now on Debian, with irregular symbolic bursts, nothing qualitative can be said about the pool of entropy. That is not having hypersonic products of entropy from high- and low-quality sources, in a rehashing scheme, exposing bias already to several bits that may lead to more exposure of any cascade of cryptographic functions ahead.
/dev/entropy would help benefit all new methods and algorithms, from cryptographic facilities aiding ambiguity such as having spatial decorrelation, spatial complexity - which by means of graphing has the worst differentiated nodes dissolved in reversal, adding temporal complexity to streams, What we need is that perhaps comes from core isolated lightweight processes to produce asynchronous tokens, to build pathways that with one way hashing functions.
TBC... there will be a tactical augmented console interface and authentication in multiple factors such as holding a zero (mirrored) in from of a image source and the gesture of 'TENET' with both hands. There will also be a tactical projection device that uses lasers to guide the one-time projection.
We are happy to announce that The NetBSD Fundation is a mentoring organization at Google Summer of Code 2022!
Would you like to contribute to NetBSD or pkgsrc during the summer? Please give a look to NetBSD wiki Google Summer of Code page with possible ideas list and/or please join #NetBSD-code IRC channel on libera or get in touch with us via mailing lists to propose new projects!
Please note that unlike past years where Google Summer of Code was opened only to university students since this year if you are 18 or older you can be a GSoC contributor.
For more information about Google Summer of Code please give a look to the official GSoC website.
Looking forward to have a nice Google Summer of Code!
Running FreeBSD on the DMP EBOX 3300A-H with a Vortex86DX CPU
After trying NetBSD and OpenBSD on my DMP EBOX 3300A-H with a Vortex86DX CPU, I was curious to see how FreeBSD would fare on such constrained systems these days.
For more information and background about the hardware, please refer to my previous article.
Attempting to install FreeBSD 13.0 failed early when loading the kernel, and both supported releases from the FreeBSD 12 series (12.2 and 12.3) also exhibit the same issue.
int=00000006 err=00000000 efl=00000002 eip=013d1651
eax=01fe26b0 ebx=0008274c ecx=00000000 edx=01fe8b77
esi=01d8c3d8 edi=019b20c8 ebp=019b2038 esp=00000000
cs=0008 ds=0010 es=0010 fs=0010 gs=0010 ss=0010
cs:eip=0f 45 f0 a1 88 20 9b 01-85 c0 0f 45 f0 81 c6 ff
ff 3f 00 81 e6 00 00 c0-ff 89 35 d4 ad d8 01 8d
ss:esp=f3 ee 00 f0 f3 ee 00 f0-c3 e2 00 f0 f3 ee 00 f0
f3 ee 00 f0 54 ff 00 f0-4f 07 00 f0 f7 06 00 f0
BTX halted
FreeBSD 13.0 release notes mention that the default CPUTYPE for the i386 architecture is now 686 (instead of 486), and have details on the rationale behind this change.
After digging a bit, it turns out some Vortex86 CPUs lack support for the Conditional Move (CMOV) instruction, and code targetting i686 will fail on those models.
Using objdump to disassemble the kernels for the 12.2, 12.3, and 13.0 releases revealed that they were indeed using CMOV. Performing the same checks on the kernels from FreeBSD 12.0 and 12.1 releases did not show any CMOV instructions use.
The FreeBSD 12.1 installation process completed successfully and I could reboot into the installed system without issues. This version is not supported anymore but it doesn’t matter in this case as it’s more of a one-off thing for the purpose of writing this post, the machine being too constrained for any real world usage in this day and age.
For installing pkg and binary packages, I had to modify the url directive in /etc/pkg/FreeBSD.conf to:
url: "pkg+http://pkg.FreeBSD.org/${ABI}/release_2",
Indeed, quarterly packages and release_3 packages are apparently targetting i686 and their binaries contain CMOV instructions.
Attempting to run i686 binaries result in the following error:
Illegal instruction (core dumped)
We can verify that the culprits are indeed CMOV instructions with the following program:
.section .text
.globl _start
_start:
cmovl %eax, %ebx
Let’s assemble, link, and run it:
as cmov.s -o cmov.o
ld cmov.o -o cmov
./cmov
Illegal instruction (core dumped)
With this out of the way, we now have a fully functioning FreeBSD 12.1 installation on this machine.
On a freshly booted system, 16 processes are running and most of the RAM is unused.
last pid: 787; load averages: 0.30, 0.30, 0.13 up 0+00:02:12 09:55:29
16 processes: 1 running, 15 sleeping
CPU: 6.2% user, 0.0% nice, 10.1% system, 2.1% interrupt, 81.6% idle
Mem: 6556K Active, 1028K Inact, 28M Wired, 16M Buf, 181M Free
Swap: 2752M Total, 2752M Free
PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND
751 root 1 22 0 5268K 2616K wait 0:00 0.00% login
759 root 1 20 0 6192K 3108K pause 0:00 0.00% csh
581 root 1 20 0 4588K 2112K select 0:00 0.00% syslogd
692 root 1 20 0 8772K 5360K select 0:00 0.00% sendmail
699 root 1 24 0 4588K 2104K nanslp 0:00 0.00% cron
787 root 1 23 0 5868K 2592K RUN 0:00 0.00% top
752 root 1 52 0 4276K 1908K ttyin 0:00 0.00% getty
756 root 1 52 0 4276K 1908K ttyin 0:00 0.00% getty
758 root 1 52 0 4276K 1908K ttyin 0:00 0.00% getty
753 root 1 52 0 4276K 1908K ttyin 0:00 0.00% getty
757 root 1 52 0 4276K 1908K ttyin 0:00 0.00% getty
754 root 1 52 0 4276K 1908K ttyin 0:00 0.00% getty
755 root 1 52 0 4276K 1908K ttyin 0:00 0.00% getty
695 smmsp 1 52 0 8548K 4848K pause 0:00 0.00% sendmail
94 root 1 52 0 4152K 1688K pause 0:00 0.00% adjkerntz
421 root 1 20 0 3864K 1108K select 0:00 0.00% devd
Here is the result of the md5 -t benchmark:
MD5 time trial. Digesting 100000 10000-byte blocks ... done
Digest = 766a2bb5d24bddae466c572bcabca3ee
Time = 20.719989 seconds
Speed = 46.026777 MiB/second
And this is the result of the sha1 -t benchmark:
SHA1 time trial. Digesting 100000 10000-byte blocks ... done
Digest = 02522491d7a8253fcab708560acfa84b2fb7ef1c
Time = 54.165445 seconds
Speed = 17.606692 MiB/second
For the record, OpenSSL speed benchmark results are available here.
Finally, here is a dmesg for reference purposes:
Copyright (c) 1992-2019 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 12.1-RELEASE r354233 GENERIC i386
FreeBSD clang version 8.0.1 (tags/RELEASE_801/final 366581) (based on LLVM 8.0.1)
VT(vga): resolution 640x480
Firmware Error (ACPI): A valid RSDP was not found (20181213/tbxfroot-369)
CPU: PentiumUnknown (1000.02-MHz 586-class CPU)
Origin="Vortex86 SoC" Id=0x522
real memory = 268435456 (256 MB)
avail memory = 225300480 (214 MB)
random: unblocking device.
stray irq7
Timecounter "TSC" frequency 1000023008 Hz quality 800
random: entropy device external interface
kbd1 at kbdmux0
[ath_hal] loaded
module_register_init: MOD_LOAD (vesa, 0x14d9fb0, 0) error 19
Firmware Error (ACPI): A valid RSDP was not found (20181213/tbxfroot-369)
ACPI: Table initialisation failed: AE_NOT_FOUND
ACPI: Try disabling either ACPI or apic support.
vtvga0: <VT VGA driver> on motherboard
cryptosoft0: <software crypto> on motherboard
pcib0 pcibus 0 on motherboard
pir0: <PCI Interrupt Routing Table: 12 Entries> on motherboard
pci0: <PCI bus> on pcib0
vgapci0: <VGA-compatible display> port 0xdf80-0xdfff mem 0xf8000000-0xfbffffff,0xfefc0000-0xfeffffff at device 3.0 on pci0
vgapci0: Boot video device
isab0: <PCI-ISA bridge> at device 7.0 on pci0
isa0: <ISA bus> on isab0
vte0: <RDC R6040 FastEthernet> port 0xde00-0xdeff mem 0xfefbb400-0xfefbb4ff irq 10 at device 8.0 on pci0
miibus0: <MII bus> on vte0
rdcphy0: <R6040 10/100 media interface> PHY 1 on miibus0
rdcphy0: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
vte0: Ethernet address: 00:1b:eb:22:16:5c
ohci0: <OHCI (generic) USB controller> mem 0xfefb9000-0xfefb9fff irq 11 at device 10.0 on pci0
usbus0 on ohci0
ehci0: <EHCI (generic) USB 2.0 controller> mem 0xfefbb800-0xfefbb8ff irq 11 at device 10.1 on pci0
usbus1: EHCI version 1.0
usbus1 on ehci0
ohci1: <OHCI (generic) USB controller> mem 0xfefba000-0xfefbafff irq 11 at device 11.0 on pci0
usbus2 on ohci1
ehci1: <EHCI (generic) USB 2.0 controller> mem 0xfefbbc00-0xfefbbcff irq 11 at device 11.1 on pci0
usbus3: EHCI version 1.0
usbus3 on ehci1
atapci0: <Generic ATA controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xef00-0xef0f irq 14 at device 12.0 on pci0
ata0: <ATA channel> at channel 0 on atapci0
ata1: <ATA channel> at channel 1 on atapci0
cpu0 on motherboard
unknown: <PNP0c01> can't assign resources (memory)
Firmware Error (ACPI): A valid RSDP was not found (20181213/tbxfroot-369)
Firmware Error (ACPI): A valid RSDP was not found (20181213/tbxfroot-369)
attimer0: <AT timer> at port 0x40-0x43 irq 0 pnpid PNP0100 on isa0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
Firmware Error (ACPI): A valid RSDP was not found (20181213/tbxfroot-369)
atrtc0: <AT realtime clock> at port 0x70-0x71 irq 8 pnpid PNP0b00 on isa0
atrtc0: registered as a time-of-day clock, resolution 1.000000s
Event timer "RTC" frequency 32768 Hz quality 0
Firmware Error (ACPI): A valid RSDP was not found (20181213/tbxfroot-369)
Firmware Error (ACPI): A valid RSDP was not found (20181213/tbxfroot-369)
Firmware Error (ACPI): A valid RSDP was not found (20181213/tbxfroot-369)
Firmware Error (ACPI): A valid RSDP was not found (20181213/tbxfroot-369)
atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 irq 1 pnpid PNP0303 on isa0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
orm0: <ISA Option ROM> at iomem 0xc0000-0xc7fff pnpid ORM0000 on isa0
fdc0: No FDOUT register!
ppc0: parallel port not found.
unknown: <PNP0c01> can't assign resources (memory)
Firmware Error (ACPI): A valid RSDP was not found (20181213/tbxfroot-369)
Timecounters tick every 1.000 msec
usbus0: 12Mbps Full Speed USB v1.0
usbus1: 480Mbps High Speed USB v2.0
ugen0.1: <(0x17f3) OHCI root HUB> at usbus0
uhub0: <(0x17f3) OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0
ugen1.1: <(0x17f3) EHCI root HUB> at usbus1
uhub1: <(0x17f3) EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus1
usbus2: 12Mbps Full Speed USB v1.0
usbus3: 480Mbps High Speed USB v2.0
ugen2.1: <(0x17f3) OHCI root HUB> at usbus2
uhub2: <(0x17f3) OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus2
ugen3.1: <(0x17f3) EHCI root HUB> at usbus3
uhub3: <(0x17f3) EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus3
uhub0: 2 ports with 2 removable, self powered
uhub2: 2 ports with 2 removable, self powered
Trying to mount root from ufs:/dev/da0s1a [rw]...
Root mount waiting for: usbus3 usbus1
uhub1: 2 ports with 2 removable, self powered
uhub3: 2 ports with 2 removable, self powered
Root mount waiting for: usbus3 usbus1
ugen0.2: <vendor 0x0d8c C-Media USB Audio Device> at usbus0
ugen2.2: <Lenovo ThinkPad Compact USB Keyboard with TrackPoint> at usbus2
ukbd0 on uhub2
ukbd0: <Lenovo ThinkPad Compact USB Keyboard with TrackPoint, class 0/0, rev 2.00/3.30, addr 2> on usbus2
kbd2 at ukbd0
Root mount waiting for: usbus3
Root mount waiting for: usbus3
ugen3.2: <Generic USB Storage> at usbus3
umass0 on uhub3
umass0: <Generic USB Storage, class 0/0, rev 2.00/2.20, addr 2> on usbus3
umass0: SCSI over Bulk-Only; quirks = 0xc100
umass0:2:0: Attached to scbus2
mountroot: waiting for device /dev/da0s1a...
da0 at umass-sim0 bus 0 scbus2 target 0 lun 0
da0: <Generic STORAGE DEVICE 0220> Removable Direct Access SCSI device
da0: 40.000MB/s transfers
da0: 61120MB (125173760 512 byte sectors)
da0: quirks=0x3<NO_SYNC_CACHE,NO_6_BYTE>
lo0: link state changed to UP
vte0: link state changed to DOWN
uaudio0 on uhub0
uaudio0: <vendor 0x0d8c C-Media USB Audio Device, class 0/0, rev 1.10/1.00, addr 2> on usbus0
uaudio0: Play: 48000 Hz, 2 ch, 16-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Play: 44100 Hz, 2 ch, 16-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Record: 48000 Hz, 1 ch, 16-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Record: 44100 Hz, 1 ch, 16-bit S-LE PCM format, 2x8ms buffer.
uaudio0: No MIDI sequencer.
pcm0: <USB audio> on uaudio0
uaudio0: HID volume keys found.
ums0 on uhub2
ums0: <Lenovo ThinkPad Compact USB Keyboard with TrackPoint, class 0/0, rev 2.00/3.30, addr 2> on usbus2
ums0: 6 buttons and [XYZT] coordinates ID=1
The time has come to upgrade my SunBlade 2500s to something more power friendly and faster. I'd already removed one CPU and thus half the ram from two of these systems to reduce their power consumption, but it's still much higher than it could be.
After much searching, I've decided on Pine64's RockPro64 4GiB ram model (technically, only 3.875GiB ram.) Pine64 make SBCs, laptops, phones, and various other mostly ARM gadgets, and the RockPro64 has the fastest CPU they ship (Rockchip RK3399), and can use a small "NAS Case", that is sufficient to house 2 HDDs and, at a stretch, upto 6 SSDs (cooling would become quite an issue at this point.)
In my SATA setup, I have 3 SSDs with a JMicron 585 card in the PCIe slot, two SSDs in the NAS case SSD region, and the third is in the HDD region with an adapter. I have used two SATA power splitters to convert the NAS case's 2 SATA power ports into 4, with the 4th one also powering a Noctua case fan. The cabling is not great with this, with enough SATA power cabling for 6 devices to lay. Probably a bespoke power cable to connect to the RockPro64 would make this nicer and probably improve cooling slightly, but I'm just using off-the-shelf components for now.
In the last year or so I've been working on making NetBSD/arm64 big-endian more featureful. In particular, I've added support for:
There are not too many special actions needed for this sort of setup compared to a normal NetBSD or Arm system. While I built my installations by hand, the standard NetBSD Arm images are suitable for this task. It's easiest to start from an SD card with the RockPro64 u-boot installed. There are two U-Boot images available, one for SD/eMMC, and one for SPI (there is an odd problem with the early SPI loader that requires a portion of the image to be different.) The pkgsrc package for sysutils/u-boot-rockpro64 version 2022.01 has these suggested methods for installing the U-Boot image (this package should be buildable on any supported pkgsrc platform).
To install U-Boot into the SD/eMMC card (can run on any system, the image must be written at 32KiB into the device):
# dd if=/usr/pkg/share/u-boot/rockpro64/rksd_loader.img seek=64 of=/dev/rld0c
To install U-Boot into the SPI flash (must be run on the host, and lives at the very start of the device:
# dd if=/usr/pkg/share/u-boot/rockpro64/rkspi_loader.img bs=64k of=/dev/spiflash0
When booting from NVMe or SATA, one must drop to the U-Boot prompt and adjust the "boot_targets" value to put scsi* (SATA) or nvme* ahead of the mmc* and usb* options.
The original value for me:
=> printenv boot_targets boot_targets=mmc1 usb0 mmc0 nvme0 scsi0 pxe dhcp sf0
Which is then adjusted and saved with eg:
=> setenv boot_targets nvme0 scsi0 mmc1 usb0 mmc0 pxe dhcp sf0 => saveenv Saving Environment to SPIFlash... Erasing SPI flash...Writing to SPI flash...done OK
(In this list, mmc1 is the SD slot, mmc0 is the eMMC card, pxe and dhcp are netbooting, and sf0 attempts to load further U-Boot scripts from SPI.)
There are some minor issues with the RockPro64. It has no ability to use ECC memory. It only comes with 1 PCIe 4x slot, and Rockchip errata limited this to PCIe 1.x (though no NetBSD users encounted any issues with PCIe 2.x enabled, and this can be forced back on via a DTS patch.) It is possible to use a PCIe bridge (I have never done this, though I would like to try in the future) to enable more devices for booting, or to enable both a network and storage device.
GNU/Hurd is the original Free Software operating system started in the 1980s. Its microkernel design has been evolving over the years and the project has not quite hit mainstream use. I believe this is due to one main reason: the lack of drivers for peripherals and hardware. In this talk, I explain how NetBSD kernel drivers have been reused in a microkernel setting and demonstrate their use to boot up a GNU/Hurd system via a userspace rump disk driver, with a driverless Hurd kernel, gnumach. The ACPI management, PCI management, and actual driver are in separate processes with RPC interfaces between them, which separates out their debugging, licencing concerns and execution.
Hurd is a neverending story, derailed by the massive popularity and uptake of the Linux kernel as the de facto standard kernel for the GNU project. I’d love for it to become more competitive, but the situation isn’t exactly looking great.