Go back to C and adapt code

This commit is contained in:
manzerbredes 2015-07-28 14:19:00 +04:00
parent aac010a9e3
commit e0c565f7ff
18 changed files with 242 additions and 308 deletions

View file

@ -1,21 +1,28 @@
CXX=g++ -Wall -m32
CC=gcc
LD=ld -m elf_i386
CFLAGS=-m32
LDFLAGS=-m elf_i386 --entry=_kernelEntry -Ttext=0x100000
EXEC=kernel.bin
export CXX
export CC
export LD
export CFLAGS
export LDFLAGS
all:$(EXEC)
#----- Kernel -----
$(EXEC):entry.o main.o GDT/gdt.o Helpers/helpers.o
$(CXX) --entry=_kernelEntry -Ttext=0x100000 -o $@ $^
$(LD) $(LDFLAGS) -o $@ $^
#-----------------
#----- Entry & Main-----
entry.o:entry.asm
nasm -f elf $^
main.o:main.cpp
$(CXX) -c $^ -o $@
main.o:main.c
$(CC) $(CFLAGS) -c $^ -o $@
#-----------------------
@ -29,6 +36,7 @@ Helpers/helpers.o:
cd ./Helpers/ && make
#---------------
#----- Other -----
.PHONY:clean