X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f From: Hans-Bernhard Broeker Newsgroups: comp.os.msdos.djgpp Subject: Re: Protected Mode disk access Date: 21 Jan 2002 18:13:59 GMT Organization: Aachen University of Technology (RWTH) Lines: 50 Message-ID: References: <1011635483 DOT 28296 DOT 0 DOT nnrp-08 DOT c1ed6b28 AT news DOT demon DOT co DOT uk> NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de X-Trace: nets3.rz.RWTH-Aachen.DE 1011636839 16552 137.226.32.75 (21 Jan 2002 18:13:59 GMT) X-Complaints-To: abuse AT rwth-aachen DOT de NNTP-Posting-Date: 21 Jan 2002 18:13:59 GMT Originator: broeker@ To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Tim Nicholson 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.