I think there are some old x86 programmers around here so I’ll give this a shot.
I’m working on porting some old code to a new board. The board starts in real mode, switches to 286 protected mode (64k code and data segments) in the boot loader, then boots to an executive. The executive then loads its own GDT and IDT and remains in 286 protected mode.
Here’s the weird thing. The code works perfectly fine on a 386, a Pentium, and Pentium III, but locks up on the Intel Atom processor on the new board. As far as I can tell, it’s locking up on either the LGDT or LIDT instruction in the executive. The LGDT and LIDT instructions in the boot loader work just fine and are fairly similar. I don’t have much debugging available since I can’t get it to switch over to the new GDT.
What changed with the Atom chip with respect to these instructions (LGDT and LIDT)? I’m not seeing anything obvious in the documentation.
IIRC on modern systems the BIOS builds the GDT/IDT for you. If that’s the case, you should be able to get the address and do whatever you want from there.
Edit: Sorry, I believe I misread your post. I have no idea why this would fail. Perhaps there’s an invalid value in one of your registers that’s invoking something reserved or undocumented?
I found the problem. A line in the source code that I thought was commented out (part of a descriptor definition) wasn’t commented out. It was shifting most of the entries in the descriptor table down by 2 bytes.