Article View: pl.comp.programming
Article #221Re: Numer seryjny HDD
From: le... Leslaw Frydel
Date: Fri, 16 Feb 1996 00:00
Date: Fri, 16 Feb 1996 00:00
226 lines
9849 bytes
9849 bytes
las...@ctrvax.vanderbilt.edu (Jurek) wrote:
>Tak, istotnie chce "uspic" HDD. Problem nie w programie - jest
>banalnie prosty - ale w tym, ze jest kilka rozkazow, ktore powoduja
>zadany efekt. Niestety nie wiem, czym sie roznia pomiedzy soba.
>Machnalbym na to reka, ale czasem gdy Windoze nagle wpadnie na pomysl
>"obudzenia" HDD calosc zawiesza sie dokumentnie. Co ciekawe, szanse na
>poprawny start sa dobrze ponad 50%, ale klopoty zdarzaja sie na tyle
>czesto, ze trudno to zaakceptowac.
>BTW - chetnie zobacze zrodlo, moze cos pomoze :-).
Ponizej znajduje sie kawalek pliku PORTS.LST (cytowanyu bez zgody autora)
moze Ci sie przyda, ja napisalem dzieki temu procedurki ktore wylaczaja HDD
znajduja sie na samym koncu!
Pozdrawiam LESZEK!
W razie pytan - PYTAJ :)
******************************************************************************
PORT LIST Release 48 Last Change:
10/29/95
This compilation is Copyright (c) 1989,1990,1991,1992,1993,1994,1995 Ralf
Brown
[This file originally by Wim Osterholt (2:512/56 or
w...@djo.wtm.tudelft.nl).]
XT, AT and PS/2 I/O port addresses
Do NOT consider this information to be complete and accurate. If you want
to do hardware programming ALWAYS check the appropriate data sheets (but
even they are sometimes in error!). Be aware that erroneous port
programming
can put your data or even your hardware at risk.
[ciach]
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
01F0 RW data register
01F1 R error register (see #P075)
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 #P076)
01F7 R status register (see #P077)
01F7 W command register (see #P078)
Bitfields for Hard Disk Controller error register:
Bit(s) Description (Table P075)
---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: #P076,#P077
Bitfields for hard disk controller drive/head specifier:
Bit(s) Description (Table P076)
7 =1
6 LBA mode enabled, rather than default CHS mode
5 =1
4 drive select (0 = drive 0, 1 = drive 1)
Text View: C:\WINDOWS\TEMP\PORTS.LST Col 0 227 832 Bytes
3-0 head select bits (CHS mode)
logical block address, bits 27-24 (LBA mode)
SeeAlso: #P075,#P077
Bitfields for hard disk controller status register:
Bit(s) Description (Table P077)
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: #P075,#P078
(Table P078)
Values for hard disk controller command codes:
Command Spec Type Proto Description class:
00h opt nondata NOP
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
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
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
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 (see 94h-96h)
E4h IDE opt PIOin read buffer 1
E5h-E6h (see 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
#P079)
EDh ATA-2 opt nondata media eject [Removable]
EEh ATA-3 opt identify device DMA (see
#P079)
EFh IDE opt nondata set features 1
F0h-F4h IDE vend EATA standard
F5h-FFh IDE vendor vend vendor unique 4
SeeAlso: #P075,#P077
[ciach]
Orginalny plik dostepny na SIMTELU w katalogu /msdos/info/inter???.zip
A teraz moje procedurki :
type
dysk=(C,D,E,F);
procedure standby(i:dysk);
begin
if i=C then begin port[$01f6]:=$a0; port[$01f7]:=$e0; writeln('standby
immediate C:') end;
if i=D then begin port[$01f6]:=$b0; port[$01f7]:=$e0; writeln('standby
immediate D:') end;
if i=E then begin port[$0176]:=$a0; port[$0177]:=$e0; writeln('standby
immediate E:') end;
if i=F then begin port[$0176]:=$b0; port[$0177]:=$e0; writeln('standby
immediate F:') end;
end;
procedure sleep(i:dysk);
begin
if i=C then begin port[$01f6]:=$a0; port[$01f7]:=$e6; writeln('set sleep
mode C:') end;
if i=D then begin port[$01f6]:=$b0; port[$01f7]:=$e6; writeln('set sleep
mode
D:') end;
if i=E then begin port[$0176]:=$a0; port[$0177]:=$e6; writeln('set sleep
mode
E:') end;
if i=F then begin port[$0176]:=$b0; port[$0177]:=$e6; writeln('set sleep
mode
F:') end;
end;
TEgo by bylo na tyle ! Jak ktos chce gotowy exe i cale zrodlo to mu podesle
!
--
_/ _/_/_/ _/_/_/ _/ _/ _/ +-----------------------------+
_/ _/ _/ _/ _/ | Leslaw Frydel |
_/ _/_/ _/_/_/ _/ _/ _/ | E-mail: |
_/ _/ _/ _/ _/ _/ | le...@zeus.polsl.gliwice.pl |
_/_/_/ _/_/_/ _/_/_/ _/ _/_/ _/ | WWW: |
| www.polsl.gliwice.pl/~lesiu |
Enjoy Your Life... Play More Games! +-----------------------------+
-------------------------------------------------------------------------
Technical Details
Message-ID:
<4g1na7$o9v@hades.polsl.gliwice.pl>Path:
mbox-mo1.pugleaf.net!unknown!not-for-mailReferences:
<4e0096$hm1@sun1000.pwr.wroc.pl> <DMI85G.5Ix@cyf-kr.edu.pl> <4fgg2i$egg@galaxy.uci.agh.edu.pl> <4fn654$eai@hades.polsl.gliwice.pl> <4fodd0$m4u@galaxy.uci.agh.edu.pl>Show Full Headers
Complete Article Headers
From: le...@zeus.polsl.gliwice.pl (Leslaw Frydel) Subject: Re: Numer seryjny HDD Date: 1996/02/16 Message-ID: <4g1na7$o9v@hades.polsl.gliwice.pl> X-Deja-AN: 139600991 references: <4e0096$hm1@sun1000.pwr.wroc.pl> <DMI85G.5Ix@cyf-kr.edu.pl> <4fgg2i$egg@galaxy.uci.agh.edu.pl> <4fn654$eai@hades.polsl.gliwice.pl> <4fodd0$m4u@galaxy.uci.agh.edu.pl> organization: Politechnika Slaska w Gliwicach newsgroups: pl.comp.programming MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit