Port-amd64 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Initial process start

Martin Husemann <martin%duskware.de@localhost> writes:

> Check the ELF ABI for x86_64, AFAICT we conform to it.
> Section 3.4.1 describes the initial stack and register state.

That makes things very simple. Then I will not use rbx as a pointer,
because I don't see it mentioned in the ABI. I'm still puzzled why
r8-r15 are not cleared, but I will not dig deeper; I'll clear them
myself on start.

> Oh, and you also need to emit a NetBSD version note:
> Sections:
> Idx Name          Size      VMA               LMA               File off  Algn
> [..]
>   1 .note.netbsd.ident 00000018  0000000000000214  0000000000000214  00000214  2**2
> [..]
> see src/lib/csu/common/sysident.S

I got the binary to exec not by adding that section as such, but rather
the associated NOTE program header.

Porting to NetBSD is turning out to be quite pleasant. Thank you for the


Göran Weinholt   | https://weinholt.se/
Debian developer | 73 de SA6CJK

Home | Main Index | Thread Index | Old Index