1

czy ktos znalazl by chwile na napisanie programu testowego ktory:

- zidentyfikowal dysk master i slave

- wykonal test zapisu/odczytu znalezionych dyskow

- ewentualnie podal jakis benchmark (read spid, write spid, overall)

tutaj sa procedury sluzace do komunikacji z dyskiem:

; Basic IO functions for SpeedDrive
; By Candle'O'Sin

;-------------------------------------------------------------
; Read_Sector
; a - master/slave (0x00/0x10)
; Sector_Number    - sector number (32 bit)
; Sector_Buffer - offset to sector buffer (512 bytes)
;-------------------------------------------------------------
Read_Sector:    
        ora    #0xE0        ; LBA mode on
        sta    0xD116
        lda    #0x01
        sta    0xD112        ; read 1 sector
        lda    Sector_Number    ; bits 0-7
        sta    0xD113
        lda    Sector_Number+1    ; bits 8-15
        sta    0xD114
        lda    Sector_Number+2    ; bits 16-23
        sta    0xD115
        lda    Sector_Number+3    ; bits 27-24
        and    #0x0f
        ldy    0xD116
        sty    Disk_Temp
        ora    Disk_Temp
        sta    0xD116
        lda    #0x20        ; read sector with retry
        sta    0xD117
        ldy    #0x00
Read_Sector_l1:    lda    0xD117
        tax
        and    #0x01        ; check if command was aborted?
        bne    Read_Sector_error
        dey            ; timed out?
        beq    Read_Sector_error
        txa
        cmp    #0x58        ; sector buffer requires servicing?
        bne    Read_Sector_l1
        ldx    #0x00
Read_Sector_l2:    lda    0xD110
        sta    Sector_Buffer,x
        lda    0xD100
        sta    Sector_Buffer+0x0100,x
        inx
        bne    Read_Sector_l2
        clc
        rts
Read_Sector_error:
        sec
        rts
;-------------------------------------------------------------
        
;-------------------------------------------------------------
; Write_Sector
; a - master/slave (0x00/0x10)
; Sector_Number    - sector number (32 bit)
; Sector_Buffer - offset to sector buffer (512 bytes)
;-------------------------------------------------------------
Write_Sector:    
        ora    #0xE0        ; LBA mode on
        sta    0xD116
        lda    #0x01
        sta    0xD112        ; write 1 sector
        lda    Sector_Number    ; bits 0-7
        sta    0xD113
        lda    Sector_Number+1    ; bits 8-15
        sta    0xD114
        lda    Sector_Number+2    ; bits 16-23
        sta    0xD115
        lda    Sector_Number+3    ; bits 27-24
        and    #0x0f
        ldy    0xD116
        sty    Disk_Temp
        ora    Disk_Temp
        sta    0xD116
        lda    #0x30        ; write sector with retry
        sta    0xD117
        ldy    #0x00
Write_Sector_l1:
        lda    0xD117
        tax
        and    #0x01        ; check if command was aborted?
        bne    Write_Sector_error
        dey            ; timed out?
        beq    Write_Sector_error
        txa
        and    #0x20        ; write fault?
        bne    Write_Sector_error
        txa
        and    #0x80        ; busy?
        bne    Write_Sector_l1
        ldx    #0x00
Write_Sector_l2:
        lda    Sector_Buffer+0x0100,x
        sta    0xD100
        lda    Sector_Buffer,x
        sta    0xD110
        inx
        bne    Write_Sector_l2
        clc
        rts
Write_Sector_error:
        sec
        rts
;-------------------------------------------------------------

;-------------------------------------------------------------
; Drive_Reset
; a - master/slave (0x00/0x10)
;-------------------------------------------------------------
Drive_Reset:    ora    #0xA0        ; sets unused bits on
        sta    0xD116
        lda    #0x08        ; reset drive
        sta    0xD117
        lda    0xD40B
        rne
        lda    0xD40B
        req            ; wait for v-sync (delay)
        rts
;-------------------------------------------------------------

;-------------------------------------------------------------
; Read_Disk_ID
; a - master/slave (0x00/0x10)
; Sector_Buffer - buffer for raw information about the drive
;-------------------------------------------------------------
Read_Disk_ID:    ora    #0xA0
        sta    0xD116
        lda    #0xEC        ; identify drive
        sta    0xD117
        ldy    #0x00
Read_Disk_ID_l1:
        lda    0xD117
        tax
        and    #0x01        ; check if command was aborted?
        bne    Read_Disk_ID_error
        dey            ; timed out?
        beq    Read_Disk_ID_error
        txa
        cmp    #0x58        ; sector buffer requires servicing?        
        ldx    #0x00
Read_Disk_ID_l2:
        lda    0xD110
        sta    Sector_Buffer,x
        lda    0xD100
        sta    Sector_Buffer+0x0100,x
        inx
        bne    Read_Disk_ID_l2
        clc
        rts
