Undefined reference to...
Posted: Mon Jun 15, 2020 9:51 am
Hi... again, I solved the vga problem but when i include the code of cpu interrupts i get the following error from ld:
my build.bat:
my build.bat:
Code: Select all
@echo off
cls
color a
echo Compiling...
gcc -ffreestanding -c kernel\kernel.c -o kernel\kernel.o
gcc -ffreestanding -c kernel\drivers\ports.c -o kernel\drivers\ports.o
gcc -ffreestanding -c kernel\drivers\screen.c -o kernel\drivers\screen.o
gcc -ffreestanding -c kernel\drivers\util.c -o kernel\util.o
gcc -ffreestanding -c cpu\idt.c -o cpu\idt.o
gcc -ffreestanding -c cpu\isr.c -o cpu\isr.o
timeout 2 >nul
echo Kernel dump:
objdump -d kernel\kernel.o
timeout 1 >nul
echo nasm:
nasm -f elf boot\kernel_entry.asm -o boot\kernel_entry.o
nasm -f elf cpu\interrupt.asm -o cpu\interrupt.o
echo ld:
ld -o kernel\kernel.out -Ttext 0x1000 kernel\kernel.o cpu\isr.o cpu\idt.o cpu\interrupt.o boot\kernel_entry.o kernel\drivers\ports.o kernel\drivers\screen.o kernel\util.o
echo objcopy:
objcopy -O binary kernel\kernel.out kernel\kernel.bin
echo nasm:
nasm boot\bootloader.asm -f bin -o boot\bootloader.bin
echo cat:
cat boot\bootloader.bin kernel\kernel.bin > os-image.bin
pause >nul
::qemu-system-x86_64 os-image.bin
call run.bat