Put debug prints and HLT in AHCIPortInit to diagnose bare-metal AHCIPortInit Page Fault bug on doodguy's UEFI machine.

This commit is contained in:
TomAwezome 2022-09-12 16:23:54 -04:00
parent 111e3475e3
commit 95ee43d4a1

View file

@ -992,6 +992,24 @@ U0 AHCIPortInit(CBlkDev *bd, CAHCIPort *port, I64 port_num)
port->fis_base = CAllocAligned(sizeof(CFisReceived), 256, sys_task->code_heap);
port->fis_base_upper = 0;
if (sys_boot_src.u16[0] == BOOT_SRC_DVD)
{
"AHCI: DEBUG: AHCIPortInit variable check\n";
"___________\n";
"port (addr): 0x%016X\n", port;
"port->fis_base: 0x%016X\n", port->fis_base;
"&port->fis_base: 0x%016X\n", &port->fis_base;
"port->cmd_list_base: 0x%016X\n", port->cmd_list_base;
"&port->cmd_list_base: 0x%016X\n", &port->cmd_list_base;
"port->cmd_list_base(CPortCmdHeader *): 0x%016X\n", port->cmd_list_base(CPortCmdHeader *);
"&port->cmd_list_base(CPortCmdHeader *): 0x%016X\n", &port->cmd_list_base(CPortCmdHeader *);
"&port->cmd_list_base(CPortCmdHeader *)[0]: 0x%016X\n", &port->cmd_list_base(CPortCmdHeader *)[0];
"blkdev.cmd_slot_count: %d\n", blkdev.cmd_slot_count;
"___________\nAHCI: DEBUG: Halting...";
while(TRUE){HLT};
}
for (i = 0; i < blkdev.cmd_slot_count; i++)
{
cmd_header = &port->cmd_list_base(CPortCmdHeader *)[i];