Read_Disk_ID_error:
        sec
        rts
;-------------------------------------------------------------

urzadzenie PBI nalezy najpierw znalesc (dla uproszczenia mozna zalozyc ze ma ID = 0x01)
znajdowanie mozna zrobic w ten sposob, ze wlaczamy kolejne numery urzadzen i sprawdzamy czy pod adresem 0xD1EE pojawila sie literka 'S' (ascii 0x53) - jesli tak, to jest to speeddrive

Post's attachments

SpeedDrive.asm 3.55 kb, liczba pobrań: 8 (od 2010-03-08) 

Tylko zalogowani mogą pobierać załączniki.
przechodze na tumiwisizm

2

Ty idź spać a nie o 4.-tej pisać posty.

OKI, ale dopiero wieczorem zacznę kodować.....

3

Pajero :) - popraw plizzz AtariCommandera :) - błagam. Nawet zwiększenie bufora na kopiowanie danych będzie zbawiennym rozwiązaniem. Bufor - im większy, tym lepiej, bo kopiowanie większych ilości danych obecnie jest zbyt czasochłonne :)

Kontakt: pin@usdk.pl

4

Candle - wysyłam Ci wersje z jeszcze niedokończonym Benchmarkiem.... potestuj

Pin - w elektro ugrzęzłem :(

5

Pajero: dzieki, odpowiedz tez na mailu... niestety...

wyglada na to ze program dziala jedynie na emulglatorze

przechodze na tumiwisizm

6 Ostatnio edytowany przez pajero (2010-03-09 10:38:50)

Nie wiedziałem, że Sparta czy Mydos nie uruchamiają EXEa bez wpisu do $2e0.
Mam zwichnięcie umysłu przez Dos-s II.

Ofkoz pisz co i jak, poprawię się :P


Mogę robić kod z "doskoku" - znowu bezrobotny jestem, ech.



UPDATE:
Wysłana wersja z Benchmarkiem....

7

jak wcisne auto - master no, slave no
jak wymusze master i wcisne read: status 8a - co to jest 8a?
czemu nie wybiera urzadzenia pbi przed dostepem do rejestrow?

przechodze na tumiwisizm

8 Ostatnio edytowany przez pajero (2010-03-10 10:36:58)

Pisałem w e-mailu co oznacza 8A

Dlaczego nie wybiera? Bo kodu nie starczyło..... dopiszę :)

UPDATE:
Wersja 0.4 - powinno już wybierać PBI :)



Dodałem Benchmark dla SIO - podobny do RWTEST

Czy są chętni do potestowania tej opcji?

Po wczytaniu wciskacie "D" i "Y"
Na dysku musi być wolne 64kB by test skończył się pomyślnie.....

* OPIS FUKCJI

* Auto / Master / Slave - test DriveID
* Choice - zmiana napędu na którym wykonany zostanie test:
* Read / Write / IO=OverAll (write and read+compare)
* Benchmark - SpeedDrive Benchmark test (write/read/average)
* DosSIO - SIO Benchmark test (write/read/average)

* status:
* 01 = SIO test koniec
* 02 = test przerwany wciśnięciem dowolnego klawisza
* 8A = na ogół oznacza to, że urządzenie nie istnieje, jest wadliwie podłączone bądź uszkodzone
* 8F = niezgodność porównania danych sektorów, zapisanych a potem odczytano i są byki
* FF = test zakończył się

Speed Drive TST v0.4.atr

9

pajero, mozesz to spackowac do zipa? Nie mam innej mozliwosci sciagniecia tego pliku jak na telefon, a ten jakos nie wie co to atr i bardzo chce go wyswietlic na ekranie...

przechodze na tumiwisizm

10

Candle - zip ;)-

http://www.ghnet.com.pl/~pin/candle/speedtest.zip

Kontakt: pin@usdk.pl

11 Ostatnio edytowany przez pajero (2010-03-10 00:06:26)

Wersja 0.5

RWTEST nie tylko na D1: Teraz możliwa zmiana nr cyferki 1-9
Master/Slave - brak wykrycia to "no", detekcja pokaże wybrany bit zamiast "ok"

Post's attachments

Speed Drive TST v0.5.zip 6.31 kb, liczba pobrań: 7 (od 2010-03-10) 

Tylko zalogowani mogą pobierać załączniki.

12

pajero napisał/a:

RWTEST nie tylko na D1: Teraz możliwa zmiana nr cyferki 1-9

RWTEST działa na każdym napędzie, trzeba podać identyfikator w linii komend... (np. RWTEST D3: )

KMK
? HEX$(6670358)

13

precyzuje, piszę o wbudowanym RWTEST do Speed Drive TST ....

14

Aha, zmyliła mnie nazwa (RWTEST to taki tool do KMK/JŻ IDE).

KMK
? HEX$(6670358)

15

