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

BIN
Asuro.iso

Binary file not shown.

Binary file not shown.

View File

@ -7,6 +7,8 @@ echo "======================="
echo " " echo " "
echo "Compiling ASM Stub..." echo "Compiling ASM Stub..."
echo " " echo " "
rm lib/*
nasm -f elf src/stub/stub.asm -o lib/stub.o nasm -f elf src/stub/stub.asm -o lib/stub.o
if [ $? -ne 0 ] if [ $? -ne 0 ]
then then

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

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