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

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.
Post Reply
User avatar
rjying
Posts: 22
Joined: Tue Jan 15, 2008 12:52 am

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

Post 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
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

well, first you'll need a 64-bit compiler (you can build one along the lines of other GCC Cross-Compilers)
"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 ]
User avatar
rjying
Posts: 22
Joined: Tue Jan 15, 2008 12:52 am

Post 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?
Post Reply