home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / CRYPT19.ZIP / IDE-INFO.ASM < prev    next >
Encoding:
Assembly Source File  |  1993-10-17  |  33.9 KB  |  902 lines

  1. ;********************************************************************************
  2. ; IDE-INFO.ASM
  3. ; VERSION:     1.0
  4. ; AUTHOR:      Köhntark
  5. ; DATE:        Sept 26 1993
  6. ;********************************************************************************
  7.  
  8. MAIN    SEGMENT BYTE
  9.         ASSUME cs:main,ds:main,ss:nothing      ;all part in one segment=com file
  10.         org    100h
  11.  
  12. START:
  13.          
  14.          mov  ah,09   
  15.          lea  dx,[FIRST_MSG]                   ;display KREATOR's msg
  16.          int  21h
  17.  
  18. ;********************************
  19. ; Determine # of IDE devices
  20. ;********************************
  21.          
  22.          mov  ax,0040h
  23.          mov  ds,ax             ;DS=0040
  24.          mov  si,0075h
  25.          mov  cl,BYTE PTR [si]  ;
  26.          cmp  cl,03
  27.          jb   CONT
  28.          
  29.          mov  ah,09   
  30.          lea  dx,[ERROR_MSG]    ;more than 2 HD devices
  31.          int  21h
  32.          int  20h
  33.  
  34. CONT:    push cs
  35.          pop  ds                ;DS=CS
  36.          
  37.          
  38. ;********************************
  39. ; Wait until Controller not busy
  40. ;********************************
  41.  
  42.           mov  dx,01F7h
  43.           in   al,dx
  44.           cmp  al,50h
  45.           jne  AGAIN
  46.  
  47. ;********************************
  48. ; Specify 1st / 2nd Drive
  49. ;********************************
  50.  
  51. AGAIN:
  52.              mov  dx,01F6h
  53.              cmp  cl,02
  54.              je   SEC_DRIVE
  55.              mov  al,0A0h
  56.              jmp  short DO_IT
  57. SEC_DRIVE:
  58.              mov  al,0B0h
  59. DO_IT:       out  dx,al
  60.              inc  dx
  61.  
  62. ;********************************
  63. ; Send Identify Drive Command
  64. ;********************************
  65.  
  66.           mov  al,0ECh
  67.           out  dx,ax
  68.  
  69. ;********************************
  70. ; Wait for Data Ready
  71. ;********************************
  72.  
  73. NOT_READY:   
  74.           in    ax,dx
  75.           cmp   al,58h
  76.           jne   NOT_READY
  77.  
  78. ;****************************************
  79. ; Get / Store Identify drive information
  80. ;****************************************
  81.           
  82.           mov   dx,01F0h
  83.           push  cx                      ;save # of IDE devices
  84.           mov   cx,0FFh
  85.           mov   di,OFFSET DATA_BUFFER
  86. MORE:          
  87.           in    ax,dx
  88.           xchg  ah,al
  89.           stosw
  90.           loop  MORE
  91.  
  92. ;****************************************
  93. ; Display Identify drive information
  94. ;****************************************
  95.  
  96.          call  DDISPLAY
  97.          pop   cx          ;restore # of IDE devices
  98.          loop  AGAIN       ;next IDE drive if any...
  99.          int   20h
  100.  
  101. ;*****************************************************************************
  102.  
  103. DDISPLAY:
  104. ;********************************
  105. ; Display Results
  106. ;********************************
  107.          
  108.          mov  ah,09                            
  109.          lea  dx,[MSG49]  
  110.          int  21h
  111.          
  112.          mov  bx,WORD PTR [General_configuration]
  113.          xchg bh,bl
  114.          
  115.          test bx,0000000000000010b
  116.          jz   GO_ON
  117.          lea  dx,[MSG35]  
  118.          int  21h
  119.  
  120. GO_ON:
  121.          test bx,0000000000000100b
  122.          jz   GO_ON1
  123.          lea  dx,[MSG36]  
  124.          int  21h
  125. GO_ON1:
  126.          test bx,0000000000001000b
  127.          jz   GO_ON2
  128.          lea  dx,[MSG37]  
  129.          int  21h
  130. GO_ON2:
  131.          test bx,0000000000010000b
  132.          jz   GO_ON3
  133.          lea  dx,[MSG38]  
  134.          int  21h
  135. GO_ON3:
  136.          test bx,0000000000100000b
  137.          jz   GO_ON4
  138.          lea  dx,[MSG39]  
  139.          int  21h
  140. GO_ON4:
  141.          test bx,0000000001000000b
  142.          jz   GO_ON5
  143.          lea  dx,[MSG40]  
  144.          int  21h
  145. GO_ON5:
  146.          test bx,0000000010000000b
  147.          jz   GO_ON6
  148.          lea  dx,[MSG41]  
  149.          int  21h
  150. GO_ON6:
  151.          test bx,0000000100000000b    
  152.          jz   GO_ON7
  153.          lea  dx,[MSG42]  
  154.          int  21h
  155. GO_ON7:
  156.          test bx,0000001000000000b
  157.          jz   GO_ON8
  158.          lea  dx,[MSG43]  
  159.          int  21h
  160. GO_ON8:
  161.          test bx,0000010000000000b
  162.          jz   GO_ON9
  163.          lea  dx,[MSG44]  
  164.          int  21h
  165. GO_ON9:
  166.          test bx,0000100000000000b
  167.          jz   GO_ON10
  168.          lea  dx,[MSG45]  
  169.          int  21h
  170. GO_ON10:
  171.          test bx,0001000000000000b
  172.          jz   GO_ON11
  173.          lea  dx,[MSG46]  
  174.          int  21h
  175. GO_ON11:
  176.          test bx,0010000000000000b
  177.          jz   GO_ON12
  178.          lea  dx,[MSG47]  
  179.          int  21h
  180. GO_ON12:
  181.          test bx,0100000000000000b
  182.          jz   GO_ON13
  183.          lea  dx,[MSG48]  
  184.          int  21h
  185. GO_ON13:
  186.          
  187.          lea  dx,[LINE]  
  188.          int  21h
  189.  
  190.          lea  dx,[MSG1]  
  191.          int  21h
  192.  
  193.          mov  bx,WORD PTR [General_configuration]
  194.          call BIN_TO_HEX
  195.          
  196. ;----------------------------------------------------------------------------
  197.          
  198.          lea  dx,[MSG2]  
  199.          int  21h
  200.  
  201.          mov  bx,WORD PTR [Number_of_cylinders]
  202.          call DEC16OUT
  203.  
  204. ;----------------------------------------------------------------------------
  205.          
  206.          lea  dx,[MSG4]  
  207.          int  21h
  208.  
  209.          mov  bx,WORD PTR [Number_of_heads]
  210.          call DEC16OUT
  211.  
  212. ;----------------------------------------------------------------------------
  213.          
  214.          lea  dx,[MSG5]  
  215.          int  21h
  216.  
  217.          mov  bx,WORD PTR [Number_unformatted_bytes_per_track]
  218.          call DEC16OUT
  219.  
  220. ;----------------------------------------------------------------------------
  221.          
  222.          lea  dx,[MSG6]  
  223.          int  21h
  224.  
  225.          mov  bx,WORD PTR [Number_unformatted_bytes_per_sector]
  226.          call DEC16OUT
  227.  
  228. ;----------------------------------------------------------------------------
  229.          
  230.          lea  dx,[MSG7]  
  231.          int  21h
  232.  
  233.          mov  bx,WORD PTR [Number_sectors_per_track]
  234.          call DEC16OUT
  235.          
  236. ;----------------------------------------------------------------------------
  237.          lea  dx,[MSG8]  
  238.          int  21h
  239.  
  240.          mov  bx,WORD PTR [Vendor_unique1]
  241.          call BIN_TO_HEX
  242.          mov  bx,WORD PTR [Vendor_unique1 + 1]
  243.          call BIN_TO_HEX
  244.          mov  bx,WORD PTR [Vendor_unique1 + 2]
  245.          call BIN_TO_HEX
  246.  
  247. ;----------------------------------------------------------------------------
  248.          
  249.          lea  dx,[MSG9]  
  250.          int  21h
  251.          
  252.          mov  WORD PTR [Serial_number + 18],'$'
  253.          lea  dx,[Serial_number]
  254.          int  21h
  255.  
  256. ;----------------------------------------------------------------------------
  257.          
  258.          lea  dx,[MSG10]  
  259.          int  21h
  260.  
  261.          mov  bx,WORD PTR [Buffer_type]
  262.          call DEC16OUT
  263.          
  264.          cmp  BYTE PTR [Buffer_type + 1],01
  265.          lea  dx,[MSG52]  
  266.          je   SKIP0
  267.          
  268.          cmp  BYTE PTR [Buffer_type + 1],02
  269.          lea  dx,[MSG53]  
  270.          je   SKIP0
  271.          
  272.          cmp  BYTE PTR [Buffer_type + 1],03
  273.          lea  dx,[MSG54]  
  274.          je   SKIP0
  275.          
  276.          lea  dx,[MSG55]                ;=0 not specified
  277.  
  278. SKIP0:   int 21h
  279.          
  280. ;----------------------------------------------------------------------------
  281.          
  282.          lea  dx,[MSG11]  
  283.          int  21h
  284.  
  285.          mov  bx,WORD PTR [Buffer_size]
  286.          call DEC16OUT
  287.  
  288. ;----------------------------------------------------------------------------
  289.          
  290.          lea  dx,[MSG12]  
  291.          int  21h
  292.  
  293.          mov  bx,WORD PTR [Num_ECC_bytes_read_write_long_cmds]
  294.          call DEC16OUT
  295.  
  296. ;----------------------------------------------------------------------------
  297.          
  298.          lea  dx,[MSG13]  
  299.          int  21h
  300.          
  301.          mov  WORD PTR [Firmware_revision + 6],'$'
  302.          lea  dx,[Firmware_revision]
  303.          int  21h
  304.  
  305. ;----------------------------------------------------------------------------
  306.          
  307.          lea  dx,[MSG14]  
  308.          int  21h
  309.          
  310.          mov  WORD PTR [Model_number + 39],'$'
  311.          lea  dx,[Model_number]
  312.          int  21h
  313.  
  314. ;----------------------------------------------------------------------------
  315.          
  316.          lea  dx,[MSG15]  
  317.          int  21h
  318.          
  319.          mov  bx,WORD PTR [Vendor_unique2]
  320.          call DEC16OUT
  321.          
  322.          cmp  BYTE PTR [Vendor_unique2 + 1],00
  323.          je   RWMCNI
  324.          lea  dx,[MSG51]  
  325.          jmp  short SKIP1
  326.  
  327. RWMCNI:                     ;read / write multiple command not implemented
  328.          lea  dx,[MSG50]  
  329. SKIP1:   int 21h
  330.          
  331. ;----------------------------------------------------------------------------
  332.          
  333.          lea   dx,[MSG16]  
  334.          int   21h
  335.  
  336.          mov   bx,WORD PTR [Doubleword_performance]
  337.          call  DEC16OUT
  338.          
  339.          cmp   WORD PTR [Doubleword_performance],00
  340.          je    NO_DD_IO
  341.          lea   dx,[MSG33]  
  342.          jmp   short SKIP2
  343.  
  344. NO_DD_IO:
  345.          lea   dx,[MSG34]  
  346. SKIP2:   int   21h
  347.  
  348.  
  349. ;----------------------------------------------------------------------------
  350.          
  351.          lea  dx,[MSG17]  
  352.          int  21h
  353.  
  354.          mov  bx,WORD PTR [Capabilities]
  355.          call DEC16OUT
  356.          
  357. ;----------------------------------------------------------------------------
  358.          
  359.          lea  dx,[MSG19]  
  360.          int  21h
  361.  
  362.          mov  bx,WORD PTR [PIO_data_transfer_cycle_timing_mode]
  363.          call DEC16OUT
  364.  
  365. ;----------------------------------------------------------------------------
  366.          
  367.          lea  dx,[MSG20]  
  368.          int  21h
  369.  
  370.          mov  bx,WORD PTR [DMA_data_transfer_cycle_timing_mode]
  371.          call DEC16OUT
  372.  
  373. ;----------------------------------------------------------------------------
  374.          
  375.          lea  dx,[MSG22]  
  376.          int  21h
  377.  
  378.          mov  bx,WORD PTR [Number_of_current_cylinders]
  379.          call DEC16OUT
  380.          
  381. ;----------------------------------------------------------------------------
  382.          
  383.          lea  dx,[MSG23]  
  384.          int  21h
  385.  
  386.          mov  bx,WORD PTR [Number_of_current_heads]
  387.          call DEC16OUT
  388.  
  389. ;----------------------------------------------------------------------------
  390.          
  391.          lea  dx,[MSG24]  
  392.          int  21h
  393.  
  394.          mov  bx,WORD PTR [Number_of_current_sectors_per_track]
  395.          call DEC16OUT
  396.  
  397. ;----------------------------------------------------------------------------
  398.          
  399.          lea  dx,[MSG25]  
  400.          int  21h
  401.  
  402.          mov  bx,WORD PTR [Current_capacity_in_sectors]
  403.          call BIN_TO_HEX
  404.          mov  bx,WORD PTR [Current_capacity_in_sectors + 1]
  405.          call BIN_TO_HEX
  406.  
  407. ;----------------------------------------------------------------------------
  408.          
  409.          lea  dx,[MSG27]  
  410.          int  21h
  411.  
  412.          mov  bx,WORD PTR [Total_number_user_addressable_sectors]
  413.          call BIN_TO_HEX
  414.          
  415.          mov  bx,WORD PTR [Total_number_user_addressable_sectors + 1]
  416.          call BIN_TO_HEX
  417.  
  418. ;----------------------------------------------------------------------------
  419.          
  420.          lea  dx,[MSG28]  
  421.          int  21h
  422.  
  423.          mov  bx,WORD PTR [Single_word_DMA_transfer_mode]
  424.          call DEC16OUT
  425.  
  426. ;----------------------------------------------------------------------------
  427.          
  428.          lea  dx,[MSG29]  
  429.          int  21h
  430.  
  431.          mov  bx,WORD PTR [Multiword_DMA_transfer_mode]
  432.          call DEC16OUT
  433.          
  434.          ret
  435.  
  436. ;****************************************************************************
  437.  
  438. BIN_TO_HEX:
  439.             xchg bh,bl
  440.             push cx       ;save registers
  441.             push dx
  442.             push ax
  443.  
  444.             mov  ch,04    ;# of digits to process
  445. ROTATE:     mov  cl,04    ;# of bits to rotate
  446.             rol  bx,cl    ;rotate bx l to r
  447.             mov  al,bl    ;move to al  (2 digits)
  448.             and  al,0Fh   ;mask off upper digit
  449.             add  al,30h   ;convert to ASCII
  450.             cmp  al,3Ah   ;is it > 9?
  451.             jl   PRINTIT  ;jump of digit =0 to 9
  452.             add  al,07h   ;digit is A to F
  453. PRINTIT:
  454.             mov dl,al
  455.             mov ah,2     ;INT 21h function
  456.             int 21h      ;print character
  457.             dec ch
  458.             jnz ROTATE
  459.  
  460.             pop  ax      ;restore registers
  461.             pop  dx
  462.             pop  cx
  463.             ret
  464.  
  465. ;****************************************************************************
  466. ;Routine to convert from internal 16-bit binary to ASCII decimal
  467.  
  468. DEC16OUT:
  469.  
  470. ;------------------------
  471. ;A binary number is in DX
  472. ;------------------------
  473.  
  474.           xchg bh,bl
  475.           xchg bx,dx
  476.           
  477.           push   DS                    ;Save registers
  478.           push   DI
  479.           push   DX
  480.           push   CX
  481.           push   AX
  482.  
  483. ;--------------------------
  484. ;Put the digits in a buffer
  485. ;--------------------------
  486.  
  487.           xor    cx,cx                 ;Initialize the counter
  488.           lea    di,[TBUFF]            ;Point to the buffer
  489. DEC16OUT1:
  490.           push   cx                    ;Save CX
  491.           mov    ax,dx                 ;Numerator
  492.           xor    dx,dx                 ;Clear upper half
  493.           mov    cx,10                 ;Divisor of 10
  494.           div    cx                    ;Divide dx:ax by cx
  495.           xchg   ax,dx                 ;Get quotient
  496.           add    al,30h                ;Add 30H
  497.           mov    [di],al               ;Put in buffer
  498.           inc    di                    ;Next byte
  499.           pop    cx                    ;Restore CX
  500.           inc    cx                    ;Count the digit
  501.           cmp    dx,0                  ;Done?
  502.           jnz    DEC16OUT1
  503.  
  504. ;-------------------
  505. ;Dump the buffer out
  506. ;-------------------
  507.  
  508. DEC16OUT2:
  509.           dec    di                    ;Back up through the buffer
  510.           mov    al,[di]               ;Get byte from buffer
  511.           call   STDOUT                ;Send it out
  512.           loop   DEC16OUT2
  513.           pop    AX                    ;Restore registers
  514.           pop    CX
  515.           pop    DX
  516.           pop    DI
  517.           pop    DS
  518.           ret                          ;Return
  519.  
  520. STDOUT: 
  521.             push  dx
  522.             mov   dl,al
  523.             mov   ah,02     ;INT 21h function
  524.             int   21h       ;print character
  525.             pop   dx
  526.             ret
  527.  
  528.  
  529. ;****************************************************************************
  530.  
  531. FIRST_MSG      db  '════════════════════════════════',13d,10d
  532.                db  '      Köhntark',027h,'s  IDE-INFO      ',13d,10d
  533.                db  '     Version 1.0  (C) 1993      ',13d,10d
  534.                db  '════════════════════════════════',13d,10d,13d,10d,'$'
  535.  
  536. MSG1           db  13d,10d,'              General configuration: ','$'
  537. MSG2           db  13d,10d,'                Number of cylinders: ','$'
  538. MSG4           db  13d,10d,'                    Number of heads: ','$'
  539. MSG5           db  13d,10d,'   # of unformatted bytes per track: ','$'
  540. MSG6           db  13d,10d,'  # of unformatted bytes per sector: ','$'
  541. MSG7           db  13d,10d,'           Number sectors per track: ','$'
  542. MSG8           db  13d,10d,'                      Vendor unique: ','$'
  543. MSG9           db  13d,10d,'                      Serial number: ','$'
  544. MSG10          db  13d,10d,'                        Buffer type: ','$'
  545. MSG11          db  13d,10d,'         Buffer size (in 512 bytes): ','$'
  546. MSG12          db  13d,10d,'       # of ECC bytes R/W long cmds: ','$'
  547. MSG13          db  13d,10d,'                  Firmware revision: ','$'
  548. MSG14          db  13d,10d,'                       Model number: ','$'
  549. MSG15          db  13d,10d,' # of sectors transferred/interrupt: ','$'
  550. MSG16          db  13d,10d,'             Doubleword performance: ','$'
  551. MSG17          db  13d,10d,'                       Capabilities: ','$'
  552. MSG19          db  13d,10d,'PIO data transfer cycle timing mode: ','$'
  553. MSG20          db  13d,10d,'DMA data transfer cycle timing mode: ','$'
  554. MSG22          db  13d,10d,'             # of current cylinders: ','$'
  555. MSG23          db  13d,10d,'                 # of current heads: ','$'
  556. MSG24          db  13d,10d,'     # of current sectors per track: ','$'
  557. MSG25          db  13d,10d,'        Current capacity in sectors: ','$'
  558. MSG27          db  13d,10d,'Total # of user addressable sectors: ','$'
  559. MSG28          db  13d,10d,'      Single word DMA transfer mode: ','$'
  560. MSG29          db  13d,10d,'        Multiword DMA transfer mode: ','$'
  561. MSG31          db  13d,10d,'                      Vendor unique: ','$'
  562.  
  563. MSG33          db  ' => Able to do Double word I/O','$'
  564. MSG34          db  ' => NOT Able to do Double word I/O','$'                           
  565.  
  566. MSG35          db  13d,10d,' Hard sectored','$'                           
  567. MSG36          db  13d,10d,' Soft sectored','$'                           
  568. MSG37          db  13d,10d,' Not MFM encoded','$'                           
  569.  
  570. MSG38          db  13d,10d,' Head switch time > 15 microseconds','$'                           
  571. MSG39          db  13d,10d,' Spindle motor control option implemented','$'                           
  572. MSG40          db  13d,10d,' Fixed drive','$'                           
  573. MSG41          db  13d,10d,' Removable cartridge drive','$'                           
  574.  
  575. MSG42          db  13d,10d,' Disk transfer rate <= 5Mbs','$'                           
  576. MSG43          db  13d,10d,' Disk transfer rate > 5Mbs but <= 10Mbs','$'                           
  577. MSG44          db  13d,10d,' Disk transfer rate > 10 Mbs','$'                           
  578. MSG45          db  13d,10d,' Rotational speed tolerance is > 0,5%','$'                           
  579.  
  580. MSG46          db  13d,10d,' Data strobe offset option available','$'                           
  581. MSG47          db  13d,10d,' Track offset option available','$'                           
  582. MSG48          db  13d,10d,' Format speed tolerance gap required','$'                           
  583.  
  584. MSG49          db  13d,10d,' General configuration bit-significant information:'    
  585. LINE:          db  13d,10d,'═══════════════════════════════════════════════════════════════════════════════','$'
  586. MSG50          db  ' => R/W multiple commands not implemented','$'
  587. MSG51          db  ' => # sectors transferred / interrupt','$'                           
  588.  
  589. MSG52          db  ' => Single Ported / Multisector','$'
  590. MSG53          db  ' => Dual Ported / Multisector','$'                           
  591. MSG54          db  ' => Dual Ported/Multisector/Caching','$'
  592. MSG55          db  ' => Not specified','$'                           
  593.  
  594. ERROR_MSG     db   13d,10d,' More than 2 HD devices reported by BIOS','$'                           
  595. ;********************************************************************************
  596.  
  597. DATA_BUFFER:
  598.  
  599. General_configuration                 dw  0
  600. Number_of_cylinders                   dw  0                                       
  601. Reserved                              dw  0                                       
  602. Number_of_heads                       dw  0                                       
  603. Number_unformatted_bytes_per_track    dw  0
  604. Number_unformatted_bytes_per_sector   dw  0
  605. Number_sectors_per_track              dw  0
  606. Vendor_unique1                        dw  0,0,0
  607. Serial_number                         dw  10 dup (0) ;(20 ASCII characters, 0000h=not specified)         
  608. Buffer_type                           dw  0
  609. Buffer_size                           dw  0          ;in 512 byte increments (0000h=not specified)         
  610. Num_ECC_bytes_read_write_long_cmds    dw  0          ;(0000h=not spec'd)  
  611. Firmware_revision                     dw  4 dup (0)  ;(8 ASCII characters, 0000h=not specified)      
  612. Model_number                          dw  20 dup (0) ;(40 ASCII characters, 0000h=not specified)          
  613. Vendor_unique2                        dw  0          ;15-8  Vendor unique                                             
  614.                                                      ;7-0  00h = Read/write multiple commands not implemented         
  615.                                                      ;xxh = Maximum number of sectors that can be transferred    
  616.                                                      ;      per interrupt on read and write multiple commands    
  617. Doubleword_performance                dw  0          ;0000h = cannot perform doubleword I/O    Included for backwards  
  618.                                                      ;0001h = can perform doubleword I/O       Compatible VU use       
  619. Capabilities                          dw  0          ;15-10  0=reserved 
  620.                                                      ;9  1=LBA supported 
  621.                                                      ;8  1=DMA supported               
  622.                                                      ;7- 0  Vendor unique                                
  623. Reserved2                             dw  0                        
  624. PIO_data_transfer_cycle_timing_mode   dw  0          ;15-8  PIO data transfer cycle timing mode 
  625.                                                      ;7-0  Vendor unique
  626. DMA_data_transfer_cycle_timing_mode   dw  0          ;15-8  DMA data transfer cycle timing mode
  627.                                                      ;7-0  Vendor unique
  628. Reserved3                             dw  0          ;15-1  Reserved                                                   
  629.                                                      ;1=the fields reported in words 54-58 are valid
  630.                                                      ;0=the fields reported in words 54-58 may be valid 
  631. Number_of_current_cylinders           dw  0
  632. Number_of_current_heads               dw  0
  633. Number_of_current_sectors_per_track   dw  0
  634. Current_capacity_in_sectors           dw  0,0
  635. Reserved4                             dw  0          ;15-9  Reserved                                               
  636.                                                      ;8  1 = Multiple sector setting is valid                      
  637.                                                      ;7-0  xxh = Current setting for number of sectors that can be 
  638.                                                      ;           transferred per interrupt on R/W multiple commands 
  639. Total_number_user_addressable_sectors dw  0,0        ;(LBA mode only)
  640. Single_word_DMA_transfer_mode         dw  0          ;15-8  Single word DMA transfer mode active    
  641.                                                      ;7-0  Single word DMA transfer modes supported                 
  642. Multiword_DMA_transfer_mode           dw  0          ;15-8  Multiword DMA transfer mode active      
  643.                                                      ;7-0  Multiword DMA transfer modes supported          
  644. Reserved5                             dw  64 dup (0) ;Reserved
  645. Vendor_unique3                        dw  32 dup (0) ;Vendor unique
  646. Reserved6                             dw  96 dup (0) ;Reserved
  647.  
  648. TBUFF                                 dd 0
  649. ;********************************************************************************
  650.  
  651. MAIN ENDS
  652.      END START
  653.  
  654. ;********************************************************************************
  655.  
  656. comment $
  657.  
  658. ---------------------
  659. Technical Information
  660. ---------------------
  661.  
  662. Identify drive Command
  663.  
  664. The Identify Drive command enables the host to receive parameter information
  665. from the drive.  When the command is issued, the drive sets BSY, stores the
  666. required parameter information in the sector buffer, sets DRQ, and generates
  667. an interrupt.  The host then reads the information out of the sector buffer. 
  668. The parameter words in the buffer have the arrangement and meanings defined
  669. in Table 1.  All reserved bits or words shall be zero.
  670.  
  671.  
  672.  
  673.                      Table 1 - Identify drive information
  674. ;=======-==================================================================
  675. ;|  Word |                                                                  |
  676. ;|-------+------------------------------------------------------------------|
  677. ;|    0  | General configuration bit-significant information:               |
  678. ;|       |   15  0   reserved for non-magnetic drives                       |
  679. ;|       |   14  1=format speed tolerance gap required                      |
  680. ;|       |   13  1=track offset option available                            |
  681. ;|       |   12  1=data strobe offset option available                      |
  682. ;|       |   11  1=rotational speed tolerance is > 0,5%                     |
  683. ;|       |   10  1=disk transfer rate > 10 Mbs                              |
  684. ;|       |    9  1=disk transfer rate > 5Mbs but <= 10Mbs                   |
  685. ;|       |    8  1=disk transfer rate <= 5Mbs                               |
  686. ;|       |    7  1=removable cartridge drive                                |
  687. ;|       |    6  1=fixed drive                                              |
  688. ;|       |    5  1=spindle motor control option implemented                 |
  689. ;|       |    4  1=head switch time > 15 usec                               |
  690. ;|       |    3  1=not MFM encoded                                          |
  691. ;|       |    2  1=soft sectored                                            |
  692. ;|       |    1  1=hard sectored                                            |
  693. ;|       |    0  0=reserved                                                 |
  694. ;|    1  | Number of cylinders                                              |
  695. ;|    2  | Reserved                                                         |
  696. ;|    3  | Number of heads                                                  |
  697. ;|    4  | Number of unformatted bytes per track                            |
  698. ;|    5  | Number of unformatted bytes per sector                           |
  699. ;|    6  | Number of sectors per track                                      |
  700. ;|  7-9  | Vendor unique                                                    |
  701. ;| 10-19 | Serial number (20 ASCII characters, 0000h=not specified)         |
  702. ;|   20  | Buffer type                                                      |
  703. ;|   21  | Buffer size in 512 byte increments (0000h=not specified)         |
  704. ;|   22  | # of ECC bytes avail on read/write long cmds (0000h=not spec'd)  |
  705. ;| 23-26 | Firmware revision (8 ASCII characters, 0000h=not specified)      |
  706. ;| 27-46 | Model number (40 ASCII characters, 0000h=not specified)          |
  707. ;|   47  | 15-8  Vendor unique                                              |
  708. ;|       |  7-0  00h = Read/write multiple commands not implemented         |
  709. ;|       |       xxh = Maximum number of sectors that can be transferred    |
  710. ;|       |             per interrupt on read and write multiple commands    |
  711. ;|   48  | 0000h = cannot perform doubleword I/O    Included for backwards  |
  712. ;|       | 0001h = can perform doubleword I/O       Compatible VU use       |
  713. ;|   49  | Capabilities                                                     |
  714. ;|       | 15-10  0=reserved                                                |
  715. ;|       |     9  1=LBA supported                                           |
  716. ;|       |     8  1=DMA supported                                           |
  717. ;|       |  7- 0  Vendor unique                                             |
  718. ;|   50  | Reserved                                                         |
  719. ;|   51  | 15-8  PIO data transfer cycle timing mode                        |
  720. ;|       |  7-0  Vendor unique                                              |
  721. ;|   52  | 15-8  DMA data transfer cycle timing mode                        |
  722. ;|       |  7-0  Vendor unique                                              |
  723. ;|   53  | 15-1  Reserved                                                   |
  724. ;|       |    0  1=the fields reported in words 54-58 are valid             |
  725. ;|       |       0=the fields reported in words 54-58 may be valid          |
  726. ;|   54  | Number of current cylinders                                      |
  727. ;|   55  | Number of current heads                                          |
  728. ;|   56  | Number of current sectors per track                              |
  729. ;| 57-58 | Current capacity in sectors                                      |
  730. ;|   59  | 15-9  Reserved                                                   |
  731. ;|       |    8  1 = Multiple sector setting is valid                       |
  732. ;|       |  7-0  xxh = Current setting for number of sectors that can be    |
  733. ;|       |             transferred per interrupt on R/W multiple commands   |
  734. ;| 60-61 | Total number of user addressable sectors (LBA mode only)         |
  735. ;|   62  | 15-8  Single word DMA transfer mode active                       |
  736. ;|       |  7-0  Single word DMA transfer modes supported (see 11-3a)       |
  737. ;|   63  | 15-8  Multiword DMA transfer mode active                         |
  738. ;|       |  7-0  Multiword DMA transfer modes supported (see 11-3b)         |
  739. ;| 64-127| Reserved                                                         |
  740. ;|128-159| Vendor unique                                                    |
  741. ;|160-255| Reserved                                                         |
  742. ;==========================================================================
  743.  
  744. ---------------------
  745. Description of Fields
  746. ---------------------
  747.  
  748. ---------------------------
  749. Word 1: Number of cylinders
  750. ---------------------------
  751.  
  752. The number of user-addressable cylinders in the default translation mode.
  753.  
  754. ---------------------------
  755. Word 3: Number of heads
  756. ---------------------------
  757.  
  758. The number of user-addressable heads in the default translation mode.
  759.  
  760. ---------------------------------------------
  761. Word 4: Number of unformatted bytes per track
  762. ---------------------------------------------
  763.  
  764. The number of unformatted bytes per translated track in the default
  765. translation mode.
  766.  
  767. ----------------------------------------------
  768. Word 5: Number of unformatted bytes per sector
  769. ----------------------------------------------
  770.  
  771. The number of unformatted bytes per sector in the default translation mode.
  772.  
  773. -----------------------------------
  774. Word 6: Number of sectors per track
  775. ------------------------------------
  776.  
  777. The number of user-addressable sectors per track in the default translation
  778. mode.
  779.  
  780. -------------------------
  781. Word 10-19: Serial Number
  782. -------------------------
  783.  
  784. The contents of this field are right justified and padded with spaces (20h).
  785.  
  786. --------------------
  787. Word 20: Buffer Type
  788. --------------------
  789.  
  790. The contents of the field are determined by the manufacturer.
  791.  
  792.       000h      =  not specified.
  793.       0001h        =  a single ported single sector buffer which is not
  794.                       capable of simultaneous data transfers to or from the
  795.                       host and the disk.
  796.       0002h     =  a dual ported multi-sector buffer capable of simultaneous
  797.                    data transfers to or from the host and the disk.
  798.       0003h     =  a dual ported multi-sector buffer capable of simultaneous
  799.                    transfers with a read caching capability.
  800.       0004-FFFFh   =  reserved
  801.  
  802. These codes are typically not used by the operating system, however, they are
  803. useful for diagnostic programs which perform initialization routines e.g.  a
  804. different interleave may be desirable for 0001h vs 0002h or 0003h.
  805.  
  806. --------------------------------------------------------
  807. Word 22: ECC bytes available on read/write long commands 
  808. --------------------------------------------------------
  809.  
  810. If the contents of this field are set to a value other than 4, the only way
  811. to use this information is via the Set Features commands.
  812.  
  813. -----------------------------
  814. Word 23-26: Firmware revision
  815. -----------------------------
  816.  
  817. The contents of this field are left justified and padded with spaces (20h).
  818.  
  819. ------------------------
  820. Word 27-46: Model number
  821. ------------------------
  822.  
  823. The contents of this field are left justified and padded with spaces (20h).
  824.  
  825. --------------------------------------------
  826. Word 51: PIO data transfer cycle timing mode
  827. --------------------------------------------
  828.  
  829. N/A
  830.  
  831. --------------------------------------------
  832. Word 52: DMA data transfer cycle timing mode
  833. --------------------------------------------
  834.  
  835. N/A
  836. The contents of this word shall be ignored if Words 62 or 63 are supported.
  837.  
  838. ------------------------------------
  839. Word 54: Number of current cylinders
  840. -------------------------------------
  841.  
  842. The number of user-addressable cylinders in the current translation mode.
  843.  
  844. --------------------------------
  845. Word 55: Number of current heads
  846. --------------------------------
  847.  
  848. The number of user-addressable heads in the current translation mode.
  849.  
  850. --------------------------------------------
  851. Word 56: Number of current sectors per track
  852. --------------------------------------------
  853.  
  854. The number of user-addressable sectors per track in the current translation
  855. mode.
  856.  
  857. ---------------------------------------
  858. Word 57-58: Current capacity in sectors
  859. ---------------------------------------
  860.  
  861. The current capacity in sectors excludes all sectors used for device-specific
  862. purposes.  The number of sectors of available capacity may be calculated as: 
  863.    (Number of current cylinders * Number of current heads * Number of current
  864.    sectors per track)
  865.  
  866. --------------------------------
  867. Word 59: Multiple sector setting
  868. --------------------------------
  869.  
  870. If the valid bit is set, then bits 7-0 reflect the number of sectors currently
  871. set to transfer on a Read or Write Multiple command.
  872.  
  873. ----------------------------------------------------
  874. Word 60-61: Total number of user addressable sectors
  875. ----------------------------------------------------
  876.  
  877. If the drive supports LBA Mode, these words reflect the total number of user
  878. addressable sectors.  This value does not depend on the current drive
  879. geometry.  If the drive does not support LBA mode, these words shall be set
  880. to 0.
  881.  
  882. ---------------------------------
  883. Word 62: Single word DMA transfer
  884. ---------------------------------
  885.  
  886. The low order byte identifies by bit all of the Modes which are supported e.g. 
  887. if Mode 0 is supported, bit 0 is set.  The high order byte contains a single
  888. bit set to indicate which mode is active.
  889.  
  890. -------------------------------
  891. Word 63: Multiword DMA transfer
  892. -------------------------------
  893.  
  894. The low order byte identifies by bit all of the Modes which are supported e.g. 
  895. if Mode 0 is supported, bit 0 is set.  The high order byte contains a single
  896. bit set to indicate which mode is active.
  897.  
  898. $
  899.  
  900.  
  901.  
  902.