!!!! X64 Exception Type - 0D

Programming, for all ages and all languages.
Post Reply
ravi
Member
Member
Posts: 105
Joined: Fri Sep 08, 2023 10:46 am

!!!! X64 Exception Type - 0D

Post by ravi »

i am trying to execute an old .efi file (an assembly file, compiled in fasm) on intel CRB

when i execute this file in slimboot(+ uefi payload), at lines where some of the uefi functions are called(EFI_BOOT_SERVICES.HandleProtocol), a general protection exception is thrown.

But same file executes perfectly in AMI BIOS.


!!!! X64 Exception Type - 0D(#GP - General Protection) CPU Apic ID - 00000000 ! !!!
ExceptionData - 0000000000000000
RIP - 00000000772877B8, CS - 0000000000000038, RFLAGS - 0000000000010246
RAX - 00000000769D2000, RCX - 00000000773DFCA0, RDX - 00000000769D1408
RBX - 8000000000000003, RSP - 00000000791B9FA8, RBP - 0000000077387E98
RSI - 0000000000000009, RDI - 00000000769D12F5
R8 - 00000000791B9EC2, R9 - 000000008101E000, R10 - 0000000000000001
R11 - 00000000791B9EC3, R12 - 00000000791BA2B8, R13 - 00000000791BA2C8
R14 - 00000000791BA438, R15 - 0000000000000000
DS - 0000000000000030, ES - 0000000000000030, FS - 0000000000000030
GS - 0000000000000030, SS - 0000000000000030
CR0 - 0000000080010033, CR2 - 0000000000000000, CR3 - 0000000078C01000
CR4 - 0000000000000668, CR8 - 0000000000000000
DR0 - 0000000000000000, DR1 - 0000000000000000, DR2 - 0000000000000000
DR3 - 0000000000000000, DR6 - 00000000FFFF0FF0, DR7 - 0000000000000400
GDTR - 0000000078BD5B18 0000000000000047, LDTR - 0000000000000000
IDTR - 0000000078379018 0000000000000FFF, TR - 0000000000000000
FXSAVE_STATE - 00000000791B9C00


Thanks
Ravi
Octocontrabass
Member
Member
Posts: 5540
Joined: Mon Mar 25, 2013 7:01 pm

Re: !!!! X64 Exception Type - 0D

Post by Octocontrabass »

That's not really enough information to figure out what's wrong.

Since you wrote it in assembly, it's possible your code doesn't follow the ABI correctly somewhere, or you might have an absolute address without a relocation. It could also be an ordinary logic bug, such as assuming a particular call will always succeed.

If you share the code, we might be able to find the problem.
Post Reply