ShabbOS banner

ShabbOS

3 devlogs
9h 27m 22s

this is my first operating system project, im planning to make an os with some jewish fetures hence the name ShabbOS - (the shabbos/shabbat/sabbath is the jewish religeous day)

This project uses AI

used for learning os design

acetim100

DOUBLE FAULT EXCEPTION HANDLING

this is a very cool feature of the cpu.
imagine you accidentally overflow your stack. what now?
well, a page fault exception is likely to occur!
but what if you do not have a page fault exception handler yet?
the answer: the double fault. its kind of a catch all statement that catches all exceptions that their handler is not present. or there was an error while handlinfg a certain exception.
so back to out stack overflow example, if our stack is full now and a double fault was triggered, how will we to to the handler function if we do not have a stack to push the data into? (return addr register data etc..)
we need to preform what is called a stack switch, we switch the stack to a predifeind valid one before each time we enter a double fault handler!

the new stack addr is stored in a data structure called the ist inside the tss inside the gdt (a lot of acronyms lol)
im not gonna explain these data structures but just know they contain crucial data for the operating system proper operation
and (bonus fact) in x86 times (32 bit) the gdt was the primary source of memory security and memory management (now all of that is passed to the paging mechanism)

the image shown here is an example of a propper kernel panic after a double fault! if i didnt handle it properlly the cpu would trigger a triple fault which most cpus just treat by rebooting the machine

Attachment
Attachment
0
acetim100

WORKING ON CPU EXCEPTIONS/ INTERRUPTS

ive set up the idt with the x84_64 crate that handles stack alignment/ register saving and some more inconvieniences
and ive successfully binded a handler function to the breakpoint interrupt

Attachment
0
acetim100

ADDED VGA OUTPUT

i created a virtual buffer thats mapped to the vga buffer to write ascii to and created print! println! and dbg! macros

TESTING SETUP

i have setup a bare bones testing environment with a custom print_serial! function that (only in testing) prints output from the kernel straight to my console

Changelog

Attachment
Attachment
0