Enabling Interrupts in P-Mode 
Author Message
 Enabling Interrupts in P-Mode

Hi,
thanks to all the help I've received from you guys I now have some simple
p-code up and running with a GDT and IDT, all it does at this point is write
various strings onto the screen but that isn't too bad considering I started
from zero.
The code first disables all interrupts via cli and for now everything runs
in ring0. I would now like to receive interrupts from the keyboard and
floppy-drive to make it more dynamic. Is that going to be as simple as using
sti and then writing an isr for int 09h and int 0Eh respectively or must I
first fiddle with the PIC, and if so in what way??
Thanks!!



Sun, 11 Aug 2002 03:00:00 GMT  
 Enabling Interrupts in P-Mode
Hi Samuel!

Since Int0...Int1Fh are reserved for exceptions and other stuff, you
can't use IRQ0...IRQ7 on their standard int vectors (8...0Fh). You have
to reprogram Interrupt controller so that IRQ0...IRQ7 would lie above
Int 1Fh.

There are a lot of code doing this stuff on the Net.
My PMode programs at my site also have reprogramming code.
Just take a look at the "Tiny OS kernel". There is a macro named

base int vector for IRQ0...IRQ7 and base int vector for IRQ8...IRQ15.
You may setup it so that Int20...Int2F would correspond to IRQ0...IRQ15:

Before returning back to Real Mode you should return original int
vectors for IRQ0...IRQ15:

That's all.
Alexei A. Frounze
P.S.
homepage: http://alexfru.chat.ru
mirror: http://members.xoom.com/alexfru

Quote:

> Hi,
> thanks to all the help I've received from you guys I now have some simple
> p-code up and running with a GDT and IDT, all it does at this point is write
> various strings onto the screen but that isn't too bad considering I started
> from zero.
> The code first disables all interrupts via cli and for now everything runs
> in ring0. I would now like to receive interrupts from the keyboard and
> floppy-drive to make it more dynamic. Is that going to be as simple as using
> sti and then writing an isr for int 09h and int 0Eh respectively or must I
> first fiddle with the PIC, and if so in what way??
> Thanks!!



Sun, 11 Aug 2002 03:00:00 GMT  
 Enabling Interrupts in P-Mode

Quote:

> Hi,
> thanks to all the help I've received from you guys I now have some simple
> p-code up and running with a GDT and IDT, all it does at this point is
write
> various strings onto the screen but that isn't too bad considering I
started
> from zero.

Not too bad for a start. It's those little things that help one raise his
self-confidence :-)
Unfortunately, I don't have as much luck right now, but who cares *ggg*.

Quote:
> The code first disables all interrupts via cli and for now everything runs
> in ring0. I would now like to receive interrupts from the keyboard and
> floppy-drive to make it more dynamic. Is that going to be as simple as
using
> sti and then writing an isr for int 09h and int 0Eh respectively or must I
> first fiddle with the PIC, and if so in what way??

Have you already redirected the hardware interrupts or something like that
yet?
If you haven't, you either have to create a handler for int 09h/exception
09h which is able to distinguish between these two sources. I haven't tried
this myself yet (and I don't want to), but one can determine the source
according to the stack layout. I for myself prefer rerouting the hardware
irqs to some place else (most ppl use vectors 20-2Fh, I use F0-FFh) by
reprogramming the PIC - not hard at all.
But the floppy will be a _lot_ more work as you have to access it directly
via port i/o. And if you don't want to go for polling (who'd ever use this
anyway?), you have to implement some DMA access routines as well.

Best regards,
    Thomas



Sun, 11 Aug 2002 03:00:00 GMT  
 Enabling Interrupts in P-Mode
Ehhh... DMA access?? and how would I go about doing that?

Quote:

> > Hi,
> > thanks to all the help I've received from you guys I now have some
simple
> > p-code up and running with a GDT and IDT, all it does at this point is
> write
> > various strings onto the screen but that isn't too bad considering I
> started
> > from zero.

> Not too bad for a start. It's those little things that help one raise his
> self-confidence :-)
> Unfortunately, I don't have as much luck right now, but who cares *ggg*.

> > The code first disables all interrupts via cli and for now everything
runs
> > in ring0. I would now like to receive interrupts from the keyboard and
> > floppy-drive to make it more dynamic. Is that going to be as simple as
> using
> > sti and then writing an isr for int 09h and int 0Eh respectively or must
I
> > first fiddle with the PIC, and if so in what way??

> Have you already redirected the hardware interrupts or something like that
> yet?
> If you haven't, you either have to create a handler for int 09h/exception
> 09h which is able to distinguish between these two sources. I haven't
tried
> this myself yet (and I don't want to), but one can determine the source
> according to the stack layout. I for myself prefer rerouting the hardware
> irqs to some place else (most ppl use vectors 20-2Fh, I use F0-FFh) by
> reprogramming the PIC - not hard at all.
> But the floppy will be a _lot_ more work as you have to access it directly
> via port i/o. And if you don't want to go for polling (who'd ever use this
> anyway?), you have to implement some DMA access routines as well.

> Best regards,
>     Thomas



Mon, 12 Aug 2002 03:00:00 GMT  
 Enabling Interrupts in P-Mode
As always, thanks for the tip!!


Mon, 12 Aug 2002 03:00:00 GMT  
 Enabling Interrupts in P-Mode


Quote:
> Ehhh... DMA access?? and how would I go about doing that?

Well, yes. Usually, the floppy is driven in DMA mode. The floppy uses DMA
channel 2.

Basically, what you have to do is setting up a single DMA transfer
operation, no auto-init, with address increment. You have to inform the DMA
controller about the physical address of your block you want to transfer,
its size, etc.

I'm sorry, but I can't give you more detailed information right now, as I
haven't come to doing this myself yet. But several other people have tried
this already (for example Alexei) and Assassin posted some references just
today. I'd suggest you to dig into these, you should be able to find
everything you need there.

Best regards,
    Thomas



Tue, 13 Aug 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Emulating real-mode interrupts in pmode

2. PMODE by Tran - CALL REAL MODE INTERRUPT BUG ?!?

3. Proteced Mode calling of Real Mode Interrupts

4. Real Mode Interrupts in Prot Mode

5. Calling Real Mode Interrupt from Watcom C32 (Protected Mode)

6. int 13h enabling interrupts

7. programming APIC / custom interrupts / PMode...

8. Interrupts in PMode

9. BIOS interrupt in PMODE

10. 16 bit interrupts in pmode

11. PMode interrupts...

12. Pmode interrupts?

 

 
Powered by phpBB® Forum Software