Commit Graph

18 Commits

Author SHA1 Message Date
AI
cf3059747a Implement physical memory allocator with zone support (AI)
- Added bitmap-based physical memory manager (PMM) that parses the Multiboot2
  memory map to discover available RAM regions.
- Supports two allocation zones: PMM_ZONE_DMA (below 16MB) and PMM_ZONE_NORMAL
  (above 16MB), with automatic fallback from NORMAL to DMA when the preferred
  zone is exhausted.
- Marks kernel memory region and multiboot info structure as reserved using
  _kernel_start/_kernel_end linker symbols.
- Page 0 is always marked as used to prevent returning NULL as a valid address.
- Added linker script symbols (_kernel_start, _kernel_end) to track kernel
  memory boundaries for the allocator.
- Kernel now initializes PMM after PIC and performs test allocations to verify
  the subsystem works.
2026-02-23 10:52:06 +00:00
AI
f1923fdbcf Implement ISR stubs and PIC driver for hardware interrupt handling (AI)
- Reworked IDT initialization to register all 32 CPU exception handlers (ISR 0-31)
  and 16 hardware interrupt handlers (IRQ 0-15, mapped to IDT entries 32-47).
- Created assembly stubs in interrupts.S using macros for ISRs with and without
  error codes, plus IRQ stubs. All route through a common stub that saves
  registers, loads kernel data segment, and calls the C handler.
- Added isr.c with a unified interrupt dispatcher that handles both exceptions
  (halts on fault) and hardware IRQs (sends EOI via PIC).
- Implemented PIC (8259) driver in pic.c with full initialization sequence that
  remaps IRQ 0-7 to IDT 32-39 and IRQ 8-15 to IDT 40-47. Includes mask/unmask
  and EOI support.
- Extracted port I/O primitives (inb, outb, io_wait) into port_io.h header for
  reuse across drivers.
- Kernel now initializes PIC after IDT and enables interrupts with STI.
2026-02-23 10:51:45 +00:00
3909a1f581 Add copilot instructions (human) 2026-02-23 11:48:40 +01:00
7c45406c23 Add PIC handling (human) 2026-02-23 11:05:41 +01:00
AI
e4cc638a8d Implement GDT and basic IDT setup
This commit adds GDT initialization with proper code/data segments and reloads CS.

It also adds the initial IDT structure and loads an empty IDT.

Build configuration updated to disable SSE/MMX to prevent compiler generation of unsupported instructions in early boot.
2026-02-23 10:05:17 +00:00
c7e9833819 Remove output file (human) 2026-02-23 09:56:22 +01:00
AI
6b00cf3154 Disable floppy generation for now, focus on CDROM (AI) 2026-02-23 08:54:39 +00:00
AI
f2e84924f5 Update gitignore (AI) 2026-02-23 08:53:59 +00:00
6d91edc897 Revert "Add script to merge boot sector and patch GRUB for floppy (AI)"
This reverts commit 7068176d91.
2026-02-23 09:52:40 +01:00
AI
7068176d91 Add script to merge boot sector and patch GRUB for floppy (AI) 2026-02-23 08:46:03 +00:00
AI
436aeceb10 Remove build artifacts from repo 2026-02-23 08:33:09 +00:00
AI
aa954045c1 Implement ISO and Floppy image generation (AI) 2026-02-23 08:32:48 +00:00
AI
a048764a3d Setup simple kernel with Hello World output via debugcon (AI) 2026-02-23 08:24:50 +00:00
AI
34382babb3 Create directory structure and initial build system (AI) 2026-02-23 08:21:49 +00:00
ffb8b02762 Update instructions based on things learned from attempt-1 2026-02-23 08:35:16 +01:00
94b0297b28 Include attempt-1 devcontainer Dockerfile (AI+human) 2026-02-23 08:34:13 +01:00
76f8b9d4dd Include attempt-1 devcontainer json (AI) 2026-02-23 08:34:01 +01:00
61af5bb313 Initial commit (human) 2026-02-23 07:06:19 +01:00