|
|
Problem with disk read/write (int 21) - help me!
Hi,
i have problem:
My program contain procedure called by timer interrupt ($1C),
and this procedure save data to log file opened by $3D function.
Procedure write to file by $42 & $40 DOS function. (go to end
and write). And it's ok. But...
Main program contain procedures which read and write to database
file, and that is problem. Sometimes database procedures return
'stupid' errors, e.g. 'acces denied'.
I suspect, that the interrupt disturb main process, but how I can
provide against this??
|
|
0
|
|
|
|
Reply
|
kmk68 (2)
|
12/15/2003 5:41:01 PM |
|
"Kajetan Krupinski" <kmk68@wp.pl> wrote in message
news:27496c7c.0312150306.2d3dcf81@posting.google.com...
> Hi,
> i have problem:
>
> My program contain procedure called by timer interrupt ($1C),
> and this procedure save data to log file opened by $3D function.
> Procedure write to file by $42 & $40 DOS function. (go to end
> and write). And it's ok. But...
>
> Main program contain procedures which read and write to database
> file, and that is problem. Sometimes database procedures return
> 'stupid' errors, e.g. 'acces denied'.
>
> I suspect, that the interrupt disturb main process, but how I can
> provide against this??
add a flag that you check within the timer interrupt to see whether or not
the database is currently accessing the disk at the moment... if it is...
then set another flag to remind yourself at a later invocation of the timer
interrupt, that you still have to do "so-and-so"
make sense?
|
|
0
|
|
|
|
Reply
|
Bx
|
12/15/2003 6:25:47 PM
|
|
Kajetan Krupinski <kmk68@wp.pl> schreef in berichtnieuws
27496c7c.0312150306.2d3dcf81@posting.google.com...
> Hi,
Hello Kajetan,
> i have problem:
>
> My program contain procedure called by timer interrupt ($1C),
> and this procedure save data to log file opened by $3D function.
> Procedure write to file by $42 & $40 DOS function. (go to end
> and write). And it's ok. But...
Nope, it's not. Never *ever* do something like that from within a
*hardware* interrupt. Your Database-program could just be busy writing
something to dsik, and then your disk-access request comes barging thru ...
*kaboom*
> Main program contain procedures which read and write to database
> file, and that is problem. Sometimes database procedures return
> 'stupid' errors, e.g. 'acces denied'.
>
> I suspect, that the interrupt disturb main process, but how I can
> provide against this??
What you (can) do is that you set, in the timer-interrup-handler, some sort
of flag. Next to that you intercept all INT 21h -calls, and check for that
flag. When the flag is set, you write whatever must be written, and reset
the flag. This way you won't ever interrupt an allready ongoing
disk-access.
Regards,
Rudy Wieser
|
|
0
|
|
|
|
Reply
|
R
|
12/16/2003 7:57:23 PM
|
|
|
2 Replies
191 Views
(page loaded in 0.049 seconds)
|
|
|
|
|
|
|
|
|