status tkwi na 8a
przy wciskaniu r licznik sektorow zatrzymuje sie na losowej wartosci z przedzialu 0-20, dysk w tym czasie sobie mignie
benchmark niezmiennie pokazuje 65535 - chyba skonczylo ci sie 16 bit...
przy jednym dysku (bez wzgledu na slave czy master) autodetekcja wykrywa slave 01 i master 01 - jakos to do mnie nie przemawia, przy czym proba odczytu z fizycznie nieistniejacego dysku konczy sie porazka

statusy ogolnie to zes pan z dupy wymyslil - a nie lepiej przepisac po prostu rejestr statusu dysku na ekran ($d117)

przydala by sie tez opcja resetu interface - reset nastepuje przy zapisie dowolnej wartosci pod adres $d180 - w ten sposob mozna podmienic dyski w locie (lub je przezworkowac)

przechodze na tumiwisizm

16

Ech, a ilu na scenie programowało PBI, wg mnie dwóch. To się nie dziw, że masz zbudowany szkielet programu. Teraz Twoja kolej....

Candle napisał/a:

status tkwi na 8a
przy wciskaniu r licznik sektorow zatrzymuje sie na losowej wartosci z przedzialu 0-20, dysk w tym czasie sobie mignie

8a pojawia się, jeśli zakończenie Twoich procek ustawi C=1

Candle napisał/a:

benchmark niezmiennie pokazuje 65535 - chyba skonczylo ci sie 16 bit...

jeśli ciągle jest 8a to benchmark się nie udał - nie było poprawnego R/W to i ustawiam na FFFF. przypomnę Ci, by przekręcić 16 bitów potrzeba 21 minut trwania testu. A obliczenia są 16 bit z wynikiem 32bit. Wystarcza, niedokładności są rzędu 1,5% w matematyce.

Candle napisał/a:

przy jednym dysku (bez wzgledu na slave czy master) autodetekcja wykrywa slave 01 i master 01 - jakos to do mnie nie przemawia, przy czym proba odczytu z fizycznie nieistniejacego dysku konczy sie porazka

korzystam z Twoich procek RW. ustawiam bity w $D1FF i tyle. dalej działaj sam - masz źródła.

Candle napisał/a:

statusy ogolnie to zes pan z dupy wymyslil - a nie lepiej przepisac po prostu rejestr statusu dysku na ekran ($d117)

A skąd mam wiedzieć o $D117. Tu (http://atariki.krap.pl/index.php/Rejestry_PBI) nic o tym nie ma!
To se zmień #$8a na $d117 i po kłopocie.

Candle napisał/a:

przydala by sie tez opcja resetu interface - reset nastepuje przy zapisie dowolnej wartosci pod adres $d180 - w ten sposob mozna podmienic dyski w locie (lub je przezworkowac)

Obawiam się, że wersje 0.6 musisz se sam spreparować. Źródła kodu masz, hardware tym bardziej. Ja tu nic więcej nie pomogę. Pisanie na czuja bez wiedzy o PBI i wymaganiach SpeedDrive (jego rejestrach)? Musisz sam dostosować kod do potrzeb. Odwaliłem 950 linii kodu - teraz Twoja kolej.

17 Ostatnio edytowany przez mikey (2010-03-13 00:33:37)

Pajero, nie denerwuj sie :) Wszyscy jedziemy na tym samym wózku :)

$D117 - prosze bardzo
http://atariki.krap.pl/index.php/Rejest … %C5%BB_IDE

18

Znaczy się, SpeedDrive znaczenie rejestrów ma być identyczne co w KMK/IDE?

19

nie, kmk/idea mapuja fizyczne rejestry interface ATA na obszar D110-D117 i tak tez robi spiddrajw - chocby dlatego, ze w tej chwili mam tylko bios do kmk/idei

procedury zapis/odczyt ktore pisalem na sucho dzialaja - sprawdzone dzieki uprzejmosci mikeya - zarowno odczyt, jak i zapis

nie rozumiem kodu ktory wyprodukowales, wiec nie bede w stanie go poprawic

co do samego pbi to jest potrzebne tyle wiedzy, ze zeby go wlaczyc nalezy wpisac 1 do rejestru D1FF, a wylacza sie go przez wpisanie tam 0 - nic wiecej cie nie interesuje

spiddrajw procz swoich specyficznych rejestrow ma standardowe rejestry ATA, ktore masz opisane w atariki, lub tu (pctowe interrupt list, plik ports.b):

PORT 01F0-01F7 - HDC 1    (1st Fixed Disk Controller) (ISA, EISA)
Range:    01F0-01F7 for primary controller, 0170-0177 for secondary controller
SeeAlso: PORT 0170h-0177h,PORT 3510h-3513h

