01. Ideas and Directions - skybonep/fishboneOS GitHub Wiki

Current Focus

Rebuild the system for production

Incremental Plan for fishboneOS

This plan is subjected to change!

This plan builds fishboneOS from scratch in fishbone, starting with a minimal kernel and adding features step-by-step. Each step includes manual implementation (reference monolithic for ideas), compilation, and tests. Use QEMU for testing. Total timeline: 4-6 weeks, assuming 1-2 days per step.

Phase 1: Boot and Basic Setup (Steps 1-4)

  1. [Done] Set Up Directory and Build System

    • Create fishbone with subdirs: include/, src/arch/i386/, kernel.
    • Copy/adapt Makefile and linker.ld from monolithic (simplify: remove debug flags).
    • Implement: Basic GRUB multiboot header in src/arch/i386/loader.s.
    • Test: Run make to compile; check for no errors. Boot in QEMU: qemu-system-i386 -cdrom fishbone.iso (should halt without panic).
  2. [Done] Basic Kernel Entry and Serial Output

    • Implement: Kernel entry in src/kernel/kernel.c (print "fishboneOS booting" via serial). Add serial driver in src/drivers/serial.c.
    • Test: Compile and boot; check QEMU serial output for message.
  3. [WIP] GDT and Protected Mode

    • Implement: GDT setup in src/arch/i386/gdt.c and src/kernel/gdt.h.
    • Test: Add a print after GDT init; verify no crashes on boot.
  4. IDT and Basic Interrupts

    • Implement: IDT in src/arch/i386/idt.c; handle divide-by-zero.
    • Test: Trigger interrupt (e.g., divide by zero); check serial log for handler message.

Phase 2: Memory and Multitasking (Steps 5-8)

  1. Paging and VMM

    • Implement: Basic paging in src/arch/i386/paging.s and src/kernel/vmm.c.
    • Test: Enable paging; print kernel CR3; ensure no page faults.
  2. PMM and Heap

    • Implement: Physical memory manager in src/kernel/pmm.c; basic heap in src/kernel/malloc.c.
    • Test: Allocate/free memory; print success/failure.
  3. Task Scheduler

    • Implement: Simple round-robin scheduler in src/kernel/task.c.
    • Test: Create idle task; verify context switches via timer.
  4. User Mode and Syscalls

    • Implement: User segments, syscall handler in src/arch/i386/cpu.s and src/kernel/syscall.c.
    • Test: Switch to user mode; call a syscall (e.g., write); check output.

Phase 3: Drivers and Filesystem (Steps 9-11)

  1. ATA and Block Drivers

    • Implement: ATA driver in src/drivers/ata.c; block abstraction.
    • Test: Read disk sectors; print data.
  2. FAT16 Filesystem

    • Implement: FAT16 reader in src/kernel/fat16.c.
    • Test: Mount disk; list files.
  3. TTY and Input

    • Implement: VGA TTY in src/arch/i386/tty.c; keyboard driver.
    • Test: Print to screen; read keyboard input.

Phase 4: Modularity and Installer (Steps 12-15)

  1. Loadable Modules

    • Implement: Basic module loader (e.g., flat binary) in src/kernel/module.c.
    • Test: Load a simple module; verify execution.
  2. ELF Loader (Optional)

    • Implement: ELF parser for executables.
    • Test: Load/run a user app from disk.
  3. Installer Prototype

    • Implement: Minimal installer UI and disk setup.
    • Test: Boot installer; detect hardware; install to disk.
  4. Integration and Polish

    • Combine features; add menu system.
    • Test: Full boot, module loading, user apps.

For each step: Implement manually, compile with make, test in QEMU, and debug via serial logs. Reference monolithic for details but rewrite in your words. Start with Step 1—ready to guide on implementation?

Completed Work

  • Create a bare-bones project to understand the basic concepts and set up the development environment.
  • Create my own c library. Only get the printf function running, still need to add the memory functions and setup for hosted c compiler later. (https://wiki.osdev.org/Meaty_Skeleton)
  • Add serial ports for debugging. (http://wiki.osdev.org/Serial_ports)
  • Implement the Global Descriptor Table (GDT) (https://wiki.osdev.org/GDT_Tutorial)
  • Implement Interrupt (https://wiki.osdev.org/Interrupts_Tutorial)
  • Enable keyboard input (https://wiki.osdev.org/PS/2_Keyboard)
  • Core Dump. printf(), sprintf(), printk() now handle basic formatting.
  • Implement a heap.
  • Solidify your memory system
  • Turn boot into a real kernel runtime
  • Implement scheduling / multitasking
  • Build a syscall interface
  • Add user mode support
  • Add a text based menu
  • Add a FAT filesystem
  • Implement loadable kernel modules
  • Transition to user-space processes with ELF binary support

Upcoming or Possible Experiments

  • Figure out how to test an OS. (Build application in the OS to test)
  • Gather hardware information to help with module selection.
  • The Installer can detect the hardware and make the basic functions work. In a new machine, we have installer that users can select the modules and applications that they need. And set it for the OS.
  • In a fishboneOS powered machine, there is a setup application where users can change, add, or delete the modules and applications. Most of the time, some installation process and a reboot will work. But if the change is more foundation, e.g. change disk format, it may need to delete all of the data in the machine, or if possible, we can come up with something to migrate the data to the new system.

Ideas for Later

  • Build a BASIC inside the OS

Created: 20251227