Skip to content

Latest commit

 

History

History
89 lines (70 loc) · 2.86 KB

README.md

File metadata and controls

89 lines (70 loc) · 2.86 KB

Sofa

Sofa is built atop SeL4 microkernel and provides a set of userland servers and an API to manipulate them.

Features:

System:

  • IPC Model between root server ('kernel_task') and applications
  • Thread in processes
  • UDP stack with virtio device
  • virtio-pci-blk driver (IRQ Not working, polling only for now)
  • VESA support

Process API

  • printf
  • getpid, getppid,
  • spawn,
  • sleep,
  • wait/waitpid,
  • kill,
  • readdir
  • Name server: register service, get service by name,
  • threads
  • VFS: mount, open, close, read
  • Net: socket, bind, recvfrom, sendto
  • module loader

POSIX status

Because we use musl, the current goal is to be as much as possible POSIX compliant. Except for:

  • fork, that might never be implemented. here's why.

Applications

  • init
  • shell
  • udp echo server

Services

  • Process: Enum, Spawn, Kill
  • VFS (read-only for now)
  • net (udp only)
  • DeviceKit
  • init: pretty much empty for now, serves as a use case to implement servers

Build

See dependencies.md for a list of required software.

You should have all the tools and external deps required to build seL4 (some info here).

Then call the update.sh script to fetch all the required components (seL4 kernel, libs, etc.)

Important

The LibSel4MuslcSysMorecoreBytes config var must be set to 0 in the project configuration. This can be done using ccmake ../projects/Sofa/ in the build folder.

sh update.sh
mkdir build
cd build
../init-build.sh  -DPLATFORM=x86_64 -DSIMULATION=TRUE -DRELEASE=FALSE -DLWIP_DEBUG=1 -DLWIP_PATH=../projects/libliwip/
ninja
./simulate --extra-qemu-args "-netdev user,id=net1,hostfwd=udp::3000-:3000 -device virtio-net-pci,netdev=net1 -device virtio-blk-pci,drive=drive0 -drive file=../sysroot.ext2.qcow2,if=none,id=drive0"

Create a qcow2 image

from here:

Note: to mount and edit the volume on the host: see https://gist.github.com/shamil/62935d9b456a6f9877b5.

Test the UDP stack:

start the udpecho program and test it by sending messages from the host:

nc  -u 127.0.0.1 3000

Create an ext2 distribution image:

after build, in the dist folder:

# note that mntP must exist!
sudo sh build.sh sofa.img mntP/
# on sucess:
qemu-system-x86_64 -cpu Nehalem,-vme,+pdpe1gb,-xsave,-xsaveopt,-xsavec,-fsgsbase,-invpcid,enforce -device virtio-blk-pci,drive=drive0 -drive file=sofa.img,if=none,id=drive0 -serial stdio

Resources