01F0  RW  data register
01F1  R-  error register (see #P0512)
01F1  -W  WPC/4     (Write Precompensation Cylinder divided by 4)
01F2  RW  sector count
01F3  RW  sector number (CHS mode)
      logical block address, bits 0-7 (LBA mode)
01F4  RW  cylinder low (CHS mode)
      logical block address, bits 15-8 (LBA mode)
01F5  RW  cylinder high (CHS mode)
      logical block address, bits 23-16 (LBA mode)
01F6  RW  drive/head (see #P0513)
01F7  R-  status register (see #P0514)
01F7  -W  command register (see #P0515)

Bitfields for Hard Disk Controller error register:
Bit(s)    Description    (Table P0512)
---diagnostic mode errors---
 7    which drive failed (0 = master, 1 = slave)
 6-3    reserved
 2-0    error code
    001    no error detected
    010    formatter device error
    011    sector buffer error
    100    ECC circuitry error
    101    controlling microprocessor error
---operation mode---
 7    bad block detected
 6    uncorrectable ECC error
 5    reserved
 4    ID found
 3    reserved
 2    command aborted prematurely
 1    track 000 not found
 0    DAM not found (always 0 for CP-3022)
SeeAlso: #P0513,#P0514

Bitfields for hard disk controller drive/head specifier:
Bit(s)    Description    (Table P0513)
 7    =1
 6    LBA mode enabled, rather than default CHS mode
 5    =1
 4    drive select (0 = drive 0, 1 = drive 1)
 3-0    head select bits (CHS mode)
    logical block address, bits 27-24 (LBA mode)
SeeAlso: #P0512,#P0514

Bitfields for hard disk controller status register:
Bit(s)    Description    (Table P0514)
 7    controller is executing a command
 6    drive is ready
 5    write fault
 4    seek complete
 3    sector buffer requires servicing
 2    disk data read successfully corrected
 1    index - set to 1 each disk revolution
 0    previous command ended in an error
SeeAlso: #P0512,#P0515

(Table P0515)
Values for hard disk controller command codes:
Command     Spec    Type    Proto    Description            class:
 00h        opt    nondata    NOP
 08h                device reset
 1xh        opt    nondata    recalibrate              1
 20h        req    PIOin    read sectors with retry          1
 21h        req    PIOin    read sectors without retry      1
 22h        req    PIOin    read long with retry          1
 23h        req    PIOin    read long without retry          1
 30h        req    PIOout    write sectors with retry      2
 31h        req    PIOout    write sectors without retry      2
 32h        req    PIOout    write long with retry          2
 33h        req    PIOout    write long without retry      2
 3Ch     IDE    opt    PIOout    write verify              3
 40h        req    nondata    read verify sectors with retry      1
 41h        req    nondata    read verify sectors without retry 1
 50h        req    vend    format track              2
 7xh        req    nondata    seek                  1
 8xh     IDE    vendor    vend    vendor unique 3
 90h        req    nondata    execute drive diagnostics      1
 91h        req    nondata    initialize drive parameters      1
 92h        opt    PIOout    download microcode
 94h E0h IDE    opt    nondata    standby immediate          1
 95h E1h IDE    opt    nondata    idle immediate              1
 96h E2h IDE    opt    nondata    standby                  1
 97h E3h IDE    opt    nondata    idle                  1
 98h E5h IDE    opt    nondata    check power mode          1
 99h E6h IDE    opt    nondata    set sleep mode              1
 9Ah     IDE    vendor    vend    vendor unique 1
 A0h     ATAPI            packet command
 A1h     ATAPI    opt    PIOin    ATAPI Identify            (see #P0524)
 B0h     SMART    opt        Self Mon., Analysis, Rept. Tech. (see #P0527)
 C0h-C3h IDE    vendor    vend    vendor unique 2
 C4h     IDE    opt    PIOin    read multiple              1
 C5h     IDE    opt    PIOout    write multiple              3
 C6h     IDE    opt    nondata    set multiple mode          1
 C7h     ATA-4            Read DMA O/Q
 C8h     IDE    opt    DMA    read DMA with retry          1
 C9h     IDE    opt    DMA    read DMA without retry          1
 CAh     IDE    opt    DMA    write DMA with retry          3
 CBh     IDE    opt    DMA    write DMA w/out retry          3
 CCh     ATA-4            Write DMA O/Q
 DAh                get media status
 DBh     ATA-2    opt    vend    acknowledge media chng        [Removable]
 DCh     ATA-2    opt    vend    Boot / Post-Boot        [Removable]
 DDh     ATA-2    opt    vend    Boot / Pre-Boot    (ATA-2)        [Removable]
 DEh     ATA-2    opt    vend    door lock            [Removable]
 DFh     ATA-2    opt    vend    door unlock            [Removable]
 E0h-E3h            (second half of commands 94h-96h)
 E4h     IDE    opt    PIOin    read buffer              1
 E5h-E6h            (second half of commands 98h-99h)
 E8h     IDE    opt    PIOout    write buffer              2
 E9h     IDE    opt    PIOout    write same              3
 EAh     ATA-3    opt        Secure Disable            [Security Mode]
 EAh     ATA-3    opt        Secure Lock            [Security Mode]
 EAh     ATA-3    opt        Secure State            [Security Mode]
 EAh     ATA-3    opt        Secure Enable WriteProt        [Security Mode]
 EBh     ATA-3    opt        Secure Enable            [Security Mode]
 EBh     ATA-3    opt        Secure Unlock            [Security Mode]
 ECh     IDE    req    PIOin    identify drive              1 (see #P0516)
 EDh     ATA-2    opt    nondata    media eject            [Removable]
 EEh     ATA-3    opt        identify device DMA            (see #P0516)
 EFh     IDE    opt    nondata    set features              1 (see #P0535)
 F0h-F4h IDE        vend    EATA standard
 F1h                Security Set Password
 F2h                Security Unlock
 F3h                Security Erase Prepare
 F4h                Security Erase Unit
 F5h-FFh IDE    vendor    vend    vendor unique 4
 F5h                Security Freeze Lock
 F6h                Security Disable Password
SeeAlso: #P0512,#P0514

Format of IDE/ATA Identify Drive information:
Offset    Size    Description    (Table P0516)
 00h    WORD    general configuration (see #P0517)
 02h    WORD    number of logical cylinders
 04h    WORD    reserved
 06h    WORD    number of logical heads
 08h    WORD    vendor-specific (obsolete: unformatted bytes per track)
 0Ah    WORD    vendor-specific (obsolete: unformatted bytes per sector)
 0Ch    WORD    number of logical sectors
 0Eh    WORD    vendor-specific
 10h    WORD    vendor-specific
 12h    WORD    vendor-specific
 14h 10 WORDs    serial number
        no serial number if first word is 0000h
        else blank-padded ASCII serial number
 28h    WORD    vendor-specific
        [buffer type: 01h single-sector, 02h multisector,
          03h multisector with read cache]
 2Ah    WORD    controller buffer size in 512-byte sectors
        0000h = unspecified
 2Ch    WORD    number of vendor-specific (usually ECC) bytes on
          Read/Write Long; 0000h = unspecified
 2Eh  4    WORDs    firmware revision
        no revision number if first word is 0000h
        else blank-padded ASCII revision number
 36h 20    WORDs    model number
        no model number if first word is 0000h
        else blank-padded ASCII model string
 5Eh    WORD    read/write multiple support
        bits 7-0: maximum number of sectors per block supported
            00h if read/write multiple not supported
        bits 15-8: vendor-specified
 60h    WORD    able to do doubleword transfers if nonzero
 62h    WORD    capabilities (see #P0518)
 64h    WORD    security mode
        bit 15: security-mode feature set supported
        bits 14-8: maximum number of passwords supported
 66h    WORD    PIO data transfer cycle timing
 68h    WORD    single-word DMA data transfer cycle timing
 6Ah    WORD    field validity
        bit 0: offsets 6Ch-75h valid
        bit 1: offsets 80h-8Dh valid
 6Ch    WORD    logical cylinders in current translation mode
 6Eh    WORD    logical heads in current translation mode
 70h    WORD    logical sectors per track in current translation mode
 72h    DWORD    current capacity in sectors (excluding device-specific uses)
 76h    WORD    multiple-sector support
        bits 7-0: count for read/write multiple command
        bit 8:    multiple-sector setting is valid
 78h    DWORD    total number of user-addressable sectors (LBA mode)
        00000000h if LBA mode not supported
 7Ch    WORD    single-word DMA transfer modes
        low byte is bitmap of supported modes (bit 0 = mode 0, etc.)
        high bytes is bitmap of active mode (bit 8 = mode 0, etc.)
 7Eh    WORD    multiword DMA transfer
        low byte is bitmap of supported modes (bit 0 = mode 0, etc.)
        high byte is bitmap of active mode (bit 8 = mode 0, etc.)
 80h    WORD    supported flow control PIO transfer modes
 82h    WORD    minimum multiword DMA transfer cycle time in ns
 84h    WORD    recommended multiword DMA cycle time in ns
 86h    WORD    minimum non-flow-control PIO transfer cycle time in ns
 88h    WORD    minimum PIO transfer cycle time with IORDY in ns
 8Ah  2 WORDs    reserved for future PIO modes (0)
 8Eh  2 WORDs    reserved (0)
 92h    WORD    command queueing/overlapped operation (see #P0523)
 94h  6 WORDs    reserved (0)
 A0h    WORD    major revision number of specification to which device conforms
        01h = ATA-1, 02h = ATA-2, etc.    0000h/FFFFh = not reported
 A2h    WORD    minor revision number of specification to which device conforms
        0000h/FFFFh = not reported
 A4h    WORD    feature set support 1 (see #P0519)
        (only valid if revision reported in A0h/A2h)
 A6h    WORD    feature set support 2 (see #P0520)
        (only valid if revision reported in A0h/A2h)
 A8h    WORD    (ATA/ATAPI-4) feature set support extension (see #P0521)
 AAh    WORD    feature set enabled 1 (see #P0522)
        (only valid if revision reported in A0h/A2h)
 ACh    WORD    feature set enabled 2 (see #P0520)
        (only valid if revision reported in A0h/A2h)
 AEh    WORD    (ATA/ATAPI-4) feature set enabled extension (see #P0521)
 B0h 42 WORDs    reserved (0)
100h 32 WORDs    vendor-specific
100h    WORD    security status
140h 96 WORDs    reserved (0)
SeeAlso: #P0524,#00267

Bitfields for IDE general configuration:
Bit(s)    Description    (Table P0517)
 15    device class
    =0 ATA device
    =1 ATAPI device
 14    requires format speed tolerance gap
 13    supports track offset option
 12    supports data strobe offset
 11    disk rotational sped tolerance > 0.5%
 10-8    disk transfer rate
    001 <= 5Mbit/sec
    010 5-10 Mbit/sec
    100 > 10Mbit/sec
 7-6    drive type
    01 fixed media
    10 removable media
 5    synchronized drive motor option enabled
 4    head-switching time > 15 microseconds
 3    encoding
    =0 MFM
 2-1    sector type
    01 hard-sectored
    10 soft-sectored
 0    unused (0)
SeeAlso: #P0516

Bitfields for IDE capabilities:
Bit(s)    Description    (Table P0518)
 13    Standby Timer values used according to ATA standard
 11    IORDY supported
 10    device can disable use of IORDY
 9    LBA mode supported
 8    DMA supported
SeeAlso: #P0516

Bitfields for ATA feature set support 1:
Bit(s)    Description    (Table P0519)
 15    Identify Device DMA command is supported
 14    NOP (00h) command is supported
 13    Read Buffer command is supported
 12    Write Buffer command is supported
 11    Write Verify command is supported
 10    host protected area feature set is supported
 9    Device Reset (08h) command is supported
 8    Service interrupt is supported
 7    release interrupt is supported
 6    device supports look-ahead
 5    device supports write cache
 4    PACKET command feature set is supported
 3    power management is supported
 2    removable-media feature set is supported
 1    security feature set is supported
 0    SMART feature set is supported
Note:    values of 0000h and FFFFh indicate that this field is not supported
SeeAlso: #P0516,#P0520,#P0521

Bitfields for ATA feature set support/enabled 2:
Bit(s)    Description    (Table P0520)
 15    must be 0 if this field is supported
 14    must be 1 if this field is supported
 13-2    reserved
 1    Read DMA O/Q (C7h) and Write DMA O/Q (CCh) commands supported/enabled
 0    Download Microcode (92h) command is supported/enabled
SeeAlso: #P0516,#P0522,#P0519,#P0521

Bitfields for ATA feature set support extension:
Bit(s)    Description    (Table P0521)
 15    must be 0 if this field is supported
 14    must be 1 if this field is supported
 13-0    reserved
SeeAlso: #P0516,#P0519,#P0520

Bitfields for ATA feature set enabled 1:
Bit(s)    Description    (Table P0522)
 15    Identify Device DMA command is supported
 14    NOP (00h) command is supported
 13    Read Buffer command is supported
 12    Write Buffer command is supported
 11    Write Verify command is supported
 10    host protected area feature set is supported
 9    Device Reset (08h) command is supported
 8    Service interrupt is enabled
 7    release interrupt is enabled
 6    look-ahead is enabled
 5    write cache is enabled
 4    PACKET command feature set is enabled
 3    power management is enabled
 2    removable-media feature set is enabled
 1    security feature set is enabled
 0    SMART feature set is enabled
SeeAlso: #P0516,#P0520

Bitfields for ATA/ATAPI-4 command queueing/overlapped operation support:
Bit(s)    Description    (Table P0523)
 15    reserved
 14    device supports command queueing
 13    device supports overlapped operation
 12-5    reserved
 4-0    maximum depth of queued commands supported (0 if bit 14 clear)
SeeAlso: #P0516

Format of ATAPI Identify Information:
Offset    Size    Description    (Table P0524)
 00h    WORD    general configuration (see #P0525)
 02h  9 WORDs    ???
 14h 10 WORDs    serial number
        no serial number if first word is 0000h
        else blank-padded ASCII serial number
 28h  3 WORDs    vendor-specific
 2Eh  4    WORDs    firmware revision
        no revision number if first word is 0000h
        else blank-padded ASCII revision number
 36h 20    WORDs    model number
        no model number if first word is 0000h
        else blank-padded ASCII model string
 5Eh    WORD    vendor-specific
 60h    WORD    reserved (0)
 62h    WORD    capabilities (see #P0518)
 64h    WORD    security mode???
 66h    WORD    PIO data transfer cycle timing
 68h    WORD    single-word DMA data transfer cycle timing
 6Ah    WORD    field validity
        bit 0: offsets 6Ch-73h valid
        bit 1: offsets 80h-8Dh valid
 6Ch    WORD    ??? logical cylinders in current translation mode
 6Eh    WORD    ??? logical heads in current translation mode
 70h    WORD    ??? logical sectors per track in current translation mode
 72h  2    WORDs    ??? current capacity in sectors
 76h    WORD    ??? multiple-sector count for read/write multiple command
 78h  2    WORDs    ??? total number of user-addressable sectors (LBA mode)
 7Ch    WORD    single-word DMA transfer modes
        low byte is bitmap of supported modes (bit 0 = mode 0, etc.)
        high bytes is bitmap of active mode (bit 8 = mode 0, etc.)
 7Eh    WORD    multiword DMA transfer
        low byte is bitmap of supported modes (bit 0 = mode 0, etc.)
        high bytes is bitmap of active mode (bit 8 = mode 0, etc.)
 80h    WORD    supported flow control PIO transfer modes
 82h    WORD    minimum multiword DMA transfer cycle time
 84h    WORD    recommended multiword DMA cycle time
 86h    WORD    minimum non-flow-control PIO transfer cycle time
 88h    WORD    minimum PIO transfer cycle time with IORDY
 8Ah  2 WORDs    reserved for future PIO modes (0)
 8Eh    WORD    typical time for release when processing overlapped CMD in
          microseconds
 90h    WORD    ???
 92h    WORD    major ATAPI version number
 94h    WORD    minor ATAPI version number
 96h 54 WORDs    reserved (0)
100h 32 WORDs    vendor-specific
140h 96 WORDs    reserved (0)
SeeAlso: #P0516

Bitfields for ATAPI General Configuration:
Bit(s)    Description    (Table P0525)
 15-14    device type
    0x not ATAPI
    10 ATAPI
    11 reserved
 13    reserved
 12    device present (non-ATAPI)
 12-8    ATAPI device type (see #P0526)
 7    device is removable
 6-5    CMD DMA Request type
    00 microprocessor DRQ
    01 interrupt DRQ
    10 accelerated DRQ
    11 reserved
 4-2    reserved
 1-0    CMD packet size (00 = 12 bytes, 01 = 16 bytes)
SeeAlso: #P0524

(Table P0526)
Values for ATAPI device type:
 00h    direct-access device (i.e. disk drive)
 01h    sequential-access device (i.e. tape drive)
 02h    printer
 03h    processor
 04h    write-once device
 05h    CD-ROM
 06h    scanner
 07h    optical memory
 08h    medium changer
 09h    communications device
 0Ah    reserved for ACS IT8
 0Bh    reserved for ACS IT8
 0Ch    array controller device (i.e. RAID)
 0Dh-1Eh reserved
 1Fh    unknown type or no device
SeeAlso: #P0525

(Table P0527)
Values for Self-Monitoring, Analysis, Reporting Technology (SMART) subcommand:
 D0h    Read Attribute Values (optional) (see #P0529)
    results returned in 512-byte sector read from controller
 D1h    Read Attribute Thresholds (optional) (see #P0528)
    results returned in 512-byte sector read from controller
 D2h    Disable Attribute Autosave (optional)
    sector-count register set to 0000h
 D2h    Enable Attribute Autosave
    sector-count register set to 00F1h
 D3h    Save Attribute Values (optional)
 D4h    execute off-line tests immediately (optional)
 D5h-D6h reserved
 D7h    vendor-specific
 D8h    Enable SMART Operations
 D9h    Disable SMART Operations
 DAh    Return SMART Status
    if any threshold(s) exceeded, CylinderLow set to F4h and CylinderHigh
      set to 2Ch
 DBh    Enable/Disable Automatic Off-Line Data Collection
    sector-count register set to 0000h to disable, 00F8h to enable
 DCh-DFh reserved
 E0h-EFh vendor-specific
Note:    to access SMART commands, the Cylinder Low register must be set to
      004Fh and the Cylinder High register must be set to 00C2h before
      invoking the SMART command with the SMART command number in the
      Features register
SeeAlso: #P0515

Format of S.M.A.R.T. attribute thresholds sector:
Offset    Size    Description    (Table P0528)
 00h    WORD    data structure revision number (0005h for SMART Revision 2.0)
 02h 12 BYTEs    attribute threshold data 1 (see #P0531)
 ...
14Eh 12 BYTEs    attribute threshold data 30 (see #P0531)
16Ah 18 BYTEs    reserved (0)
17Ch 131 BYTEs    vendor-specific
1FFh    BYTE    checksum (two's complement of eight-bit sum of first 511 bytes)
Note:    if the drive provides fewer than 30 attributes, all remaining attribute
      records are filled with NUL (00h) bytes
SeeAlso: #P0527,#P0529

Format of S.M.A.R.T. attribute values sector:
Offset    Size    Description    (Table P0529)
 00h    WORD
 02h 12 BYTEs    attribute value data 1 (see #P0532)
 ...
14Eh 12 BYTEs    attribute value data 30 (see #P0532)
16Ah    BYTE    off-line data collection status (see #P0533)
16Bh    BYTE    vendor-specific
16Ch    WORD    time to complete off-line data collection, in seconds
        0001h-FFFFh
16Eh    BYTE    vendor-sepcific
16Fh    BYTE    off-line data collection capability (see #P0534)
170h    WORD    S.M.A.R.T. capabilities (see #P0530)
172h 16 BYTEs    reserved (0)
182h 125 BYTEs    vendor-specific
1FFh    BYTE    checksum (two's complement of eight-bit sum of first 511 bytes)
Note:    if the drive provides fewer than 30 attributes, all remaining attribute
      records are filled with NUL (00h) bytes
SeeAlso: #P0527,#P0528

Bitfields for S.M.A.R.T capabilities:
Bit(s)    Description    (Table P0530)
 0    attributes saved on going into power-saving mode
 1    Enable/Disable Attribute Autosave subcommands are supported
 2-15    reserved
SeeAlso: #P0529

Format of S.M.A.R.T. attribute threshold:
Offset    Size    Description    (Table P0531)
 00h    BYTE    attribute ID (01h-FFh)
 01h    BYTE    attribute threshold
        00h always passing
        01h minimum threshold value
        FDh maximum threshold value
        FEh invalid (do not use)
        FFh always failing (for testing)
 02h 10 BYTEs    reserved (0)
Note:    the attribute ID and actual threshold values are vendor-specific
SeeAlso: #P0528,#P0532

Format of S.M.A.R.T attribute value:
Offset    Size    Description    (Table P0532)
 00h    BYTE    attribute ID (01h-FFh)
 01h    WORD    status flags
        bit 0: pre-failure/advisory
            =0 value < threshold indicates usage/age exceeding
                  design life
            =1 value < threshold indicates pre-failure condition
        bit 1: on-line data collection
        bits 2-5 vendor-specific
        bits 6-15 reserved
 03h    BYTE    attribute value (01h-FDh)
        initial value prior to data collection is 64h
 04h  8 BYTEs    vendor-specific
SeeAlso: #P0529,#P0531

(Table P0533)
Values for S.M.A.R.T. off-line data collection status:
 00h    off-line collection never started
 01h    reserved
 02h    off-line data collection completed successfully
 03h    reserved
 04h    off-line data collection suspended by command from host
 05h    off-line data collection aborted by command from host
 06h    off-line data collection aborted due to fatal error
 07h-3Fh reserved
 40h-7Fh vendor-specific
 80h    off-line collection never started (auto-offline feature enabled)
 81h    reserved
 82h    off-line data collection completed successfully (auto-offline feature
      enabled)
 83h    reserved
 84h    off-line data collection suspended by command from host (auto-offline
      feature enabled)
 85h    off-line data collection aborted by command from host (auto-offline
      feature enabled)
 86h    off-line data collection aborted due to fatal error (auto-offline
      feature enabled)
 87h-BFh reserved
 C0h-FFh vendor-specific
SeeAlso: #P0529,#P0534

Bitfields for S.M.A.R.T. off-line data collection capabilities:
Bit(s)    Description    (Table P0534)
 0    Execute Off-Line Immediate (D4h) subcommand is implemented
 1    Enable/Disable Automatic Off-Line subcommand is implemented
 2    abort/resume on interrupting command
    =0 off-line resumes automatically after an interrupting command
    =1 off-line collection is aborted by an interrupting command
 3-7    reserved
SeeAlso: #P0527

(Table P0535)
Values for Feature Code:
 01h    [opt] 8-bit instead of 16-bit data transfers
 02h    [opt] enable write cache
 03h          set transfer mode as specified by Sector Count register
 04h    [opt] enable all automatic defect reassignment
 22h    [opt] Write Same, user-specified area
 33h    [opt] disable retries
 44h          specify length of ECC bytes used by Read Long and Write Long
 54h    [opt] set cache segments (value in Sector Count register)
 55h          disable look-ahead
 66h          disable reverting to power-on defaults
 77h    [opt] disable ECC
 81h    [opt] 16-bit instead of 8-bit data transfers
 82h    [opt] disable write cache
 84h    [opt] disable all automatic defect reassignment
 88h    [opt] enable ECC
 99h    [opt] enable retries
 9Ah    [opt] set device maximum average current
 AAh          enable look-ahead
 ABh    [opt] set maximum prefecth (value in Sector Count register)
 BBh          use four bytes of ECC on Read Long and Write Long (for compat.)
 CCh          enable reverting to power-on defaults
 DDh    [opt] Write Same, entire disk

no ale po to pisalem te procedury we/wy zeby nie trzeba bylo sie przez to przedzierac

no i dalej nie wiem co to jest 8a

przechodze na tumiwisizm

20

No patrzac na procki candle'a i rozpiske w linku ktory podalem to z grubsza raczej tak :)