Subject: Re: Hardware Project From: david@uow.edu.au (David Wilson) Date: Wed, Nov 11, 1998 15Ç33@ Message-id: "Terence J. Boldt" writes: >Write the controlling code for it and squeeze it into 256 bytes. Make it >work with ProDOS. >I need to know how ProDOS accesses a block device for read and write. I >know about all the ID and info bytes required in ROM (thanks Dave Wilson), >but what do I need to handle as far as calls from ProDOS to my card? Cn01 20 Cn03 00 Cn05 03 Cn07 00 If Smartport, bootable on enhanced //e and //gs 3C If not Smartport and bootable on ][+, //e and //gs. other bootable only on enhanced //e and //gs CnFC/D XXXX total blocks on disk 0000 if STATUS call will return # of blocks CnFE XX status byte bit 7 removable medium bit 6 device is interruptable bits 5 & 4 number of volumes supported (0..3 according to Apple docs - I think that this represents 1..4) bit 3 device supports FORMAT bit 2 device supports WRITE bit 1 device supports READ (must be set) bit 0 device supports STATUS (must be set) CnFF XX low byte of entry point to driver 00 Disk II with 16 sector ROM - internal driver used FF Disk II with 13 sector ROM - not supported The first 4 bytes listed above can be taken care of by: Cn00 CMP #$20 CMP #$00 CMP #$03 CMP #$3C The driver code is passed the following: 0042 command 0 = STATUS, 1 = READ, 2 = WRITE, 3 = FORMAT 0043 unit# bit 7 drive (0 = 1st, 1 = 2nd) bits 6-4 slot # bits 3-0 unused 0044/5 buffer pointer to 512 byte buffer 0046/7 block# number of block to read/write, ignored for status/format The return status is in the A register and carry is set if an error occured. Errors such as I/O Error ($27), No Device Connected ($28) and Write Protected ($2B) should be implemented. If you support 3 or 4 volumes then the card has to go in slot 5 and you have to handle being passed calls for slot 2 (by adding 2 to the drive number passed in $43). To have a bootable card, the code starting at Cn00 should load block 0 of drive 0 into memory at $0800. If this succeeds, check that $0800 contains a $01. If so, jump to $0801. If any of this fails, put a message up on the screen saying so. If you want to be really nice you can jump back to SLOOP in the monitor (after adjusting the slot number) and the system will keep scanning for a bootable device. -- David Wilson School of IT & CS, Uni of Wollongong, Australia david@uow.edu.au