-
Notifications
You must be signed in to change notification settings - Fork 119
BootingFreeBSDMIPS
This page describes how to boot FreeBSD on the Sail MIPS64 model found at https://github.com/CTSRD-CHERI/sail-cheri-mips. It assumes you have a checkout of the sail repository at SAIL_DIR
and sail-cheri-mips at SAIL_CHERI_MIPS_DIR
.
cd $SAIL_CHERI_MIPS_DIR/mips
make SAIL_DIR=$SAIL_DIR mips_c
Note: If you installed sail using opam you can omit SAIL_DIR above and it will use sail from your PATH, however you will still need a checkout of the sail repository for the files described below.
For convenience the sail repository contains a few things you need to test booting. In $SAIL_DIR/tests/cheri
you will find:
-
simboot_128m.sailbin
-- a minimal boot loader in a file format understood by the sail C simulator. -
freebsd-beri-sim-mdroot-smoketest_bootonly-kernel.bz2
-- a bz2 compressed FreeBSD kernel image with an embedded memory disk root filesystem. -
sim.dtb
-- a flattened device tree blob describing the devices available to the kernel when running in the sail simulator (essentially just the UART for console output).
You can test the boot like this:
cd $SAIL_DIR/test/cheri
bunzip2 freebsd-beri-sim-mdroot-smoketest_bootonly-kernel.bz2
$SAIL_CHERI_MIPS_DIR/mips/mips_c --cyclelimit 85000000 \
--binary 0x100000,freebsd-beri-sim-mdroot-smoketest_bootonly-kernel \
--binary 0x7f010000,sim.dtb \
--image simboot_128m.sailbin
This will cause the simulator to load simboot, the kernel image and the device tree blob at appropriate addresses and run for 85 million simulated instructions before exiting. You should see lots of messages printed by the kernel like so:
entry: platform_start()
Using FDT at 0xffffffff861afb20 from ROM
...
Eventually it should print Done booting
followed by a #
indicating the boot reached a shell prompt (you won't be able to type any commands because the simulated UART does not support input!). It will exit after about 2 minutes, printing some debugging information including the average instructions per second for the boot.