bios switch to pmode
bios switch to pmode
I was going through a list of int 15h services and noticed that function 89h allows you to switch to pmode. This sure seems like an easier way to do it as it also allows you to setup the irq's during the call as well. Of course you still need a GDT before making the call.
Is this something that is supported by most bios's or only a specific type.
[EDIT] And has anyone ever used this? Just curious.
Is this something that is supported by most bios's or only a specific type.
[EDIT] And has anyone ever used this? Just curious.
- mathematician
- Member
- Posts: 437
- Joined: Fri Dec 15, 2006 5:26 pm
- Location: Church Stretton Uk
- mathematician
- Member
- Posts: 437
- Joined: Fri Dec 15, 2006 5:26 pm
- Location: Church Stretton Uk
Hi,
You also don't end up with 6 descriptors when 2 is (typically) enough, and don't need to be worried about how the BIOS returns to your code (if CS needs to use a 16-bit default operand size to make sure the BIOS's IRET works, if CS base needs to be the same as it was in real mode, and whether or not the IDT must have descriptors preconfigured or if the BIOS returns with interrupts disabled).
Cheers,
Brendan
Because if you use your own code you don't have to worry about whether or not this BIOS function is supported by the computer.mathematician wrote:Why take a couple of dozen lines to do what you can do in four or five?
You also don't end up with 6 descriptors when 2 is (typically) enough, and don't need to be worried about how the BIOS returns to your code (if CS needs to use a 16-bit default operand size to make sure the BIOS's IRET works, if CS base needs to be the same as it was in real mode, and whether or not the IDT must have descriptors preconfigured or if the BIOS returns with interrupts disabled).
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
- mathematician
- Member
- Posts: 437
- Joined: Fri Dec 15, 2006 5:26 pm
- Location: Church Stretton Uk
This function has been a standard part of the BIOS for as long as I have been programming PCs, and that is quite a few years now. You have as many entries in the GDT as you want to put in it. If you read the documentation you will discover that the cs base does need to be the same as it was in real mode, which is hardly surprising given that execution is going to resume with the very next instruction after the int.Brendan wrote:Hi,
Because if you use your own code you don't have to worry about whether or not this BIOS function is supported by the computer.mathematician wrote:Why take a couple of dozen lines to do what you can do in four or five?
You also don't end up with 6 descriptors when 2 is (typically) enough, and don't need to be worried about how the BIOS returns to your code (if CS needs to use a 16-bit default operand size to make sure the BIOS's IRET works, if CS base needs to be the same as it was in real mode, and whether or not the IDT must have descriptors preconfigured or if the BIOS returns with interrupts disabled).
Re: bios switch to pmode
Hi,kubeos wrote:I was going through a list of int 15h services and noticed that function 89h allows you to switch to pmode. This sure seems like an easier way to do it as it also allows you to setup the irq's during the call as well. Of course you still need a GDT before making the call.
Is this something that is supported by most bios's or only a specific type.
[EDIT] And has anyone ever used this? Just curious.
well, I think that this function was for simpler way for going into protected mode. In AThelp, this function is not recommended (I do not know why), but it remaps the PIC and enables A20 so I think it is a space-preserving way to enter pmode.
I am just wondering if this function wasn't rarely used in 80286's where you could not enable pmode with CR0. (Through MSW)
inflater
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English
)
Derrick operating system: http://derrick.xf.cz (Slovak and English
![Razz :P](./images/smilies/icon_razz.gif)