Linker probleme ...
Posted: Sat Aug 18, 2007 11:11 am
Hy devs, I'm trying to create my own OS, i've created a very small kernel but i have a problem. Every time i use the linker's command i get this msg, help pls
the msg:"ld: warning: cannot find entry symbol system; defaulting to 0000000000000000"
given that:
the kernel file "system.c" is :
int main(){
char hatem[20]="hatemStein";
char *vidmem=(char *)0xb8000;
char a=0x7;
*(vidmem+2)='A';
*(vidmem+3)=a;
for(;;);
return 3;
}
the linker file "link.ld" is:
OUTPUT_FORMAT("binary")
ENTRY(system)
phys = 0x000009c0;
SECTIONS
{
.text phys : AT(phys) {
code = .;
*(.text)
}
.data : AT(phys + (data - code))
{
data = .;
*(.data)
. = ALIGN(4096);
}
.bss : AT(phys + (bss - code))
{
bss = .;
*(.bss)
. = ALIGN(4096);
}
end = .;
}
the commands are:
>gcc -o system.c
>ld -T link.ld -o kernel.bin system.o
the message error is:
>ld: warning: cannot find entry symbol system; defaulting to 00000000000009c0
help pleas
the msg:"ld: warning: cannot find entry symbol system; defaulting to 0000000000000000"
given that:
the kernel file "system.c" is :
int main(){
char hatem[20]="hatemStein";
char *vidmem=(char *)0xb8000;
char a=0x7;
*(vidmem+2)='A';
*(vidmem+3)=a;
for(;;);
return 3;
}
the linker file "link.ld" is:
OUTPUT_FORMAT("binary")
ENTRY(system)
phys = 0x000009c0;
SECTIONS
{
.text phys : AT(phys) {
code = .;
*(.text)
}
.data : AT(phys + (data - code))
{
data = .;
*(.data)
. = ALIGN(4096);
}
.bss : AT(phys + (bss - code))
{
bss = .;
*(.bss)
. = ALIGN(4096);
}
end = .;
}
the commands are:
>gcc -o system.c
>ld -T link.ld -o kernel.bin system.o
the message error is:
>ld: warning: cannot find entry symbol system; defaulting to 00000000000009c0
help pleas