No description
  • C 72.8%
  • PostScript 9.3%
  • HTML 9.1%
  • Roff 2.2%
  • Shell 2%
  • Other 4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-06-08 16:00:00 +00:00
.github/workflows boot: add scripts to run Plan 9 on QEMU 2025-06-08 16:00:00 +00:00
386 sys/src/ape: support 64-bit architectures (thanks Geoff Collyer) 2026-07-08 23:08:26 +02:00
acme acme/bin/source/win: increase EVENTSIZE to 16 KB (thanks Geoff Collyer) 2019-04-20 07:09:04 +02:00
adm Plan 9 from Bell Labs Fourth Edition 2013-01-25 2013-01-25 10:50:05 +01:00
amd64 sys/src/ape: support 64-bit architectures (thanks Geoff Collyer) 2026-07-08 23:08:26 +02:00
arm sys/src/ape: support 64-bit architectures (thanks Geoff Collyer) 2026-07-08 23:08:26 +02:00
arm64 all: import arm64 library support (thanks Richard Miller) 2026-03-15 19:56:12 +01:00
boot boot: add scripts to run Plan 9 on QEMU 2025-06-08 16:00:00 +00:00
cfg boot: add scripts to run Plan 9 on QEMU 2025-06-08 16:00:00 +00:00
cron Plan 9 from Bell Labs Fourth Edition 2007-10-06 2007-10-06 06:00:03 +02:00
dist/replica dist/replica: add /arm64 directory to plan9.proto (thanks Richard Miller) 2026-04-27 11:09:50 +02:00
lib sys/src/cmd/cpu.c: make an encrypted TLS connection to a cpu server (thanks Geoff Collyer) 2026-07-08 23:08:26 +02:00
mail Plan 9 from Bell Labs Fourth Edition 2010-01-17 2010-01-17 11:00:08 +01:00
mips sys/src/ape: support 64-bit architectures (thanks Geoff Collyer) 2026-07-08 23:08:26 +02:00
mips64 all: import mips64 and spim64 support from bitbucket.org/cherry9/4c (thanks Cherry Zhang) 2017-09-18 23:25:37 +02:00
power sys/src/ape: support 64-bit architectures (thanks Geoff Collyer) 2026-07-08 23:08:26 +02:00
power64 sys/src/ape: support 64-bit architectures (thanks Geoff Collyer) 2026-07-08 23:08:26 +02:00
rc all: import mips64 and spim64 support from bitbucket.org/cherry9/4c (thanks Cherry Zhang) 2017-09-18 23:25:37 +02:00
riscv all: add the intptr type and define _BITS64 for ape (thanks Geoff Collyer) 2026-07-08 23:08:26 +02:00
riscv64 all: various fixes for riscv (thanks Richard Miller) 2023-04-14 18:56:36 +02:00
sparc sparc: add the object suffix and cpu to the mkfile 2026-07-08 23:08:26 +02:00
spim all: import spim support from bitbucket.org/cherry9/plan9-loongson (thanks Cherry Zhang) 2017-09-17 22:13:34 +02:00
spim64 all: import mips64 and spim64 support from bitbucket.org/cherry9/4c (thanks Cherry Zhang) 2017-09-18 23:25:37 +02:00
sys sys/src/9k: drop the stale errstr from the server error messages 2026-07-08 23:08:26 +02:00
usr/glenda boot: add scripts to run Plan 9 on QEMU 2025-06-08 16:00:00 +00:00
.gitignore boot: add scripts to run Plan 9 on QEMU 2025-06-08 16:00:00 +00:00
LICENSE Plan 9 from Bell Labs Third Edition 2000-06-07 2000-06-07 17:23:05 +02:00
LICENSE.afpl Plan 9 from Bell Labs Fourth Edition 2003-06-29 2003-06-29 06:00:01 +02:00
LICENSE.gpl Plan 9 from Bell Labs Fourth Edition 2003-06-26 2003-06-26 06:00:02 +02:00
LICENSE.lucida Plan 9 from Bell Labs Third Edition 2000-06-07 2000-06-07 17:23:05 +02:00
LICENSE.old Plan 9 from Bell Labs Fourth Edition 2005-07-14 2005-07-14 06:00:08 +02:00
NOTICE Plan 9 from Bell Labs Fourth Edition 2002-04-27 2002-04-27 16:52:16 +02:00
NOTICE.old Plan 9 from Bell Labs Fourth Edition 2002-04-27 2002-04-27 16:52:16 +02:00
README Plan 9 from Bell Labs Fourth Edition 2015-01-10 2015-01-10 10:50:05 +01:00
README.md boot: add scripts to run Plan 9 on QEMU 2025-06-08 16:00:00 +00:00

