About HDD: how to see it.
ZXNet echo conference «zx.spectrum»
From Valerij Kozhevnikov (500:95/462. → To All 18 April 1998
Hello All!
So that there are no battles about the need for #3d13 and the smelliness/steering of turbo drivers, I’m throwing this out. Before accessing the
disk drive, it would be logical to make sure that it is present, so as not to get a turboloader from the tape recorder E.
========================================= Import begin =============================
New subroutines of the Shadow Service Monitor for working with the
peripheral controller SMUC.
A number of new calls for the subroutine. #81 RST #08 (DOS).
(calling the disk interpreter built into the monitor), the code
of the subfunction is set in the C register.
Subfunction 9 setwrk of the disk system has been changed. Starting with
version 3.0a (code 68 from 04/29/95), the version code and monitor compilation date are returned in the DE and BC registers: D- version code; C,
B, E - day, month, year, respectively.
C = #22 ($hddid) - hard drive identification.
in: 512 byte buffer, the pointer to which is set in setwrk
(subfunction 9).
the buffer must be in the range #4000 - #C000.
out: CY - error (no hdd).
This the subfunction determines whether the disk exists at all and tries to
return the sector-identifier (passport) read from
hdd to the buffer.
Hdd passport format (512 bytes). All numbers hex.
──────┬────────┬──────────────
Addr │ Length │ Value│
──────┼────────┼────────────────
000 │ 02 │ Main configuration word │
002 │ 02 │ Number of cylinders │
004 │ 02 │ Reserved │
006 │ 02 │ Number of heads │
008 │ 02 │ Number of bytes per track │
00A │ 02 │ Number of bytes per sector │
00C │ 02 │ Number of sectors per track │
00E │ 06 │ Vendor specification │
014 │ 14 │ Serial number (ASCII) │
028 │ 02 │ Controller type │
02A │ 02 │ Buffer (cache) capacity divided by 512 bytes │
02C │ 02 │ ECC code value for Long Read/Write commands │
02E │ 08 │ Operating program version (ASCII) │
036 │ 26 │ Model (ASCII) │
──────┴────────┴────────────────
Then each manufacturer is free to enter whatever they want.
I have only zeros.
A word is two bytes, low/high.
ECC - Error Control Code.
Due to incomprehensible standards, ASCII does not look very clear in the passport. Model st3144AT looks like ts1344TA.This means that if you need to display this on the screen, you need to swap the first byte with the second, the third with the fourth, etc. to
the end of the line.
For clarity of terminology:
Disk drive: My screw:
80 cylinders 1001 cylinders
2 heads 15 heads
16 sectors/track 17 sectors/track
256 bytes/sector 512 bytes/sector
But the specific source -
- how to detect scorpion screw:
;.................................................................
DI
LD A,(#0008)
CP #C3
JR NZ,NO_HDD ;This is not scorp
;
LD BC,#1FFD
LD A,#02
OUT (C),A ;switched ROM
LD A,(#00F1) ;Took the TM version code.
LD E,A ;screws are found
XOR A ;on versions 96 and higher.
OUT (C),A
LD A,E
CP 96
JR C,NO_HDD ;scorpio, but with the old ROM.
;
LD HL,BUFF ;BUFF MUST BE IN RANGE
LD C,#09 ;#4000...#BDFF !
RST #08 ;Install working buffer
DEFB #81 ;(size 512 bytes)
LD C,#22
RST #08 ;Is there a screw?
DEFB #81 ;
JR C,NO_HDD ;no however.
...
... ;there is a screw. In BUFF we have
CALL #3D13 ;screw passport. here use #3d13
DI
...
;============================================================================
NO_HDD
...
... ;there is no screw, you can
PUSH IX ;use turbo drivers.
JP #3D2F
;
BUFF ;working buffer
DEFS #200
============================= Import end ===============
Jason.
Powered by ScorpionZS256turbo+/SMUC/HDD'IDE130Mb/FDD'800/
/CMOS/Cache8k/Covox/ATkbd/Mouse/CDOS...