MemoryManager WTF?!
git-svn-id: https://spexeah.com:8443/svn/Asuro@101 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
@ -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
37
src/memorymanager.pas
Normal 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.
|
Reference in New Issue
Block a user