Create foundational structure for MetalOS - Phase 1 complete

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-28 17:43:20 +00:00
parent 7548ab87cc
commit e66ef697f7
23 changed files with 2580 additions and 12 deletions

View File

@@ -0,0 +1,31 @@
#ifndef METALOS_KERNEL_CONSOLE_H
#define METALOS_KERNEL_CONSOLE_H
#include <stdint.h>
// Simple framebuffer console for early boot messages
typedef struct {
uint32_t* framebuffer;
uint32_t width;
uint32_t height;
uint32_t pitch;
uint32_t x;
uint32_t y;
uint32_t fg_color;
uint32_t bg_color;
} Console;
// Initialize console with framebuffer
void console_init(uint32_t* fb, uint32_t width, uint32_t height, uint32_t pitch);
// Print functions
void console_putchar(char c);
void console_print(const char* str);
void console_println(const char* str);
void console_clear(void);
// Set colors (RGB)
void console_set_color(uint32_t fg, uint32_t bg);
#endif // METALOS_KERNEL_CONSOLE_H

View File

@@ -0,0 +1,33 @@
#ifndef METALOS_KERNEL_KERNEL_H
#define METALOS_KERNEL_KERNEL_H
#include <stdint.h>
// Kernel version
#define KERNEL_VERSION_MAJOR 0
#define KERNEL_VERSION_MINOR 1
#define KERNEL_VERSION_PATCH 0
#define KERNEL_NAME "MetalOS"
// Boot information structure (matches bootloader)
typedef struct {
uint64_t memory_map_size;
uint64_t memory_map_descriptor_size;
void* memory_map;
uint64_t framebuffer_base;
uint32_t framebuffer_width;
uint32_t framebuffer_height;
uint32_t framebuffer_pitch;
uint32_t framebuffer_bpp;
uint64_t kernel_base;
uint64_t kernel_size;
void* rsdp;
} BootInfo;
// Kernel entry point
void kernel_main(BootInfo* boot_info);
#endif // METALOS_KERNEL_KERNEL_H