Page 1 of 1

Error with interruptions

Posted: Sun Apr 25, 2010 3:58 pm
by gta126
Hello all

Sorry for my bad English

Here is my problem:
I am the http://a.michelizza.free.fr/pmwiki.php?n=TutoOS.Int2 tutorial and I have a problem with compiling (more precisely at linking). I obtain it as error:

Code: Select all

idt.o:idt.c:(.text+0x77): Undefined referenc to "_asm_default_int"
idt.o:idt.c:(.text+0xa2): Undefined referenc to "_asm_irq_0"
idt.o:idt.c:(.text+0xc6): Undefined referenc to "_asm_irq_1"
I compile under Windows Vista and here is my bat file for compiling:

Code: Select all

nasm -f win32 -o int.o  int.asm
gcc -ffreestanding -nostdinc -mno-stack-arg-probe -c *.c

ld --oformat pe-i386 -Ttext 1000 kernel.o screen.o lib.o gdt.o idt.o int.o interrupt.o pic.o -o linked.tmp
objcopy -R .note -R .comment -S -O binary linked.tmp ..\krnl
I also try to remove the "_" (underscore) in the file "idt.c" but still the same error.

How could I do??

Thank you in advance and good day

Re: Error with interruptions

Posted: Mon Apr 26, 2010 11:34 am
by Selenic
Those error messages look like they could be fixed by adding the -fno-leading-underscore option to GCC (and removing all the leading _s from your assembly files). You should probably do this anyway, because otherwise it depends on what output format you're using.

In addition, you should really build an ELF-targetting GCC Cross-Compiler, because that's better-documented (though some people have got PE kernels working)

Also, doing that requires installing Cygwin, which (among other things) also allows you to use 'make' rather than a batch file, which is just nicer :wink:

Re: Error with interruptions

Posted: Wed Apr 28, 2010 10:56 am
by gta126
Thank you for your help but the option-fno-leading-underscore does not work.
When trying to install Cygwin, libgmp not found uses a different ABI gold
This is the reason why I was not using Cygwin