Changed Memory Management, working on Virtual Memory Management for next rev.
git-svn-id: https://spexeah.com:8443/svn/Asuro@116 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
parent
da0401a21e
commit
278c2e8fa7
Binary file not shown.
BIN
lib/console.ppu
BIN
lib/console.ppu
Binary file not shown.
BIN
lib/idt.ppu
BIN
lib/idt.ppu
Binary file not shown.
BIN
lib/irq.ppu
BIN
lib/irq.ppu
Binary file not shown.
BIN
lib/isr0.ppu
BIN
lib/isr0.ppu
Binary file not shown.
BIN
lib/isr1.ppu
BIN
lib/isr1.ppu
Binary file not shown.
BIN
lib/isr10.ppu
BIN
lib/isr10.ppu
Binary file not shown.
BIN
lib/isr11.ppu
BIN
lib/isr11.ppu
Binary file not shown.
BIN
lib/isr12.ppu
BIN
lib/isr12.ppu
Binary file not shown.
BIN
lib/isr13.ppu
BIN
lib/isr13.ppu
Binary file not shown.
BIN
lib/isr14.ppu
BIN
lib/isr14.ppu
Binary file not shown.
BIN
lib/isr15.ppu
BIN
lib/isr15.ppu
Binary file not shown.
BIN
lib/isr16.ppu
BIN
lib/isr16.ppu
Binary file not shown.
BIN
lib/isr17.ppu
BIN
lib/isr17.ppu
Binary file not shown.
BIN
lib/isr18.ppu
BIN
lib/isr18.ppu
Binary file not shown.
BIN
lib/isr2.ppu
BIN
lib/isr2.ppu
Binary file not shown.
BIN
lib/isr3.ppu
BIN
lib/isr3.ppu
Binary file not shown.
BIN
lib/isr32.ppu
BIN
lib/isr32.ppu
Binary file not shown.
BIN
lib/isr33.ppu
BIN
lib/isr33.ppu
Binary file not shown.
BIN
lib/isr4.ppu
BIN
lib/isr4.ppu
Binary file not shown.
BIN
lib/isr40.ppu
BIN
lib/isr40.ppu
Binary file not shown.
BIN
lib/isr5.ppu
BIN
lib/isr5.ppu
Binary file not shown.
BIN
lib/isr6.ppu
BIN
lib/isr6.ppu
Binary file not shown.
BIN
lib/isr7.ppu
BIN
lib/isr7.ppu
Binary file not shown.
BIN
lib/isr8.ppu
BIN
lib/isr8.ppu
Binary file not shown.
BIN
lib/isr9.ppu
BIN
lib/isr9.ppu
Binary file not shown.
BIN
lib/kernel.ppu
BIN
lib/kernel.ppu
Binary file not shown.
BIN
lib/keyboard.ppu
BIN
lib/keyboard.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.
BIN
lib/paging.ppu
BIN
lib/paging.ppu
Binary file not shown.
BIN
lib/pmemorymanager.ppu
Normal file
BIN
lib/pmemorymanager.ppu
Normal file
Binary file not shown.
Binary file not shown.
BIN
lib/stub.o
BIN
lib/stub.o
Binary file not shown.
BIN
lib/util.ppu
BIN
lib/util.ppu
Binary file not shown.
BIN
lib/vmemorymanager.ppu
Normal file
BIN
lib/vmemorymanager.ppu
Normal file
Binary file not shown.
@ -13,9 +13,9 @@ uses
|
||||
console,
|
||||
bios_data_area,
|
||||
keyboard,
|
||||
memorymanager,
|
||||
scheduler,
|
||||
paging;
|
||||
vmemorymanager,
|
||||
pmemorymanager,
|
||||
scheduler;
|
||||
|
||||
procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: uint32); stdcall;
|
||||
|
||||
@ -51,19 +51,21 @@ begin
|
||||
idt.init();
|
||||
isr.init();
|
||||
irq.init();
|
||||
memorymanager.init();
|
||||
pmemorymanager.init();
|
||||
scheduler.init();
|
||||
|
||||
STI;
|
||||
isr32.hook(uint32(@bios_data_area.tick_update));
|
||||
|
||||
{z:= 1;
|
||||
z:= 1;
|
||||
while true do begin
|
||||
console.writeintln(z);
|
||||
pint:= kalloc(65000);
|
||||
console.writeword(z);
|
||||
console.writestring(': ');
|
||||
pint:= kalloc(1024*4);
|
||||
console.writewordln(uint32(pint));
|
||||
if pint = nil then while true do begin end else pint^:= 1234;
|
||||
z:=z+1;
|
||||
end;}
|
||||
end;
|
||||
|
||||
//drivers
|
||||
keyboard.init(keyboard_layout);
|
||||
|
@ -1,14 +1,15 @@
|
||||
unit memorymanager;
|
||||
unit pmemorymanager;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
util,
|
||||
console;
|
||||
console,
|
||||
vmemorymanager;
|
||||
|
||||
const
|
||||
ALLOC_SPACE = 8; //64-Bit Allocations
|
||||
MAX_ENTRIES = $FFFF;
|
||||
MAX_ENTRIES = $FFFFF;
|
||||
|
||||
procedure init;
|
||||
function kalloc(size : uint32) : void;
|
||||
@ -41,7 +42,7 @@ end;
|
||||
|
||||
function kalloc(size : uint32) : void;
|
||||
var
|
||||
blocks : uint8;
|
||||
blocks : uint32;
|
||||
rem : uint32;
|
||||
i,j : uint32;
|
||||
miss : boolean;
|
||||
@ -66,11 +67,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;
|
@ -5,12 +5,16 @@ interface
|
||||
uses
|
||||
console,
|
||||
isr32,
|
||||
memorymanager;
|
||||
pmemorymanager;
|
||||
|
||||
const
|
||||
Quantum = 64;
|
||||
|
||||
type
|
||||
TTask_State_Segment = packed record
|
||||
|
||||
end;
|
||||
|
||||
TScheduler_Entry = packed record
|
||||
ThreadID : uint32;
|
||||
Priority : uint8;
|
||||
|
@ -97,5 +97,6 @@ section .bss
|
||||
; Kernel stack location
|
||||
;
|
||||
align 32
|
||||
global KERNEL_STACK
|
||||
KERNEL_STACK:
|
||||
resb KERNEL_STACKSIZE
|
||||
|
@ -34,6 +34,7 @@ procedure psleep(t : uint16);
|
||||
|
||||
var
|
||||
endptr : uint32; external name '__end';
|
||||
stack : uint32; external name 'KERNEL_STACK';
|
||||
|
||||
implementation
|
||||
|
||||
@ -135,7 +136,7 @@ begin
|
||||
asm
|
||||
PUSH EAX
|
||||
PUSH EDX
|
||||
MOV DX, port
|
||||
MOV DX, port$FFFF
|
||||
IN EAX, DX
|
||||
MOV inl, EAX
|
||||
POP EDX
|
||||
|
@ -1,10 +1,9 @@
|
||||
unit paging;
|
||||
unit vmemorymanager;
|
||||
|
||||
interface
|
||||
|
||||
type
|
||||
PPageTableEntry = ^TPageTableEntry;
|
||||
|
||||
{PPageTableEntry = ^TPageTableEntry;
|
||||
TPageTableEntry = bitpacked record
|
||||
Present,
|
||||
Writable,
|
||||
@ -17,7 +16,7 @@ type
|
||||
GlobalPage: Boolean;
|
||||
Available: UBit3;
|
||||
FrameAddress: UBit20;
|
||||
end;
|
||||
end;}
|
||||
|
||||
PPageDirEntry = ^TPageDirEntry;
|
||||
TPageDirEntry = bitpacked record
|
Loading…
x
Reference in New Issue
Block a user