MemoryManager WTF?!

git-svn-id: https://spexeah.com:8443/svn/Asuro@101 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
kieron
2017-05-18 14:08:16 +00:00
parent ca9537f89f
commit f2a42134c7
14 changed files with 41 additions and 2 deletions

View File

@ -12,7 +12,8 @@ uses
isr32,
console,
bios_data_area,
keyboard;
keyboard,
memorymanager;
procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: uint32); stdcall;
@ -78,7 +79,6 @@ begin
console.writeint(((mbinfo^.mem_upper + 1000) div 1024) + 1);
console.writestringln('MB');
console.setdefaultattribute(console.combinecolors(lYellow, Black));
console.writewordln(uint32(@util.endptr) - KERNEL_VIRTUAL_BASE);
util.halt_and_dont_catch_fire;
end;

37
src/memorymanager.pas Normal file
View File

@ -0,0 +1,37 @@
unit memorymanager;
interface
uses
util;
const
ALLOC_SPACE = 8; //64-Bit Allocations
MAX_ENTRIES = $FFFF;
procedure init();
function kalloc(size : uint32) : void;
procedure kfree(area : void);
implementation
var
Memory_Start : uint32;
Memory_Manager : bitpacked array[1..MAX_ENTRIES] of Boolean;
procedure init();
begin
Memory_Start:= uint32(@util.endptr);
end;
function kalloc(size : uint32) : void;
begin
kalloc:= void(0);
end;
function kfree(area : void);
begin
end;
end.