[haiku-development] Re: Need help with UEFI and Jam

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Fri, 23 Aug 2013 12:40:38 +0200

On 08/22/2013 10:14 PM, Fredrik Holmqvist wrote:
I've switched to a './configure --use-xattr --use-gcc-pipe -j8
--distro-compatibility official --build-cross-tools-gcc4 x86_64
../buildtools' build, but upon compiling I get problems.

Is our assembler not 64 bit enabled? It don't seem to recognise rXX
registers. Also I don't see the flags I pass to BootMergeObject
(-fshort-wchar for instance) but others that I don't think should be
there (-m32 and -march=pentium).

The boot loader for Haiku x86-64 is most 32 bit, hence the respective flags (look for HAIKU_BOOT_{LINK,CC,C++}FLAGS in build/jam/BuildSetup, they are used with TARGET_ prefix in build/jam/BootRules). Reasons for that are that it required less changes and it's easier to support loading both 32 and 64 bit kernels.

What to do depends mostly on how the boot process is supposed to work. With two stages (UEFI loader -> haiku_loader) there's a bit more flexibility and the boot loader could possibly remain 32 bit. Although that also depends on how the interaction with UEFI works (you might need to switch back and forth between 32 bit and long mode). With only one stage (like the OpenFirmware boot loader) you'll either need entry code to switch to 32 bit or you'll need to add 64 bit support to the boot loader.

In the latter case you'd change the HAIKU_BOOT_{LINK,CC,C++}FLAGS variables when building for UEFI (or even in all cases, if that works for the BIOS loader as well). If you want to build a separate 64 bit UEFI application, but keep the boot loader mostly 32 bit, you'll have to write your own rules (or do more stuff manually) to build the former.

CU, Ingo


Other related posts: