kernel.cpp:(.text+0x4971): undefined reference to 'isr0()'
Lots of this errors is appeared. I think that the problem is in my link command:
Code: Select all
i686-elf-ld -T link.ld -o os365.bin -O2 -nostdlib idt.o boot.o kernel.o
Code: Select all
i686-elf-ld -T link.ld -o os365.bin -O2 -nostdlib idt.o boot.o kernel.oPerhaps you miss using the .globl directive?And, more global, any assembly code in separate files is not linking for me.

No, i'm written in ASM code that:Roman wrote:Perhaps you miss using the .globl directive?And, more global, any assembly code in separate files is not linking for me.
Code: Select all
global isr0
; 0 to 31.
global isr31

yasm idt.asm -o idt.o -f elf32Roman wrote:And how do you build your assembly file?

It's the same as in the Bare Bones tutorial.Roflo wrote:Since magic isn't discovered yet you should post your linker script, I bet, so we can help you in the way we can check it and reply.
Code: Select all
ENTRY(_start)
SECTIONS
{
. = 1M;
.text BLOCK(4K) : ALIGN(4K)
{
*(.multiboot)
*(.text)
}
.rodata BLOCK(4K) : ALIGN(4K)
{
*(.rodata)
}
.data BLOCK(4K) : ALIGN(4K)
{
*(.data)
}
.bss BLOCK(4K) : ALIGN(4K)
{
*(COMMON)
*(.bss)
*(.bootstrap_stack)
}
}

It's from Bran's kernel development tutorial.Roman wrote:How does the assembly code look like?

It's the same as in the Bare Bones
Shame on you for mix&matching tutorials, and then complaining here because you can't even sort out the simple things such as an undefined symbol, as it is basically the first error you encounter as a C developer when you make a typo.It's from Bran's kernel development tutorial.

1) idt.asm, and really haves it.Combuster wrote:It's the same as in the Bare BonesShame on you for mix&matching tutorials, and then complaining here because you can't even sort out the simple things such as an undefined symbol, as it is basically the first error you encounter as a C developer when you make a typo.It's from Bran's kernel development tutorial.
The solution is in every case a homework exercise:
- Which source file or library should have that symbol? Does it? Really?
- Which object file should have that symbol? Does it? Really?
- Are you actually adding it in the linking process?
My crystal ball says you failed at both #1 and #3.

Tried your method, not working for me. Can you give me your linker script, please?Roflo wrote:Your c++ compiler, when referring to 'idt0()', will import it as a mangled symbol, eg 'xz164_v0idt0' or something like this. Use 'extern "c"' to import it as '_idt0'. Then you also have to change your asm file to export '_idt0'.

Why are you still not using a crosscompiler?Roflo wrote:Use 'extern "c"' to import it as '_idt0'. Then you also have to change your asm file to export '_idt0'.