How hacke-rc/optimistos works
Main Components
• Bootloader: Represent the bootloader module (Limine) and its configuration. Indicate that the OS uses UEFI and the provided limine.cfg file.
• CPU Initialization: Create a block for CPU-related components that includes:
• GDT (from kernel/gdt)
• IDT (from kernel/idt)
• ACPI (from kernel/acpi) for managing hardware configurations
• Memory Management: Separate into two distinct areas:
• Heap allocation (in kernel/memory using mallocx)
• Paging and virtual memory management (in kernel/paging including free list handling, page frame allocator, etc.)
• Process and Scheduling: Represent process management (kernel/process) and scheduling (kernel/scheduler) modules, indicating that the scheduling mechanism and context switching are key in managing processes.
• I/O and Renderer: Group the input/output functions (kernel/io) and the basic rendering functionalities (kernel/renderer, printutils) which are used for basic debugging and display output.
• Libraries and Utilities: Mention supporting libraries in kernel/lib (e.g., lock management, memory abstractions, string utilities) and include directories for various STL-like functionalities under kernel/include, which bolster the rest of the system.
• External Resources & Media: Note the presence of external files (kernel/external) and media (images in media/) that the OS uses during boot or for assets.
Relationships and Interactions
• The UEFI boot process launches the Limine bootloader, which triggers the kernel entry point (kernel/kernelEntry.cpp/hpp).
• That early CPU initialization (setting up GDT/IDT and ACPI routines) happens during boot.
• After boot, the memory management modules initialize paging and allocate heap space.
• The scheduler and process modules depend on the CPU initialization to manage context switching, and they interact with memory management for process address space setup.
• I/O and renderer modules are used by several components for diagnostics and possibly user interaction.
Architectural and Design Patterns
• Modular structure: The project is organized into clear directories for specific hardware and system subsystems (representing a layered architecture).
• Initialization sequence: The bootloader hands off control to low-level initialization routines for CPU and memory.
• Separation of concerns: Each subsystem (CPU, Memory, Process, I/O) is clearly isolated, enabling focused improvements and debugging.
Relevant Technologies and Frameworks
• UEFI and Limine bootloader
• Assembly and C++ for low-level operations
• External dependency for heap allocation (mallocx)
• Emphasis on low-level hardware interfacing components such as ACPI for hardware configuration