Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!apple!altos!altos86!rcollins From: rcollins@altos86.Altos.COM (Robert Collins) Newsgroups: comp.sys.ibm.pc.hardware Subject: Re: How to partition a drive on AT without drive table entry? Message-ID: <139@altos86.Altos.COM> Date: 19 Mar 91 16:36:29 GMT References: <5831@trantor.harris-atd.com> <1991Mar15.134518.10866@bwdls61.bnr.ca> Reply-To: rcollins@altos86.UUCP (Robert Collins) Organization: Altos Computer Systems, San Jose, CA Lines: 119 >In <1991Mar15.134518.10866@bwdls61.bnr.ca> coop4y44@bwdla28.bnr.ca (Takis Skagos) writes: > >>In article <5831@trantor.harris-atd.com>, sonny@charybdis.harris-atd.com (Bob Davis) writes: >>> >>> I have an AT clone for which I am trying to partition >>> an MFM drive using DOS's FDISK command. Apparently FDISK only >>> knows to assume Cylinders and Heads for the drive as those selected >>> during Setup of CMOS RAM. But there is no match of Cyls/Hds available >>> during Setup on my machine to match my hard drive. >>> Is there some way that I can partition this MFM drive without having >>> the right drive type in BIOS? Is there software available to do whatever >>> my Adaptec controller BIOS did before? > >> On my machine there is a blank entry in my drive table that >>can be set up by the user. You might want to check that out. > >Unfortunately not all machines have the user setup entry in the CMOS table, >but one way of getting your drive partitioned if you don't have a user setup >(this isn't a simple method - only do it if yoy've got no formatting and >partitioning software that will handle it) is to find someone who has a bios >with a user setup, put your hard drive into his machine, format and partition >the drive, and when your finished put the drive back into your machine. > Sorry, but I tried to stay out of these things until I see that nobody is being too helpful, or until the responses aren't the obvious solutions. As mentioned, not all BIOS's support a user-definable drive type. So upon discovery of such a feature, I wouldn't get too excited about using it unless you have a BIOS that supports this feature. Let's assume that the BIOS in question doesn't support a user-definable drive type. How then can we support this drive. There are at least two obvious solutions, but both require a minimal understanding of the role of the disk parameter table and how it is accessed. Method 1: Modify the disk drive parameter table in your BIOS. To do this you need to make a soft-copy of your BIOS. Debug is suitible for this simply by executing the following commands: -n bios.bin rbx 1 rcx 0 w f000:0 q That will write the BIOS in a disk file called BIOS.BIN. Next you need to modify the disk drive parameter table. The table is located (in every AT-compatible BIOS) beginning @ offset E401. If you wanted your drive to appear at entry #26, you would modify the table beginning at address (E401h + 26*16) = E5A1h. Each table entry has to following format (followed by an example for a Micropolis 1325a): DW MAX_CYL ; Maximum number of cylinders: 3FFh DB MAX_HD ; Maximum number of heads: 8 DW ? ; Not used 0 DW WPC ; Start of write precomp cyl: FFFFh DB ? ; Not used 0 DB CTRL ; Control byte: 0 ; bit7 = Disable retries ; bit6 = Disable retries (same as above) ; bit3 = More than 8 heads DB ? ; Not used 0 DW ? ; Not used 0 DW LZ ; Landing Zone 3FFh DB N_SEC ; # of sector/track 11h DB ? ; Reserved 0 Simply modify this table to suit your drive specifications. Next you need to checksum the BIOS. From the DOS prompt, execute the following debug script: C> debug bios.bin -m cs:100 l8000 8000:0 -m cs:8100 l8000 8000:8000 -a -mov ax,8000 -mov ds,ax -xor ax,ax -xor cx,cx -mov ds:[ffff],0 -lodsb -add ah,al -loop $-3 -neg ah -mov ds:[ffff],ah -int 3 - -g -rbx 1 -rcx 0 -w 8000:0 -q This routine will calculate and modify the BIOS checksum. Now all you need to do is burn the ROM(s). If you BIOS is two ROMs then you will need to split the file into even and odd components. Then find an EPROM burner and burn your ROMs. Method 2: If you can't do method 1 for any reason, then here is an alternate method. INT41 and INT46 are pointers to your current hard drive parameter table entries. INT41 points to device 80's table, and INT46 points to device 81's table entry. If you had drive type 26 selected for device 80, then INT41 would point to F000:E51A. This pointer is used by LLformat routines to get the parameters used to format the drive. So, you can write a very simple TSR that has a resident portion in memory with a hard drive parameter table entry in it. The initialization code for the TSR simply changes the INT41 (or INT46) vector to point to the data table. Upon powerup you set the BIOS drive type to the closest one that fits your drive (less cylinders, but same number of heads). Execute the TSR, and LLformat the drive. Now put the TSR in your AUTOEXEC.BAT file. Since you chose a BIOS entry that is close to your drive, you will be able to boot from the drive. Furthermore, since you executed the TSR upon booting you will have no software incompatibilities with programs that uses the drive parameter tables. -- "Worship the Lord your God, and serve him only." Mat. 4:10 Robert Collins UUCP: ...!sun!altos86!rcollins HOME: (408) 225-8002 WORK: (408) 432-6200 x4356