lordmilko / i686-elf-tools

i386-, i686- and x86_64-elf GCC, GDB and Binutils
MIT License
228 stars 44 forks source link

64-bit support? #5

Closed davidcallanan closed 4 years ago

davidcallanan commented 4 years ago

Hi, these tools have been very useful for learning to write my own 32-bit operating system kernel. Thank you very much!

However, I'd like to move on to a 64-bit operating system kernel as soon as possible, and it appears these tools do not support the 64-bit target when using the -m64 flag.

Do you have plans to add 64-bit support? Do you know of anywhere else I can get gcc for x86_64-elf?

lordmilko commented 4 years ago

Hi @davidcallanan,

When I started this project my perspective was 64-bit was unnecessary; most people writing a toy operating system will be 32-bit only. Now this project is mildly popular I think it probably does make sense to provide an option for 64-bit binaries should users wish to advance to the next level; I have a feeling this will be very painful to get going however, so I don't expect to add this feature anytime soon.

In the meantime, I would recommend having a look at the other Prebuilt Toolchains on the OSDev wiki; I see there are some x86_64-elf toolchains available from other people, potentially these may be of help

Regards, lordmilko

davidcallanan commented 4 years ago

Hi @lordmilko, thanks for your reply.

I managed to find a docker image based on this repo that has prebuilt x86_64-elf tools. So if anyone's having the same problem who's not using linux, that docker image seems to be working perfectly. Otherwise the one for linux in your link above should probably work too. Finally, after nearly a week, I can compile my kernel 😁

Here's the Dockerfile I'm using if anyone's interested:

FROM randomdude/gcc-cross-x86_64-elf

RUN apt-get update 
RUN apt-get upgrade -y
RUN apt-get install -y nasm
RUN apt-get install -y xorriso
RUN apt-get install -y grub-pc-bin
RUN apt-get install -y grub-common

VOLUME /root/env
WORKDIR /root/env
lordmilko commented 4 years ago

Hi @davidcallanan,

FYI I have updated the script for building x86_64-elf tools natively and have uploaded pre-compiled binaries for both platforms on the Releases page; compiling for Linux is pretty straight forward, however as expected there were some silly issues that caused a bit of trouble compiling for Windows!

This might not be of use to you anymore, but in any case thanks for the idea!

Regards, lordmilko