Skip to content

Greyrat7490/haiirOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

haiirOS

My first Kernel based on C

Fun project to learn C, Assembly x86 and how Kernels work

Support for

  • x86_64 little endian
  • Legacy boot (enable CSM if you have UEFI)
  • no RAID support (disable RAID in BIOS to get AHCI controller instead)

ToDo-List

  • Documention
    • VGA text buffer
    • Paging
    • mapping
  • drivers
    • AHCI
    • XHCI
    • NVMe
  • Interrupts
    • Keyboard
    • timer
    • exceptions
  • Memory
    • get memory map
    • create page tables
    • mapping
    • frame allocator (really basic)
      • use memory map
    • heap allocation
  • Error handling
    • exceptions
  • Basic IO
    • print
    • keyboard input
  • Basic syscalls
    • write
    • exit
    • mmap
    • sched_yield
    • fork
    • open
    • read
    • close
    • shutdown
    • restart
    • kill
    • getcwd
    • mkdir
    • rmdir
    • rename
    • pause
    • nanosleep

Environment

  • OS:
    • Linux
    • Windows with WSL2
  • IDE:
    • VSCode
    • Neovim

Dev dependencies

  • create iso:
    • sudo apt install grub2 xorriso (debian based)
    • sudo pacman -S libisoburn (arch based)
  • VSCode:
    • install extension C/C++ (ms-vscode.cpptools) (language server / Debugging)
  • Neovim:
    • install cpptools (Debugger)
    • install clangd (i.e. via lsp_installer) (language server)
  • compiling/(assembling):
    • install nasm (assembler)
    • install ld (Linker)
    • install gcc (should already be installed) (C compiler)
    • install make (run Makefile / automation)
  • Testing/Debugging:
    • install qemu/qemu-desktop (virtual-machine)

Run kernel in a VM

  • run make run

Debugging

  • run make debug
  • VSCode
    • press f5 or run task "(gdb) Launch"
    • using extension: "C/C++" (ms-vscode.cpptools)
  • Neovim
    • press f5 or :lua require'dap'.continue()
    • using plugin: nvim-dap

Resources