git-svn-id: https://spexeah.com:8443/svn/Asuro@424 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
		| @@ -18,7 +18,8 @@ uses | ||||
|     terminal, | ||||
|     drivermanagement, | ||||
|     vmemorymanager, | ||||
|     lmemorymanager; | ||||
|     lmemorymanager, | ||||
|     strings; | ||||
|  | ||||
| type  | ||||
|  | ||||
| @@ -27,7 +28,6 @@ type | ||||
|     PPIOHook = procedure(volume : PStorage_volume; directory : pchar; byteCount : uint32; buffer : puint32); | ||||
|  | ||||
|     TFilesystem = record | ||||
|         idx   : uint8;  | ||||
|         sName : pchar; | ||||
|         writeCallback : PPIOHook; | ||||
|         readCallback  : PPIOHook; | ||||
| @@ -39,6 +39,7 @@ type | ||||
|         sectorSize  : uint32; | ||||
|         filesystem  : TFilesystem;  | ||||
|     end; | ||||
|     APStorage_Volume = array[0..255] of PStorage_volume; | ||||
|  | ||||
|     TStorage_Device = record | ||||
|         idx              : uint8; | ||||
| @@ -73,25 +74,27 @@ procedure disk_command(params : PParamList); | ||||
| var | ||||
|     i : uint8; | ||||
| begin | ||||
|     for i:=0 to 255 do begin | ||||
|         if storageDevices[i].maxSectorCount = 0 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, '); | ||||
|     if stringEquals(getParam(1, params), 'ls') then begin | ||||
|         for i:=0 to 255 do begin | ||||
|             if storageDevices[i].maxSectorCount = 0 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(((storageDevices[i].maxSectorCount * storageDevices[i].sectorSize) DIV 1000) DIV 1000); | ||||
|             console.writestringln('MB'); | ||||
|         end; | ||||
|         console.writestring('Capacity: '); | ||||
|         console.writeint(((storageDevices[i].maxSectorCount * storageDevices[i].sectorSize) DIV 1000) DIV 1000); | ||||
|         console.writestringln('MB'); | ||||
|     end; | ||||
| end; | ||||
|  | ||||
| procedure init(); | ||||
| begin | ||||
|     terminal.registerCommand('disk', @disk_command, 'List storage devices'); | ||||
|     terminal.registerCommand('DISK', @disk_command, 'List physical storage devices'); | ||||
| end; | ||||
|  | ||||
| procedure register_device(device : TStorage_Device); | ||||
|   | ||||
| @@ -36,7 +36,8 @@ uses | ||||
|      testdriver, | ||||
|      E1000, | ||||
|      AHCI_OLD, | ||||
|      IDE; | ||||
|      IDE, | ||||
|      storagemanagement; | ||||
|   | ||||
| procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: uint32); stdcall; | ||||
|   | ||||
| @@ -94,6 +95,7 @@ begin | ||||
|      terminal.registerCommand('BSOD', @terminal_command_bsod, 'Force a Panic Screen.'); | ||||
|  | ||||
|      drivermanagement.init(); | ||||
|      storagemanagement.init(); | ||||
|  | ||||
|      console.init(); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 aaron
					aaron