change build system and cosmetic changes to main.s
This commit is contained in:
parent
6887afafa9
commit
52303cb629
|
|
@ -0,0 +1,25 @@
|
||||||
|
CFLAGS="-g -c -m32 -fno-pie -mno-sse -O3 -D __bits__=32 -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast -Wno-incompatible-pointer-types -Wno-address-of-packed-member -fno-stack-protector -mno-red-zone -mno-sse -mno-sse2 -ffreestanding -nostdlib -mno-mmx"
|
||||||
|
LDFLAGS_i386="-Ttext 0xc0000000 --oformat binary -melf_i386"
|
||||||
|
|
||||||
|
cd src/kernel/
|
||||||
|
gcc kmain.c $CFLAGS -o ../../bin/kernel/kmain.o
|
||||||
|
for d in ./*/; do
|
||||||
|
if [ "$d" != "./obj/" ]; then
|
||||||
|
echo -e "\033[1;32mCompiling files in $d\033[0m"
|
||||||
|
for f in $d*.c; do
|
||||||
|
echo -e "\033[1;36mfile: $f\033[0m"
|
||||||
|
SUF=".c"
|
||||||
|
SUF_REM=${f%"$SUF"}
|
||||||
|
END=${SUF_REM#"$d"}
|
||||||
|
# doing this, '#' removes prefix, and '%' removes suffix
|
||||||
|
gcc $f $CFLAGS -o ../../bin/kernel/$END.o
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
cd ../../
|
||||||
|
|
||||||
|
# find -name bin/ *.o | xargs echo
|
||||||
|
# echo ../obj/*.o
|
||||||
|
|
||||||
|
# ld ../obj/kentry.o obj/*.o -T linker.ld -melf_i386 -o ../obj/kernel.bin
|
||||||
|
|
@ -779,7 +779,6 @@ k_info:
|
||||||
.yres: dw 25
|
.yres: dw 25
|
||||||
.framebuffer_ptr: dd 0xb8000
|
.framebuffer_ptr: dd 0xb8000
|
||||||
.loaded_modules: dd 0
|
.loaded_modules: dd 0
|
||||||
;NOTE: remember to search for a free pg directory for the paddr map
|
|
||||||
;loaded_modules points to a struct array containing a ptr to the entry point of each pre-loaded module to be executed during startup
|
;loaded_modules points to a struct array containing a ptr to the entry point of each pre-loaded module to be executed during startup
|
||||||
;module_struct:
|
;module_struct:
|
||||||
;.entry_point: dd 0
|
;.entry_point: dd 0
|
||||||
|
|
@ -792,9 +791,6 @@ sacrifice1: dd 0
|
||||||
sacrifice0: dd 1
|
sacrifice0: dd 1
|
||||||
kernel_physical_size: dd 0
|
kernel_physical_size: dd 0
|
||||||
kload_paddr: dd 0x20000
|
kload_paddr: dd 0x20000
|
||||||
|
|
||||||
|
|
||||||
; elf_magic EQU 0x7f454c46
|
|
||||||
elf_magic EQU 0x464c457f
|
elf_magic EQU 0x464c457f
|
||||||
file_buffer EQU 0xa000
|
file_buffer EQU 0xa000
|
||||||
root_dir EQU 0x1000
|
root_dir EQU 0x1000
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue