>CoreNotes2 3/2/88
&40540 DiscOp *
entry
R1 bits 0-7 reason code and option bits, bits 8-31 if non zero are bits 2-25
of a word aligned ptr to an alternative disc record
R2 disc address
R3 RAM ptr
R4 length
R8 ->FileCore instance private word
exit
R0 IF V set error pointer else preserved
R1 preserved
R2-R4 adjusted to reflect amount transferred
&40541 Create
exit
R0 if error V set R0->error block else R0->FileCore instance private word
R1 address to call after completing background floppy op
R2 address to call after completing background winnie op
R3 address to call to release FIQ after low level op
the layout of the descriptor block is
offset length entry
0 3 misc flags currently all 0 bit 0 set if winnie needs FIQ bit 1 set if floppy needs FIQ bit 2 set if able to support background ops 3 1 filing system number 4 4 offset of filing system title from module base 8 4 offset of boot text from module base 12 4 offset of low level disc op entry from module base 16 4 offset of miscellaneous low level from module base
&40542 Drives *
exit
R0 default drive
R1 number of floppies
R2 number of winnies
&40543 FreeSpace *
exit
R0 if error V set r0-> error block else total free space on disc
R1 largest object than can be created
Entry Exit R0 irrelevant IF successful 0 else ptr to error block R1 reason code Unchanged R2 disc address Incremented by amount transferredR3 RAM address (or ptr to scatter list) Incremented appropriately
R4 length in bytes Decremented by amount transferredR5 disc record describing disc
V set <=> error
0 Verify R2,R4 1 Read sectors R2,R3,R4 2 Write sectors R2,R3,R4
3 Read track on floppy, Read Id on hard discs R2,R3 4 Write track R2,R3
5 Seek R2 6 Restore R2
7 Step in, floppy only 8 Step out floppy only
15 Specify, hard discs only, DESCRIPTION BELOW R2
Only reason codes 0,1,2,5,6 are essential. Seek is actually only used for park. Only reasn codes 0-2 modify R2-R4 on exit
=
((track * heads + head) * sectors_per_track + sector - x) * sectors_size + byte
x is an adjustment for defect skipping applied for reason codes 0-2 with old map hard discs, and is the number of defective sectors earlier on the disc.
bits 29 to 31
This is the drive number, 0 to 3 floppies, 4 to 7 hard discs.
R5 Disc Record
entries marked * should be 0 for old map
offset length
0 1 log to base 2 of sector size 1 1 sectors per track 2 1 heads (1 for L format floppy) 3 1 density 1/2/4 single double quad if applicable
12 4 disc address of root directory 16 4 disc size in bytes
20 2 disc id 22 10 disc name
32 4
0 1 2 0 C 0 0 0 0
| Hardware | Disc record |
|==>Defect list Specific <==| describing | | Parameters | disc |
The drivers are responsible for doing defect skipping on old format hard discs. The defect list is a word list of disc addresses in bytes of the start of sectors which are defective. These do not have drive bits set and are absolute, rather than adjusted for earlier defects. The end of the defect list is marked by &200000xx where xx is a check byte calculated as follows
entry
Ra -> list start
exit
Ra corrupt Rb check byte Rc corrupt
MOV Rb,#0 ;init checkloop
LDR Rc,[Ra],#4 ;get next entry CMPS Rc,#&20000000 ;all done ? EORCC Rb,Rc,Rb,ROR #13 BCC loop EOR Rb,Rb,Rb,LSR #16;compress word to byte EOR Rb,Rb,Rb,LSR #8 AND Rb,Rb,#&FF
&1BC-&1BF unadjusted parking disc address The boot block should also have the same check byte at the end as an old format map.
exit
IF error V set R0->error block else R0 preserved
R1-R5 preserved
Floppy
This asks you to read in the free space map and identify the format. The
suggested density to try first is given in the disc record. Identify the
format consits of filling in the density and for old format sector size,
sectors per track, heads, disc size and root dir.
Winnie
This asks you to read in the boot block if it doesn't have one you will
have to fudge it
exit
R2 sequence number
R3 result flags
The sequence number is to ensure no changes are lost due to reset being pressed. Both the parent module and the file core incarnation should start with a sequence number of 0 for each drive. The parent module increments the sequence number with each change of state. If the parent module finds the entry sequence number does not match its copy it should return changed/maybe changed depending on whether the disc changed line works/doesn't work.
result flags (exactly one of b0-b3 must be set) set<=>true
b0 not changed
b1 maybe changed
b2 changed
b3 empty
b6 empty works may never return 0 after returning 1 for this drive
b7 changed works may never return 0 after returning 1 for this drive