FIFOS is a bare-metal educational operating system kernel built for x86, implementing:
- Preemptive multitasking and context switching
- Round-robin scheduling using the Programmable Interval Timer (PIT)
- Thread creation with per-thread kernel stacks
- GDT / IDT setup for protected-mode segmentation and interrupts
- Fully mapped PIC (8259) + PIT (IRQ0) interrupt infrastructure
- Minimal terminal output using VGA text mode
- Support for hardware exceptions and software breakpoints
- Basic coroutine/protothread-like task execution
This kernel runs without an operating system and is booted directly by GRUB using the Multiboot standard.
| Component | Description |
|---|---|
| Threading system | Thread Control Blocks, separate stacks, TID, runtime, status flags |
| Preemptive Scheduler | Timer interrupt every tick, round-robin switching |
| Context switching | Saves & restores registers, ESP, EIP, segment selectors |
| Interrupt Handling | Fully initialized IDT, manual PIC remapping |
| VGA Console | Low-level terminal output (no libc) |
| Exception testing | Breakpoint interrupt (INT 3), divide-by-zero fault |
| Boot process | Custom boot.S, Multiboot header, stack setup |
boot.S contains the Multiboot header consumed by GRUB. It sets up a 4KB kernel stack, saves the Multiboot pointer, and calls C code:
movl $stack+0x1000, %esp
pushl %ebx # multiboot pointer
call init