*BSD News Article 8111


Return to BSD News archive

Newsgroups: comp.unix.bsd
Path: sserve!manuel.anu.edu.au!munnari.oz.au!news.hawaii.edu!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!hamblin.math.byu.edu!news.byu.edu!ux1!fcom.cc.utah.edu!cs.weber.edu!terry
From: terry@cs.weber.edu (A Wizard of Earth C)
Subject: [386BSD] HOW TO PUT DOS ON SAME DRIVE (Was: We need a collective...)
Message-ID: <1992Nov26.002531.6395@fcom.cc.utah.edu>
Keywords: 386bsd DOS coexist hard harddrive drive second
Sender: news@fcom.cc.utah.edu
Organization: Weber State University  (Ogden, UT)
References: <1992Nov25.090447.2950@sol.cs.wmich.edu>
Date: Thu, 26 Nov 92 00:25:31 GMT
Lines: 145

In article <1992Nov25.090447.2950@sol.cs.wmich.edu> gray@sol.cs.wmich.edu (Curtis Gray) writes:
>It is quite obvious to me that, on way to many cases, 386BSD and DOS cannot
>coexist on the same drive. This is frustrating as there are many of us who have
>spent countless hours backing up our large harddrives (which previously had
>DOS allocated to the entire drive) only to end up with a 200 meg unusable 
>partition. If there  is some fix, or even some way to circumvent the install
>program and do manually what install was supposed to do originally, please
>drop a friendly line. The problem is that, if you have DOS in the first
>partition on your drive, 386bsd somehow loses the disk label. I am not
>familar with how to make another disklabel, but it seems to work fine if the
>entire drive is dedicated to bsd. 
>
>I will compile all information I receive on the subject and, if it turns out
>to be something that all of us can use (not just my particular setup) I will
>post all of that information here for all to use.


Apparently it is absolutely impossible for some people to run in "native
geometry" mode on their IDE/ESDI drives (more of a problem on IDE, but
some Maxtor ESDI drives ...like mine... suffer from this as well.

If you are one of the stout few who refuses to run your drive in an
untranslated geometry because you fear the 300% increase in I/O speed which
can result (or other religious reasons), you CAN run 386BSD off the drive
in native mode with a *lot* of hacking to the boot code.

If I can find a way of ensuring that I only do this on translated drives,
I will release modified boot code -- otherwise, you must repeat the hack,
and no amount of begging will get me to send you my modified code that
works on the IDE drives of 386SX/WGS machines and hasn't been tested
elsewhere.  This is because the hack is ugly, inelegant, sick, and
probably won't work for you, and I don't want to support it.

So if you are *still* convinced you need to "do something other than native
mode", and have an eerie understanding of your ROM BIOS, the following
procedure may or may not work for you:



HOW TO DO IT SO IT WORKS EVERY TIME IF YOU DO IT JUUUUSSSST RIGHT:
--------------------------------------------
1)	Warning! This procedure will screw up most existing installations
	of 386BSD; you can *NOT* continue to use your already installed 386BSD
	after making this change!

2)	You *MUST* have an existing installation of 386BSD to make and compile
	this change.

3)	You *MUST* have a copy of a dist.fs disk.

4)	You *MUST* have a copy of a fixit.fs disk.

5)	You *MUST* have all sources used installed on the current 386BSD
	installation.
--------------------------------------------

1)	Using the existing code for reading the CMOS RAM (used in the boot
	code for reading the amount of memory), make code for reading the
	disk drive type.

2)	If you are using a "soft" drive type (ie: AMI BIOS), note that you
	will have to write code to read the drive parameters normally
	stored in RAM out of the CMOS as well, since 386BSD will load
	over top of this information, and it may not be initialized in
	any case (this is machine dependant).  The location of this info
	in your CMOS NVRAM is machinee/BIOS dependant.

3)	Replace the drive query code in wdboot/bootwd with your new code
	to get the cylinders/sectors/heads information.  This will cause
	the controller to remain in "translated" mode.

	a)	This will not work on older "smart" controllers, since
		the translation in the BIOS.  Buy a new controller.

4)	Replace the wdboot/bootwd on your copy of the dist.fs:

	a)	Mount the dist.fs flopy as a regular file system.
	b)	Copy the modified files to the disk.
	c)	Type "sync" -- UNMOUNTING WILL NOT AUTOMATICALLY
		CAUSE A "sync" TO BE DONE!
	d)	Unmount the disk

5)	Repeat procedure 4 with the fixit.fs copy, but also put "sync" on
	the fixit disk.

6)	Install your DOS partition.  It is recommended that you use a system
	other than your developement system, in case you made a mistake.  Use
	the DOS 5.0 fdisk's undocumented "/mbr" switch, if necessary, to
	remove the 386BSD MBR so DOS will install correctly.

7)	Install with your new dist.fs.  DO NOT REBOOT FROM THE HARD DISK!
	THE MODIFIED FILES ARE NOT THERE YET!

8)	BOOT OFF THE fixit.fs.  Using an appropriate disklabel, mount the
	hard disk (you may need to delete the text files off the fixit.fs
	to be able to edit your disklabel/disktab entry).

9)	Copy the modified code to the appropriate places on the hard drive.

10)	TYPE "sync" TO SAVE THE IN CORE BUFFERS -- AGAIN, A SIMPLE "umount"
	WON'T DO IT!

11)	Unmount the hd.

12)	Reboot from the hard drive.

--------------------------------------------

The problem is the difference between the BIOS selected drive parameters
and those reported by the controller when the disk geometry is requested.  By
NOT initializing  with the "incorrect" parameters reported by the disk drive,
you stay "in translation mode".


This has the "wonderful" side effect of reducing your disk space on
untranslated drives to the BIOS settings, since 386BSD used to be able to
use the whole thing.  So your 1056 cylinder MFM drive is back to acting
like a 1024 cylinder drive... which means you *don't* want to do this to
the boot code on good (non-IDE) hard drives unless you are punishing them
for some reason.

--------------------------------------------

If you screw up your installation and have to reinstall, or only have one
machine and have to repeat the process umpteen times to get it to work,
since you can only recompile if it's already installed, then it serves you
right for listening to such an obvious "anti-drive-translation" bigot like me.

In any case, may the DOS guy who though "10 bits is enough" and the IDE
guy who agreed with him and used translation to prove it rot in Hell.  8-).

In any case, I'm not responsible for lost work/data/etc. as a result of
following this procedure.

					Terry Lambert
					terry@icarus.weber.edu
					terry_lambert@novell.com
---
Any opinions in this posting are my own and not those of my present
or previous employers.
-- 
-------------------------------------------------------------------------------
                                        "I have an 8 user poetic license" - me
 Get the 386bsd FAQ from agate.berkeley.edu:/pub/386BSD/386bsd-0.1/unofficial
-------------------------------------------------------------------------------