How jack-d1/j-os works
Main Components Identification
• Boot Loader & Initialization:
• Components include the boot-related assembly code found in the “boot” directory.
• It contains submodules for different modes (16-bit, protected mode) and tasks like disk loading and printing.
• CPU & Interrupt Handling:
• Files in the “cpu” directory (such as idt.c, isr.c, and timer functions) define interrupt handling, port interactions, and timer management.
• The “interrupt.asm” supports configuring the CPU to handle system interrupts.
• Kernel Core:
• The “kernel” directory (kernel.c, kernel_entry.asm) represents the core of the operating system that integrates various subsystems.
• Drivers:
• This includes the “drivers” directory where keyboard, mouse, and screen drivers handle hardware interactions.
• Standard Library Support (libc):
• Implements basic memory and string operations that are used throughout the OS.
Relationships and Interactions
• Boot Process Flow:
• Transition to boot/16bit code that prepares the system (loading disk sectors, printing initial messages, switching to protected mode).
• CPU & Interrupt Infrastructure:
• After the boot sequence, initialize CPU settings (GDT setup in gdt.asm) and register interrupt and exception handlers from the “cpu” folder.
• Kernel Initialization and Runtime:
• Once the CPU is configured, control is passed to the kernel (kernel_entry.asm to kernel.c).
• The kernel then interacts with the drivers (keyboard, mouse, screen) to manage I/O and with the libc for basic operations.
• Device Driver Integration:
• The drivers interact with both the kernel and directly with hardware ports (as seen in "cpu/ports.c").
Architectural Patterns and Design Principles
• Layered Architecture:
• The design is layered: Boot (lowest level) prepares the environment, followed by CPU and interrupt management, then the kernel integrating drivers and library calls.
• Modular Design:
• Each component (boot loader, CPU management, drivers, kernel, libc) is separated into its own directory, promoting clear boundaries and modular development.
Relevant Technologies and Frameworks
• Assembly Language:
• Used extensively in the boot process and startup (e.g., .asm files).
• C Programming:
• Employed for kernel logic, CPU management, and drivers.
• Basic OS Development Concepts:
• Bootstrapping, interrupt handling, and hardware abstraction.