From: Stephen Wong S M (a080700@hp9000.csc.cuhk.hk)
Date: 08/06/93


From: a080700@hp9000.csc.cuhk.hk (Stephen Wong S M)
Subject: Re: Why is there a 1024 cylinder limit in Linux.
Date: Fri, 6 Aug 1993 08:51:59 GMT

In article <1993Aug3.140714.7910@rcn.mass.edu> jprater@rcnvms.rcn.mass.edu writes:
>
> If there the limitation is in BIOS then I have three questions,
>
> 1) Why does BIOS work with a drive with 1224 cyl, I can format and
> and run test and even install dos on it (I has to be partitioned,
> but it still works)

Your BIOS works with 1224 cyl drive, doesn't mean your BIOS KNOW your
drive has 1224 cyl. There are lots of drive that can fool the stupid
BIOS by remapping cyl > 1024 to extra heads and sectors per track. The
trick works with BIOS, and it should work with linux also, as long as
linux doesn't probe the drive for ACTUAL configuration.

> 2) Why is this drive type in the default table for BIOS, type #46

Type > 16 is not defined in the original IBM PC BIOS, and therefore,
what type 46 means will depend on BIOS implementation, perhaps type
46 is a user defined type, ie. let user to set whatever configuration
of the drive.

> 3) I still don't understand why Linux kernel should have this limit,
> it should just take the values from BIOS and build the appropriate
> model. It has to resources to do it. It claims to be a real 32bit
> OS not a 8bit one. (Flame not intended, I'm just frustrated)

Linux is a real 32-bit OS, but wait a minute, before linux is loaded into
your RAM, the stupid real mode BIOS is responsible to load linux from
disk. The process to load linux from disk actually requires 2 steps.
They are 1) initial boot program (I'm not sure the official naming!), 2)
load kernel image by initial boot program. The BIOS of course will use
BIOS to load the initial boot program, AND the initial boot program still
uses the BIOS to load the kernel image from disk. That's why the complete
kernel image has to be within 1024 cyl. After the kernel image is loaded,
CPU will go into protected mode, and the device driver inside kernel is
intelligent enough to handle cyl > 1024. That's why other files can reside
outside 1024 cyl.

You may ask why the initial boot program should use BIOS to access disk
instead of building in superior disk handler. The answer is to reduce the
size of that program, which has a small size limit, and definitely not
enough to hold all possible device drivers to work with ST506/IDE/ESDI,
Adaptec, Future Domain, Seagate ... drives.

Disclaimer: My opinion is mine, and have nothing to do with my employer.
*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*
v Stephen Wong Siu-ming v internet: stephenwong@cuhk.hk v
^ Computer Services Center ^ bitnet : a080700@cucsc.bitnet ^
* Chinese University of * phone : (852) 609-8904 *
v Hong Kong v fax : (852) 603-5001 v
*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*