Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 May 1999 15:15:35 -0400 (EDT)
From:      Larry Baird <lab@gta.com>
To:        freebsd-small@freebsd.org
Subject:   Re: 4MB DiskOnChip
Message-ID:  <199905101915.PAA12420@gta.com>
In-Reply-To: <37320638.FB5D8844@gta.com> <99050817043500.00291@babsi.tu-graz.ac.at>

next in thread | previous in thread | raw e-mail | index | archive | help
In article <99050817043500.00291@babsi.tu-graz.ac.at> you wrote:
> Am Do , 06 Mai 1999 schrieb Larry Baird:
>> Has anyone had any luck booting from a 4MB diskOnChip using FreeBSD
>> 3.1.0?
>> 

> Yes, It works fine.
Yes it works fine with a few caveats (-:.   Hopefully somebody out there
can help me understand the things I have almost figured out.
If you use the 'c' partition everything works without a hitch.

If you create multiple partitions and use the 'a' partition things get
a bit strange.  If the 'a' partition is less than 4096 blocks in size
everthing works fine.  If the 'a' partition is larger than 4096 blocks
you must take care with how you put files onto the disk.   I'll come back
to this in a bit.

The disk geometry that the DiskOnChip firmware driver maps into CMOS
is a bit strange.  The second stage of the boot uses standard bios int13
functions to do all disk I/O.  

Using the int13 function 0x8 to determine the geometry for the disk gives:
     heads (maximum heads) - 2
     spt (sectors per track) - 2
     maximum cylinder - 9

>From the above values the calculation for spc (sectors per cylinder) is:
    spc = spt * heads = 4

The maximum number of blocks for a 4MB DiskOnChip is 7888.  This number
comes from Paul-Henning's driver.

Now say we want to read the block 7000 using int13 function 2.   This
function expects the access to be in terms of cylinder, head, and sector.   
So dividing 7000 by spc gives us a cylinder of 1750.   This value causes
problems from two perspectives.  The first being that it is greater than
the maximum of 9 from above.  It is also greater than the maximum cylinder
supported by int13 function 2 of 1023.

From experimentation I have determined the following:

In the 'c' partition case disk blocks are allocated from the beginning
of the partition.

In the 'a' partition case disk blocks are allocated from the end
of the partition.

So to boot off the 'a' partition make sure that loader and kernel are
the last things you write to the 'a' partition.   I have no idea why
the two partitions act differently. Does anybody have a clue?

Thanks for your time,
Larry


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-small" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199905101915.PAA12420>