Cleaned up debug messages.

git-svn-id: https://spexeah.com:8443/svn/Asuro@111 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
kieron 2017-05-18 16:37:54 +00:00
parent fa68dad487
commit b9984e7a44
13 changed files with 15 additions and 25 deletions

BIN
Asuro.iso

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -53,22 +53,11 @@ begin
memorymanager.init(); memorymanager.init();
scheduler.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; STI;
isr32.hook(uint32(@bios_data_area.tick_update)); isr32.hook(uint32(@bios_data_area.tick_update));
//drivers //drivers
keyboard.init(keyboard_layout); keyboard.init(keyboard_layout);
scheduler.add_task(5);
scheduler.add_task(15);
asm asm
MOV dds, CS MOV dds, CS

View File

@ -31,10 +31,12 @@ var
i : uint32; i : uint32;
begin begin
console.writestringln('MEM-MANAGER: INIT BEGIN.');
For i:=0 to MAX_ENTRIES-1 do begin For i:=0 to MAX_ENTRIES-1 do begin
Memory_Manager[i].Present:= False; Memory_Manager[i].Present:= False;
end; end;
Memory_Start:= uint32(@util.endptr); Memory_Start:= uint32(@util.endptr);
console.writestringln('MEM-MANAGER: INIT END.');
end; end;
function kalloc(size : uint32) : void; function kalloc(size : uint32) : void;
@ -64,11 +66,11 @@ begin
Memory_Manager[i+j].Length:= 0; Memory_Manager[i+j].Length:= 0;
if j = 0 then Memory_Manager[i+j].Length:= blocks; if j = 0 then Memory_Manager[i+j].Length:= blocks;
end; end;
console.writestring('Allocated '); //console.writestring('Allocated ');
console.writeint(blocks); //console.writeint(blocks);
console.writestring(' Block(s). [Block: '); //console.writestring(' Block(s). [Block: ');
console.writeint(i); //console.writeint(i);
console.writestringln(']'); //console.writestringln(']');
break; break;
end; end;
end; end;
@ -93,11 +95,11 @@ begin
for i:=0 to bLength-1 do begin for i:=0 to bLength-1 do begin
Memory_Manager[Block+i].Present:= False; Memory_Manager[Block+i].Present:= False;
end; end;
console.writestring('Freed '); //console.writestring('Freed ');
console.writeint(bLength); //console.writeint(bLength);
console.writestring(' Block(s). [Block: '); //console.writestring(' Block(s). [Block: ');
console.writeint(Block); //console.writeint(Block);
console.writestringln(']'); //console.writestringln(']');
end else begin end else begin
asm asm
INT 13 INT 13

View File

@ -31,11 +31,7 @@ var
procedure context_switch(); procedure context_switch();
begin begin
// This will switch contexts eventually,
// For now just print upon context switch.
Current_Task:= PScheduler_Entry(Current_Task^.Next); Current_Task:= PScheduler_Entry(Current_Task^.Next);
console.writestring('Task: ');
console.writeintln(Current_Task^.ThreadID);
end; end;
procedure add_task(priority : uint8); procedure add_task(priority : uint8);
@ -62,11 +58,13 @@ end;
procedure delta(data : void); procedure delta(data : void);
begin begin
Tick:= Tick + 1; Tick:= Tick + 1;
If Tick = 0 then context_switch();
If (Current_Task^.Delta + (Current_Task^.Priority * Quantum)) <= Tick then context_switch(); If (Current_Task^.Delta + (Current_Task^.Priority * Quantum)) <= Tick then context_switch();
end; end;
procedure init; procedure init;
begin begin
console.writestringln('SCHEDULER: INIT BEGIN.');
Root_Task:= PScheduler_Entry(kalloc(sizeof(TScheduler_Entry))); Root_Task:= PScheduler_Entry(kalloc(sizeof(TScheduler_Entry)));
Root_Task^.ThreadID:= 0; Root_Task^.ThreadID:= 0;
Root_Task^.Priority:= 1; Root_Task^.Priority:= 1;
@ -75,6 +73,7 @@ begin
Current_Task:= Root_Task; Current_Task:= Root_Task;
Tick:= 0; Tick:= 0;
isr32.hook(uint32(@delta)); isr32.hook(uint32(@delta));
console.writestringln('SCHEDULER: INIT END.');
end; end;
end. end.