9legacy

CI

9legacy is a continuation of Plan 9 from Bell Labs.

1. Usage

boot/qemu runs Plan 9 under QEMU with this tree as the guest's root file system. An edit on the host is an edit in the running system. By default it serves the tree over a virtio-9p device and boots an ELF kernel with multiboot. -9fat boots the virtio-9p root from a 9fat menu disk instead. -u9fs serves the tree with u9fs over 9P-over-TCP and boots boot/pxeboot.raw over tftp through the PXE loader. That last path is slower, but doesn't depend on the multiboot ELF or the virtio-9p driver.

Quit QEMU with Ctrl-a x.

1.1. Prepare the tree

Do this once before the first boot.

  1. Build the empty directories

Git won't store an empty directory. boot/mkdirs creates the ones Plan 9 expects, matching the original CD image.

./boot/mkdirs
  1. Install the binaries

boot/getbin downloads the latest 9legacy CD image and copies the 386 and amd64 binaries, libraries and kernels into the tree. It reads the image with 9660srv and 9p from plan9port, which must be installed.

./boot/getbin

1.2. virtio-9p mode

With no arguments boot/qemu boots the 386 terminal kernel over virtio-9p, on the serial console, with four CPUs and QEMU's slirp networking.

./boot/qemu                 # 386 terminal (default)
./boot/qemu -amd64          # amd64 terminal
./boot/qemu -cpu            # 386 cpu server
./boot/qemu -amd64 -cpu     # amd64 cpu server
./boot/qemu -smp 8          # eight CPUs

1.2.1. Graphics

-vga opens a window and runs rio at 1920x1080. Change the resolution with vgasize at the top of boot/qemu.

./boot/qemu -vga
./boot/qemu -amd64 -vga

1.2.2. Boot from the 9fat disk

boot/qemu -9fat boots a small 9fat disk that holds every kernel behind a boot menu. Build the disk once inside a guest with mk9fat, then pick a kernel at the Selection: prompt.

mk9fat                      # in the guest, writes boot/9fat.raw
./boot/qemu -9fat

1.3. u9fs mode

boot/qemu -u9fs is the original mode. It builds u9fs from sys/src/cmd/unix/u9fs, boots boot/pxeboot.raw over tftp, and serves the tree with u9fs over 9P-over-TCP. It boots the stock kernel through the PXE loader.

./boot/qemu -u9fs

1.4. Rebuild the boot images

boot/pxeboot.raw, the PXE loader for -u9fs, is committed. boot/9fat.raw, the menu disk for -9fat, is built on demand. boot/regen rebuilds both from the host. It boots a guest and runs mkbootpbs, mkpxeboot and mk9fat.

./boot/regen

To rebuild boot/pxeboot.raw by hand, shrink 9bootpbs and build the loader in a guest. The boot ramdisk shadows /boot, so the diff is read from /root/boot:

cd / && ape/patch -p1 < /root/boot/9-pcboot-boot.diff
mkbootpbs
mkpxeboot   # writes boot/pxeboot.raw

Test the new loader with ./boot/qemu -u9fs.

To rebuild boot/9fat.raw by hand, run mk9fat in a guest. It lays 9load, every installed kernel and a plan9.ini boot menu onto the disk, with the root over virtio-9p.

mk9fat

2. Test

boot/test drives a guest through a CI task and reports on the serial console.

boot/test build           # boot 386, build every architecture
boot/test smoke -386      # boot 386, compile and run the smoke test
boot/test smoke -amd64    # boot amd64, compile and run the smoke test

The smoke test is usr/glenda/src/smoke/smoke.c. It checks the compiler and library, then stresses the allocator, processes, pipes, the file system and the network. GitHub Actions runs all three on every push and pull request. See .github/workflows/ci.yml.

3. Thanks

We thank Russ Cox, who made the original scripts to easily boot a Plan 9 file hierarchy on QEMU.