Replies: 1 comment
-
I went on debugging my earlier code and I think I resolved the issues caused the crash/triple fault in my program. I loaded the GDT at address The working version use correct segment base Everything else unnecessary was removed. Just a minimal PMODE program.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
Im trying to enter Protected mode in .COM file (org 0x100) for NASM.
I've tried several approaches. Because .COM is flat binary in 64k space only. Had to hardcode addresses instead of using labels freely. My goal is eventually to use clever macros, but for now, I'm stuck just trying to get a basic PMODE setup working.
I tried enabling A20 gate via the config ([dosbox] a20=on), but it didn't help much.
I managed to get past errors like:
But now I'm getting a new one: "Triple fault reset call unexpectedly returned".
This is the first time I've seen that one, and I can't figure out what's going wrong.
I suspect it's something with the jump to 32-bit mode or a segment descriptor mismatch.
Here's my current test code (NASM 0.98.39):
As you se I had GDT null start at 0x20 in .COM. pmode label at 0x40. But what am I missing?
I think it's right, but I dont know the messagebox bug from Dosbox?
Any help or working example for entering PMODE cleanly from a .COM file in DOSBox-X would be super appreciated.
I have not yet tried this on my laptop with DOS boot (maybe I should try?)
Tricks, known pitfalls, ideas. ANything welcome.
I know this isn't strictly a asm code forum, but perhaps the developers or others familiar with the emulation might have ideas?
What im not doing right.
Thanks in advance!
Edit:
Im still learning the debugger, but I noticed the last executed instruction was an
IRET (0xCF)
I guess it tried to load garbage and triggered a fault. I've read that in PMODE, especially with a null IDT, one should avoid instructions like
INT
IRET
RETF
CALLF
or task switch. Without any valid handler or TSS, such operations can cause a fault, in this case a triple fault. Still trying to track down exactly where in the code things go off the rails.Wait i was wrong:

moving EAX into CR0 caused fail. What happens then is "Data view" gets filled with na-values. same with Code Overview.
Beta Was this translation helpful? Give feedback.
All reactions