Skip to content

nickoncrack/osdev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

osdev

Features & TODOs

  • GDT/IDT ✅
  • PIT timer ✅
  • Paging ✅
  • Kernel heap memory allocator ✅
  • ACPI table parsing ✅
  • VESA mode (using LFB provided by grub) ✅
  • Text rendering with custom font support (using ssfn.h) ✅
  • Simple ATA driver with sector I/O ✅
  • Custom block based filesystem (skbd-fs) ✅
  • Multitasking and flat binary loader ✅
  • Keyboard and mouse drivers ✅
  • Graphical interface ❌

Notes

User task memory layout (8 MB process)

# offset - (0x40000000 + i * 8 MB)
0x00000000   -> end_code        : code
end_code*    -> buffer_start**  : heap
buffer_start -> 0x007DFFFF      : guard page
0x007E0000   -> 0x007FFFFF      : stack (128 kb)

*page aligned
**Some tasks are not allowed to have a buffer, these tasks end up with a larger heap.

Building & running

make
qemu-system-i386 -cdrom build/out/os-image.iso -hda image.bin -serial file:serial.log

External binary example

Binary dependencies are currently hardcoded, so modifying user/Makefile is required.

#include <stdio.h> // fprintf
#include <stdlib.h> // exit

__attribute__((section(".text._start")))
void _start() {
    fprintf(stdio, "Hello world!\n");
    exit(0);
}

Known bugs

Since time is very limited right now, if a bug doesn't block progress it will be placed here and fixed later.

  • Using global variables inside a user program causes a page fault
  • Context switching after sleep() of a task expires causes undefined behavior
  • Indexing by pid in the tcb array causes undefined behavior (already fixed, will commit soon)
  • tty binary
  • Adding large files in the rootfs corrupts the image

Third party software

While this operating system uses its own native tools, in also relies on Scalable Screen Font 2.0 for font rendering.

About

hobby operating system

Topics

Resources

Stars

Watchers

Forks