Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Hi,
I followed this page: http://wiki.osdev.org/GCC_Cross-Compiler
and built a cross-compiler for x86_64-elf. But when I enter the command "gcc Kernel.c-o kernel.o", I get this error message:
/home/isaac/Cross-compiler/lib/gcc/x86_64-elf/4.8.2/../../../../x86_64-elf/bin/ld: cannot find crt0.o: No such file or directory
/home/isaac/Cross-compiler/lib/gcc/x86_64-elf/4.8.2/../../../../x86_64-elf/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
What should I do about this error? How can I get it to work?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
but I just did that because my compiler is for x86_64-elf not for i586-elf. And to Combuster that asked me to at least put in a -c into my command... I tried that and it does work. But my OS won't boot using grub. Grub just prints the following error:
void print(char *message, int line,int ch){
char *vm=(char *)0xb8000;
int i=(line*80*2);
i=i+(ch*2);
while(*message!=0){
if (*message=='\n'){line++;
i=(line*80*2);}
else {vm[i]=*message;
i++;
vm[i]=0x07;
i++;} *message++;}}
void kernel_main(){
print("Welcome!\nHow do you like my OS?",0,0);}
but I just did that because my compiler is for x86_64-elf not for i586-elf. And to Combuster that asked me to at least put in a -c into my command... I tried that and it does work. But my OS won't boot using grub. Grub just prints the following error:
Isaac wrote:And to Combuster that asked me to at least put in a -c into my command...
That's not what it said. You concluded a solution without understanding why.
But I just get this error:
(...)
warning:
Do you know the difference between warning and error? (What is it?)
Not bad. Right?
That's -20% on your grade for illegible code. Didn't bother to calculate the rest of the score.
---
There's just so much wrong with every part of your explanation that I don't believe you meet the required knowledge, nor that you have properly executed the relevant tutorials on the matter at least once.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
You do, of course, realize that you cannot complete the Bare Bones with a x86_64-elf cross-compiler and you must use a ix86-elf cross-compiler? Probably not.
GRUB cannot boot x86_64 multiboot kernels directly, so you should just do a 32-bit kernel instead if you are starting out.
Combuster wrote:That's -20% on your grade for illegible code. Didn't bother to calculate the rest of the score.
Don't tell me my code is illegible just because YOU can't read it!!
Uh, no. Your coding style is as bad as it gets. I can parse and reformat your C code, which allows me to read it, but I sure as hell can't maintain coding like that.
Last edited by sortie on Thu Dec 12, 2013 2:00 pm, edited 1 time in total.
void print(char *message, int line,int ch){
char *vm=(char *)0xb8000;
int i=(line*80*2);
i=i+(ch*2);
while(*message!=0){
if (*message=='\n'){line++;
i=(line*80*2);}
else {vm[i]=*message;
i++;
vm[i]=0x07;
i++;} *message++;}}
void kernel_main(){
print("Welcome!\nHow do you like my OS?",0,0);}