Path: utzoo!utgpu!water!watmath!clyde!att!pacbell!ames!pasteur!ucbvax!decwrl!purdue!gatech!udel!mmdf From: Leisner.Henr@xerox.com (marty) Newsgroups: comp.os.minix Subject: Re: DOS[READ\WRITE\DIR] on hard disk Message-ID: <2649@louie.udel.EDU> Date: 20 May 88 13:43:29 GMT Sender: mmdf@udel.EDU Lines: 34 I'm currently trying to do a rewrite of dos[dir/read/write] to handle hard disks. The first thing I did was have the argument specify the block special device (/dev/fd0 instead of 0). However, it seems hard disks are a major pain. In order to compute the fat size, there is this mega-equation in the DOS tech reference manual, based on some generic system parameters and the number of sectors in the partition. So I need a way to determine sectors/partition. The algorithm would have to look something like: if(floppy disk) if(360K floppy) do 360k floppy if(1.2 meg floppy) do 1.2 meg floppy else /* hard disk */ figure out sectors for this partitions (somehow) check first fat entry for hard disk partition ID do good stuff end I suppose the major device numbers could be examined to determine floppy/hard disks. But in multiple hard disk systems, how would the boot block be read in? Or is there a better way to determine number sectors/drive? Seek off the end? Then divide the offset by SECTOR_SIZE? marty ARPA: leisner.henr@xerox.com GV: leisner.henr NS: martin leisner:henr801c:xerox UUCP: nsc!nscimg!amps!marty