Re: why LIDT needed in Real Mode?
- From: Ed Beroset <spamtrap@xxxxxxxxxx>
- Date: Fri, 30 Dec 2005 20:51:45 GMT
Wendy E. McCaughrin wrote:
I note in much working Pmode code that a necessary part of the transition back to Real Mode is: LIDT [RM_IDT], where `RM_IDT' is a descriptor for an IDT with limit = 64K and base-address = 0, coinciding with the Real-Mode IVT. Why is this necessary, since Real Mode does not use the IDTR? Or does it?
It does. The IDTR is in effect even in real mode, but most real mode code (especially older real mode code) assumes that the settings are as you describe above, so it's good practice to return them to those settings when getting back out of protected mode. Interestingly, it's possible to set up some other IDTR, say something like base=0x1c00, limit=1k and it would also work, provided the real mode code (including interrupt handlers) were set up to accomodate it. This is analgous to the old "flat real mode" trick in which descriptor limits are changed to 4G before returning to real mode.
Ed
.
- References:
- why LIDT needed in Real Mode?
- From: Wendy E. McCaughrin
- why LIDT needed in Real Mode?
- Prev by Date: Re: Basic Floppy Disk loader help.
- Next by Date: Re: Basic Floppy Disk loader help.
- Previous by thread: why LIDT needed in Real Mode?
- Next by thread: Re: why LIDT needed in Real Mode?
- Index(es):
Relevant Pages
|