[comp.os.msdos.programmer] 1024 byte sectors

dmurdoch@watstat.waterloo.edu (Duncan Murdoch) (12/10/90)

A program I've written (SHOWFAT) seems to die when it sees 1024 byte secctors
on other people's machines.  I'm trying to set up a ramdisk with big sectors
on my machine to see what's going on, but am having no luck.

The RAMDRIVE.SYS programs that come with DOS 3.2 and 4.01 both give an
option for 1024 byte sectors, but DOS always refuses to load them with
that option.  The error message is explained in the DOS 4.01 manual as:

------
Sector size too large in file filename
[MS-DOS]
The specified device driver loaded by config.sys uses a sector size larger
than that of any other device driver on the system.

You cannot run this device driver.
-----

Can anyone tell me how to get around this stupid error?

Duncan Murdoch
dmurdoch@watstat.waterloo.edu

ekalenda@cup.portal.com (Edward John Kalenda) (12/11/90)

The only way I've ever seen to do this is to have a disk on the system which
has been formatted with 1024 byte sectors. Before DOS loads your drivers,
it allocates the space for the disk cache buffers based on the largest
sector size found so far on the hard disks in the system. Floppys are
assumed to have 512 byte sectors regardless of reality. Some OEM versions
of DOS can only handle sector sizes of 512 and smaller.

I can't even think of a way to cheat on this one since you HAVE to get 
DOS to allocate 1024 byte buffers. I guess you'll need to get or borrow
at 1024 byte sector hard drive. Your format utility may let you do it to
your present disk but would you risk it?

Ed
ekalenda@cup.portal.com

Ralf.Brown@B.GP.CS.CMU.EDU (12/11/90)

In article <1990Dec10.144757.15032@maytag.waterloo.edu>, dmurdoch@watstat.waterloo.edu (Duncan Murdoch) wrote:
}The RAMDRIVE.SYS programs that come with DOS 3.2 and 4.01 both give an
}option for 1024 byte sectors, but DOS always refuses to load them with
}that option.  The error message is explained in the DOS 4.01 manual as:
}
}------
}Sector size too large in file filename

The problem is that DOS allocates the disk buffers BEFORE loading in any
installable device drivers, and disk buffers must be the size of the largest
sector size of any device.  Since the built-in drivers all use 512-byte
sectors, the 1024-byte sector driver can't be installed.

You need to patch two bytes in IBMDOS.COM/MSDOS.SYS.  First, issue an INT 21h
with AH set to 52h.  On return, BX is the offset into IBMDOS.COM of the
"list of lists".  The word containing the maximum sector size is 11h bytes
further into the file for DOS 2.x and 3.0, and 10h bytes further for DOS 3.1
to 4.0x.  Set those two bytes to 00h 04h and away you go....

There is one significant drawback to using 1024-byte sectors: your disk
buffers use up twice as much space, half of which is wasted on every drive
except the one with the large sectors.

--
UUCP: {ucbvax,harvard}!cs.cmu.edu!ralf -=- 412-268-3053 (school) -=- FAX: ask
ARPA: ralf@cs.cmu.edu  BIT: ralf%cs.cmu.edu@CMUCCVMA  FIDO: 1:129/3.1
Disclaimer?    |   I was gratified to be able to answer promptly, and I did.
What's that?   |   I said I didn't know.  --Mark Twain