interrupts in pmode

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
CoolnessItself

interrupts in pmode

Post by CoolnessItself »

Are there any ways to use interrupts in pmode? any way around it?
Tom

Re:interrupts in pmode

Post by Tom »

there's a way to use ints in Pmode it's called v86 mode, but it's complicated, and i'm still trying to get it to work
drizzt

Re:interrupts in pmode

Post by drizzt »

There is another way, even if I think that V86 is the best way. Go to my previous topic in this site:

PMode interrupt again

http://www.mega-tokyo.com/forum/index.p ... eadid=1290
CoolnessItself

Re:interrupts in pmode

Post by CoolnessItself »

Thanks, but according to that, paging is not possible. Is it possible to make a mix of the two?
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:interrupts in pmode

Post by Pype.Clicker »

you can't have paging unless you're in protected/virtual mode. BTW, i don't recommand the real mode interrupts as it means the system is completely locked during the service (hum, like Win95, reading the floppy will completely freeze the GUI :( )
drizzt

Re:interrupts in pmode

Post by drizzt »

Yes pype... the best way is to write drivers from himself, without using BIOS ints, but it's very difficult, especially because there is not enough documentation... :'(
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:interrupts in pmode

Post by Pype.Clicker »

using bios&v86 mode seems safer (though more complicated) than using real mode switch back because when in v86 mode, IRQs are still handled by kernel (and thus you can go on with multitasking while the BIOS is waiting for an interrupt) -- but you still can't detect when the BIOS start to wait for its IRQ (thus losing some CPU cycles)...

I guess the best way to go is to learn from Linux drivers
drizzt

Re:interrupts in pmode

Post by drizzt »

CoolnessItself wrote: Thanks, but according to that, paging is not possible. Is it possible to make a mix of the two?
I think paging is possible... because you are in protected mode. You temporaly switch to real mode only when a int occurs, then you come back to protected mode.

So you could write your IRQ and interrupt handlers without calling BIOS ints, but switching to real mode only when it is necessary... for your video & disk drivers for example, that are very difficult to write from himself...

In this way you have a protected mode code with a little help from the BIOS...

But as I said it's not the best way... as pype I think V86 is the best way even if is more complicated than using real mode switching...
Post Reply