kernel entry assembly code to avoid compiler anomalies.
This commit is contained in:
parent
2aa306c9a3
commit
b8fe2bd8a3
5
Makefile
5
Makefile
@ -9,12 +9,13 @@ LDFLAGS=-melf_i386 -Ttext 0x1000 --oformat binary
|
|||||||
basicos:
|
basicos:
|
||||||
mkdir -p $(BIN)
|
mkdir -p $(BIN)
|
||||||
$(ASM) boot_sect.asm $(AFLAGS) -o boot_sect.bin
|
$(ASM) boot_sect.asm $(AFLAGS) -o boot_sect.bin
|
||||||
|
$(ASM) kernel_entry.asm -f elf -o kernel_entry.o
|
||||||
$(CC) $(CFLAGS) -c kernel.c -o kernel.o
|
$(CC) $(CFLAGS) -c kernel.c -o kernel.o
|
||||||
$(LD) $(LDFLAGS) -o kernel.bin kernel.o
|
$(LD) $(LDFLAGS) -o kernel.bin kernel_entry.o kernel.o
|
||||||
cat boot_sect.bin kernel.bin > $(BIN)/os-image
|
cat boot_sect.bin kernel.bin > $(BIN)/os-image
|
||||||
|
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm *.bin *.o
|
rm -f *.bin *.o
|
||||||
|
4
kernel_entry.asm
Normal file
4
kernel_entry.asm
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[bits 32]
|
||||||
|
[extern main] ; reference an external label
|
||||||
|
call main ; call the main function of our kernel
|
||||||
|
jmp $ ; hang
|
Loading…
Reference in New Issue
Block a user