mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-25 23:10:32 +00:00
Implement prekernel disk GPT UUID pass to kernel, add to headers, check in AHCIBootDVDProbeAll.
This commit is contained in:
parent
ce84d5532f
commit
41a033fe8a
5 changed files with 25 additions and 1 deletions
|
@ -1163,7 +1163,17 @@ Bool AHCIBootDVDProbeAll(CBlkDev *bd)
|
|||
return TRUE;
|
||||
}
|
||||
else
|
||||
"AHCI: Did not find matching sys_compile_time on Port %d\n", i;
|
||||
"AHCI: Did not find matching sys_compile_time at BLK %d on Port %d\n", sys_boot_blk, i;
|
||||
|
||||
"%X %X", sys_disk_uuid[0], sys_disk_uuid[1];
|
||||
AHCIAtapiBlksRead(bd, buf, 0, 1, FALSE);
|
||||
if (!MemCompare(buf + 568, sys_disk_uuid, 16))
|
||||
{
|
||||
"AHCI: Found sys_disk_uuid at BLK 0 byte 568 on Port %d\n", i;
|
||||
"______________________\n";
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
|
@ -58,6 +58,8 @@ SYS_FRAMEBUFFER_BPP:: DU16 0;
|
|||
|
||||
SYS_SMBIOS_ENTRY:: DU64 0;
|
||||
|
||||
SYS_DISK_UUID:: DU64 0, 0;
|
||||
|
||||
#assert $$ - SYS_KERNEL == sizeof(CKernel) - sizeof(CZXE)
|
||||
|
||||
REQUESTED_SCREEN_WIDTH: DU16 1024;
|
||||
|
|
|
@ -570,6 +570,7 @@ class CKernel
|
|||
U64 sys_framebuffer_pitch;
|
||||
U16 sys_framebuffer_bpp;
|
||||
U64 sys_smbios_entry;
|
||||
U64 sys_disk_uuid[2];
|
||||
};
|
||||
|
||||
//Run-Levels
|
||||
|
|
|
@ -253,4 +253,6 @@ public _extern SYS_FRAMEBUFFER_BPP U16 sys_framebuffer_bpp;
|
|||
#help_index "Processor/SMBIOS"
|
||||
public _extern SYS_SMBIOS_ENTRY U8 *sys_smbios_entry;
|
||||
|
||||
public _extern SYS_DISK_UUID U64 sys_disk_uuid[2];
|
||||
|
||||
#help_index ""
|
||||
|
|
|
@ -132,6 +132,10 @@ struct CKernel {
|
|||
uint64_t sys_framebuffer_pitch;
|
||||
uint16_t sys_framebuffer_bpp;
|
||||
uint64_t sys_smbios_entry;
|
||||
uint32_t sys_disk_uuid_a;
|
||||
uint16_t sys_disk_uuid_b;
|
||||
uint16_t sys_disk_uuid_c;
|
||||
uint8_t sys_disk_uuid_d[8];
|
||||
} __attribute__((packed));
|
||||
|
||||
#define BOOT_SRC_RAM 2
|
||||
|
@ -270,6 +274,11 @@ void _start(void) {
|
|||
void *sys_smbios_entry = smbios_request.response->entry_32;
|
||||
CKernel->sys_smbios_entry = (uintptr_t)sys_smbios_entry - hhdm_request.response->offset;
|
||||
|
||||
CKernel->sys_disk_uuid_a = kernel->gpt_disk_uuid.a;
|
||||
CKernel->sys_disk_uuid_b = kernel->gpt_disk_uuid.b;
|
||||
CKernel->sys_disk_uuid_c = kernel->gpt_disk_uuid.c;
|
||||
memcpy(CKernel->sys_disk_uuid_d, kernel->gpt_disk_uuid.d, 8);
|
||||
|
||||
void *trampoline_phys = (void *)final_address + kernel->size;
|
||||
|
||||
uintptr_t boot_stack = ALIGN_UP(final_address + kernel->size + trampoline_size, 16) + boot_stack_size;
|
||||
|
|
Loading…
Reference in a new issue