Error with interruptions

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Post Reply
gta126
Posts: 4
Joined: Sun Apr 11, 2010 4:41 am
Location: Belgium

Error with interruptions

Post 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
Attachments
source_code.rar
The comments are in French sorry but this is my mother tongue
(27.2 KiB) Downloaded 64 times
Selenic
Member
Member
Posts: 123
Joined: Sat Jan 23, 2010 2:56 pm

Re: Error with interruptions

Post 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:
gta126
Posts: 4
Joined: Sun Apr 11, 2010 4:41 am
Location: Belgium

Re: Error with interruptions

Post 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
Post Reply