Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Jul 2012 07:41:28 -0700
From:      perryh@pluto.rain.com
To:        bonomi@mail.r-bonomi.com
Cc:        freebsd-questions@freebsd.org
Subject:   Re: fsck on FAT32 filesystem?
Message-ID:  <500d6298.mW4a90i/Zh2U1/xR%perryh@pluto.rain.com>
In-Reply-To: <201207230403.q6N43iBQ029276@mail.r-bonomi.com>
References:  <201207230403.q6N43iBQ029276@mail.r-bonomi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Robert Bonomi <bonomi@mail.r-bonomi.com> wrote:

> > MSDOS/PCDOS had no _documented_ functions to directly access the
> > disks, bypassing the file system, but the functions _did_ exist.
>
> I'm sure you can provide the DOS 'function number' for those calls,
> and cites to published data confirming.

They may have involved a dedicated INT or two, e.g. INT 25H and/or
INT 26H, rather than INT 21H with a function number in AX.

I could have provided specifics 25 years ago :) when I was involved
with this stuff on a daily basis.  I have no idea whether it was
ever published, but it was well known to those of us who were using
it in system-level utilities.

> > The debugger's "read sector" and "write sector" commands used them,
> > and I suspect chkdsk, scandisk, and format probably also used them
> > although I never had occasion to verify one way or the other.
>
> My experince in porting MSDOS 3.1 to a non pc-clone architecture was 
> that fdisk, format, chkdsk, debug, and sys all invoked INT 13H directly.

I've got you beat in seniority :)  I was mostly working on 2.x, and
got out of the business somewhere around 3.1 or 3.2.

I think I'd remember if our stuff had quit working when 3.x came
along, but it's possible that those interfaces were only retained
for compatibility -- to avoid breaking old 3rd-party code -- and
that the MS userland had been revised to call the BIOS directly
(since by then the market consisted almost entirely of PCs and
clones -- decidedly not the case in the 2.0-2.1 timeframe).

BTW fdisk _would_ always have had to use BIOS calls, or some other
platform-specific mechanism, since the direct disk access in DOS was
restricted to the DOS partition(s).  The parameters were something
like buffer address, logical drive number (0 => A:, 2 => C:, etc.),
starting sector within the logical drive, and number of sectors.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?500d6298.mW4a90i/Zh2U1/xR%perryh>