From: Michael D. Lowis Date: Wed, 8 Feb 2023 03:04:54 +0000 (-0500) Subject: cleanup build error X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=8ac1aac54d4213d24d18904f36b4c4122d614563;p=proto%2Fuefi.git cleanup build error --- diff --git a/uefi/crt_x86_64.c b/uefi/crt_x86_64.c index 7826efc..188a800 100644 --- a/uefi/crt_x86_64.c +++ b/uefi/crt_x86_64.c @@ -12,7 +12,20 @@ static efi_runtime_services_t *RT = NULL; static efi_loaded_image_protocol_t *LIP = NULL; /* platform specific globals */ -VideoConfig Video = {0}; +VideoConfig Video; +MemoryMap Map; + +//#define D(base, flags, access, base, limit) \ +// (((base >> 24) << 56) | \ +// (flags << 52) | \ +// (limit << 48) | \ +// (access << 40) | \ +// (base << 16) | \ +// (limit)) + +uint64_t GDT[] = { + 0u +}; void sleep(int ms) { @@ -57,14 +70,6 @@ static void video_init(void) Video.height = gop->Mode->Information->VerticalResolution; } -extern void Term_Init(void); -extern void Term_Print(char* s, ...); -extern void Term_PutHex32(uint32_t); -extern void Term_PutHex64(uint64_t); -extern void Term_PutChar(uint8_t); - -MemoryMap Map; - static void memory_init(void) { efi_status_t status = 0; @@ -77,20 +82,6 @@ static void memory_init(void) EfiBootServicesData, Map.size + 2 * Map.desc_size, (void**)&Map.data); status = BS->GetMemoryMap( &Map.size, (efi_memory_descriptor_t*)Map.data, &Map.key, &Map.desc_size, &Map.desc_ver); - -// efi_memory_descriptor_t* entry = (efi_memory_descriptor_t*)Map.data; -// Term_Init(); -// do { -// Term_Print("%x %x %x %x %x %d\n", -// (uint64_t)entry->Type + 1u, -// (uint64_t)entry->Pad, -// (uint64_t)entry->Attribute, -// (uint64_t)entry->PhysicalStart, -// (uint64_t)entry->VirtualStart, -// (uint64_t)entry->NumberOfPages -// ); -// entry = (efi_memory_descriptor_t*)((uint8_t*)entry + Map.desc_size); -// } while((uint8_t*)entry < ((uint8_t*)Map.data + Map.size)); } /* @@ -198,8 +189,13 @@ int uefi_init(uintptr_t ldbase, Elf64_Dyn *dyn, efi_system_table_t *systab, efi_ /* exit boot services now */ status = BS->ExitBootServices(IM, Map.key); - /* setup global descriptor table */ - /* setup interrupt descriptor table */ + /* initialize the TSS */ + /* initialize the IDT */ + /* initialize the paging tables */ + /* initialize the heap allocator */ + /* initialize system calls */ + /* initialize the realtime clock */ + /* initialize the global timer */ /* now jump to kernel main() */ return main();