Installing 9front on a Raspberry Pi
This guide has only been tested on the Raspberry Pi 4.
You need:
- A Raspberry Pi.
- An SD card. This will be the device you will install to.
- A USB drive. This should have the pi3.img flashed onto it.
Boot the Raspberry Pi from the USB drive.
Before installing determine your hardware and planned OS configuration.
Although hjfs is the recommended filesystem for running Plan 9 on the Raspberry Pi, it is possible to use cwfs with some modifications.
At some point Ori had said that for drives over 32 GB cwfs may be a better choice.
If you want to use cwfs follow the steps at kvik's site except for the preppart
step.
Before install, run disk/fdisk /dev/sdM0/data to edit the DOS partition table.
If it produces errors read prep(8)
and try the other commands as necessary.
Add 2 DOS partitions:
p1
should be roughly 100 MB in size. You will need to calculate how many cylinders this is.
p2
should take up the remaining space.
- You should make
p1
FAT32 and p2
PLAN9.
Next run disk/prep /dev/sdM0/plan9 to edit the Plan 9 partition table.
Add 2 Plan 9 partitions:
- The first partition,
nvram
, should start at sector 2 and end at sector 3.
- There are two options for the second partition. If using hjfs this partition will be named
fs
; if using cwfs it will be named fsmain
. Add either fs
(hjfs) or fsmain
(cwfs) from sector 3 to the end.
Your disk should now be correctly partitioned.
Next modify /bin/inst/prepdisk
and change the line if(! test -f /dev/sd*/9fat) to if(! test -f /dev/sd*/fs).
If using cwfs instead of hjfs, instead replace with if(! test -f /dev/sd*/fsmain).
This change will remain in your installed /bin/inst/prepdisk
and you may want to change it back once you boot.
Next run inst/start. Installation should proceed without issue.
During the partdisk
and prepdisk
steps make sure to quit out of the partitioning tools it puts you in since you've already partitioned.
After inst/start finishes installing you need to copy the Pi DOS partition files, which are required to boot on the Raspberry Pi.
To copy the files:
- Run mount <{dossrv -s} /n/newdos /dev/sdM0/dos
- Run mount <{dossrv -s} /n/olddos /dev/sdUa1a1a, where
sdUa1a1a
is the device filename of the USB drive.
- Run dircp /n/olddos /n/newdos to transfer the Pi DOS files from the existing DOS partition to the new DOS partition.
- Unmount the DOS partitions.
If the install was successful you should now be able to reboot from the SD card.
Notes:
- You will need to run 9fs dos instead of 9fs 9fat.
- Any configuration intended for
plan9.ini
should instead go in cmdline.txt
in the Pi DOS partition. See here.
- Raspberry Pi specific configuration goes in
config.txt
located in the Pi DOS partition. See here
- If setting up
ndb
each tuple should stay on a single line. Like with cmdline.txt
multiple line tuples are seeemingly ignored.
- The 9front FQA, kvik's 9front docs, Nicolas Montanaro's guide, and Dan-Simon Myrland's guide should help to understand how to install and configure 9front.