os-tutorial icon indicating copy to clipboard operation
os-tutorial copied to clipboard

linker cannot access definitions in interrupts.asm

Open TheRealMichaelWang opened this issue 5 years ago • 7 comments

The linker cannot find the definitions of the isrs from the assembly file, inturrupts.asm.

C:\Users\Administrator\Documents\os\src>i686-elf-gcc -ffreestanding -c kernel/kernel.c -o bin/kernel.o i686-elf-gcc: error: drivers/ports.c: No such file or directory i686-elf-gcc: error: drivers/screen.c: No such file or directory C:\Users\Administrator\Documents\os\src>nasm boot/kernel_entry.asm -f elf -o bin/kernel_entry.o C:\Users\Administrator\Documents\os\src>i686-elf-ld -o bin/kernel.bin -Ttext 0x1000 bin/kernel_entry.o bin/kernel.o --oformat binary i686-elf-ld: warning: cannot find entry symbol _start; defaulting to 00001000 bin/kernel.o: In function isr_install': kernel.c:(.text+0x598): undefined reference to isr0' kernel.c:(.text+0x5a8): undefined reference to isr1' kernel.c:(.text+0x5b8): undefined reference to isr2' kernel.c:(.text+0x5c8): undefined reference to isr3' kernel.c:(.text+0x5d8): undefined reference to isr4' kernel.c:(.text+0x5e8): undefined reference to isr5' kernel.c:(.text+0x5f8): undefined reference to isr6' kernel.c:(.text+0x608): undefined reference to isr7' kernel.c:(.text+0x618): undefined reference to isr8' kernel.c:(.text+0x628): undefined reference to isr9' kernel.c:(.text+0x638): undefined reference to isr10' kernel.c:(.text+0x648): undefined reference to isr11' kernel.c:(.text+0x658): undefined reference to isr12' kernel.c:(.text+0x668): undefined reference to isr13' kernel.c:(.text+0x678): undefined reference to isr14' kernel.c:(.text+0x688): undefined reference to isr15' kernel.c:(.text+0x698): undefined reference to isr16' kernel.c:(.text+0x6a8): undefined reference to isr17' kernel.c:(.text+0x6b8): undefined reference to isr18' kernel.c:(.text+0x6c8): undefined reference to isr19' kernel.c:(.text+0x6d8): undefined reference to isr20' kernel.c:(.text+0x6e8): undefined reference to isr21' kernel.c:(.text+0x6f8): undefined reference to isr22' kernel.c:(.text+0x708): undefined reference to isr23' kernel.c:(.text+0x718): undefined reference to isr24' kernel.c:(.text+0x728): undefined reference to isr25' kernel.c:(.text+0x738): undefined reference to isr26' kernel.c:(.text+0x748): undefined reference to isr27' kernel.c:(.text+0x758): undefined reference to isr28' kernel.c:(.text+0x768): undefined reference to isr29' kernel.c:(.text+0x778): undefined reference to isr30' kernel.c:(.text+0x788): undefined reference to `isr31' C:\Users\Administrator\Documents\os\src>nasm boot/bootsect.asm -f bin -o bin/bootsect.bin C:\Users\Administrator\Documents\os\src>cd bin C:\Users\Administrator\Documents\os\src\bin>copy /b bootsect.bin + kernel.bin os-image.bin bootsect.bin 1 file(s) copied. C:\Users\Administrator\Documents\os\src\bin>pause Press any key to continue . . .

TheRealMichaelWang avatar Jun 16 '20 19:06 TheRealMichaelWang

How are you compiling and adding interrupt.asm into the main os-image.bin?

Matthiasclee avatar Jun 17 '20 20:06 Matthiasclee

Just don't worry about it and proceed on to lesson 20 and it should go away (It did for me)

Matthiasclee avatar Jun 17 '20 20:06 Matthiasclee

yeah i am getting the same problem. Once i try to link kernel.o with kernel_entry.o the ld linker shows the above message as if it can't define the isr's or irq's. How can i define them? Also i'm not compiling the interrupt.asm at all, i just left it as is. I have reached lesson 23 with no luck and the same message above.

jinevitable1 avatar Jun 20 '20 21:06 jinevitable1

Nevermind Got it figured out. It was a simple fix.

jinevitable1 avatar Jun 21 '20 01:06 jinevitable1

What was the fix? :)

somerandomdev49 avatar Apr 19 '21 10:04 somerandomdev49

@somerandomdev49 Did u update ur makfile?

tarithj avatar May 25 '21 08:05 tarithj

I think fixed it. the solution above worked and the makefile is updated

somerandomdev49 avatar May 25 '21 10:05 somerandomdev49