git-svn-id: https://spexeah.com:8443/svn/Asuro@392 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
parent
ed74a4100d
commit
b62e3ce8c6
@ -38,11 +38,38 @@ const
|
|||||||
|
|
||||||
|
|
||||||
var
|
var
|
||||||
|
storageDevices : array[0..255] of TStorage_Device;
|
||||||
|
|
||||||
|
procedure init();
|
||||||
procedure register_device(device : TStorage_Device);
|
procedure register_device(device : TStorage_Device);
|
||||||
function get_all_devices() : APStorage_Device;
|
function get_all_devices() : APStorage_Device;
|
||||||
function read(device : uint16; address : uint32; byteCount : uint32) : PuInt32;
|
function read(device : uint16; address : uint32; byteCount : uint32) : PuInt32;
|
||||||
procedure write(device : uint16; address : uint32; byteCount : uint32; data : PuInt32);
|
procedure write(device : uint16; address : uint32; byteCount : uint32; data : PuInt32);
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
procedure list_drives_command(params : PParamList);
|
||||||
|
var
|
||||||
|
i : uint8;
|
||||||
|
begin
|
||||||
|
for i:=0 to 255 do begin
|
||||||
|
if storageDevices[i].controller = nil then break;
|
||||||
|
console.writeint(i);
|
||||||
|
console.writestring(') Device_Type: ');
|
||||||
|
case storageDevices[i].controller of
|
||||||
|
ControllerIDE:console.writestring('IDE ');
|
||||||
|
ControllerUSB:console.writestring('USB ');
|
||||||
|
ControllerAHCI:console.writestring('AHCI ');
|
||||||
|
ControllerNET:console.writestring('NET ');
|
||||||
|
end;
|
||||||
|
console.writestring('Capacity: ');
|
||||||
|
console.writeint(((sectors * 512) / 1000) / 1000);
|
||||||
|
console.writestringln('MB');
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure init();
|
||||||
|
begin
|
||||||
|
terminal.registerCommand('disks', @list_drives_command, 'List storage devices');
|
||||||
|
end;
|
||||||
end.
|
end.
|
Loading…
x
Reference in New Issue
Block a user