Ramos is a small kernel that was initially developed to explore operating systems concepts and implementation. Its main goal is to be a teaching platform for learning about OSs.
- Make
- i686-elf-gcc Cross-Compiler. Refer to Why do I need a cross-compiler? and for how to compile a cross-compiler from source code, GCC Cross-Compiler. An easier method if you just want to try this toy OS out is to get a pre-compiled cross-compiler at https://github.com/lordmilko/i686-elf-tools
- QEMU to run the OS itself on emulated hardware, specifically qemu-system-i386
- (Optional) Bochs: Another emulator.
- (Optional) genisoimage if you want to create an ISO for Bochs, or to put onto an external drive.
Ramos is most easily tested with an emulator like QEMU or Bochs, although I believe you could get the ISO onto a USB drive and boot from it. I have not tried this yet, do so at your own risk.
make run
will compile and run Ramos on QEMU. I tend use this for testing almost all the time.make run-bochs
will do the same for Bochs. An ISO file is generated in the process. I tend to do this when I need to confirm that I am seeing the same behavior on both emulators. Remember to typec
into the Bochs terminal to start running the OS.
I will continue active development on master
.
However, to encourage learning, I am creating multiple branches off master that are different "checkpoints" that learners can pick up OS development from. For example, the level1
branch contains only enough code to boot the OS and print text to the screen. After switching to a level*
branch, you can find that branch's state in level*.MD
, e.g. for level1
the file describing the current state will be in level1.MD
.
Have fun!
- Simple VGA-buffer text terminal with scrolling
- Ability to read Multiboot header information
- Prints memory map from Multiboot information
- Implement interrupt system for timer (PIT) and keyboard
- Implements a basic kernel command line shell
- die() command in kernel libk to print registers and halt kernel.
- Implements basic dynamic memory allocation in kernelspace with malloc() and free()
- Create an abstraction for processes (PCB, scheduling). Consider multicore.
- Add command framework to kterm (command, args, etc). Have useful utilities (register state, memory state, malloc, free, processor info, etc)
- Dump memory space / stack frames on crash
- No current plan exists for implementing a userspace
-
boot
: Code dedicated to the boot process andkernel_main
function (entry point to kernel)- Flow of control:
- Bootloader calls
start.s
, which loads the multiboot information onto the stack, thenkernel.c
'skernel_main
function. - Terminal is initialized
- Memory manager is initialized using multiboot information from GRUB
- The GDT and IDT are set up
- The keyboard and internal timer are initialized
- Interrupts are enabled to start receiving events from the hardware
- The kernel terminal (kterm) begins reading from the keyboard key buffer and processes user commands
- Bootloader calls
linker.ld
script: Links all object files into final.elf
file for the bootloader to run.start.s
is first to be executed, with the multiboot header at the top of the executable.
- Flow of control:
-
io
: Code related to io devices like the keyboard, terminal and their interrupt handlers -
lib
: Common libraries and definitions for rest of codebase -
mm
: Memory management code