Page 2 of 2
Re:ASSEMBLER HELP
Posted: Thu Dec 05, 2002 10:11 am
by 123abc
You need [bits 32] before your IDT?
Re:ASSEMBLER HELP
Posted: Thu Dec 05, 2002 11:16 am
by Unexpected
[BITS 32] is wrote...
But when I compile to BINARY format it works.
What's the problem?
Re:ASSEMBLER HELP
Posted: Thu Dec 05, 2002 1:27 pm
by 123abc
I read you CANNOT compile this IDT into anyother format than binary

Re:ASSEMBLER HELP
Posted: Thu Dec 05, 2002 4:18 pm
by Unexpected
But later I linking my source with kernel to binary.
And how I call C kernel main?
Re:ASSEMBLER HELP
Posted: Thu Dec 05, 2002 4:32 pm
by Curufir
If you're using the example IDT I think you're using then the problems with linking it have been made clear in other threads.
To reiterate. When linking into something that isn't binary it breaks down because the relocation addresses are 32-bits, the IDT has 2 entries for the physical address of the code to be called. The example only uses the lower 16-bits and sets the upper 16-bit to be zero. The linker doesn't work because it has difficulty putting a 32-bit label into a 16-bit space (Because it doesn't know it is a 16-bit space). This is why this particular IDT example ONLY works with flat binaries. For any other format you need to split the address of the code into the lower and upper 16-bits somehow (Many thanks to Intel for not making this easy by having it as a single 32-bit value

).
Re:ASSEMBLER HELP
Posted: Fri Dec 06, 2002 9:23 am
by Unexpected
Thnx for help
But there is another problem.
When I compiling my asm source in flat bin format I can'y use my kernel.c functions (binary output format does not support external references)
How I can call C function from another file or create global variable?
Re:ASSEMBLER HELP
Posted: Fri Dec 06, 2002 3:17 pm
by Unexpected
Can anyone show to me full IDT source? Please?
I need an example