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

Re: Apple ][ using PC floppy



On Dec 28, 9:34 pm, vladitx <vlad...@nucleusys.com> wrote:
> Only one question arises - is this
> routine checking the block bounds for sanity, or is used when creating
> a new volume?

This is just a sanity check on READ/WRITE calls. The Disk II routine
does not implement FORMAT.

> When a new logical volume is to be created on enlarged
> Disk ][ it has to have this information written in the right place of
> the file system (ProDOS equivalent to "superblock").

Yes. The following blocks would be initialised:

0000 Boot block
0001 SOS boot Block (no longer used)
0002
.... 4 block volume directory (13 files per block less 1 for volume
gives 51 file limit)
0005
0006..00nn bit map of free blocks (4096 bits/block means 16 blocks is
enough for largest ProDOS volume (32MB))

To create a volume you need to do two things - low level track format
to create the raw blocks to be used by the filesystem and root
directory plus bit map creation (plus boot block initialisation for
bootable disks) which in the case of Disk ][ drives are done by the
same program {on 3.5" drives the low level format is done by a call to
the 3.5 ROM firmware). In the early days of ProDOS, you used the FILER
application to create a new disk and it also needed a single byte
patch to upgrade it from 35 to 40 tracks (if you had a mixture of
drives on your system you could have FILER and FILER40 and use
whichever one you required for the particular drive).

> As to the comparison, what about something like this:
>
> ; on entry A=LSB of block number
>     LDX $D356 ; get MSB of block #
>     CPX #$03
>     BCS X
>     CMP #$80
> X: RTS

BCS can be looked at as BHS - Branch Higher or Same. So that would
test the LSB only if MSB < 3 whereas we want it tested only if MSB ==
3.

I think you need to do:

    LDX $D356
    CPX #$03
    BNE DONE     ; carry clear for 00..02, carry set for 04..FF
    CMP #$80      ; carry clear for 00..7F, carry set for 80..FF
DONE
    RTS

That worked out much simpler than I expected.My original routine was
longer. It is the same as yours with only the branch changed. I must
do a timing analysis on this - I wonder if Apple's code is actually
slower (and less flexible) than this?

> > Finally, as the Disk II driver does not implement a FORMAT routine,
> > you will need to either modify an existing ProDOS disk formatter or
> > write your own to format these larger disks.
>
> I was thinking about using Locksmith 6.0 "16-sector Utilites" ->
> "Format". It allows to specify start/end tracks, physical and logical
> increment.

That may do the low level format but it will not create the volume
directory and free bit-map ProDOS requires.

> If the efforts of using the additional 80 - 35 = 45 tracks is too big,
> they can just be well ignored.

So far it looks like no trouble at all. I will have to check out the
code in FILER and see if the same mod works there.

P.S. My first IIe was a clone made by Multitech - the MPF-III. It has
a 40 track 1/2 height 40 track direct drive FDD with an adapter board
that converts the Apple 20 pin bus into the standard 34 pin bus. It
uses a couple of one-shots and a PAL to do the conversion.

P.P.S. If you want to use the full 400KB for DOS, why not make sectors
16..31 use the second head of the double sided drive?