git-svn-id: https://spexeah.com:8443/svn/Asuro@673 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c

This commit is contained in:
aaron
2018-05-07 23:45:38 +00:00
parent 2cbea55087
commit 680b758ee7
4 changed files with 76 additions and 27 deletions

View File

@ -223,6 +223,10 @@ begin
storageDevice.controller := ControllerIDE;
storageDevice.controllerId0:= 0;
storageDevice.maxSectorCount:= (IDEDevices[0].info[60] or (IDEDevices[0].info[61] shl 16) ); //LBA28 SATA
console.writeintln(storageDevice.maxSectorCount);
redrawWindows();
storageDevice.sectorSize:= 512;
if storageDevice.maxSectorCount <> 0 then begin
IDEDevices[0].exists:= true;
@ -244,7 +248,7 @@ begin
IDEDevices[1].exists:= true;
storageDevice1.readCallback:= @read;
storageDevice1.writeCallback:= @write;
storagemanagement.register_device(@storageDevice1);
//storagemanagement.register_device(@storageDevice1);
end;
end;
@ -299,7 +303,7 @@ begin
t +=1;
end;
for i:=0 to 254 do begin
for i:=0 to 255 do begin
identResponse[i] := inw($1F0); //read all bits
end;
@ -393,17 +397,39 @@ begin
for i:=0 to sectorCount do begin
console.writeintln(11);
redrawWindows();
//poll status
while true do if (inw($1f7) and (1 shl 7)) = 0 then break; //Wait until drive not busy
console.writeintln(12);
redrawWindows();
while true do begin
if (inw($1f7) and (1 shl 3)) <> 0 then break;
if (inw($1f7) and (1 shl 5)) <> 0 then begin
console.writestringln('IDE DRIVE FAULT');
redrawWindows();
exit;
end;
if (inw($1f7) and (1 shl 6)) <> 0 then begin
console.writestringln('IDE Spun Down');
redrawWindows();
exit;
end;
if (inw($1F7) and 1) <> 0 then begin
console.writestringln('IDE read ERROR');
redrawWindows();
exit;
end; //drive error
end;
console.writeintln(13);
redrawWindows();
for ii:=0 to 127 do begin //read data
Puint32(buffer + ((i * 512) + (ii * 32) DIV 32))^ := uint32(inw($1F0));
while true do if (inw($1f7) and (1 shl 7)) = 0 then break; //Wait until drive not busy