Mail Archives: djgpp/2002/01/21/13:18:05
Tim Nicholson <djgpp AT gizzy DOT co DOT uk> wrote:
> Am I correct in thinking the DJGPP switches from protected mode to real mode
> to access the HDD and transfers data in 64K blocks (variable) via the DPMI
> to and from DOS?
Yes. Practically all I/O is done this by, in DJGPP. It has to be.
> Is it not possible to access the HDD directly in protected mode via a FAT32
> Library?
A library wouldn't do it. To make sure you don't blow up the
underlying DOS, it would at least need a 16bit DOS driver counterpart
that informs DOS and its programs (smartdrv most notably), of what is
happening. Otherwise, you'ld almost certainly corrupt data.
> - Does such a thing exist? and would it speed up disk I/O where
> reasonable quantities (several MB) of data was been transferred to
> and from the drive?
Not by very much. That's what you have that several 10's of KB of
transfer buffer for, after all: to make sure the mode switch overhead
is as small as possible compared to the time the realmode call itself
(i.e. actual disk writing) takes. For linear reads from protected
mode, I don't think you can be much faster than DJGPP already is.
Of course, it would still be crazy to implement a large database
management system in DJGPP... The tininess of the written blocks used
by such systems would drown your performance in modeswitch overhead.
> The reason for asking is that disk I/O seems much faster under
> Windows 98/ME etc. and I am guessing this is partly because the
> whole thing is happening in protected mode.
To some extent. There's also the fact that Windows talks directly to
the hardware, whereas DOS always goes via the BIOS, and thus can't use
some of the modern features, plus it may have to execute lots of code
that was and continues to be written with a 1980's MFM disk in mind.
> going much faster! I can't use Windows or Linux because the code must be
> deterministic to meet certification requirments, besides, I like DOS!
"Deterministic behaviour" and "caching" contradict each other to quite
some extent.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -