#include #include #include "boot/cmdline.h" #include "limine.h" void _start(void); #define LIMINE_REQUEST_SECTION __attribute__((section(".limine_requests"))) LIMINE_REQUEST_SECTION static volatile uint64_t limine_base_revision[] = LIMINE_BASE_REVISION(4); LIMINE_REQUEST_SECTION static volatile uint64_t limine_requests_start_marker[] = LIMINE_REQUESTS_START_MARKER; LIMINE_REQUEST_SECTION static volatile struct limine_executable_cmdline_request cmdline_req = { .id = LIMINE_EXECUTABLE_CMDLINE_REQUEST_ID, .revision = 0, .response = NULL }; LIMINE_REQUEST_SECTION static volatile struct limine_entry_point_request entry_point_req = { .id = LIMINE_ENTRY_POINT_REQUEST_ID, .revision = 0, .response = NULL, .entry = _start }; LIMINE_REQUEST_SECTION static volatile struct limine_executable_address_request executable_address_req = { .id = LIMINE_EXECUTABLE_ADDRESS_REQUEST_ID, .revision = 0, .response = NULL }; LIMINE_REQUEST_SECTION static volatile struct limine_memmap_request memmap_req = { .id = LIMINE_MEMMAP_REQUEST_ID, .revision = 0, .response = NULL }; LIMINE_REQUEST_SECTION static volatile struct limine_module_request module_req = { .id = LIMINE_MODULE_REQUEST_ID, .revision = 0, .response = NULL }; LIMINE_REQUEST_SECTION static volatile struct limine_framebuffer_request framebuffer_request = { .id = LIMINE_FRAMEBUFFER_REQUEST_ID, .revision = 0, .response = NULL }; LIMINE_REQUEST_SECTION static volatile struct limine_rsdp_request rsdp_request = { .id = LIMINE_RSDP_REQUEST_ID, .revision = 0, .response = NULL }; LIMINE_REQUEST_SECTION static volatile uint64_t limine_requests_end_marker[] = LIMINE_REQUESTS_END_MARKER; void *_kernel_physptr = NULL; void *_initrd_module = NULL; struct limine_framebuffer_response *_limine_framebuffers; struct limine_memmap_response *_limine_memmap_resp = NULL; struct limine_rsdp_response *_limine_rsdp_resp = NULL; __attribute__((noreturn)) void _start(void) { _kernel_physptr = (void*)executable_address_req.response->physical_base; _limine_memmap_resp = memmap_req.response; _limine_framebuffers = framebuffer_request.response; _limine_rsdp_resp = rsdp_request.response; if(module_req.response->module_count > 0) { _initrd_module = module_req.response->modules[0]->address; } cmdline_init(cmdline_req.response->cmdline); __attribute__((noreturn)) extern void kernel_entry(void); kernel_entry(); }