Page 1 of 1

Pmode and interrupt

Posted: Thu May 23, 2002 11:00 pm
by COB
It is posible to use interrup in Pmode,

How is the form to access to the keyboard o same
other device in Pmode

RE:Pmode and interrupt

Posted: Wed May 29, 2002 11:00 pm
by Chase
You have a couple of options.

In your PMode int handler you can

1) Switch back to real mode and run the real mode int handlers then switch back. Some old DOS extenders worked this way.

2) Write a PMode int handler that starts up a Virtual RM section of code and runs the real mode handler. This takes a lot of work because lots of instructions in the real mode handler are going to cause exceptions so you have to have handlers to deal with those.

3) Write a PMode handler that deals with all the hardware yourself.

RE:Pmode and interrupt

Posted: Wed May 29, 2002 11:00 pm
by cobrab
Chase:
      If option 1 is old and the 2nd takes a lot of work, I think the option 3 is optimal. Where can I find info about Write a PMode handler?

      Thanks.

PD: Very well new message-board.

RE:Pmode and interrupt

Posted: Thu May 30, 2002 11:00 pm
by Chase
The thing is that most OS's do both 2 and 3.

Here's why:
Say you boot your OS from a SCSI disk drive. After the OS is loaded and PMode is started you want to read from that same SCSI disk right? Well if you haven't written PMode drivers for every SCSI controller then maybe your OS won't be able to read from the hard drive since you can't use the real mode INT 0x13 stuff. If you did the Virtual Mode thing you'd atleast get some support for stuff like hard drives/controllers that you haven't written drivers for yet.

As for writting a PMode handler...
For just how to set on up in memory, IDT, segments, etc.. Look at the Intel developers manuals. If you can afford to get some dead tree info, look at "Protected Mode Software Architecture" by MindShare?(I think).

Once you get to writting a handler for a specific piece of hardware you might want to look at The Operating System Resource Center listed in the links section but it really depends on what piece of hardware you're looking to support.


> PS: Very well new message-board.

Thanks!

RE:Pmode and interrupt

Posted: Fri May 31, 2002 11:00 pm
by Tim Robinson
As far as booting goes, the thing to do is to have the boot loader load all the necessary drivers to get the rest of the system running -- probably hard disk and file system, and anything they depend on. Assuming that the BIOS supports your SCSI controller (it will come with a SCSI BIOS built-in), the boot loader will load the real SCSI driver, which can then load the rest of the OS from disk.

Another example of calling the BIOS from your pmode OS is the VESA BIOS: it's usually very hard to get enough chipset information to write your own high-resolution video drivers, so here it's more-or-less essential to call the BIOS to switch modes and to handle non-linear frame buffers.