mirror of
https://github.com/johndoe6345789/MetalOS.git
synced 2026-04-24 13:45:02 +00:00
Embrace extreme minimalism - cut everything unnecessary
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* MetalOS Kernel - Main Entry Point
|
||||
*
|
||||
* Minimal kernel implementation for running QT6 applications.
|
||||
* Only implements what's absolutely necessary.
|
||||
* EXTREME MINIMAL kernel - only what's needed for QT6 Hello World.
|
||||
* No scheduler, no process management, no filesystem, no nothing.
|
||||
* Just: boot -> init GPU -> init input -> run app.
|
||||
*/
|
||||
|
||||
#include "kernel/kernel.h"
|
||||
@@ -11,6 +12,9 @@
|
||||
/*
|
||||
* Kernel main entry point
|
||||
* Called by bootloader with boot information
|
||||
*
|
||||
* This is it. The entire OS. No scheduler, no processes, no filesystem.
|
||||
* Just set up hardware and jump to the QT6 app.
|
||||
*/
|
||||
void kernel_main(BootInfo* boot_info) {
|
||||
// Initialize basic console output using framebuffer
|
||||
@@ -22,41 +26,55 @@ void kernel_main(BootInfo* boot_info) {
|
||||
);
|
||||
|
||||
console_clear();
|
||||
console_print("MetalOS Kernel v0.1.0\n");
|
||||
console_print("=====================\n\n");
|
||||
console_print("MetalOS v0.1 - MINIMAL\n");
|
||||
console_print("======================\n\n");
|
||||
|
||||
console_print("Initializing minimal kernel...\n");
|
||||
// TODO: Set up minimal page tables (identity mapped or simple offset)
|
||||
console_print("[ ] Memory (identity map)\n");
|
||||
|
||||
// TODO: Initialize memory management
|
||||
console_print("[ ] Memory management\n");
|
||||
// TODO: Set up IDT with only interrupts we need:
|
||||
// - Keyboard/mouse (USB or PS/2)
|
||||
// - Timer (for QT event loop)
|
||||
// - GPU (if needed)
|
||||
// That's it! Maybe 5 interrupt handlers total.
|
||||
console_print("[ ] Interrupts (minimal)\n");
|
||||
|
||||
// TODO: Initialize interrupt handling
|
||||
console_print("[ ] Interrupt handling\n");
|
||||
// TODO: Simple memory allocator (bump allocator is fine)
|
||||
console_print("[ ] Heap (bump allocator)\n");
|
||||
|
||||
// TODO: Initialize PCI bus
|
||||
console_print("[ ] PCI enumeration\n");
|
||||
// TODO: Find RX 6600 GPU via PCI (hardcode vendor/device ID)
|
||||
console_print("[ ] PCI (find GPU only)\n");
|
||||
|
||||
// TODO: Initialize GPU driver
|
||||
console_print("[ ] GPU driver (Radeon RX 6600)\n");
|
||||
// TODO: Initialize GPU - minimal
|
||||
// - Enable BAR
|
||||
// - Init display pipeline
|
||||
// - Set up framebuffer at 1920x1080 (hardcoded)
|
||||
console_print("[ ] GPU (RX 6600, 1920x1080)\n");
|
||||
|
||||
// TODO: Initialize input devices
|
||||
console_print("[ ] Input devices\n");
|
||||
// TODO: Initialize input
|
||||
// Try PS/2 first (simpler!)
|
||||
// Fall back to minimal USB XHCI if needed
|
||||
console_print("[ ] Input (PS/2 or USB)\n");
|
||||
|
||||
// TODO: Setup system calls
|
||||
console_print("[ ] System call interface\n");
|
||||
// TODO: Jump directly to QT6 Hello World app
|
||||
// No shell, no init, no fork/exec
|
||||
// Just: jump to application entry point
|
||||
console_print("[ ] Jump to QT6 app\n");
|
||||
|
||||
// TODO: Load and run QT6 hello world application directly (no shell/init)
|
||||
console_print("[ ] Loading QT6 Hello World application...\n");
|
||||
console_print("\nBooting app...\n");
|
||||
|
||||
console_print("\nKernel initialization complete.\n");
|
||||
console_print("Booting directly into application (no shell)...\n");
|
||||
// TODO: Replace this with jump to QT6 app
|
||||
// For now, halt
|
||||
console_print("ERROR: App not linked yet\n");
|
||||
|
||||
// TODO: Jump to QT6 hello world application entry point
|
||||
// The application will run full-screen until exit
|
||||
// No shell, no command line - just the one app
|
||||
|
||||
// Halt - in real implementation, we'd start the application
|
||||
while(1) {
|
||||
__asm__ volatile("hlt");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* That's the entire kernel. No scheduler. No processes. No filesystem.
|
||||
* Just boot, initialize hardware, run app.
|
||||
*
|
||||
* Total kernel size target: < 100 KB
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user