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
How can I build a binrary with 64bit mode in the bootloader.
- Combuster
- 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:
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.Combuster wrote:well, first you'll need a 64-bit compiler (you can build one along the lines of other GCC Cross-Compilers)
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?