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,
|
console,
|
||||||
bios_data_area,
|
bios_data_area,
|
||||||
keyboard,
|
keyboard,
|
||||||
memorymanager,
|
vmemorymanager,
|
||||||
scheduler,
|
pmemorymanager,
|
||||||
paging;
|
scheduler;
|
||||||
|
|
||||||
procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: uint32); stdcall;
|
procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: uint32); stdcall;
|
||||||
|
|
||||||
@ -51,19 +51,21 @@ begin
|
|||||||
idt.init();
|
idt.init();
|
||||||
isr.init();
|
isr.init();
|
||||||
irq.init();
|
irq.init();
|
||||||
memorymanager.init();
|
pmemorymanager.init();
|
||||||
scheduler.init();
|
scheduler.init();
|
||||||
|
|
||||||
STI;
|
STI;
|
||||||
isr32.hook(uint32(@bios_data_area.tick_update));
|
isr32.hook(uint32(@bios_data_area.tick_update));
|
||||||
|
|
||||||
{z:= 1;
|
z:= 1;
|
||||||
while true do begin
|
while true do begin
|
||||||
console.writeintln(z);
|
console.writeword(z);
|
||||||
pint:= kalloc(65000);
|
console.writestring(': ');
|
||||||
|
pint:= kalloc(1024*4);
|
||||||
|
console.writewordln(uint32(pint));
|
||||||
if pint = nil then while true do begin end else pint^:= 1234;
|
if pint = nil then while true do begin end else pint^:= 1234;
|
||||||
z:=z+1;
|
z:=z+1;
|
||||||
end;}
|
end;
|
||||||
|
|
||||||
//drivers
|
//drivers
|
||||||
keyboard.init(keyboard_layout);
|
keyboard.init(keyboard_layout);
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
unit memorymanager;
|
unit pmemorymanager;
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
util,
|
util,
|
||||||
console;
|
console,
|
||||||
|
vmemorymanager;
|
||||||
|
|
||||||
const
|
const
|
||||||
ALLOC_SPACE = 8; //64-Bit Allocations
|
ALLOC_SPACE = 8; //64-Bit Allocations
|
||||||
MAX_ENTRIES = $FFFF;
|
MAX_ENTRIES = $FFFFF;
|
||||||
|
|
||||||
procedure init;
|
procedure init;
|
||||||
function kalloc(size : uint32) : void;
|
function kalloc(size : uint32) : void;
|
||||||
@ -41,7 +42,7 @@ end;
|
|||||||
|
|
||||||
function kalloc(size : uint32) : void;
|
function kalloc(size : uint32) : void;
|
||||||
var
|
var
|
||||||
blocks : uint8;
|
blocks : uint32;
|
||||||
rem : uint32;
|
rem : uint32;
|
||||||
i,j : uint32;
|
i,j : uint32;
|
||||||
miss : boolean;
|
miss : boolean;
|
||||||
@ -66,11 +67,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;
|
@ -5,12 +5,16 @@ interface
|
|||||||
uses
|
uses
|
||||||
console,
|
console,
|
||||||
isr32,
|
isr32,
|
||||||
memorymanager;
|
pmemorymanager;
|
||||||
|
|
||||||
const
|
const
|
||||||
Quantum = 64;
|
Quantum = 64;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
TTask_State_Segment = packed record
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
TScheduler_Entry = packed record
|
TScheduler_Entry = packed record
|
||||||
ThreadID : uint32;
|
ThreadID : uint32;
|
||||||
Priority : uint8;
|
Priority : uint8;
|
||||||
|
@ -97,5 +97,6 @@ section .bss
|
|||||||
; Kernel stack location
|
; Kernel stack location
|
||||||
;
|
;
|
||||||
align 32
|
align 32
|
||||||
|
global KERNEL_STACK
|
||||||
KERNEL_STACK:
|
KERNEL_STACK:
|
||||||
resb KERNEL_STACKSIZE
|
resb KERNEL_STACKSIZE
|
||||||
|
@ -34,6 +34,7 @@ procedure psleep(t : uint16);
|
|||||||
|
|
||||||
var
|
var
|
||||||
endptr : uint32; external name '__end';
|
endptr : uint32; external name '__end';
|
||||||
|
stack : uint32; external name 'KERNEL_STACK';
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@ -135,7 +136,7 @@ begin
|
|||||||
asm
|
asm
|
||||||
PUSH EAX
|
PUSH EAX
|
||||||
PUSH EDX
|
PUSH EDX
|
||||||
MOV DX, port
|
MOV DX, port$FFFF
|
||||||
IN EAX, DX
|
IN EAX, DX
|
||||||
MOV inl, EAX
|
MOV inl, EAX
|
||||||
POP EDX
|
POP EDX
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
unit paging;
|
unit vmemorymanager;
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
type
|
type
|
||||||
PPageTableEntry = ^TPageTableEntry;
|
{PPageTableEntry = ^TPageTableEntry;
|
||||||
|
|
||||||
TPageTableEntry = bitpacked record
|
TPageTableEntry = bitpacked record
|
||||||
Present,
|
Present,
|
||||||
Writable,
|
Writable,
|
||||||
@ -17,7 +16,7 @@ type
|
|||||||
GlobalPage: Boolean;
|
GlobalPage: Boolean;
|
||||||
Available: UBit3;
|
Available: UBit3;
|
||||||
FrameAddress: UBit20;
|
FrameAddress: UBit20;
|
||||||
end;
|
end;}
|
||||||
|
|
||||||
PPageDirEntry = ^TPageDirEntry;
|
PPageDirEntry = ^TPageDirEntry;
|
||||||
TPageDirEntry = bitpacked record
|
TPageDirEntry = bitpacked record
|
Loading…
x
Reference in New Issue
Block a user