Hard Disk Drive - New Shadow Service Monitor routines for working with the SMUC peripheral controller.

╔════════════════════════ ═══════════════════ ═══════════════════╗
║  Hard Disk Drive.        ║
╙─────────────────────────────── ───────────────────────────────╜
(C) Valerij Kozhevnikov (500:95/462.18)

Hello All!

So that there are no battles about the need for #3D13 and stinkiness/-
steering of turbo drivers, I throw this:

======== Import begin ===========================

 New Shadow Service Monitor routines for working with
SMUC peripheral controller.
     A number of new calls for p/p #81 RST #08 (DOS). (call built-in
disk interpreter monitor), the subfunction code specified
is in register C.
     Subfunction 9 setwrk of the disk system has been changed. Starting from
version 3.0a (code 68 from 04/29/95) in the DE and BC registers return -
This version code and compilation date of the monitor: D - version code; C, B, E
- date, 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 subfunction determines whether the disk exists at all and tries to return it.
Put the sector-identifier (passport) read from the hdd into the buffer.

Formathdd passports (512 bytes). All numbers are 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 on track │
│ 00A │ 02 │ Number of bytes in sector │
│ 00C │ 02 │ Number of sectors per track │
│ 00E │ 06 │ Seller's specification │
│ 014 │ 14 │ Serial number (ASCII) │
│ 028 │ 02 │ Controller type │
│ 02A │ 02 │ Buffer (cache) capacity divided by 512 bytes │
│ 02C │ 02 │ ECC code meaning 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.
   Next I have only zeros.

 A word is two bytes, low/high.
 ECC - Error Control Code.
Due toincomprehensible standards, ASCII does not look consistent in the passport
This is clear. Model stZ1CHCHAT looks like ts13CHCHTA. So, es-
If you need to display this on the screen, you need to swap the first
the first byte with the second, the third with the fourth, etc. to the end of the line.

For clarity of terminology:

  Drive: My screw:
 80 cylinders 1001 cylinders
 2 heads 15 heads
 16 sectors/track 17 sectors/track
 256 bytes/sector 512 bytes/sector

 How to detect a scorpion screw:
;........................................
         D.I.
         LD A,(#0008)
         CP#C3
         JR NZ,NO_HDD ;This is not a scorpion
;
         LD BC,#1FFD
         LD A,#02
         OUT (C),A ;switched ROM
         LD A,(#00F1) ;Took TM version code
         LD E,A ;screws are installed
         XOR A ;on versions 96 and higher.
         OUT(C),A
         LD A,E
         CP 96
         JR C,NO_HDD; scorpion, but with old ROM.
;
         LD HL,BUFF ;BUFF MUST BE IN RANGE
         LD C,#09 ;#4000...#C000 !
         RST #08 ;Set 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
                              ;screw passport. here use #3d13
NO_HDD
         ...
                              ;there is no screw, you can
                              ;use turbo drivers.

BUFF ;working buffer
        DEFS #200

======================== Import end ============================

 In general: ask, I will answer.

Jason.
Powered by ScorpionZS25bturbo+/SMUC/HDD'IDE1ЗOMb/FDD'800/
 /CMOS/Covox/ATkbd/Mouse/CDOS

--- is'edit 4.12+
 * Origin: ...Altering The Future... (500:95/462.18)

Share your thoughts about the article