Plan9 Tips
I want to documents some tips here, which are quite useful.
Copying files from Plan9 to Linux using floppy:
Create a 1.44 MB floppy image in linux, format it with FAT FS. Use it as 1st floppy disk in qemu.
In Plan9, use following commands to access it:
a:
cd /n/a:
Editing plan9.ini configuration file:
Type following command in Plan9,
9fat:
cd /n/9fat
Command to reboot / halt the system: reboot fshalt
For PC 386:
8c - is the C compiler
8a - is the assembler
8l - is the linker
One typically needs to add u.h and libc.h files as headers for C programs.
Important linker options for 8l are:
-H5 = Output is generated with ELF header
-l = Suppress default loading of startup files.
-T0x100000 = Loads Text section at 1MB
Default Entry symbol is _main
Default Plan9 kernel configuration for PC is pcf
Procedure for Compiling kernel:
cd /sys/src/9/pc
mk 'CONF=pcf'
To compile kernel in ELF format I modified /sys/src/9/pc/mkfile
and added -H5
option to $(LD) command.