🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #28

Re: Protected Mode Interrupts

#28
From: Patrick Klos
Date: Thu, 29 Oct 1992 13:40
50 lines
3402 bytes
In article <1992Oct29.075500.15529@cis.ohio-state.edu> madia@gecko.cis.ohio-state.edu (joseph anthony madia) writes:
>From: madia@gecko.cis.ohio-state.edu (joseph anthony madia)
>Subject: Protected Mode Interrupts
>Date: Thu, 29 Oct 1992 07:55:00 GMT
>	I have a question involving Protected mode for 386/486 (no 286)
>programming. The scenario is as follows:  The program is a normal DOS
>executable that is designed to take COMPLETE control of the pc. (ie it has
>no intention of returning to dos once it is running). This program sets up
>a simple protected mode 32-bit operating environment solely for the purpose
>of experiment with the full power of the 386/486. I have a question about
>handling hardware IRQs in this environment. 
>	BIOS originally sets the hardware IRQs 0 -7 to use INTs 8 - 15, and 
>IRQs 8 - 15 to use INTs 70h - 77h. The IRQ 0 - 7 assignments cause confilcts 
>with the reserved exception INTs (ie INT 8 is reserved by Intel for Double 
>Fault exceptions, and is also set by BIOS to receive IRQ0 hardware interrupts)
>	How should this be handled? Is there anything that needs handling, or
>am I missing something in this picture. Do the IRQs have to be re-mapped to 
>different INTs that aren't reserved by Intel (map IRQs 0-7 to INTs 32-30)?
>If I do have to remap the IRQs, then how do I do so in the 386 environment.
>I have seen the BIOS source for an AT that does the original IRQ to INT 
>mapping, and how to accomplish this, but its written for a 286 AT and Im 
>not sure if that will work on this machine. (PS/2 model 70 386). 
>	Any help regarding this, or Protected mode programming in general 
>would be appreciated. Unfortunately, most of the information that I have
>found on Protected mode has few, if any examples. Thanks in advance...
>
>Joe Madia				       madia@cis.ohio-state.edu
>
>
>	

If you're not interested in any real DOS compatibility (it sounds like you'
re not, at least not right now), the proper way to handle hardware 
interrupts is to MOVE them hardware interrupts to someplace safe, which is 
anyplace that isn't currently reserved by Intel.  I don't recall exactly how 
to reprogram both 8259's (interrupt controllers), but it's pretty 
straightforward.  Then you need to set up appropriate descriptors in the 
IDT (interrupt descriptor table).  After that, interrupt handlers in 
protected mode aren't too different from real-mode interrupt handlers.  I've 
written an entire multi-tasking protected mode kernel for the 386, which 
uses paging to support V86 tasks.  It was alot of fun, and very educational.

Good luck!

Patrick
========================================================================
        Patrick Klos                 Internet: klosp@rimail.interlan.com
        Klos Technologies, Inc.      Compuserve: 71521,145
        (603) 424-0138
========================All opinions are my own!========================
Technical Details
Message-ID: <klosp.15.720366007@rimail.interlan.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!interlan.InterLan.COM!rimail.interlan.com!klosp
References: <1992Oct29.075500.15529@cis.ohio-state.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.programmer,comp.sys.ibm.pc.misc
Path: arc1-ca.pugleaf.net!sparky!uunet!interlan.InterLan.COM!rimail.interlan.com!klosp
From: klosp@rimail.interlan.com (Patrick Klos)
Subject: Re: Protected Mode Interrupts
Message-ID: <klosp.15.720366007@rimail.interlan.com>
Lines: 50
Sender: news@Interlan.com
Organization: Klos Technologies, Inc. (603) 424-0138
References: <1992Oct29.075500.15529@cis.ohio-state.edu>
Date: Thu, 29 Oct 1992 13:40:07 GMT