git-svn-id: https://spexeah.com:8443/svn/Asuro@1319 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
1 parent
6b6129b769
commit
c7c49f24d9
5 files changed
+59
-89
No files matched your search
@@ -42,7 +42,7 @@ end;
|
|||||||
procedure register();
|
procedure register();
|
||||||
begin
|
begin
|
||||||
memset(uint32(@Hooks[0]), 0, sizeof(pp_hook_method)*MAX_HOOKS);
|
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);
|
//IDT.set_gate(76, uint32(@Main), $08, ISR_RING_0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
+30
-38
File diff suppressed because it is too large.
Load diff
@@ -833,73 +833,35 @@ begin //maybe increase buffer size by one?
|
|||||||
console.writestringWND('sectorsize', getTerminalHWND());
|
console.writestringWND('sectorsize', getTerminalHWND());
|
||||||
console.writeintlnWND(disk^.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));
|
disk^.writecallback(disk, start + 1, 1, puint32(buffer));
|
||||||
|
|
||||||
console.writestringlnWND('finished writting to bootrecord', getTerminalHWND());
|
|
||||||
|
|
||||||
console.redrawWindows;
|
|
||||||
|
|
||||||
fatStart:= start + 1 + bootRecord^.rsvSectors;
|
fatStart:= start + 1 + bootRecord^.rsvSectors;
|
||||||
dataStart:= fatStart + bootRecord^.FATSize;
|
dataStart:= fatStart + bootRecord^.FATSize;
|
||||||
|
|
||||||
zeroBuffer:= puint32(kalloc( disk^.sectorSize ));
|
zeroBuffer:= puint32(kalloc( disk^.sectorSize ));
|
||||||
memset(uint32(zeroBuffer), 0, disk^.sectorSize );
|
memset(uint32(zeroBuffer), 0, disk^.sectorSize );
|
||||||
|
|
||||||
// while true do begin
|
while true do begin
|
||||||
// if i > FATSize then break;
|
if i > FATSize then break;
|
||||||
// disk^.writecallback(disk, fatStart + i, 1, zeroBuffer);
|
disk^.writecallback(disk, fatStart + i, 1, zeroBuffer);
|
||||||
// i+=1;
|
i+=1;
|
||||||
// end;
|
end;
|
||||||
|
|
||||||
kfree(buffer);
|
kfree(buffer);
|
||||||
kfree(zeroBuffer);
|
kfree(zeroBuffer);
|
||||||
writestring('Frees');
|
|
||||||
console.redrawWindows;
|
|
||||||
console.writestringlnWND('writting 1', getTerminalHWND());
|
|
||||||
console.redrawWindows;
|
|
||||||
|
|
||||||
buffer:= puint32(kalloc(disk^.sectorSize));
|
buffer:= puint32(kalloc(disk^.sectorSize));
|
||||||
memset(uint32(buffer), 0, disk^.sectorSize);
|
memset(uint32(buffer), 0, disk^.sectorSize);
|
||||||
console.writestringlnWND('writting 1', getTerminalHWND());
|
|
||||||
console.redrawWindows;
|
|
||||||
|
|
||||||
puint32(buffer)[0]:= $FFFFFFF8; //fsinfo
|
puint32(buffer)[0]:= $FFFFFFF8; //fsinfo
|
||||||
puint32(buffer)[1]:= $FFFFFFF8; //root cluster
|
puint32(buffer)[1]:= $FFFFFFF8; //root cluster
|
||||||
writestring('Buffer Alloc');
|
|
||||||
console.redrawWindows;
|
|
||||||
|
|
||||||
disk^.writecallback(disk, fatStart, 1, buffer);
|
disk^.writecallback(disk, fatStart, 1, buffer);
|
||||||
writestring('WriteCB1');
|
|
||||||
console.redrawWindows;
|
|
||||||
|
|
||||||
kfree(buffer);
|
kfree(buffer);
|
||||||
|
|
||||||
buffer:= puint32(kalloc(disk^.sectorsize));
|
buffer:= puint32(kalloc(disk^.sectorsize));
|
||||||
memset(uint32(buffer), 0, disk^.sectorsize);
|
memset(uint32(buffer), 0, disk^.sectorsize);
|
||||||
writestring('Buffer Alloc 2');
|
|
||||||
console.redrawWindows;
|
|
||||||
|
|
||||||
PDirectory(buffer)[0].fileName := thisArray;
|
PDirectory(buffer)[0].fileName := thisArray;
|
||||||
PDirectory(buffer)[0].attributes := $08;
|
PDirectory(buffer)[0].attributes := $08;
|
||||||
@@ -910,12 +872,8 @@ begin //maybe increase buffer size by one?
|
|||||||
PDirectory(buffer)[1].clusterLow := 1;
|
PDirectory(buffer)[1].clusterLow := 1;
|
||||||
|
|
||||||
disk^.writecallback(disk, dataStart + (config^ * rootCluster), 1, buffer);
|
disk^.writecallback(disk, dataStart + (config^ * rootCluster), 1, buffer);
|
||||||
writestring('WriteCB2');
|
|
||||||
console.redrawWindows;
|
|
||||||
|
|
||||||
kfree(buffer);
|
kfree(buffer);
|
||||||
writestring('Free');
|
|
||||||
console.redrawWindows;
|
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
@@ -152,14 +152,25 @@ end;
|
|||||||
procedure format_command(params : PParamList);
|
procedure format_command(params : PParamList);
|
||||||
var
|
var
|
||||||
driveIndex : uint16;
|
driveIndex : uint16;
|
||||||
|
drive : PStorage_Device;
|
||||||
|
|
||||||
filesystemString : pchar;
|
filesystemString : pchar;
|
||||||
filesystem : PFileSystem;
|
filesystem : PFileSystem;
|
||||||
|
spc : puint32;
|
||||||
begin
|
begin
|
||||||
// driveIndex:= stringToInt( getParam(params, 1) );
|
|
||||||
|
|
||||||
// PFilesystem(LL_Get(filesystems, 0))^.createCallback(
|
spc:= puint32(kalloc(4));
|
||||||
// (PStorage_Device(LL_Get(storageDevices, drive))), 10000, 1, spc); //todo fs
|
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;
|
end;
|
||||||
|
|
||||||
@@ -173,6 +184,12 @@ var
|
|||||||
begin
|
begin
|
||||||
push_trace('StorageManagment.disk_command');
|
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);
|
subcmd:= getParam(0, params);
|
||||||
|
|
||||||
//ls for listing storage devices
|
//ls for listing storage devices
|
||||||
@@ -183,6 +200,7 @@ begin
|
|||||||
|
|
||||||
//format command for clearing a disk and make a new volume
|
//format command for clearing a disk and make a new volume
|
||||||
if stringEquals(subcmd, 'format') then begin
|
if stringEquals(subcmd, 'format') then begin
|
||||||
|
format_command(params);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//lsfs command for listing filesystems
|
//lsfs command for listing filesystems
|
||||||
|
|||||||
@@ -267,6 +267,7 @@ begin
|
|||||||
switchendian:= (lo(b) SHL 4) OR hi(b);
|
switchendian:= (lo(b) SHL 4) OR hi(b);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
//Was broken, now does nothing.
|
||||||
procedure psleep(t : uint16);
|
procedure psleep(t : uint16);
|
||||||
var
|
var
|
||||||
t1, t2 : uint16;
|
t1, t2 : uint16;
|
||||||
@@ -275,6 +276,7 @@ begin
|
|||||||
t1:= BDA^.Ticks;
|
t1:= BDA^.Ticks;
|
||||||
t2:= BDA^.Ticks;
|
t2:= BDA^.Ticks;
|
||||||
while t2-t1 < t do begin
|
while t2-t1 < t do begin
|
||||||
|
break;
|
||||||
t2:= BDA^.Ticks;
|
t2:= BDA^.Ticks;
|
||||||
if t2 < t1 then break;
|
if t2 < t1 then break;
|
||||||
end;
|
end;
|
||||||
|
|||||||
Reference in new issue
Block a user