Posted By: bundasek (bundasek) on 'CZhardware'
Title:     ZDROJAK na identifikaci disku 
Date:      Thu Oct 23 19:35:50 1997

Zasilam slibeny zdrojak (PAS) na identifikaci disku aniz by byl nastaven v 
setupu.

Zjistuje MASTER na PRIMARNIM kanalu

---------------------------------

uses crt;

var
  i,j,k,l:longint;
  s,bios:string;
  p:record
    konst:word;
    cylindru:word;
    OdstrCyl:word;
    hlav:word;
    NfBOnTrack:word;
    NfBOnSektor:word;
    Sektoru:word;
    BytuMeziSektory:word;
    BytuVSynchPoli:word;
    konst1:word;
    SerialNumber:array[1..10] of word;
    Kontroler:word;
    InternalBuffer:word;
    EccWrite:word;
    VerzeKontroleru:array[1..4] of word;
    TypDisku:array[1..20] of word;
    UnknownInfo:array[1..100] of word;
    end;

Procedure ReadData;assembler;
 asm
 cli
 mov al,04
 mov dx,3f6h
 out dx,al
 xor al,al
 out dx,al
 mov dx,1f7h

@bussy:
 in al,dx
 and al,128
 jnz @bussy

 mov di,offset p
 push ds
 pop es
 mov cx,80h
 mov dx,1f7h
 mov al,0ech
 out dx,al

@drq:
 in al,dx
 and al,08
 jz @drq
 push dx
 mov dx,1f0h
 in ax,dx
 pop dx
 stosw
 loop @drq

 mov al,04
 mov dx,3f6h
 out dx,al
 xor al,al
 out dx,al
 sti
 end;

Procedure DetectBios;
var
  b:byte;
  i:word;
 begin
 i:=$8078;
 bios:='';
 Repeat
  b:=mem[$f000:i];
  bios:=bios+chr(b);
  inc(i);
  until b=0;
 end;

Procedure Vypis;
 begin
with p do
  begin
  Writeln('Hlav :                            ',hlav);
  Writeln('Cylindru :                        ',Cylindru);
  Writeln('Sektoru :                         ',Sektoru);
  Writeln('Odstranitelnych cylindru :        ', OdstrCyl);

  s:='';
  for i:=1 to 10 do
     begin
     s:=s+chr(serialNumber[i] div 256);
     s:=s+chr(serialNumber[i] mod 256);
     end;
  Writeln('Serial number :         ',s);

  s:='';
  for i:=1 to 20 do
     begin
     s:=s+chr(TypDisku[i] div 256);
     s:=s+chr(TypDisku[i] mod 256);
     end;
  Writeln('Typ disku :                       ',s);

  s:='';
  for i:=1 to 4 do
     begin
     s:=s+chr(VerzeKontroleru[i] div 256);
     s:=s+chr(VerzeKontroleru[i] mod 256);
     end;
  Writeln('VerzeKontroleru :                 ',s);

  Writeln('Neformatovanych bytu na stope :   ',NfBOnTrack);
  Writeln('Pocet bytu mezi sektory :         ',BytuMeziSektory);
  Writeln('Bytu v synchronizacnim poli :     ',BytuVSynchPoli);
  Writeln('Pocet bytu v poli ECC :           ', EccWrite);
  writeln;
  i:=Sektoru;j:=Cylindru;k:=Hlav;
  l:=i*j*k*512;
  Writeln('Velikost disku :                  ',(l/1e6):0:3,' MB.');
  Writeln;
  Writeln('Seriove cislo biosu :             ',bios);
  end;
 end;

begin
writeln;
writeln;
clrscr;
ReadData;
DetectBios;
Vypis;
end.

-----------------------
mejte se 

Bundasek

Search the boards