From: adam@microware.com (Adam Goldberg)
Subject: Re: sector remapping woes with 1542A/SCO Unix
Organization: Microware Systems Corp., Des Moines, Iowa
Date: Tue, 21 Jul 1992 13:41:27 GMT

paul@wurtel.hobby.nl (Paul Slootman) writes:

>I have a strange problem. I recently added a SCSI controller and
>disk to my 386 system (Adaptec 1540A and Fujitsu M2249SA (I think)).
>I already have an Adaptec RLL controller with two drives in my machine.

>The problem is this: if I disable the two "standard" disks in the CMOS
>setup of the machine, the Adaptec SCSI controller properly sees the
>SCSI disk and installs it as C:. If I put DOS on it, there's no problem,
>I can boot from it, run apps, etc.: everything works ok. The SCSI BIOS
>remaps the sectors to 318 cylinders of 64 heads, 32 sectors, giving me
>318 MB, which is right.

>However, when I access it from UNIX by installing SCO Unix 3.2.2, SCO
>tells me it's a disk with 1272 cylinders, 16 heads, 32 sectors, also
>giving me 318MB. However, after installing everything, I can't boot from
>it ("NO OS").

>Some exploratory work shows me that the PC BIOS wants to load the stuff
>from the hard disk, but does this using the first translation (64 heads).
>As the partition table is written while 16 heads are assumed, the stuff
>can't be found, and the bootstrap fails.

Perhaps some background would be helpful:

Because DOS relies on head/cylinder/sector information in the partition
table (and the BIOS relies on it to load the bootstrap(s)), and because
SCSI disks don't exactly have heads/cylinders/sectors (they just have
sectors/blocks numbered 0..n), the Adaptec *real mode ROM/firmware* 
takes the blocks numbered 0..n, and (logically) chops it up into 64
heads, 32 sectors and M cylinders (where M is the size of the drive,
in Mb, rounded down).

This is good, IMHO, because it allows standard BIOS disk access to work
with the SCSI drives, while allowing up to 1G drives (1024 cylinders) without
special drivers.  However, since the Big Ugly Monster of DOS defined the
partition table without SCSI-foresight, the partition table must be
in terms of these logical 64 head/32 sector cylinders.  

But, this poses a (slight) problem to protected-mode OSs (ie, every real
OS <plug>), because the *real mode ROM/firmware* cannot be used in 
protected mode.  Moreover, even if you could use it, you wouldn't want 
to--the firmware is inherently single-threaded and cannot do background
transfers.  

So what you have is a disk partitioned in terms of 1Mb logical cylinders,
but to a PM OS, all you have is a disk with N sectors.  The OS must
realize that the partition table only 'sees' the logical cylinders and
deal with the partition table in that manner.

For some reason, Paul's Unix doesn't seem to realize that.  There is
no difference (from a software point of view) between the 154{0,2}{a,b},
therefore SCO is doing something really screwy.

There must be an option to SCO to force it to look at the partition
table as 64h/32s cylinders.  I can't imagine that you should even NEED
to do that.

But nevertheless, the problem remains.  Perhaps Paul should try to use
a sector editor (or something like Norton Utils DISKEDIT) to create
the Unix partition manually, then NOT CHANGE IT AT ALL with the SCO
partition-table editor.  Maybe that'd work.
-- 
Adam G.
adamg@microware.com, or ...!uunet!mcrware!adamg
The above is not to be construed in any way as the official or unofficial
statements of Microware, or any of it's employees.