diff --git a/src/Kernel/KStart16.ZC b/src/Kernel/KStart16.ZC index 863ccab9..26621bb0 100755 --- a/src/Kernel/KStart16.ZC +++ b/src/Kernel/KStart16.ZC @@ -63,6 +63,8 @@ SYS_FRAMEBUFFER_HEIGHT:: DU64 0; SYS_FRAMEBUFFER_PITCH:: DU64 0; SYS_FRAMEBUFFER_BPP:: DU16 0; +SYS_SMBIOS_ENTRY:: DU64 0; + #assert $$ - SYS_KERNEL == sizeof(CKernel) - sizeof(CZXE) TEMP_VBE_MODE: DU8 sizeof(CVBEMode) DUP(0); diff --git a/src/Kernel/KernelA.HH b/src/Kernel/KernelA.HH index 2690d74c..6d886f54 100755 --- a/src/Kernel/KernelA.HH +++ b/src/Kernel/KernelA.HH @@ -574,6 +574,7 @@ class CKernel U64 sys_framebuffer_height; U64 sys_framebuffer_pitch; U16 sys_framebuffer_bpp; + U64 sys_smbios_entry; }; //Run-Levels diff --git a/src/Kernel/KernelB.HH b/src/Kernel/KernelB.HH index d7e65669..b43ee1bf 100755 --- a/src/Kernel/KernelB.HH +++ b/src/Kernel/KernelB.HH @@ -256,4 +256,7 @@ public _extern SYS_FRAMEBUFFER_HEIGHT U64 sys_framebuffer_height; public _extern SYS_FRAMEBUFFER_PITCH U64 sys_framebuffer_pitch; public _extern SYS_FRAMEBUFFER_BPP U16 sys_framebuffer_bpp; +#help_index "Processor/SMBIOS" +public _extern SYS_SMBIOS_ENTRY U8 *sys_smbios_entry; + #help_index "" diff --git a/src/System/Utils/SysRep.ZC b/src/System/Utils/SysRep.ZC index 09f70026..d6bf571e 100755 --- a/src/System/Utils/SysRep.ZC +++ b/src/System/Utils/SysRep.ZC @@ -660,6 +660,12 @@ Bool SMBIOSEntryScan(CSMBIOSEntryPoint **entry) I64 i; U8 noreg checksum = 0, *mem = 0xF0000; + if (sys_smbios_entry) + { + *entry = sys_smbios_entry; + return TRUE; + } + do { if (!MemCompare(mem, "_SM_", 4)) diff --git a/zealbooter/zealbooter.c b/zealbooter/zealbooter.c index 7fc025cf..002b87e1 100644 --- a/zealbooter/zealbooter.c +++ b/zealbooter/zealbooter.c @@ -28,6 +28,11 @@ static volatile struct limine_framebuffer_request framebuffer_request = { .revision = 0 }; +static volatile struct limine_smbios_request smbios_request = { + .id = LIMINE_SMBIOS_REQUEST, + .revision = 0 +}; + struct CZXE { uint16_t jmp; uint8_t module_align_bits; @@ -136,6 +141,7 @@ struct CKernel { uint64_t sys_framebuffer_height; uint64_t sys_framebuffer_pitch; uint16_t sys_framebuffer_bpp; + uint64_t sys_smbios_entry; } __attribute__((packed)); #define BOOT_SRC_RAM 2 @@ -271,6 +277,9 @@ void _start(void) { void *sys_gdt_ptr = (void *)&CKernel->sys_gdt_ptr - (uintptr_t)kernel->address; sys_gdt_ptr += final_address; + void *sys_smbios_entry = smbios_request.response->entry_32; + CKernel->sys_smbios_entry = (uintptr_t)sys_smbios_entry - hhdm_request.response->offset; + void *trampoline_phys = (void *)final_address + kernel->size; uintptr_t boot_stack = ALIGN_UP(final_address + kernel->size + trampoline_size, 16) + boot_stack_size;