no92 wrote:Hi,
a few things that I came across in about 30 seconds of browsing your repo:
1. You are using your system compiler against all advice on osdev. Please build a cross-compiler and see what output you get when using it. See
GCC_Cross-Compiler
2. Why are you lying to your assembler, telling it that your code is should be output as elf64 when it isn't 64-bit?
3. Why are you creating a flat binary?
Your error means that it you are mixing 32-bit and 64-bit code in one binary, which probably has something to do with your usage of your system compiler. I assume it doesn't output elf32 for you.
Cheers, Leo
Initially this all worked on my macbook pro where I was using the cross compiler, I was under the impression that I needed that cross compiler because I was on mac and clang is missing some things. Are you saying that I need to use the cross-compiler regardless of my host OS? That would make sense is suppose but I want to be sure I understand you correctly.
as to the elf64 line, I made that change on the recommendation of a stack overflow post, I knew it was incorrect obviously as it was causing one of the problems mentioned in the post. This advice not solving my problem is the reason I came to this forum for this problem.
Please explain what you mean by "flat binary", does this refer to the fact that everything is being written into one file os-image at the end of the process? what is wrong with this? what are the alternatives?
thank you,
theOSdev
============
I have installed the i386 cross compiler and that works, I also have the x86_64 ccgcc and I will try that to see if it works as well.
I would appreciate you elaborating on the other question if you have the time. ie, what is flat binary? why is it bad?
much thanks.