Форум: "Система";
Текущий архив: 2002.04.08;
Скачать: [xml.tar.bz2];
ВнизКак определить номер железа Найти похожие ветки
← →
Red Alert (2002-01-04 17:54) [4]На должно работать, единственно библиотеку на www.torry.ru
возьми, SmallPort называется.. Или какую другую, тогда функции переправишь..Единственное, давно писал, нашел в архиве, не знаю точно работает или нет..
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, SmallPort;
type
TForm1 = class(TForm)
Button1: TButton;
SmallPort1: TSmallPort;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
PIDEInfo = ^TIDEInfo;
TIDEInfo = Record
Config, {General configuration bit-significant information}
Cyls, {Number of logical cylinders}
Unused, {Reserved}
Heads, {Number of logical heads}
BPT, {Number of unformatted bytes per track}
BPS, {Number of unformatted bytes per sector}
SPT : Word; {Number of logical sectors per logical track}
Vendor : Array [0..2] of Word; {Vendor specific}
Serial : Array [1..20] of Char; {Serial number. 20 ASCii characters, 0000H=not specified}
BufType, {Buffer type}
BufSize, {Buffer size in 512 byte increments. 0000H=not specified}
ECC : Word; {# of ECC bytes avail on read/write long cmds. 0000H=not spec.}
Revision : Array [1..8] of Char; {Firmware revision. 8 ASCii characters. 0000H=not specified}
Model : Array [1..40] of Char; {Model number. 40 ASCii characters. 0000H=not specified}
Features : Word; {Features information}
DwordIO : Word; {0001H=Can perform doubleword I/O}
Capabil : Word; {Capabilities}
Reserved : Word; {Reserved}
PIO : Word; {PIO data transfer information}
DMA : Word; {DMA data transfer information}
ExtValid : Word; {Extended data validation information}
CurrCyls, {Number of current logical cylinders}
CurrHeads, {Number of current logical heads}
CurrSect : Word; {Number of current logical sectors per track}
Capacity : LongInt; {Current capacity in sectors}
BlockMode : Word; {Multiple sectors transfer information}
LBACapacity : LongInt; {Total number of user addressable sectors. LBA mode only}
SingleDMA : Word; {Single word DMA transfer information}
MultiDMA : Word; {Multiword DMA transfer information}
AdvancedPIO : Word; {Advanced PIO Transfer information}
MinDMACycle : Word; {Minimum Multiword DMA Transfer Cycle Time Per Word in nsecs}
RecDMACycle : Word; {Manufacturer Recommended Multiword DMA Transfer Cycle Time}
MinPIOCycle : Word; {Minimum PIO Transfer Cycle Time Without Flow Control in nsecs}
MinIORDYPIOCycle : Word; {Minimum PIO Transfer Cycle Time With IORDY Flow Control in nsecs}
Filler : Array [1..374] of Byte;
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var
info : array[0..255] of word; i : integer;
IDEInfo : PIDEInfo;
begin
{
procedure GetIdeInfo(Drive, IDEInfo)
New(IDEInfo);
While(SmallPort1.Port[$1f7] and $80 <>0) do;
begin
end;
}
SmallPort1.Opened:=True;
SmallPort1.port[$3f6]:= 2;
SmallPort1.port[$1f6]:= $A0;{+ (0 shl 4);}
SmallPort1.port[$1f7]:= $Ec;
While(SmallPort1.Port[$1f7] and $80 <>0) do;
for i:= 0 to 255 do
Info[i]:=swap(SmallPort1.PortW[$01f0]);
Move(Info,IDEInfo^,512);
for i:= 1 to 20 do
label1.Caption:=label1.Caption+IDEInfo^.Serial[i];
Dispose(IDEInfo);
SmallPort1.Opened:=False;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
SmallPort1.Opened:=False;
end;
end.
Страницы: 1 вся ветка
Форум: "Система";
Текущий архив: 2002.04.08;
Скачать: [xml.tar.bz2];
Память: 0.45 MB
Время: 0.007 c