Advanced Namespace Tools blog
27 December 2016
Fixing Rio Support in the 9front-ANTS Service Namespace
The ANTS "service namespace" is intended to be a workable, self-sufficient environment. I usually access it via rcpu/drawterm to its own rcpu listener, conventionally on port 17060 in 9front. Occasionally it is more convenient to work on the machine console. The original Bell Labs version of ANTS supported running Rio and/or Acme in the service namespace, but it has taken me awhile to update the "gui" script to work in 9front also.
Adjusting the Toolcopy Script
The programs available in the independent ANTS namespace are determined by three things:
- The most fundamental programs are included in the kernel configuration files, pcf or pcf64.
- The next layer of programs are compiled into paqfs, determined by cfg/mkpaq.
- Optional tools are in a tools.tgz stored in 9fat and copied into a ramdisk, determined by cfg/toolcopy.
The piece that was missing for proper gui support was aux/realemu, which I decided to put in the tools.tgz rather than the bootpaq, for now. This just meant adding one line to the toolcopy script:
cp /$objtype/bin/aux/realemu .
Fixing the Namespace at /lib
Because ANTS is layered "on top of" the normal 9front configuration, the standard 9front bootfs.paq is still mounted and bound by boot.c. The ANTS bootpaq and ramdisk root skeleton are union-binded behind with the -a flag. This meant that in the case of any duplicated subdirectories, walking the pathnames will give you what is present in the standard bootfs.paq. The only place I have noted a conflict is in /lib. For the gui to work properly, some fonts need to available in /lib/font/bit, and the bootfs.paq only contains /lib/firmware. I worked around this with a small addition to the doramsetup fn in plan9rc:
mount -c /srv/ramboot /mnt/rboot bind -ac /mnt/rboot/lib /lib
At some point, I may change the architecture to use a single paqfs at boot, but for the moment I prefer to keep the default 9front configuration separated from what ANTS needs.
Updating the GUI script
The gui script to start rio in Bell Labs ANTS was as primitive as could be:
bind -b '#P' /dev bind -b '#m' /dev mouse $mouseport vga -m vesa -l 1024x768x24 grio
Since 9front has a nice screenrc script (a lot of which used to be part of termrc) I figured the best thing to do was just modify it slightly for use in the ANTS environment. The changes were minor, adding a test and bind of the vgactl device:
if(! test -e /dev/vgactl) bind -a '#v' /dev
Changing aux/vga and aux/mouse to just vga and mouse, because the ANTS service namespace binds everything into /bin with no subdirectories, and then setting the font and starting a nice pink-colored grio. (It is conventional in ANTS to set different background colors in Rio to identify the base namespace.)
font=/lib/font/bit/lucm/unicode.9.font grio -s -w 2 -y 0 -c 0xffaaaaff
GUI and cross-compiling bugfix added to 2.6 release
It was somewhat of an oversight that I hadn't fixed starting the GUI from the service namespace in 9front, so I am adding these changes to the plan9ants repo, along with a bugfix/cleanup for cross-compiling between amd64 and 386. Assuming I don't find anything else that counts as a bug or missing feature, the plan9ants repo will probably go awhile without further updates, with development occuring in antsexperiments.