Linking Multiple Object files using Nasm and gcc ?
From: Anish (anish.n_at_lycos.com)
Date: 04/28/04
- Next message: Villy Kruse: "Re: send to socket: Bad file descriptor"
- Previous message: Kasper Dupont: "Re: Spindle speed of Hard Disk- How to find"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 28 Apr 2004 00:39:17 -0700
My Bootloader loads the following code at 0x7e00:0000. I am trying to
link 'c' file, But unable to do that.
Assembler : Nasm
Kernel : 2.4.22
/*************************/
; PMode.asm
org 0x7e00
extern _cl_scr
..............
...............
..............
..............
call _cl_scr
/*************************/
Assembling Process followed : nasm -f elf PMode.asm
Output of it : PMode.o
/***************Animate.c******************/
void _cl_scr()
{
int i=0;
do {
*( scr + i ) = 'A';
i++;
} while( i < 200 );
}
Compiling Process Followed : cc -ffreestanding -c Animate.c
Output of it : Animate.o
Linking : ld -Ttext 0x7e00 -format binary PMode.o Animate.o
Output : a.out
In the above PMode.asm, i am not able to include 'org' statement. But
i don't want to use the offset whenever i try to access memory or
setting up the GDT.
If i include the org statement, then i get parser instruction expected
error.
Please let me know how to get bin out of it.????
- Next message: Villy Kruse: "Re: send to socket: Bad file descriptor"
- Previous message: Kasper Dupont: "Re: Spindle speed of Hard Disk- How to find"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|