Improve disk benchmark suites and timing, and fix command launch race

This commit is contained in:
Aaron committed 2026-10-31 19:06:46 +00:00
1 parent 8e0ab3da8b
commit 720ba46630
8 files changed
+1057 -181

No files matched your search

+5 -1
View File
@@ -27,6 +27,10 @@ uses
arch.x86.isr.mgr,
arch.x86.idt;
const
PIT_INPUT_HZ = 1193182;
PIT_DIVISOR = 149;
procedure register();
procedure hook(hook_method : uint32);
procedure unhook(hook_method : uint32);
@@ -54,7 +58,7 @@ procedure register();
begin
if not registered then begin
asm
mov ax, 149
mov ax, PIT_DIVISOR
out $40, al
mov al, ah
out $40, al
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+4
View File
@@ -486,6 +486,10 @@ var
begin
search := params;
for i := 0 to index do begin
if search = nil then begin
getParam := nil;
exit;
end;
if search^.next = nil then begin
getParam := nil;
exit;
+20 -7
View File
@@ -107,10 +107,10 @@ procedure process_trampoline; forward;
{ ---- Process creation ---- }
function create(name : pchar;
function createInternal(name : pchar;
entry : TProcessEntryPoint;
localData : void;
priority : uint8) : PProcessContext;
priority : uint8; runnable : boolean) : PProcessContext;
var
ctx : PProcessContext;
slotPtr : ^uint32;
@@ -119,7 +119,7 @@ var
prio : uint8;
begin
push_trace('proc.mgr.create');
create := nil;
createInternal := nil;
if priority = 0 then prio := 1 else prio := priority;
@@ -140,7 +140,7 @@ begin
ctx^.ParentID := CurrentProcess^.ProcessID;
{ State }
ctx^.State := psCreated;
ctx^.State := psSuspended;
ctx^.ExitCode := 0;
{ Entry point }
@@ -269,14 +269,22 @@ begin
slotPtr^ := uint32(ctx);
{ Mark as ready for scheduling }
ctx^.State := psReady;
if runnable then ctx^.State := psReady;
asm popf end;
io.syslog.log('PROCMGR', 'Created process: ');
io.syslog.writestringln(name);
pop_trace;
create := ctx;
createInternal := ctx;
end;
{ Public creation retains its ready-on-return behavior. Commands need their
arguments and streams installed before the scheduler may enter them. }
function create(name : pchar; entry : TProcessEntryPoint;
localData : void; priority : uint8) : PProcessContext;
begin
create := createInternal(name, entry, localData, priority, true);
end;
{ ---- Process trampoline ---- }
@@ -543,12 +551,17 @@ function runCommand(name : pchar; method : TCommandMethod; params : PParamList;
var
ctx : PProcessContext;
begin
ctx := create(name, @legacy_entry, void(method), 1);
ctx := createInternal(name, @legacy_entry, void(method), 1, false);
if ctx <> nil then begin
ctx^.MsgData := void(params);
ctx^.StdIn := stdin_buf;
ctx^.StdOut := stdout_buf;
ctx^.StdErr := stderr_buf;
{ Publish only after all fields read by legacy_entry are initialized.
psCreated is also runnable, so creation must use psSuspended. }
asm pushf; cli end;
ctx^.State := psReady;
asm popf end;
end;
runCommand := ctx;
end;
+2
View File
@@ -33,6 +33,7 @@ uses
core.ds.prio,
driver.storage.vfs,
driver.storage.test,
driver.storage.bench,
driver.storage.metatest,
driver.storage.perftest,
driver.storage.ctl.ahci,
@@ -71,6 +72,7 @@ begin
core.ds.prio.UnitTest;
driver.storage.vfs.UnitTest;
driver.storage.test.UnitTest;
driver.storage.bench.UnitTest;
driver.storage.metatest.UnitTest;
driver.storage.perftest.UnitTest;
driver.storage.ctl.ahci.UnitTest;