[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GBBS Dies - L&L Gives Up



In article <ulan.755109443@ee.ualberta.ca> ulan@ee.ualberta.ca (Dale Ulan) writes:
> 
> I've just finished getting an IDE hard drive installed in my
> ][+. I wrote up a quick boot PROM, which loads the first sector
> in at $0800 and starts running at $0801 if the first byte matches
> the checksum of the 512 byte sector (yea, I know... sectors should
> have 256 bytes.... the drive spits out 512 though.) :-)

If you are going to auto-boot like an Apple drive, you should follow
the Apple standards for this.

On a 5.25" disk, the first byte in track 0, sector 0 specifies how many
sectors need to be read from track 0 before jumping to location $0801.
This is normally $01.  [Note: if you set this to a higher value, the
sectors will be read in physical sector order, which is not what is
expected by either DOS 3.3 or ProDOS.]

On other types of disk, the first byte of block 0 is used to determine
if the disk is formatted.  If it contains $00, then the disk is not
formatted and the boot code in the card should resume the autostart
ROM's boot scan from the next slot.

If the byte contains $01, the block is valid and you should jump to
$0801.

You should be using 512-byte blocks.  The only Apple II operating
system which uses 256-byte sectors is DOS 3.3, and it is obsolete (and
can't support disks larger than 400k anyway).

Unless you intend to write your own operating system, I suggest you
stick to ProDOS in the meantime.  Supporting ProDOS should be
reasonably easy.

> Any suggestions on what to put in that first sector? An IDE hard
> drive isn't really 'standard' as far as I can tell... everyone
> else in this newsgroup seems to use SCSI... And what do I do
> about the fact that I can have differing capacities of hard drives
> attached to the controller?

Hm, tricky.  If you want to use more than 32 megabytes of your drive
from ProDOS, you'll have to implement a partitioning scheme.

You should probably stick to an existing one.  I don't know if
documentation is available for the PC's partitioning system, but that
seems most appropriate (since you're using IDE drives).

You could emulate Apple's SCSI partitioning system, but existing SCSI
support software won't work with your card, so you'll have to write
your own partitioning utility anyway.

If you are prepared to limit yourself to 32 megabytes in the meantime,
here is what I suggest:

1. Your card's EPROM should contain all the code required to read and
write the drive, and do a soft format.

2. You should implement a ProDOS block driver.  This is documented in
the ProDOS-8 Technical Reference Manual.  You must provide STATUS,
READ, WRITE and FORMAT routines (format doesn't have to do anything if
you can't do a low-level format on the drive).  If you implement this
properly, then ProDOS will automatically recognise your drive.

3. Ignoring partitioning considerations for the moment, map the
sectors on the drive so that Cylinder 0, Sector 0, Side 0 appears as
ProDOS block 0 and contains the boot code (written to the drive by
standard ProDOS formatting utilities).  Subsequent sectors can be
mapped in whatever way suits you.

You should be able to interrogate the drive to determine its capacity
and emulated number of cylinders, sectors and heads.


If you want to implement a partitioning scheme, then it must be
transparent to ProDOS.  The only way to implement this properly is to
have RAM on the interface card which holds the partition table from
the drive.  The partitioning should be read by the boot code.
Accesses through the ProDOS driver should refer to a particular
partition, which will start at a given offset into the disk.


If you want to discuss this further, I suggest we move to the
comp.sys.apple2.programmer newsgroup, or go to E-Mail.  I'll be happy
to help in any way I can.
-- 
David Empson                                                               
dempson@swell.actrix.gen.nz                                                
Snail mail: P.O. Box 27-103, Wellington, New Zealand