.github | ||
devfs | ||
init | ||
initrd | ||
initrd_drv | ||
kernel | ||
libc | ||
patches | ||
pci | ||
psinfo | ||
stuff | ||
sysroot | ||
tar_fs | ||
vfs | ||
vga_drv | ||
.gdbinit | ||
.gitignore | ||
bochsrc.txt | ||
bochsrc.txt.old | ||
docindex.html | ||
ext2.img | ||
image.img | ||
install.rb | ||
LICENSE | ||
Makefile | ||
network.rb | ||
orig_ext2.img | ||
README.md | ||
Vagrantfile |
os
This is a hobby OS based on a microkernel. It currently supports:
- Basic preemptive multitasking with task states & exiting.
- Physical & virtual memory management
- Interrupts.
- The PIT, used to do preemption.
- The serial port, used as an output for logs. (driver in kernel, will eventually be moved out)
- RPC as the IPC mechanism
- A working VFS and devfs
- VGA text mode
Building
To build the OS, you will need custom patched versions of GCC and Binutils targeted for my OS.
Building the cross-compiler
The instructions for building a cross compiler are here, though a few changes need to be made. First, you must download GCC 9.2.0 and Binutils 2.32, or the patches may not apply correctly. Next, you need to apply the patches located in the patches/ directory. Set $TARGET to i386-myos, not i686-elf. When running configure for both Binutils and GCC, you must pass --sysroot=<path to cloned github repo>/sysroot as an extra argument, otherwse the compiler will not be able to find the libc headers. Otherwise, the build is as normal.
Once the cross-compiler is built, the OS can be built by simply typing make
.
Additional setup (on Linux or Mac (Unsupported on Mac) )
To run & debug the OS, you willl need to install QEMU, GRUB, and GDB.
Installing GRUB on:
- Ubuntu. GRUB is already installed.
- Arch. If you have chosen GRUB as your bootloader, run
sudo pacman -S dosfstools libisoburn
, as arch by default does not have the necessary tools for grub-mkrescue to work, otherwise runsudo pacman -S grub dosfstools libisoburn
- Another linux distro. GRUB is likely already installed, but if it is not, you will need to use your distribution's package manager to install GRUB.
- Mac. You will need to install Homebrew, then run
brew install i386-elf-grub
Installing QEMU on
- Ubuntu. Run
sudo apt get install qemu
- Arch. Run
sudo pacman -S qemu qemu-arch-extra
- Another linux distro. Use your distribution's package manager to install QEMU.
- Mac. Run
brew install qemu
Installing GDB on
- Ubuntu. Run
sudo apt get install gdb
- Arch. Run
sudo pacman -S gdb
- Another linux distro. Use your distribution's package manager to install GDB.
- Mac. Run
brew install gdb
After this, you can run the OS in QEMU by typing make run
, or run the OS and start the debugger by typing make debug
.
The serial port output of the OS is redirected to a file callled serout in the main directory.