SoD code problems...
Posted: Mon Jul 16, 2007 8:08 am
Hello,
I'm having a little problem in my BSOD code:
I can't get properly CS:EIP and EFLAGS values from stack It always will display something that's terribly wrong (I compared the values between crashed QEMU register dump and "panic'ed Bochs" emulator screen (not the debugger, because it would throw other EIP, logically), I invoked the error on purpose)
Here's my commented code:
Thanks for your advice...
inflater
I'm having a little problem in my BSOD code:
I can't get properly CS:EIP and EFLAGS values from stack It always will display something that's terribly wrong (I compared the values between crashed QEMU register dump and "panic'ed Bochs" emulator screen (not the debugger, because it would throw other EIP, logically), I invoked the error on purpose)
Here's my commented code:
Code: Select all
div_error:
mov [TempEAX],eax ;save EAX and all 32bit regs
mov [TempEBX],ebx
mov [TempECX],ecx
mov [TempEDX],edx
mov [TempESI],esi
mov [TempEDI],edi
pop eax ;get EIP
pop ebx ;get CS
pop ecx ;get EFLAGS
mov [EIPValue],eax ;store EIP
mov [CSValue],ebx ;store CS
mov [EFlagsValue],ecx ;store Eflags
push ecx ;and return them on the stack:
push bx ;sometime there will be a option
push eax ;about continuing in OS execution
mov eax,TempEAX ;and ignoring the BSOD
mov ebx,TempEBX ;return the registers
mov ecx,TempECX
mov edi,Div_Flt ;just a simple exception handling
push edx ;save EDX
mov edx,00h ;exception handling
mov [CanContinue_BSOD],1 ;....
call DoException ;draw the RSOD etc.
iret ;this will never trigger
inflater