💾 32-bit operating system displaying current date and time
Go to file
Maciej Krzyżanowski 6e13394215 Remove scripts directory
Scripts in scripts/ directory were platform-dependent and
even distribution-dependent, so they were not usable for anyone
except me. That's why I removed them from repository.
2024-08-20 00:03:08 +02:00
config Repair permissions 2024-08-19 23:57:32 +02:00
source Repair permissions 2024-08-19 23:57:32 +02:00
.gitignore Update .gitignore 2024-08-19 23:57:32 +02:00
mkos32.png Add README.md 2024-08-19 23:57:32 +02:00
README.md Add README.md 2024-08-19 23:57:32 +02:00

💾 MKOS32

MKOS32 is very basic operating system, the only thing it can do is printing current date and time twice a second.

mkos running in bochs emulator

Steps

General list of steps which led me to the current state of project:

  1. Cross compilation, preparing gcc and bintuils to compile programs for my OS
  2. Loading operation system, I used GRUB and Multiboot 1 to achieve that
  3. Printing text (useful for debugging), based on VGA, based on osdev wiki code, but extended with ability to:
    • scrolling text when there is no space left
    • ability to use newline character
    • printing numbers in various bases or with '0' padding
    • basic and limited printf
  4. Setting up GDT to a flat memory model (currently only supported model in newer versions of GCC) - for memory protection/isolation paging should be used
    • sources/gdt.h
    • refreshing segment registers (far jump for CS)
    • placing GDT table in memory and loading it using lgdt instruction
  5. Installing and setting up bochs emulator, which made debugging significantly easier
    • memory dumping
    • breakpoints (xchg %bx, %bx)
    • displaying GDT/IDT tables
  6. Interruption handling
    • sources/idt.h
    • set IDT table
    • 8259A PIC initialisation (master and slave, appropriate masks etc)
    • written basic ISRs
    • loaded IDT with lidt
    • one of ISRs is used to handle clock interruptions coming from RTC (real time clock)
    • communication through ports (helper functions outb and inb)
    • RTC configuration

Sources

I used mainly OsDev wiki, Intel x86 ISA and some other related pages as my knowledge source.: