git-svn-id: https://spexeah.com:8443/svn/Asuro@594 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
1 parent
db57eb7cd8
commit
2d902a1380
5 files changed
+157
-48
No files matched your search
@@ -247,6 +247,7 @@ begin
|
|||||||
storagemanagement.register_device(@storageDevice1);
|
storagemanagement.register_device(@storageDevice1);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
pop_trace();
|
pop_trace();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
@@ -33,15 +33,20 @@ type
|
|||||||
PPHIOHook = procedure(volume : PStorage_device; addr : uint32; sectors : uint32; buffer : puint32);
|
PPHIOHook = procedure(volume : PStorage_device; addr : uint32; sectors : uint32; buffer : puint32);
|
||||||
PPCreateHook = procedure(disk : PStorage_Device; sectors : uint32; start : uint32; config : puint32);
|
PPCreateHook = procedure(disk : PStorage_Device; sectors : uint32; start : uint32; config : puint32);
|
||||||
PPDetectHook = procedure(disk : PStorage_Device);
|
PPDetectHook = procedure(disk : PStorage_Device);
|
||||||
|
PPCreateDirHook = function(volume : PStorage_volume; directory : pchar; dirname : pchar; attributes : uint32) : uint8;
|
||||||
|
PPReadDirHook = function(volume : PStorage_volume; directory : pchar; listPtr : PLinkedListBase) : uint8; //returns: 0 = success, 1 = dir not exsist, 2 = not directory, 3 = error
|
||||||
|
|
||||||
|
|
||||||
PPHIOHook_ = procedure;
|
PPHIOHook_ = procedure;
|
||||||
|
|
||||||
TFilesystem = record
|
TFilesystem = record
|
||||||
sName : pchar;
|
sName : pchar;
|
||||||
writeCallback : PPIOHook;
|
writeCallback : PPIOHook;
|
||||||
readCallback : PPIOHook;
|
readCallback : PPIOHook;
|
||||||
createCallback : PPCreateHook;
|
createCallback : PPCreateHook;
|
||||||
detectCallback : PPDetectHook;
|
detectCallback : PPDetectHook;
|
||||||
|
createDirCallback : PPCreateDirHook;
|
||||||
|
readDirCallback : PPReadDirHook;
|
||||||
end;
|
end;
|
||||||
PFileSystem = ^TFilesystem;
|
PFileSystem = ^TFilesystem;
|
||||||
|
|
||||||
@@ -134,7 +139,7 @@ begin
|
|||||||
drive := stringToInt(getParam(1, params));
|
drive := stringToInt(getParam(1, params));
|
||||||
console.writeintln(drive); // works
|
console.writeintln(drive); // works
|
||||||
if stringEquals(getParam(2, params), 'fat32') then begin
|
if stringEquals(getParam(2, params), 'fat32') then begin
|
||||||
PFilesystem(LL_Get(filesystems, 0))^.createCallback((PStorage_Device(LL_Get(storageDevices, drive))), 1000000, 1, spc); //todo check fs
|
PFilesystem(LL_Get(filesystems, 0))^.createCallback((PStorage_Device(LL_Get(storageDevices, drive))), 10000, 1, spc); //todo check fs
|
||||||
console.writestring('Drive ');
|
console.writestring('Drive ');
|
||||||
//console.writeint(drive); // page faults
|
//console.writeint(drive); // page faults
|
||||||
console.writestringln(' formatted.');
|
console.writestringln(' formatted.');
|
||||||
@@ -149,6 +154,65 @@ begin
|
|||||||
pop_trace;
|
pop_trace;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure mkdir_command(params : PParamList);
|
||||||
|
var
|
||||||
|
dir : pchar;
|
||||||
|
device : PStorage_Device;
|
||||||
|
volume : PStorage_Volume;
|
||||||
|
error : uint32;
|
||||||
|
begin
|
||||||
|
if paramCount(params) > 0 then begin
|
||||||
|
dir := getParam(0, params);
|
||||||
|
device:= PStorage_Device(LL_Get(storageDevices, 0));
|
||||||
|
volume:= PStorage_Volume(LL_Get(device^.volumes, 0));
|
||||||
|
|
||||||
|
//error:= volume^.filesystem^.createDirCallback(volume, dir, $10);
|
||||||
|
if error <> 1 then console.writestringln('ERROR');
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure ls_command(params : PParamList);
|
||||||
|
type
|
||||||
|
TDirectory = bitpacked record
|
||||||
|
fileName : array[0..7] of char;
|
||||||
|
fileExtension : array[0..2] of char;
|
||||||
|
attributes : uint8;
|
||||||
|
reserved0 : uint8;
|
||||||
|
timeFine : uint8;
|
||||||
|
time : uint16;
|
||||||
|
date : uint16;
|
||||||
|
accessTime : uint16;
|
||||||
|
clusterHigh : uint16;
|
||||||
|
modifiedTime : uint16;
|
||||||
|
modifiedDate : uint16;
|
||||||
|
clusterLow : uint16;
|
||||||
|
byteSize : uint32;
|
||||||
|
end;
|
||||||
|
PDirectory = ^TDirectory;
|
||||||
|
var
|
||||||
|
dirs : PLinkedListBase;
|
||||||
|
dir : pchar;
|
||||||
|
device : PStorage_Device;
|
||||||
|
volume : PStorage_Volume;
|
||||||
|
error : uint32;
|
||||||
|
i : uint32;
|
||||||
|
begin
|
||||||
|
if paramCount(params) > 0 then begin
|
||||||
|
dir := getParam(0, params);
|
||||||
|
device:= PStorage_Device(LL_Get(storageDevices, 0));
|
||||||
|
volume:= PStorage_Volume(LL_Get(device^.volumes, 0));
|
||||||
|
|
||||||
|
error:= volume^.filesystem^.readDirCallback(volume, dir, dirs);
|
||||||
|
|
||||||
|
if error <> 1 then console.writestringln('ERROR');
|
||||||
|
|
||||||
|
for i:=0 to LL_Size(dirs) - 1 do begin
|
||||||
|
console.writestring(' ');
|
||||||
|
console.writestringln(pchar( PDirectory(LL_Get(dirs, 0))^.filename ));
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure volume_command(params : PParamList);
|
procedure volume_command(params : PParamList);
|
||||||
var
|
var
|
||||||
i : uint32;
|
i : uint32;
|
||||||
@@ -183,7 +247,8 @@ begin
|
|||||||
fileSystems:= ll_New(sizeof(TFilesystem));
|
fileSystems:= ll_New(sizeof(TFilesystem));
|
||||||
terminal.registerCommand('DISK', @disk_command, 'Disk utility');
|
terminal.registerCommand('DISK', @disk_command, 'Disk utility');
|
||||||
terminal.registerCommand('VOLUME', @volume_command, 'Volume utility');
|
terminal.registerCommand('VOLUME', @volume_command, 'Volume utility');
|
||||||
terminal.registerCommand('POO', @test_command, 'Volume utility');
|
terminal.registerCommand('mkdir', @mkdir_command, 'Volume utility');
|
||||||
|
terminal.registerCommand('ls', @ls_command, 'Volume utility');
|
||||||
pop_trace();
|
pop_trace();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ interface
|
|||||||
const
|
const
|
||||||
KERNEL_VIRTUAL_BASE = $C0000000;
|
KERNEL_VIRTUAL_BASE = $C0000000;
|
||||||
KERNEL_PAGE_NUMBER = KERNEL_VIRTUAL_BASE SHR 22;
|
KERNEL_PAGE_NUMBER = KERNEL_VIRTUAL_BASE SHR 22;
|
||||||
BSOD_ENABLE = true;
|
BSOD_ENABLE = false;
|
||||||
TRACER_ENABLE = true;
|
TRACER_ENABLE = true;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|||||||
@@ -118,18 +118,17 @@ var
|
|||||||
i : uint32;
|
i : uint32;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
push_trace('util.printmemory');
|
|
||||||
buf:= puint8(source);
|
buf:= puint8(source);
|
||||||
for i:=0 to length do begin
|
for i:=0 to length-1 do begin
|
||||||
if offset_row and (i = 0) then begin
|
if offset_row and (i = 0) then begin
|
||||||
console.writehex(source + (i * col));
|
console.writehex(source + (i));
|
||||||
console.writestring(': ');
|
console.writestring(': ');
|
||||||
end;
|
end;
|
||||||
console.writehexpair(buf[i]);
|
console.writehexpair(buf[i]);
|
||||||
if ((i+1) MOD col) = 0 then begin
|
if ((i+1) MOD col) = 0 then begin
|
||||||
console.writestringln(' ');
|
console.writestringln(' ');
|
||||||
if offset_row then begin
|
if offset_row then begin
|
||||||
console.writehex(source + (i * col));
|
console.writehex(source + (i + 1));
|
||||||
console.writestring(': ');
|
console.writestring(': ');
|
||||||
end;
|
end;
|
||||||
end else begin
|
end else begin
|
||||||
@@ -137,7 +136,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
console.writestringln(' ');
|
console.writestringln(' ');
|
||||||
pop_trace;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function hi(b : uint8) : uint8; [public, alias: 'util_hi'];
|
function hi(b : uint8) : uint8; [public, alias: 'util_hi'];
|
||||||
|
|||||||
Reference in new issue
Block a user