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

This commit is contained in:
aaron
2020-07-18 21:01:29 +00:00
parent 6b6129b769
commit c7c49f24d9
5 changed files with 61 additions and 91 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ end;
procedure register();
begin
memset(uint32(@Hooks[0]), 0, sizeof(pp_hook_method)*MAX_HOOKS);
isrmanager.registerISR(76, @Main);
//isrmanager.registerISR(76, @Main);
//IDT.set_gate(76, uint32(@Main), $08, ISR_RING_0);
end;
File diff suppressed because it is too large Load Diff
+5 -47
View File
@@ -833,73 +833,35 @@ begin //maybe increase buffer size by one?
console.writestringWND('sectorsize', getTerminalHWND());
console.writeintlnWND(disk^.sectorsize, getTerminalHWND());
console.redrawWindows();
bt:= puint32(kalloc(512));
bt[1] := 1;
bt[2] := 1;
bt[3] := 1;
bt[4] := 1;
bt[5] := 1;
bt[6] := 1;
bt[7] := 11;
bt[8] := 33;
bt[9] := 22;
disk^.writecallback(disk, 3, 1, puint32(bt));
// puint32(buffer)[127]:= $55AA;
console.writestringlnWND('writting to bootrecord', getTerminalHWND());
console.writeintlnWND(start + 1, getTerminalHWND());
console.redrawWindows;
disk^.writecallback(disk, start + 1, 1, puint32(buffer));
console.writestringlnWND('finished writting to bootrecord', getTerminalHWND());
console.redrawWindows;
fatStart:= start + 1 + bootRecord^.rsvSectors;
dataStart:= fatStart + bootRecord^.FATSize;
zeroBuffer:= puint32(kalloc( disk^.sectorSize ));
memset(uint32(zeroBuffer), 0, disk^.sectorSize );
// while true do begin
// if i > FATSize then break;
// disk^.writecallback(disk, fatStart + i, 1, zeroBuffer);
// i+=1;
// end;
while true do begin
if i > FATSize then break;
disk^.writecallback(disk, fatStart + i, 1, zeroBuffer);
i+=1;
end;
kfree(buffer);
kfree(zeroBuffer);
writestring('Frees');
console.redrawWindows;
console.writestringlnWND('writting 1', getTerminalHWND());
console.redrawWindows;
buffer:= puint32(kalloc(disk^.sectorSize));
memset(uint32(buffer), 0, disk^.sectorSize);
console.writestringlnWND('writting 1', getTerminalHWND());
console.redrawWindows;
puint32(buffer)[0]:= $FFFFFFF8; //fsinfo
puint32(buffer)[1]:= $FFFFFFF8; //root cluster
writestring('Buffer Alloc');
console.redrawWindows;
disk^.writecallback(disk, fatStart, 1, buffer);
writestring('WriteCB1');
console.redrawWindows;
kfree(buffer);
buffer:= puint32(kalloc(disk^.sectorsize));
memset(uint32(buffer), 0, disk^.sectorsize);
writestring('Buffer Alloc 2');
console.redrawWindows;
PDirectory(buffer)[0].fileName := thisArray;
PDirectory(buffer)[0].attributes := $08;
@@ -910,12 +872,8 @@ begin //maybe increase buffer size by one?
PDirectory(buffer)[1].clusterLow := 1;
disk^.writecallback(disk, dataStart + (config^ * rootCluster), 1, buffer);
writestring('WriteCB2');
console.redrawWindows;
kfree(buffer);
writestring('Free');
console.redrawWindows;
end;
+22 -4
View File
@@ -118,7 +118,7 @@ end;
{ Disk subcommand for listing drives }
procedure ls_command(params : PParamList);
var
var
i : uint16;
begin
push_trace('storagemanagment.ls_command');
@@ -152,15 +152,26 @@ end;
procedure format_command(params : PParamList);
var
driveIndex : uint16;
drive : PStorage_Device;
filesystemString : pchar;
filesystem : PFileSystem;
spc : puint32;
begin
// driveIndex:= stringToInt( getParam(params, 1) );
// PFilesystem(LL_Get(filesystems, 0))^.createCallback(
// (PStorage_Device(LL_Get(storageDevices, drive))), 10000, 1, spc); //todo fs
spc:= puint32(kalloc(4));
spc^:= 4;
driveIndex:= stringToInt( getParam(1, params) );
drive:= PStorage_Device(LL_Get(storageDevices, driveIndex));
//todo change b4 adding in aniother filesytem
PFilesystem(LL_Get(filesystems, 0))^.createCallback(drive, drive^.maxSectorCount-1, 1, spc);
writestringWnd('Drive ', getTerminalHWND);
writeintWnd(driveIndex, getTerminalHWND);
writestringlnWnd(' formatted.', getTerminalHWND);
end;
@@ -172,6 +183,12 @@ var
subcmd : pchar;
begin
push_trace('StorageManagment.disk_command');
//check if params wehre supplied
if paramCount(params) = 0 then begin
writestringlnWnd('Incorrect number of params.', getTerminalHWND);
exit;
end;
subcmd:= getParam(0, params);
@@ -183,6 +200,7 @@ begin
//format command for clearing a disk and make a new volume
if stringEquals(subcmd, 'format') then begin
format_command(params);
end;
//lsfs command for listing filesystems
+2
View File
@@ -267,6 +267,7 @@ begin
switchendian:= (lo(b) SHL 4) OR hi(b);
end;
//Was broken, now does nothing.
procedure psleep(t : uint16);
var
t1, t2 : uint16;
@@ -275,6 +276,7 @@ begin
t1:= BDA^.Ticks;
t2:= BDA^.Ticks;
while t2-t1 < t do begin
break;
t2:= BDA^.Ticks;
if t2 < t1 then break;
end;