Difference between revisions of "OSWORD &FE"
(Updates from disassembly.) |
(Updated summary.) |
||
Line 1: | Line 1: | ||
[[Category:OSWORD]][[Category:Second Processors]]__NOTOC__ | [[Category:OSWORD]][[Category:Second Processors]]__NOTOC__ | ||
− | ==OSWORD &FE (254) - Z80 | + | ==OSWORD &FE (254) - Z80 FM disk access (Z80 Tube OS)== |
On entry: | On entry: | ||
XY?0 = &10 (send block length) | XY?0 = &10 (send block length) | ||
Line 11: | Line 11: | ||
XY?9 = sector number b8-b15 | XY?9 = sector number b8-b15 | ||
XY?10 = sector number b0-b7 | XY?10 = sector number b0-b7 | ||
− | XY?11 = number of sectors | + | XY?11 = number of sectors (what does &00 mean?) |
XY?12 = drive flags, b7=drive 0, b6=drive 1, etc. | XY?12 = drive flags, b7=drive 0, b6=drive 1, etc. | ||
XY?13 = drive 0 settings | XY?13 = drive 0 settings | ||
Line 19: | Line 19: | ||
This is loaded by the Z80 Tube v2 client code from $.CPM.X (for BBC B/B+) or $.CPM.Y | This is loaded by the Z80 Tube v2 client code from $.CPM.X (for BBC B/B+) or $.CPM.Y | ||
− | (for Master) on the | + | (for Master) from ADFS. It provides FM (single-density) disk access when DFS OSWORD &7F |
+ | is not available. MFM disk access is provided by OSWORD &72 on the assumption that if | ||
+ | ADFS is present, which is implied by being able to load $.CPM.X from ADFS, then ADFS's | ||
+ | OSWORD &72 is available. | ||
− | The floppy disk layout used is 2 sides x 80 tracks x 10 sectors x | + | The floppy disk layout used is 2 sides x 80 tracks x 10 sectors x 256 bytes FM. |
===Commands=== | ===Commands=== | ||
Line 57: | Line 60: | ||
===Notes=== | ===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. | ||
− | |||
− | |||
− | |||
− | |||
==OSWORD &FE (254) - DOS Text output (80x86 DOS, unimplemented)== | ==OSWORD &FE (254) - DOS Text output (80x86 DOS, unimplemented)== | ||
Line 67: | Line 66: | ||
just returns from OSWORD &FE. | just returns from OSWORD &FE. | ||
− | ==See | + | ===See also=== |
* [[OSWORD &FF]] | * [[OSWORD &FF]] | ||
− | * [ | + | * [[OSWORD &72]] |
+ | * mdfs.net/Software/Tube/Z80 | ||
* [http://mdfs.net/Software/Tube/ mdfs.net] | * [http://mdfs.net/Software/Tube/ mdfs.net] | ||
[[User:Jgharston|Jgharston]] 14:29, 26 May 2009 (UTC) | [[User:Jgharston|Jgharston]] 14:29, 26 May 2009 (UTC) | ||
[[User:Jgharston|Jgharston]] ([[User talk:Jgharston|talk]]) 03:29, 20 July 2020 (CEST) | [[User:Jgharston|Jgharston]] ([[User talk:Jgharston|talk]]) 03:29, 20 July 2020 (CEST) |
Revision as of 10:50, 16 December 2024
OSWORD &FE (254) - Z80 FM 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 (what does &00 mean?) 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) from ADFS. It provides FM (single-density) disk access when DFS OSWORD &7F is not available. MFM disk access is provided by OSWORD &72 on the assumption that if ADFS is present, which is implied by being able to load $.CPM.X from ADFS, then ADFS's OSWORD &72 is available.
The floppy disk layout used is 2 sides x 80 tracks x 10 sectors x 256 bytes FM.
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.
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
- OSWORD &FF
- OSWORD &72
- mdfs.net/Software/Tube/Z80
- mdfs.net
Jgharston 14:29, 26 May 2009 (UTC) Jgharston (talk) 03:29, 20 July 2020 (CEST)