Port-sparc64 archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Custom boot loader stub
On Wed, Oct 15, 2025 at 08:24:05 +0100, Sad Clouds wrote:
> 2. Binary format
>
> Some information I've read states that the binary OpenBoot loads must
> be in the old a.out format. This may have been the case for older
> 32-bit sparc hardware, but for sun4u/sun4v does anyone know if OpenBoot
> also supports elf32 or elf64 formats?
From a sparc64 nfs root:
$ file /export/root/aurinko/usr/mdec/ofwboot
/export/root/aurinko/usr/mdec/ofwboot: ELF 64-bit MSB executable, SPARC V9, relaxed memory ordering, version 1 (SYSV), statically linked, not stripped
> 3. Calling OpenBoot functions
>
> I'd like to call prom_printf() to print a test message. I think when
> OpenBoot loads my binary it jumps to a _start() function, passing
> pointer to promvec structure in %o0 register. If I save the value of
> this register somewhere on the stack, I can use the pointer to call
> prom_printf(). At this stage, OpenBoot had already initialised MMU,
> setup basic trap table and my code is running in OpenBoot virtual
> address space. Is all of this correct?
Yes. You can look at how ofwboot does that: sys/arch/sparc/stand, in
ofwboot and neighborhood, in particular ofwboot/promlib.c and follow
xrefs from there. "romp" is the magic value we are passed by OFW that
we can use to call it, we save it first thing in the asm startup code.
-uwe
Home |
Main Index |
Thread Index |
Old Index