[haiku-development] Re: FatELF Implementation

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 28 Nov 2012 14:06:20 +0100

On 11/27/2012 01:20 AM, Landon J Fuller wrote:
I set aside my Thanksgiving vacation to work on FatELF (fitting for the 
season?), and I have haiku_loader, kernel, and runtime_loader changes ready for 
review. This was a great introduction to the Haiku code base, and I hope my 
code will measure up to the existing level of quality. While I made every 
effort to conform to style standards, while also remaining consistent with 
surrounding style, I'm sure I might have missed something. If so, I apologize, 
and I'll be happy to clean it up.

With these changes, one can load/execute multi-architecture kernels, 
kernel-addons, and userspace executables and libraries. For example:
        ~> ~/fatelf-haiku/fatelf-glue hello hello-i386 hello-x86-64
         ~> ./hello
        Hello, World!\n

Nice!

This only encompasses the OS work necessary to execute fat binaries. I plan to 
tackle next:
        - Developer tools, including gcc and gdb. My goal is that one can run 
simply run:
                gcc -arch x86 -arch x86_64 -arch x86-gcc2 hello.c -o hello
        - A combined x86-64/x86/(x86-gcc2) distribution.

The latter goal is a large one, and will also involve implementing 32-bit 
syscall compatibility in the x86-64 port, unless someone else beats me to it.

There's a bit more to it than just syscall compatibility. You'll also need to be able to load a 32 bit runtime loader, support 32 bit thread entries and signal handling and generally a 32 bit userland. I haven't looked into what exactly the latter entails, but I think you'll have to additionally do 32 bit paging for 32 bit teams, which might require a bit of VM hacking.

Whether we go with FatELF or not, this is stuff we want anyway.

CU, Ingo


Other related posts: