Adapt Makefile, modify some comments

This commit is contained in:
manzerbredes 2015-07-19 11:52:01 +04:00
parent af0fdb77e3
commit bf801b82fd
3 changed files with 16 additions and 6 deletions

View file

@ -1,5 +1,12 @@
kernel.bin:
touch kernel.bin kernel.bin:entry.o main.o
ld -m elf_i386 --entry=_start -Ttext=0x1000 -o $@ $^
entry.o:entry.asm
nasm -f elf $^
main.o:main.c
gcc -m32 -c $^ -o $@
clean: clean:
rm ./*.o
rm kernel.bin rm kernel.bin

View file

@ -1,14 +1,14 @@
[BITS 32] [BITS 32]
;Define extern symbole ;Define extern symbol
extern main extern main
;Define global symbole ;Define entry point as global for linking
global _start global _start
;Define kernel entry point ;Define kernel entry point
_start: _start:
jmp begin ;Go to begin and run main kernel function jmp begin ;Go to begin (for skip Multiboot Specification Header)
;----- Multiboot Specification Header ----- ;----- Multiboot Specification Header -----
@ -20,5 +20,5 @@ dd 0x1BADB002
begin: begin:
call main ;Run main function call main ;Start kernel

View file

@ -1,4 +1,7 @@
//----- PiegOS kernel main -----
void main(){ void main(){
while(1); while(1);