Page 1 of 1

How can I build a binrary with 64bit mode in the bootloader.

Posted: Wed Jan 16, 2008 12:47 am
by rjying
Hello
I wrote a bootloader for OS development study. I built C file to binrary format, Link and combine all code to a image. I will change the bootloader to
complete 64bit mode. So How can I built the C code to 64bit instructions.
Do I need use some the gcc compile options?
Following is script code:

OUTPUT_FORMAT("binary")
INPUT(start.o main.o serial.o io.o misc.o pci.o memory.o
string.o cmdinput.o command.o xmodem.o hdisk.o)
SEARCH_DIR(../build/obj)
ENTRY(_start)
SECTIONS
{
. = 0x10000;
.text : { *(.text) }
.rodata : { *(.rodata) }
.data : { *(.data) }
.bss : { *(.bss) }
_mainend = .;
}

Thanks

Posted: Wed Jan 16, 2008 1:40 am
by Combuster
well, first you'll need a 64-bit compiler (you can build one along the lines of other GCC Cross-Compilers)

Posted: Wed Jan 16, 2008 3:41 am
by rjying
Combuster wrote:well, first you'll need a 64-bit compiler (you can build one along the lines of other GCC Cross-Compilers)
Thank you very much.
I have installed the gcc 4.1.1 in my x86-32 platform.
Do I need a new cross-compiler gcc?
Can I use the "gcc -march=x86-64" to build 64 bit instructions?