MemoryManager WTF?!
git-svn-id: https://spexeah.com:8443/svn/Asuro@101 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
1 parent
ca9537f89f
commit
f2a42134c7
14 files changed
+41
-2
No files matched your search
Binary file not shown.
@@ -7,6 +7,8 @@ echo "======================="
|
||||
echo " "
|
||||
echo "Compiling ASM Stub..."
|
||||
echo " "
|
||||
rm lib/*
|
||||
|
||||
nasm -f elf src/stub/stub.asm -o lib/stub.o
|
||||
if [ $? -ne 0 ]
|
||||
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.
+2
-2
@@ -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;
|
||||
|
||||
|
||||
@@ -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