mirror of
https://github.com/johndoe6345789/MetalOS.git
synced 2026-04-26 14:45:03 +00:00
Create foundational structure for MetalOS - Phase 1 complete
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
31
kernel/include/kernel/console.h
Normal file
31
kernel/include/kernel/console.h
Normal 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
|
||||
33
kernel/include/kernel/kernel.h
Normal file
33
kernel/include/kernel/kernel.h
Normal 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
|
||||
Reference in New Issue
Block a user