Cleaned up debug messages.
git-svn-id: https://spexeah.com:8443/svn/Asuro@111 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
parent
fa68dad487
commit
b9984e7a44
BIN
bin/kernel.bin
BIN
bin/kernel.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
lib/kernel.ppu
BIN
lib/kernel.ppu
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
lib/libpsystem.a
BIN
lib/libpsystem.a
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -53,22 +53,11 @@ begin
|
||||
memorymanager.init();
|
||||
scheduler.init();
|
||||
|
||||
pint2:= kalloc(18);
|
||||
pint:= kalloc(sizeof(uint32));
|
||||
if pint = nil then console.writestringln('!');
|
||||
pint^:= 1234;
|
||||
kfree(pint2);
|
||||
console.writeintln(pint^);
|
||||
kfree(pint);
|
||||
pint2:= kalloc(128);
|
||||
|
||||
STI;
|
||||
isr32.hook(uint32(@bios_data_area.tick_update));
|
||||
|
||||
//drivers
|
||||
keyboard.init(keyboard_layout);
|
||||
scheduler.add_task(5);
|
||||
scheduler.add_task(15);
|
||||
|
||||
asm
|
||||
MOV dds, CS
|
||||
|
@ -31,10 +31,12 @@ var
|
||||
i : uint32;
|
||||
|
||||
begin
|
||||
console.writestringln('MEM-MANAGER: INIT BEGIN.');
|
||||
For i:=0 to MAX_ENTRIES-1 do begin
|
||||
Memory_Manager[i].Present:= False;
|
||||
end;
|
||||
Memory_Start:= uint32(@util.endptr);
|
||||
console.writestringln('MEM-MANAGER: INIT END.');
|
||||
end;
|
||||
|
||||
function kalloc(size : uint32) : void;
|
||||
@ -64,11 +66,11 @@ begin
|
||||
Memory_Manager[i+j].Length:= 0;
|
||||
if j = 0 then Memory_Manager[i+j].Length:= blocks;
|
||||
end;
|
||||
console.writestring('Allocated ');
|
||||
console.writeint(blocks);
|
||||
console.writestring(' Block(s). [Block: ');
|
||||
console.writeint(i);
|
||||
console.writestringln(']');
|
||||
//console.writestring('Allocated ');
|
||||
//console.writeint(blocks);
|
||||
//console.writestring(' Block(s). [Block: ');
|
||||
//console.writeint(i);
|
||||
//console.writestringln(']');
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
@ -93,11 +95,11 @@ begin
|
||||
for i:=0 to bLength-1 do begin
|
||||
Memory_Manager[Block+i].Present:= False;
|
||||
end;
|
||||
console.writestring('Freed ');
|
||||
console.writeint(bLength);
|
||||
console.writestring(' Block(s). [Block: ');
|
||||
console.writeint(Block);
|
||||
console.writestringln(']');
|
||||
//console.writestring('Freed ');
|
||||
//console.writeint(bLength);
|
||||
//console.writestring(' Block(s). [Block: ');
|
||||
//console.writeint(Block);
|
||||
//console.writestringln(']');
|
||||
end else begin
|
||||
asm
|
||||
INT 13
|
||||
|
@ -31,11 +31,7 @@ var
|
||||
|
||||
procedure context_switch();
|
||||
begin
|
||||
// This will switch contexts eventually,
|
||||
// For now just print upon context switch.
|
||||
Current_Task:= PScheduler_Entry(Current_Task^.Next);
|
||||
console.writestring('Task: ');
|
||||
console.writeintln(Current_Task^.ThreadID);
|
||||
end;
|
||||
|
||||
procedure add_task(priority : uint8);
|
||||
@ -62,11 +58,13 @@ end;
|
||||
procedure delta(data : void);
|
||||
begin
|
||||
Tick:= Tick + 1;
|
||||
If Tick = 0 then context_switch();
|
||||
If (Current_Task^.Delta + (Current_Task^.Priority * Quantum)) <= Tick then context_switch();
|
||||
end;
|
||||
|
||||
procedure init;
|
||||
begin
|
||||
console.writestringln('SCHEDULER: INIT BEGIN.');
|
||||
Root_Task:= PScheduler_Entry(kalloc(sizeof(TScheduler_Entry)));
|
||||
Root_Task^.ThreadID:= 0;
|
||||
Root_Task^.Priority:= 1;
|
||||
@ -75,6 +73,7 @@ begin
|
||||
Current_Task:= Root_Task;
|
||||
Tick:= 0;
|
||||
isr32.hook(uint32(@delta));
|
||||
console.writestringln('SCHEDULER: INIT END.');
|
||||
end;
|
||||
|
||||
end.
|
Loading…
x
Reference in New Issue
Block a user