C ld unrecognised emulation mode

I am trying to generate a binary of the type elf_i386.

When I try and use ld link it, I get an unrecognised emulation mode error:

Code:
$ ld -T link.ld -melf_i386 loader.o -o kernel.elf
ld -T link.ld -melf_i386 loader.o -o kernel.elf
ld: unrecognised emulation mode: elf_i386
Supported emulations: elf_x86_64_fbsd elf_i386_fbsd
$

I want to run this code on the metal to try and understand basic operating system design. Will the i386_fbsd format work?

EDIT: I ran a helloworld with the ELF format of elf_i386_fbsd and it seems to work inside QEMU.
 
Use ld(1) from ports: just install devel/binutils.

Code:
% /usr/local/bin/ld -V | grep elf_i386
   elf_i386
   elf_i386_be
   elf_i386_chaos
   elf_i386_fbsd
   elf_i386_ldso
   elf_i386_nacl
   elf_i386_sol2
   elf_i386_vxworks
 
Back
Top