hot dos (Developers)
> > Unfortunately most DOS and ROM-BIOS do not do that.
>
> You say "unfortunately" - but I have a question. Whose
> responsibility do you think it ideally is to do this work?
Whoever is in a polling loop. When you call 16.00 then the int 16h handler goes into a polling loop until a keypress is available. When you call 21.08, either the DOS goes into a polling loop, or else it translates the call to a 16.00 (or 16.10, 16.20) so again the int 16h handler does the polling loop. The same is true of 21.0A, it has to do a polling loop at some point if no complete input line is available yet.
This also means if your *application* does a polling loop, then it should idle the machine while waiting. This can be querying keypresses using DOS stdin (21.0B), or the int 16.01/16.11/16.21, or mouse movement or clicks, or serial port data reception. If no input is received, then there is an opportunity to wait until something happens, so the CPU should be idled.
For instance, idling with sti
and hlt
, if it works, may let the CPU idle until the next IRQ arrives, be it a timer, keyboard event, serial I/O, etc.
In lDebug the idling is done in getc
within lineio.asm. The idle
function is also in this file. Note that several options flags can be used to modify the application's behaviour.
> And especially the spinning down of disks. If you know
> you are waiting for a keystroke, should you begin the
> disk spindown procedure straight away, or does that
> cause an issue if the user is touch-typing and the next
> keystroke is 0.1 seconds away?
>
> If a complex algorithm is required, then perhaps it is
> best relegated to DOS. And in fact, DOS would ideally
> have the smarts to see that a keystroke is not enough
> to wake up the disk - it should only be done if after
> sufficient keystrokes, there is some request for disk
> services.
Spinning down disks is vastly less important than idling the CPU during input polling loops.
---
l
Complete thread:
- hot dos - kerravon, 08.05.2025, 00:24 (Developers)
- hot dos - ecm, 08.05.2025, 00:36
- hot dos - Rugxulo, 08.05.2025, 03:22
- hot dos - kerravon, 08.05.2025, 07:24
- hot dos - rmcconne, 11.05.2025, 15:15