@balaton
Quote:
I haven't read all of the lengthy discussion but I don't think amigaboot.of does any ELF loading. It does what BBoot does which is just load all the modules in the memory and make a list of them that is passed to the loader binary that probably handles the ELF stuff (or just relocations) and calls kernel.
Unless something radically changed in the last 20 years booting AmigaOS 4.x, no matter with with firmware, involves 3 major parts:
1) The firmware itself, aka the 1st level boot loader (= AmigaOS 3.x/m68k on classic Amigas, U-Boot on the AmigaOne SE/XE/µA1/X5000/A1222, CFE on X1000, SmartFirmware on the Pegasos2, etc.):
Loads and starts the 2nd level boot loader (SLB_v2 on the A1 and Sam440/460, AmigaBoot.(of|ub) on X1000/X5000/A1222, no idea about the Pegasos2).
Loading the SLB_v2 (or replacements like Acube's ub2lb/Parthenope) doesn't involve any file systems, it's stored in the "BOOT" sectors of the RSDK/RDB blocks of a HDD/SSD, or using the El Torito standard in case of ISO9660 (ATAPI CD/DVD/BD hardware, or an IOS9960 image stored on an USB stick).
2) The 2nd level boot loader implements the file systems, for example FFS, ext2fs (for booting PPC Linux), ISO9660, SFS, etc., using callback hooks from the firmware for reading sectors from the current boot device (no matter if PATA, SATA, NVMe, USB, MicroSD or whatever). I don't know all of them, but for example the A1/Sam SLB_v2 supports loading and unpacking gzip and bzip2 compressed kickstart modules as well. There is a replacement for SLB_v2 from ACube called Parthenope/ub2lb which supports booting Linux and AROS (maybe MorphOS too, not sure), but unlike the original SLB_v2 it doesn't support booting AmigaOS 4.x from SFS\0 and SFS\2 partitions.
3) The "EXEC" entry in the kicklayout: A simple ELF parser which might be different for different systems (loader, loader.ub, loader.of, ...): relocating the other ELF executables in the kicklayout (all "MODULE" entries in the kicklayout).
But "loader" only works in RAM, it doesn't support loading anything from disk, that was alreay done by the 1st level (firmware) and/or 2nd level (SLB_v2/ub2lb/...) boot loaders already.
Edited by joerg on 2026/4/7 17:46:50