Skip to content

boredcoder411/mboot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mboot

mboot is a minimal os for i386 platforms.

Prequisites

Building mboot depends on:

  • llvm tools (clang, ld.lld)
  • nasm

Running mboot needs:

  • the building tools or a disk image
  • qemu-system-x86_64

Building

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.pcap

UDP demo

The 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.pcap

From the host, send a datagram to the forwarded port:

printf 'hello from host\n' | nc -u -w 1 127.0.0.1 10007

If your nc supports listen mode, you can also watch the echoed reply with a second terminal:

nc -u -l 10007

On 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:7 log line
  • an Echoing N bytes back to port src log line

todo:

  • 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

Screenshots

mboot running in qemu

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors