mboot is a minimal os for i386 platforms.
Building mboot depends on:
- llvm tools (clang, ld.lld)
- nasm
Running mboot needs:
- the building tools or a disk image
- qemu-system-x86_64
make
# normal os
qemu-system-x86_64 -m 4G -drive file=image.img -serial stdio
# with networking enabled
qemu-system-x86_64 -m 4G -drive file=image.img -serial stdio -device e1000,netdev=n0 -netdev user,id=n0 -object filter-dump,id=f1,netdev=n0,file=netdump.pcap
# with networking enabled and UDP forwarded from host port 10007 to guest port 7
qemu-system-x86_64 -m 4G -drive file=image.img -serial stdio \
-device e1000,netdev=n0 \
-netdev user,id=n0,hostfwd=udp::10007-:7 \
-object filter-dump,id=f1,netdev=n0,file=netdump.pcapThe kernel now starts a UDP echo service on guest IP 10.0.2.15, port 7.
Run QEMU with host UDP forwarding:
qemu-system-x86_64 -m 4G -drive file=image.img -serial stdio \
-device e1000,netdev=n0 \
-netdev user,id=n0,hostfwd=udp::10007-:7 \
-object filter-dump,id=f1,netdev=n0,file=netdump.pcapFrom the host, send a datagram to the forwarded port:
printf 'hello from host\n' | nc -u -w 1 127.0.0.1 10007If your nc supports listen mode, you can also watch the echoed reply with a second terminal:
nc -u -l 10007On the guest serial log you should see:
- the local IPv4 address announcement
UDP echo service listening on port 7- an
RX a.b.c.d:src -> 10.0.2.15:7log line - an
Echoing N bytes back to port srclog line
- 32 bit protected mode
- cpu exceptions
- individual hardware interrupts
- a ps/2 keyboard
- vga in 320x200x8bpp
- reading ata drives
- rs232 interfaces
- the intel 8259 PIC
- the intel 8253 PIT
- the mbr partitioning scheme
- wad files as the filesystem
- enable x87 fpu
- memory allocator
- elf loader
- paging
- libc
- implement more demos to show syscalls working
