*BSD News Article 7049


Return to BSD News archive

Path: sserve!manuel.anu.edu.au!munnari.oz.au!spool.mu.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!swrinde!news.dell.com!math.utexas.edu!ut-emx!ccwf.cc.utexas.edu
From: stew@ccwf.cc.utexas.edu (Stewart Lilley)
Newsgroups: comp.unix.bsd
Subject: Re: Finding untranslated params for IDE drives (w/ pgm)
Summary: How to install both 386BSD and DOS on an IDE drive (instructions)
Message-ID: <82287@ut-emx.uucp>
Date: 24 Oct 92 19:16:28 GMT
References: <1992Oct18.153007.28120@crash> <1992Oct19.053131.11296@tfs.com> <1992Oct19.173418.10490@fcom.cc.utah.edu>
Sender: news@ut-emx.uucp
Organization: The University of Texas at Austin, Austin TX
Lines: 186

To everyone who has been pulling their hair out trying to install both
BSD386 and DOS on their hard drive, and has been trying to figure out
this long discussion about translation, BIOS, booting, etc., here's
help.  I have a Connor 120 IDE (114MB formatted capacity- not big enough :)
and AMI BIOS - apparently this is one of the worst combinations for
installing 386BSD.  I tried many, many different things and started
over numerous times, but I finally got it to work and I believe this
procedure will work for others as it overcomes the translation
problems by putting 386BSD right at the start of the disk.  In this
post I give explicit examples of what I did, so you can do likewise
on your system without having to figure things out from scratch like
I did.  The numbers I give are valid for my system only, unless you
also have a Connor 120 and want a 32MB DOS partition your numbers
WILL BE DIFFERENT.  I certainly hope this procedure will work for
everyone, but I can't guarantee it as I'm still learning (a week ago
I hadn't even heard of 386BSD).  It worked for me; your mileage may
vary.  If anyone knows of a good deal on a larger hard drive (330 or
540 would be nice) or has one that could use a new home, please let
me know.  I don't even have enough room to extract all of the utilities
much less the source and the X stuff.

1.  Low-level format the disk from the CMOS SETUP.  Obviously, save any
    of your DOS stuff you don't have on disk and want to keep.
2.  Boot off of the dist.fs floppy (I used the unpatched ones in the
    /pub/386BSD/386bsd-0.1/bootables directory on agate.berkeley.edu)
    and run the install program: tell it to use your whole disk.
3.  After install has done its installing, shutdown and boot off of the
    fixit.fs floppy.  Make the floppy writable with mount -u /dev/fd0a /
    and run this command:  disklabel -r wd0 > /tmp/dlwd0.  (don't type
    the period)  You may get an error message about the filesystem
    being full and not creating the file.  I got this message every
    time I tried to write to the floppy, but the writes seemed to work
    anyhow.  Basically, ignore it.  I was using 3.5" disks.
4.  Use vi to look at the file /tmp/dlwd0.  It should have information
    about your disk and how it's partitioned.  Some people have posted
    about using your drive's "native geometry."  I didn't change a
    thing in the CMOS parameters.  I think that my drive IS translated,
    but since you're installing BSD at the beginning of the disk it
    still works translated.
5.  Looking at the file /tmp/dlwd0, you should first check to make sure
    that the heads, sectors, cylinders, and other physical information
    agrees with the parameters in the CMOS.  This was not a problem
    for me if I installed BSD first on a clean low-level formatted
    drive: otherwise it would be corrupted.  Figure out how much room
    you want for DOS:  I gave it 32MB.  using the "sectors/cylinder"
    information, turn this into a number of cylinders, then round up.
    Now multiply by the "sectors/cylinder" to get a number of sectors
    to allocate to DOS that will start and end on a cylinder boundary.
6.  Your disklabel should have three partitions: a, b, and c.  For my
    drive it looked like this:

[other parameters]
bytes/sector: 512
sectors/track: 32
tracks/cylinder: 9
sectors/cylinder: 288
cylinders: 813
[other parameters]
3 partitions:
a:	223488		0	4.2BSD	1024	8192	16
b:	 10000	   223644	unused	   0	   0	 0
c:	234144		0	unused	   0	   0	 0

the 'a' partition is your file space, the 'b' partition is your swap
space, and the 'c' partition represents your entire 386BSD space.
What I did: 32MB for DOS / ( 288 sectors/cylinder * 512 bytes/sector)
= 227.5555 cylinders for DOS (remember that 1MB = 1048576 bytes).  Make
this 228.  Subtract this from 813 (the total number of cylinders on the
disk):  813 - 228 = 585.  Therefore DOS should start at cylinder 585
and continue for 228 cylinders to the end of the disk at cylinder 813.
That means 386BSD must end at cylinder 584.  Just to be safe I put a
cylinder of free space between them, so my 386BSD ends at cylinder 583.
that means the 'size' entry in partition 'c' should be: 583 cylinders *
288 sectors/cylinder = 167904 sectors.  So I changed that entry to
167904.  Next I rounded the swap space to an even number of cylinders:
35 cylinders = 10080.  If the swap space ends at 167904 and is 10080
sectors long, it must have an offset of 167904 - 10080 = 157824.  I
put 10080 and 157824 in the 'size' and 'offset' fields of partition
'b'.  By similar reasoning, the 'a' partition must end where the swap
partition starts, so it must be 157824 sectors long: I put this in the
'size' field.  Also, if the 'type' field of partition 'b' does not
read 'swap', change it to do so.

7.  Do a :wq to exit out of vi.  Due to the filesystem problem, vi
    keeps putting messages about not being able to write to the disk
    on the screen at inappropriate locations.  Just do a CTRL-L to
    get your normal screen back.  It also warns you that it was
    unable to write to the file when you exit.  These warnings are
    just bogus: for me it wrote the file just fine.  If you're not
    sure whether vi properly saved the changed file, just use cat to
    display it.
8.  You should now have a /tmp/dlwd0 file that contains what your
    disklabel should be.  However, the dist.fs disk install program
    has already messed up everything, so do a shutdown and use your
    CMOS setup to low-level format your disk again.  You may be
    tempted to boot off of the dist.fs disk and try the 'install'
    again after fixing the disklabel, which you're about to do:
    let me warn you that I tried many different ways of using that
    intall program and whereever or however I tried it, it just
    messed things up where I had to go back and start over.  The
    only exception to this was when I started from scratch and gave
    it the whole disk.
9.  Boot from the fixit.fs floppy and issue this command:
    disklabel -R -r wd0 /tmp/dlwd0 /usr/mdec/wdboot /usr/mdec/bootwd
    this will put the right disklabel on the disk and install the
    bootstrap programs.  Type 'sync' to make sure that the changes
    are written immediately.
10. Use the newfs command to initialize the 'a' partition:
    newfs /dev/rwd0a
11. (from here on it's in the FAQ)  mount the 'a' partition under
    /mnt:  mount /dev/wd0a /mnt
12. Use cpio to copy the contents of the fixit floppy to the hard
    drive:
    cd /
    ls | cpio -pdalmu /mnt
    cd bin
    ls | cpio -pdalmu /mnt/bin
    cd ../sbin
    ls | cpio -pdalmu /mnt/sbin ....
and keep doing this, cd to each directory, working your way down the
directory tree, and at each directory do the ls | cpio -pdalmu to the
corresponding directory under /mnt.

13. cp /usr/distbin/mount /mnt/mount
    cp /usr/distbin/umount /mnt/umount
14. Shutdown and reboot off the hard drive.
15. Do an  fsck -p /dev/rwd0a  to make sure the filesystem is correct.
16. Make the hard drive writable with mount -u /dev/wd0a /
17. Insert the dist.fs floppy and  mount /dev/fd0a /mnt
18. cd /mnt  and issue this command exactly as shown:
    usr/bin/zcat etc/baselist.Z | usr/bin/cpio -pdalmu /
19. cd/  and issue this command exactly as shown:
    /mnt/usr/bin/zcat /mnt/etc/baseutils.cpio.Z | /mnt/usr/bin/cpio -idalmu
20. umount /mnt
21. Shutdown and reboot from the hard drive.
22. Copy the bindist files (bin01.*) to /tmp.  First cd /tmp, then
    for each floppy do:  mread "a:*.*" .  (type the period)
23. When this is done, cd /, and issue this command:
    cat /tmp/bin01.* | uncompress | cpio -idalmu
24. Put your hostname in the file /etc/myname.
25. Use vi to make the file /etc/fstab:  It should look like

/dev/wd0a	/	ufs	rw	1	1
/dev/wd0b	/	ufs	sw	1	2

This file tells the system how to mount the partitions at bootup.

26. vi the file /etc/disktab and find the entry that corresponds to
    the message you get at boot time that tells you what kind of
    hard drive BSD thinks you have (my drive is a Connor 120, BSD
    thinks I have a Quantum 120, it seems to work just fine).  Set
    the partition parameters to be the same as the ones you put in
    the disklabel (the disktab file has a bunch of comments that
    tell you exactly which parameters you need to change).
27. Shutdown and reboot off the hard drive: the auto-reboot should
    take over and you'll be asked for a login- just login as root,
    no password.  Congratulations, you now have BSD386 installed
    and working on your hard drive!
28. Now you need to get DOS working.  Use the Norton Utilities (nu)
    and edit absolute sector, drive C:, the first sector on the disk.
    this is the partition table, and it should be blank.  Make an
    entry of type BIGDOS, bootable, starting and ending at the right
    places.  For my case this was:

System	Boot	Side	Cyl	Sec	Side	Cyl	Sec	Rel	#
BIGDOS	 Y	  0	585	  1	  8	813	 32   168480  65952

Now boot from the MS-DOS distribution floppies.  MS-DOS should find
this partition, format it, and install in it just fine.



Any comments, corrections, or suggestions are welcome.  If you have
questions, or if this doesn't work for you, I suggest you talk to
someone more knowledgeable about 386BSD than I am.
  
-- 
**********************************************************************
* Stewart Lilley          *  The meek shall inherit the earth:       *
* stew@ccwf.cc.utexas.edu *  the rest of us will head for the stars. *
**********************************************************************
-- 
**********************************************************************
* Stewart Lilley          *  The meek shall inherit the earth:       *
* stew@ccwf.cc.utexas.edu *  the rest of us will head for the stars. *
**********************************************************************