Deprecated IEEE 1275 client interface functions
Sad Clouds <[email protected]> Mon, 23 Feb 2026 08:52:25 +0000
| Newsgroups | gmane.os.netbsd.ports.sparc64 |
|---|---|
| Message-ID | <[email protected]> |
I've been looking at IEEE 1275 document that describes various client interface functions for SPARC firmware. The problem with SPARC bootblk is that it is limited by firmware to around 8 KiB. Once the bootblk is executing, it needs to allocate a memory segment, into which it can read a much bigger second stage boot loader or kernel and then execute it. I can use client interface functions like claim(), open(), seek(), read() etc., in order to allocate a buffer and read my custom kernel into it, but I hit an issue when trying to execute that code from the buffer. There is one control transfer function that is meant to execute another program: chain IN: [address] virt, size, [address] entry, [address] args, len OUT: none Frees size bytes of memory starting at virtual address virt, then executes another client program beginning at address entry. The argument buffer args, len is copied into the Open Firmware memory and passed to the other program. The address of the arguments in the Open Firmware memory is the client program’s second argument, and their length is its third argument. chain is used to free any remaining memory for a secondary boot program and begin executing the booted program. This was failing for me and the reason was this function was disabled in the firmware: $ ack 'cif:' ... obp/arch/sun4u/go.fth 153:cif: enter ( -- ) reenter call ; 154:cif: exit ( -- ) exittomon call ; 155:\ cif: chain ( len args entry size virt -- ) op-chain ; You can see on line 155 the '\' comment character disables this function. There is execute-buffer() in obp/os/bootprom/clientif.fth which can execute ELF 64 code from a buffer allocated by claim(). I've tested it and all seems to work, however I'm trying to understand the history behind chain() and why it was deprecated. I guess this may only be known to a person who actually made this change to go.fth file years ago. However, if anyone here remembers the reasons, please let me know. Thanks.