www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/03/23/19:30:13

Date: Thu, 23 Mar 1995 18:04:09 +0500
From: hvb AT netrix DOT com
To: THE MASKED PROGRAMMER <badcoe AT bsa DOT bris DOT ac DOT uk>
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: Int 0x8 problems
References: <0098DCB1 DOT 675838B8 DOT 9 AT bsa DOT bristol DOT ac DOT uk>

THE MASKED PROGRAMMER writes:
 > Hi,
 > 	I'm still having trouble with interrupts (but the trouble's got a lot
 > more subtle now).
 > 
 > 	The following source file is supposed to implement a technique for
 > using the PIT and int 0x8 to refresh the screen.  Basically the idea is to run
 > the PIT at about ~140Hz (twice the VGA refresh rate) and in odd-numbered
 > interrupts ScreenBuffer is blasted onto the video memory, whereas in even
 > numbered interrupts the PIT is resynchronised with the VGA retrace.
 > 

1) I was using the similar scheme like what you had described but we
reprogram the TOD clock to 1000Hz.  The problem we get into is
when we are doing a lot of disk accesses, there were a lot of
real-mode to protected mode context switching while the disk access
code (real mode) code is activated.  This causes some weird behavior:
system hangs for no reason.

2) I then used another method by allocating DOS memory.  This block of
memory contains the shared counter variables used by the real and
protected interrupt code.  The idea is not have to switch to protected
mode from the real mode interrupt code.

This has worked relatively well, except if we do a lot of disk access,
suddenly we get an error like:

"Insert a diskette in drive B: - Press any key when ready"
(my system only has one floppy - drive A).

The following excerpt taken from "Programmer's Problem Solver for the
IBM PC, XT & AT, by Robert Jourdain - Prentice Hall Press, 1956 -
p. 46" scares me off:

This paragraph talks about the Channel 0 of the 8253 PC timer chip:

"The *out* line of channel *0* is also used to for timing certain disk
operations, and so if you change it you must be sure to restore it to
its original reading every time disks are accessed."

I thought this may be why I am getting those weird errors during disk
access.

3) Currently, I am trying to use the Real Time Clock for 1msec interrupt
and forget about the TOD clock all together.

I have now got the RTC 1msec interrupt to work but have not yet gone
through vigorous testing.  In the course of getting the RTC interrupt
to work.

Hope this helps.  Please let me know if you need sample code for 3) or
2).

Cheers

==============================================================
Hung Bui                            Internet: h DOT bui AT ieee DOT org
Netrix Corporation                    Phone: +1 703 793 1016
13595 Dulles Technology Drive           Fax: +1 703 713 3805
Herndon Va 22071
==============================================================

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019