Difference between revisions of "OSWORD &FE"
(Added some Z80 disk access details.) |
(Updates from disassembly.) |
||
Line 1: | Line 1: | ||
[[Category:OSWORD]][[Category:Second Processors]]__NOTOC__ | [[Category:OSWORD]][[Category:Second Processors]]__NOTOC__ | ||
− | ==OSWORD &FE (254) - Z80 MFM disk access (Z80 Tube OS)== | + | ==OSWORD &FE (254) - Z80 MFM disk access (Z80 Tube OS)==__NOTOC__ |
+ | On entry: | ||
+ | XY?0 = &10 (send block length) | ||
+ | XY?1 = &03 (receive block length) | ||
+ | The rest of the block is a SCSI command block similar to OSWORD &72 | ||
+ | XY?2 = returned result, 0=ok, &00+n=HDD error, &40+n=FDD error | ||
+ | XY!3 = data address | ||
+ | XY?7 = command | ||
+ | XY?8 = drive number in b5-b7, sector b16-b20 in b0-b4 | ||
+ | XY?9 = sector number b8-b15 | ||
+ | XY?10 = sector number b0-b7 | ||
+ | XY?11 = number of sectors | ||
+ | XY?12 = drive flags, b7=drive 0, b6=drive 1, etc. | ||
+ | XY?13 = drive 0 settings | ||
+ | XY?14 = drive 1 settings | ||
+ | XY?15 = etc. | ||
+ | XY?20 = drive 7 settings | ||
− | + | This is loaded by the Z80 Tube v2 client code from $.CPM.X (for BBC B/B+) or $.CPM.Y | |
− | + | (for Master) on the host filing system. | |
− | + | ||
− | + | The floppy disk layout used is 2 sides x 80 tracks x 10 sectors x ??? bytes MFM. | |
− | + | ||
− | + | ===Commands=== | |
− | + | &08 Read data | |
− | + | &09 Read Verify | |
− | + | &0A Write data | |
− | + | &0B Seek track | |
− | + | ||
− | + | If the drive flag is set in XY?12, the drive setting in XY+13 onwards is used, and the drive | |
− | + | seeks for track 0 before the operation. | |
+ | |||
+ | Known code only implements command &08, &0A and &0B. | ||
+ | |||
+ | ===Results=== | ||
+ | &00 Ok &40 FDD Write protected | ||
+ | &08 CRC error in data (FDC status &08) | ||
+ | &10 Sector not found (FDC status &10) | ||
+ | &18 CRC error in ID (FDC status &18) | ||
+ | &20 Invalid command to controller &60 Bad SCSI command | ||
+ | &21 Illegal disc address - beyond end of disk &61 Bad disc address | ||
+ | &22 unused &62 unused | ||
+ | &23 Volume error &63 Volume error | ||
+ | &24 Invalid parameter to controller &64 Bad arguments | ||
+ | &25 Illegal drive number &65 Bad drive | ||
+ | &26 Invalid field in parameter list/Timeout &66 Drive timed out | ||
+ | &27 Unsupported controller command &67 Unsupported SCSI command | ||
+ | &2F Abort &6F Abort | ||
+ | |||
+ | Bit 6 of the result is used to indicate if the error is from the hard drive | ||
+ | controller or the floppy controller. Floppy errors are the same as hard drive | ||
+ | errors, ORed with &40. Floppy errors are also the 1770 status byte ORed with &40. | ||
− | + | However, the known OSWORD &FE driver omits setting &40 when returning the result. | |
− | |||
− | & | ||
− | + | ===Notes=== | |
− | |||
* The default code fails if called from the I/O processor with the control block at &xxFE or &xxFF due to incrementing X without carrying the overflow into Y. | * The default code fails if called from the I/O processor with the control block at &xxFE or &xxFF due to incrementing X without carrying the overflow into Y. | ||
− | + | ===See also=== | |
+ | * [[OSWORD &72]] | ||
+ | * mdfs.net/Software/Tube/Z80 | ||
==OSWORD &FE (254) - DOS Text output (80x86 DOS, unimplemented)== | ==OSWORD &FE (254) - DOS Text output (80x86 DOS, unimplemented)== |
Revision as of 13:37, 10 December 2024
OSWORD &FE (254) - Z80 MFM disk access (Z80 Tube OS)
On entry: XY?0 = &10 (send block length) XY?1 = &03 (receive block length) The rest of the block is a SCSI command block similar to OSWORD &72 XY?2 = returned result, 0=ok, &00+n=HDD error, &40+n=FDD error XY!3 = data address XY?7 = command XY?8 = drive number in b5-b7, sector b16-b20 in b0-b4 XY?9 = sector number b8-b15 XY?10 = sector number b0-b7 XY?11 = number of sectors XY?12 = drive flags, b7=drive 0, b6=drive 1, etc. XY?13 = drive 0 settings XY?14 = drive 1 settings XY?15 = etc. XY?20 = drive 7 settings
This is loaded by the Z80 Tube v2 client code from $.CPM.X (for BBC B/B+) or $.CPM.Y (for Master) on the host filing system.
The floppy disk layout used is 2 sides x 80 tracks x 10 sectors x ??? bytes MFM.
Commands
&08 Read data &09 Read Verify &0A Write data &0B Seek track
If the drive flag is set in XY?12, the drive setting in XY+13 onwards is used, and the drive seeks for track 0 before the operation.
Known code only implements command &08, &0A and &0B.
Results
&00 Ok &40 FDD Write protected &08 CRC error in data (FDC status &08) &10 Sector not found (FDC status &10) &18 CRC error in ID (FDC status &18) &20 Invalid command to controller &60 Bad SCSI command &21 Illegal disc address - beyond end of disk &61 Bad disc address &22 unused &62 unused &23 Volume error &63 Volume error &24 Invalid parameter to controller &64 Bad arguments &25 Illegal drive number &65 Bad drive &26 Invalid field in parameter list/Timeout &66 Drive timed out &27 Unsupported controller command &67 Unsupported SCSI command &2F Abort &6F Abort
Bit 6 of the result is used to indicate if the error is from the hard drive controller or the floppy controller. Floppy errors are the same as hard drive errors, ORed with &40. Floppy errors are also the 1770 status byte ORed with &40.
However, the known OSWORD &FE driver omits setting &40 when returning the result.
Notes
- The default code fails if called from the I/O processor with the control block at &xxFE or &xxFF due to incrementing X without carrying the overflow into Y.
See also
- OSWORD &72
- mdfs.net/Software/Tube/Z80
OSWORD &FE (254) - DOS Text output (80x86 DOS, unimplemented)
The 6502 host support code in 6502.SYS installed by the 80x86 DOS just returns from OSWORD &FE.
See Also
Jgharston 14:29, 26 May 2009 (UTC) Jgharston (talk) 03:29, 20 July 2020 (CEST)