diff --git a/src/driver/storage/storagemanagement.pas b/src/driver/storage/storagemanagement.pas index 6c078dc2..0ae2389b 100644 --- a/src/driver/storage/storagemanagement.pas +++ b/src/driver/storage/storagemanagement.pas @@ -38,11 +38,38 @@ const var + storageDevices : array[0..255] of TStorage_Device; +procedure init(); procedure register_device(device : TStorage_Device); function get_all_devices() : APStorage_Device; function read(device : uint16; address : uint32; byteCount : uint32) : PuInt32; procedure write(device : uint16; address : uint32; byteCount : uint32; data : PuInt32); 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. \ No newline at end of file