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

This commit is contained in:
aaron 2018-04-09 15:29:57 +00:00
parent 8e91ed30ac
commit 59e2d9c4ad
2 changed files with 21 additions and 16 deletions

View File

@ -18,7 +18,8 @@ uses
terminal, terminal,
drivermanagement, drivermanagement,
vmemorymanager, vmemorymanager,
lmemorymanager; lmemorymanager,
strings;
type type
@ -27,7 +28,6 @@ type
PPIOHook = procedure(volume : PStorage_volume; directory : pchar; byteCount : uint32; buffer : puint32); PPIOHook = procedure(volume : PStorage_volume; directory : pchar; byteCount : uint32; buffer : puint32);
TFilesystem = record TFilesystem = record
idx : uint8;
sName : pchar; sName : pchar;
writeCallback : PPIOHook; writeCallback : PPIOHook;
readCallback : PPIOHook; readCallback : PPIOHook;
@ -39,6 +39,7 @@ type
sectorSize : uint32; sectorSize : uint32;
filesystem : TFilesystem; filesystem : TFilesystem;
end; end;
APStorage_Volume = array[0..255] of PStorage_volume;
TStorage_Device = record TStorage_Device = record
idx : uint8; idx : uint8;
@ -73,25 +74,27 @@ procedure disk_command(params : PParamList);
var var
i : uint8; i : uint8;
begin begin
for i:=0 to 255 do begin if stringEquals(getParam(1, params), 'ls') then begin
if storageDevices[i].maxSectorCount = 0 then break; for i:=0 to 255 do begin
console.writeint(i); if storageDevices[i].maxSectorCount = 0 then break;
console.writestring(') Device_Type: '); console.writeint(i);
case storageDevices[i].controller of console.writestring(') Device_Type: ');
ControllerIDE : console.writestring('IDE, '); case storageDevices[i].controller of
ControllerUSB : console.writestring('USB, '); ControllerIDE : console.writestring('IDE, ');
ControllerAHCI : console.writestring('AHCI, '); ControllerUSB : console.writestring('USB, ');
ControllerNET : console.writestring('NET, '); ControllerAHCI : console.writestring('AHCI, ');
ControllerNET : console.writestring('NET, ');
end;
console.writestring('Capacity: ');
console.writeint(((storageDevices[i].maxSectorCount * storageDevices[i].sectorSize) DIV 1000) DIV 1000);
console.writestringln('MB');
end; end;
console.writestring('Capacity: ');
console.writeint(((storageDevices[i].maxSectorCount * storageDevices[i].sectorSize) DIV 1000) DIV 1000);
console.writestringln('MB');
end; end;
end; end;
procedure init(); procedure init();
begin begin
terminal.registerCommand('disk', @disk_command, 'List storage devices'); terminal.registerCommand('DISK', @disk_command, 'List physical storage devices');
end; end;
procedure register_device(device : TStorage_Device); procedure register_device(device : TStorage_Device);

View File

@ -36,7 +36,8 @@ uses
testdriver, testdriver,
E1000, E1000,
AHCI_OLD, AHCI_OLD,
IDE; IDE,
storagemanagement;
procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: uint32); stdcall; procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: uint32); stdcall;
@ -94,6 +95,7 @@ begin
terminal.registerCommand('BSOD', @terminal_command_bsod, 'Force a Panic Screen.'); terminal.registerCommand('BSOD', @terminal_command_bsod, 'Force a Panic Screen.');
drivermanagement.init(); drivermanagement.init();
storagemanagement.init();
console.init(); console.init();