Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Borland > Re: How to debu...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 14 of 25 Topic 1039 of 1114
Post > Topic >>

Re: How to debug inside the BIOS and/or interrupt?

by "Jason Burgon" <spamtrap@[EMAIL PROTECTED] > Jul 5, 2007 at 10:55 PM

"Jim Leonard" <spamtrap@[EMAIL PROTECTED]
> wrote in message
news:1183655242.640201.198510@[EMAIL PROTECTED]
> However, I'm not sure an "in ISR" flag is necessary -- The interrupt
> in question is a hardware interrupt.  Since it's a hardware interrupt,
> isn't another hardware interrupt for the SAME IRQ not possible until I
> issue the EOI to the PIC?

Correct, but IRQ priorities on an IBM PC have been assigned somewhat
arbitarily, so it's a good idea IMO to issue an EOI and execute an STI
early
in your ISR. This will allow all other interrupts to occur, and not just
the
ones that have a higher PIC priority. This also of course also allows your
ISR to re-enter itself, but you can avoid disaster with a counting
semaphore. Depending on what exactly your ISR does, you might want to do
something like the following:

procedure MyISR(var Regs: Registers); assembler;
const
  InISR: Integer = 0;
asm
    inc   [InISR]
    sti            { Allow higher priority interrupts }
    cmp   [InISR],1
    out   [$20],$20 { EOI - Allow all interrupts, incl. this one  }
    jne   @[EMAIL PROTECTED]
       { ISR is re-entered, so exit with InISR + 1, EOI & STI
}
    push  ax
    push  bx
    push  ...etc
    push  ds
    mov   ax,Seg @[EMAIL PROTECTED]
    push  es
    mov   ds,ax
@[EMAIL PROTECTED]
    call  DoISROperation
    lock; dec [InISR]
    jnz   @[EMAIL PROTECTED]
       { Repeat for every re-entry }
    pop   es
    pop   ds
    pop   ...etc
    pop   bx
    pop   ax
@[EMAIL PROTECTED]
    rti
end;

The above (written off the top of my head) has two advantages:

(1) It doesn't block any other ISR's, even lower priority ones such as the
IRQ5 which you say your hard drive is using.

(2) It allows re-entrancy without causing any damage and without missing
any
"DoISROperation"s. The jitter might be bad, but often this either doesn't
matter, or bad jitter is much better than completely missing an ISR
operation altogether.

The above assumes that the hardware in question will generate another IRQ
without you reading or writing any of its registers. If it doesn't then
the
semaphore isn't needed, or you need to re-enable its IRQ firing mechanism
even when it's just a re-entry.
 




 25 Posts in Topic:
How to debug inside the BIOS and/or interrupt?
Jim Leonard <spamtrap  2007-07-05 02:45:50 
Re: How to debug inside the BIOS and/or interrupt?
"Rod Pemberton"  2007-07-05 02:17:27 
Re: How to debug inside the BIOS and/or interrupt?
"Benjamin David Lunt  2007-07-05 15:28:00 
Re: How to debug inside the BIOS and/or interrupt?
NoSpam@[EMAIL PROTECTED]   2007-07-05 12:15:06 
Re: How to debug inside the BIOS and/or interrupt?
HubbleBubble <spamtra  2007-07-05 02:21:48 
Re: How to debug inside the BIOS and/or interrupt?
hartnegg <spamtrap@[EM  2007-07-05 08:11:22 
Re: How to debug inside the BIOS and/or interrupt?
Jim Leonard <spamtrap  2007-07-05 09:04:20 
Re: How to debug inside the BIOS and/or interrupt?
"Rod Pemberton"  2007-07-05 18:33:55 
Re: How to debug inside the BIOS and/or interrupt?
"Wolfgang Kern"  2007-07-06 17:40:44 
Re: How to debug inside the BIOS and/or interrupt?
Jim Leonard <spamtrap  2007-07-05 09:13:45 
Re: How to debug inside the BIOS and/or interrupt?
Jim Leonard <spamtrap  2007-07-05 10:07:22 
Re: How to debug inside the BIOS and/or interrupt?
"Rod Pemberton"  2007-07-05 18:32:16 
Re: How to debug inside the BIOS and/or interrupt?
"Markus.Humm"   2007-07-10 19:37:06 
Re: How to debug inside the BIOS and/or interrupt?
"Jason Burgon"   2007-07-05 22:55:04 
Re: How to debug inside the BIOS and/or interrupt?
Jim Leonard <spamtrap  2007-07-05 10:12:12 
Re: How to debug inside the BIOS and/or interrupt?
Jim Leonard <spamtrap  2007-07-05 14:49:30 
Re: How to debug inside the BIOS and/or interrupt?
Jim Leonard <spamtrap  2007-07-06 02:15:15 
Re: How to debug inside the BIOS and/or interrupt?
Jim Leonard <spamtrap  2007-07-06 03:38:11 
Re: How to debug inside the BIOS and/or interrupt?
NoSpam@[EMAIL PROTECTED]   2007-07-06 12:18:48 
Re: How to debug inside the BIOS and/or interrupt?
ArarghMail707NOSPAM <s  2007-07-06 15:31:57 
Re: How to debug inside the BIOS and/or interrupt?
Jim Leonard <spamtrap  2007-07-06 08:57:39 
Re: How to debug inside the BIOS and/or interrupt?
Jim Leonard <spamtrap  2007-07-06 09:39:13 
Re: How to debug inside the BIOS and/or interrupt?
Jim Leonard <spamtrap  2007-07-11 09:01:39 
Re: How to debug inside the BIOS and/or interrupt?
NoSpam@[EMAIL PROTECTED]   2007-07-12 11:46:55 
Re: How to debug inside the BIOS and/or interrupt?
"Jason Burgon"   2007-07-12 18:28:36 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Jul 6 2:17:52 CDT 2008.