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

This commit is contained in:
aaron 2018-04-11 14:59:37 +00:00
parent d492b8a122
commit 2d73017379
2 changed files with 21 additions and 5 deletions

View File

@ -197,6 +197,7 @@ end;
function load(ptr : void) : boolean;
var
storageDevice : TStorage_Device;
storageDevice1 : TStorage_Device;
begin
//controller := PPCI_Device(ptr);
@ -204,7 +205,6 @@ begin
//check if bus is floating and identify device
if inb($1F7) <> $FF then begin
outb($3F6, inb($3f6) or (1 shl 1)); // disable interrupts
IDEDevices[0].exists:= true;
IDEDevices[0].isMaster:= true;
IDEDevices[0].info := identify_device(0, $A0);
@ -212,9 +212,25 @@ begin
storageDevice.controllerId0:= 0;
storageDevice.maxSectorCount:= (IDEDevices[0].info[60] or (IDEDevices[0].info[61] shl 16) ); //LBA28 SATA
storageDevice.sectorSize:= 512;
storagemanagement.register_device(@storageDevice);
if storageDevice.maxSectorCount <> 0 then begin
IDEDevices[0].exists:= true;
storagemanagement.register_device(@storageDevice);
end;
end;
if inb($1F7) <> $FF then begin
IDEDevices[1].isMaster:= false;
IDEDevices[1].info := identify_device(0, $B0);
storageDevice1.controller := ControllerIDE;
storageDevice1.controllerId0:= 0;
storageDevice1.maxSectorCount:= (IDEDevices[1].info[60] or (IDEDevices[1].info[61] shl 16) ); //LBA28 SATA
storageDevice1.sectorSize:= 512;
if storageDevice1.maxSectorCount <> 0 then begin
IDEDevices[1].exists:= true;
storagemanagement.register_device(@storageDevice1);
end;
end
//identify_device(0, $B0);
end;

View File

@ -85,7 +85,6 @@ var
i : uint8;
begin
console.writestringln('poop');
if stringEquals(getParam(0, params), 'ls') then begin
for i:=0 to LL_Size(storageDevices) - 1 do begin
@ -99,7 +98,7 @@ begin
ControllerNET : console.writestring('NET, ');
end;
console.writestring('Capacity: ');
console.writeint((( PStorage_Device(LL_Get(storageDevices, i))^.maxSectorCount * PStorage_Device(LL_Get(storageDevices, i))^.sectorSize) DIV 1000) DIV 1000);
console.writeint((( PStorage_Device(LL_Get(storageDevices, i))^.maxSectorCount * PStorage_Device(LL_Get(storageDevices, i))^.sectorSize) DIV 1024) DIV 1024);
console.writestringln('MB');
end;
end;
@ -119,6 +118,7 @@ var
begin
elm:= LL_Add(storageDevices);
PStorage_device(elm)^ := device^;
//check for volumes
end;