Created the Malloc function; first stage of memory management implemented.

This commit is contained in:
2019-01-06 20:38:45 -06:00
parent dfe852f69b
commit 67bf4a355d
7 changed files with 69 additions and 149 deletions
+16 -9
View File
@@ -1,11 +1,10 @@
GCCPARAMS = -m32 -fno-pie -nostdlib -fstrength-reduce -fomit-frame-pointer -finline-functions -fno-builtin -nostdinc
GCCPARAMS = -m32 -fno-pie -nostdlib -fstrength-reduce -fomit-frame-pointer -finline-functions -fno-builtin -nostdinc -fno-stack-protector
ASPARAMS = -f elf32
LDPARAMS = -m elf_i386
#BUILD_NUMBER_FILE=build-number.txt
INCBULDNUM := sh make_buildnum.sh
objects = obj/start.o \
obj/main.o \
obj/kernel.o \
obj/scrn.o \
obj/gdt.o \
obj/idt.o \
@@ -13,9 +12,12 @@ objects = obj/start.o \
obj/irq.o \
obj/timer.o \
obj/kb.o \
obj/shell.o
obj/shell.o \
obj/memorymanager.o \
obj/pci.o \
obj/port.o
run: kernel.iso
run:kernel.iso
qemu-system-x86_64 -cdrom kernel.iso &
obj/%.o: src/%.c
@@ -27,10 +29,11 @@ obj/%.o: src/%.asm
nasm $(ASPARAMS) -o $@ $<
kernel.bin: linker.ld $(objects)
#Crap way to increment the build number, but will do for now
#thanks to my limited knowledge of Makefiles.
sh make_buildnum.sh
mkdir -p obj/bin
ld $(LDPARAMS) -T $< -o obj/bin/$@ $(objects)
#https://www.linuxjournal.com/content/add-auto-incrementing-build-number-your-build-process
#include buildnumber.mak
kernel.iso: kernel.bin
mkdir iso
@@ -46,4 +49,8 @@ kernel.iso: kernel.bin
.PHONY: clean
clean:
rm -rf obj kernel.iso
rm -rf obj kernel.iso
.PHONY: resetbuild
resetbuild:
echo 0 > build.number