TIP: Click on subject to list as thread! ANSI
echo: os2
to: LINDA PROULX
from: MIKE RUSKAI
date: 1999-10-29 19:31:00
subject: Re: File Systems

Some senseless babbling from Linda Proulx to Mike Ruskai
on 10-27-99  12:03 about Re: File Systems...

 -=> MIKE RUSKAI wrote to JACK STEIN <=-
 
 MR> data, but they are unreachable (except using direct drive access).

 LP> What is exactly meant by direct drive access?

Nothing you can do as a normal user.

When writing a program, you can access a drive directly in one of two ways:

1)  Open the drive as a file (pass the drive string to DosOpen() and use
the OPEN_FLAGS_DASD flag), and use the normal file access APIs.  This
treats the entire drive, from boot sector to end, as a big file.  It won't
work for drives larger than 2GB.  For such drives, HPFS does have a special
access mode that makes the file access APIs deal in sector units, rather
than byte units (function 0x9014 with DosFSCtl()).  That will handle any
drive size up to 2^31 sectors (1TB, with 512-byte sectors).  HPFS386
doesn't support sector mode, however.  It does support larger drives with
normal mode, but how large, I'm not sure (the DosSetFilePtr() function is
only useful with 2GB drives, however, since the offset parameter is a
signed long integer).

2)  Open the drive as a file, like above, but just to get a handle (pointer
that let's OS/2 know what opened device you're referring to).  Use
DosDevIOCtl() with category 0x08 functions to read the drive via CHS values
(cylinder, head, sector).  The head, cylinder, and sector values for this
function are unsigned short integers, so the size limit is 2^48 sectors
(128KTB), beyond the limit of the PC partitioning scheme (2^32 sectors or
2TB).  A category 0x09 DosDevIOCtl() call can be used to read the physical
drive, after using another DosDevIOCtl() call to get a physical drive
handle.  The only real difference between the two is what the
cylinder/head/sector values are relative to.  For category 0x09 calls,
they're relative to the beginning of the physical drive.  For category 0x08
calls, they're relative to the beginning of the logical drive, which for
primary partitions is the physical drive, and for logical volumes is the
pseudo-drive in the extended partition that defines the logical volume's
partition.

Well, there is a third option, which is to write your own IFS (installable
file system) driver, to mimic HPFS, but use all of the drive.  That option
is at least as complicated to me as those first two are to you :)

Mike Ruskai
thannymeister@yahoo.com


... I'm not always right. Only 99.938742% of the time.

___ Blue Wave/QWK v2.20
--- Platinum Xpress/Win/Wildcat5! v3.0pr2
633/260
2501/209
* Origin: FIDO QWK MAIL & MORE! WWW.DOCSPLACE.ORG (1:3603/140)

SOURCE: echoes via The OS/2 BBS

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.