-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Anthill OS is a distributed, multitasking operating system for the Raspberry Pi.
This example runs two instances of Anthill OS on QEMU and lets you access one's file tree from the other.
Notes:
- Only tested on Linux.
Prerequisites:
- QEMU (works only up to version 8.2.6)
- socat (or any program which can connect two sockets)
- Release tarball
- A terminal multiplexer, such as tmux or screen, is recommended.
First, download the tarball and unpack it in an empty directory, using
tar -xvf anthill-os.tar.gz
.
Open a terminal and input:
socat -v UNIX-LISTEN:/tmp/i.so UNIX-LISTEN:/tmp/o.so
This creates and connects two sockets, i.so
and o.so
in the
tmp
directory
In another terminal, input:
qemu-system-aarch64 -M raspi3b -kernel kernel8.bin -device loader,file=ramdisk,addr=0x3e000000 -nographic -serial unix:/tmp/i.so -serial mon:stdio
And in another terminal, input
qemu-system-aarch64 -M raspi3b -kernel kernel8.bin -device loader,file=ramdisk,addr=0x3e000000 -nographic -serial unix:/tmp/o.so -serial mon:stdio
What this does, line by line:
-
qemu-system-aarch64
: Starts QEMU aarch64 instance. -
-M raspi3b
: Virtualises Raspberry Pi Model B. -
-kernel kernel8.bin
: Loads Anthill OS kernel. -
-device loader,file=ramdisk,addr=0x3e000000
: Tells QEMU where to load the ramdisk. The kernel expects it at this exact address. -
-nographic
: Disables graphical output. -
-serial unix:/tmp/{i,o}.so
: Connects pl011 device to unix socket -
-serial mon:stdio
: Connects mini uart to input output
You should now have two QEMU instances connected via unix sockets. You can
navigate their file trees with the commands cd
and ls
. You can
use Ctrl-C
to clear the command (backspace can't be used as this is
all through the uart).
Now, go to the first instance and input:
/boot/bin/exportfs /dev/pl011
This tells Anthill OS to export its file tree to connections through the
device /dev/pl011
. Go to the second instance and input:
importfs /dev/pl011 /mnt
This tells the system to import a file tree from the device
/dev/pl011
and put its root to the /mnt
directory.
You can exit QEMU with Ctrl-A Ctrl-X
.