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 9 of 25 Topic 1039 of 1118
Post > Topic >>

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

by "Wolfgang Kern" <nowhere@[EMAIL PROTECTED] > Jul 6, 2007 at 05:40 PM

Rod Pemberton wrote:

[..]
> Sorry, my mistake.  I should have asked if interrupts were disabled (IF
> cleared) for the entire routine.  I wrapper my IRQ routines with CLI/STI
> because they go through a trap gate.  This shouldn't affect you.  I was
> considering that interrupts might be enabled for part of the IRQ
routine,
> and that it might be a problem.

> Anyway, Ben thinks it might work better with interrupts enabled.
> It's worth a shot.  I usually try all combinations anyway.  :-)
> Helps to learn new stuff - even if painful...

> The problem I experienced with my personal OS was corruption of static
or
> shared data.  Since my IRQ routines were becoming quite large, I enabled
> interrupts for non-critical ****tions of the routines.
[...]

My first OS attempts encountered similar effects. So I decedied to split
the story into shortest HW-related 'IRQ-routines' and 'event-handlers'.
The main idle in my OS just polls two 32-bit event-flags variables and
the main timecounter for timesliced tasks.
__________
MAIN_RESET:  ;at start and after fatal errors
cli
LGDT...      ;initialise all what's needed
....
MAIN:
sti
mov eax,[hw-events]
and eax,[hw-mask]      ;may ignore ie: IRQ09 VGA-retrace
jz L0
call act_event
L0:
mov eax,[time_events]  ;software and hardware time-outs
and eax,[sw-mask]
jz L1
call act_timeout
L1:
mov eax,[main_time]
cmp eax,[next_sceduled]
jc main
call next_task
jmp main
________

The IRQ00 routine only increments one main counter and decrement a set
of timeout-counters until zero (set TimeOut# event bit on 1 -> 0 only).
And I the added the 0...999 mSec counter synchronised by RTCL (IRQ8).

My 'largest' IRQ-handlers are mouse and keyboard, because this devices
fire several IRQs in certain sequences, the event-bits are only set
when the sequence is completed. I enable IRQ very early in this two, but
never encountered any problems by using 'normal' EOI (out[A0/20],20)
even KEYBD(IRQ01) and PS/2 mouse(IRQ0C) share I/O-****ts.

With 'largest' I mean larger than 64 bytes, but not more than 256,
whereas (depending on the sequence count) again maximal 64 bytes per
IRQ will be executed.

So the only possibile reentrance could occure if the KEYBD-IRQ would
handle KEYBD-LEDs on it's own, because LED-setting needs 'some' time
and a fast typist can hit two more keys meanwhile.
I experienced this as buggy behaviour and finally made CAPS,NUM,SCROLL-
LED-actions apart from IRQ-handler (event driven now).

__
wolfgang
 




 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 Fri Jul 25 0:14:23 CDT 2008.