*BSD News Article 16328


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!constellation!convex!convex!convex!cs.utexas.edu!uunet!psgrain!ee.und.ac.za!tplinfm
From: barrett@lucy.ee.und.ac.za (Alan Barrett)
Newsgroups: comp.os.386bsd.questions
Subject: Re: NetBSD and DOS coexistence ?
Date: 20 May 1993 13:48:24 +0200
Organization: Elec. Eng., Univ. Natal, Durban, S. Africa
Lines: 88
Message-ID: <1tfr68$f4b@lucy.ee.und.ac.za>
References: <1993May15.164807.15131@alf.uib.no> <1t5kqp$mh4@lucy.ee.und.ac.za> <1993May16.212102.6346@fcom.cc.utah.edu>
NNTP-Posting-Host: lucy.ee.und.ac.za

Well, after several days' delay, I have finally got around to going through
this carefully.

In article <1t5kqp$mh4@lucy.ee.und.ac.za>,
I wrote:
> I have been unable to get NetBSD to work with its disk label anywhere
> other than in the second physical sector.  The docs suggest that one
> should be able to set aside a partition with type 0xA5, and have NetBSD
> keep its disk label in the second sector of that partition, but it
> doesn't work for me.

In article <1993May16.212102.6346@fcom.cc.utah.edu>,
Terry Lambert <terry@cs.weber.edu> (A Wizard of Earth C) replied
with a long description of what looked like a complicated process, but
turned out to be only trivially different from what I had already
tried, without success.

> 3)	Translated geometries are "different".  You still need a calculator,
> 	but you also need a piece of paper and a pen.  Then you need to do
> 	the following:
> 
> 	c, h, s :	untranslated geometry, as reported during boot.

In my case (Maxtor 7120 drive), c=1024, h=14, s=17.  (and c*h*s = 243712)

> 	c', h`, s':	translated geometry, as reported by int13 ah=8
> 			or ide_conf.exe or pfdisk.exe..

In my case, c'=900, h'=15, s'=17.  (and c'*h'*s' = 229500)

> 	Dc:		Number of cylinders (using the translated geometry)
> 			reported by fdisk/pfdisk under DOS (1c).

I think that what is really wanted is the number of the first cylinder
available for NetBSD, which in my case is 501.  My DOS partition is in
fact slightly less than 501 cylinders, because 1 sector is used by the
partition table and several sectors are wasted between the partition
table and the start of the DOS partition.

> 	The calculations:
> 		Total_translated_cylinders = ( c * h * s) / ( h' * s')

In my case, (1024 * 14 * 17) / (15 * 17) gives 955 and some change, so
truncate it to 955.  (This is the only difference that I could find
between what I had already done and what Terry described; I had used
Total_translated_cylinders = c' = 900, but I don't see why that should
make any difference other than to deny me the use of the last 55
translated cylinders.)

> 		Total_translated_sectors = Total_translated_cylinders * h' * s'

In my case, Total_translated_sectors = 224525 (or 229500 when calculated
my old way).

> 		Total_translated_offset_sectors = Dc * h' * s'

In my case, Total_translated_offset_sectors = 127755

> 		Total_386BSD_translated_sectors =
> 		  Total_translated_sectors - Total_translated_offset_sectors

In my case, 115770 (or 101745 when calculated my old way).

> 	yield the information necessary for the disklabel for the 386BSD
> 	install after the DOS install.

Fine so far, and the install process writes the disk label in
translated cylinder 501, head 0, sector 2, as expected.  However, a
subsequent attempt to copy the kernel from the kernel copy disk fails,
with mount complaining about a missing or invalid disk label.  Sorry, I
don't remember the exact error messagei, and I haven't tried it again
recently because my system now works with a partition table that fools
NetBSD into storing the disk label in the physical second sector.

As I mentioned before, I did some reading of the sources and could not
immediately see what was wrong.  As far as I could tell from the
sources, all accesses to the disk label were using the info in the
partition table to help them decide where to look, and I am sure that I
had the correct translated cylinder, head and sector numbers in the
partition table, but something wasn't right.  The only think I did
differently from Terry's explanation was to use 900 instead of 955
total_translated_cylinders, so my disk label is wrong in that respect
(and I still haven't fixed it), but I don't see why having extra
inaccessible space at the end of the disk should make a difference.

--apb
Alan Barrett, Dept. of Electronic Eng., Univ. of Natal, Durban, South Africa
RFC822: barrett@ee.und.ac.za