make prom_debug more useful outside startup.c
We have a coarse-grained early boot debug logging facility that one may enable by setting
prom_debug in the boot environment (
set prom_debug=true in the loader, or
boot -B). This facility uses
prom_printf() to emit information about where we got up to, and the value of some variables, and is very helpful when your machine is hanging or crashing in very early boot before better debugging tools are available.
The mechanism is presently a set of macros within
startup.c for i86pc, but during startup we call into routines in other files that do potentially risky device initialisation work. It would help if there was a common header (as there is on the SPARC side of things) that defined these macros. It would also help to sprinkle the macros around a bit in the APIC and HPET initialisation code. I added most of this while debugging #13039 recently.
Updated by Joshua M. Clulow over 1 year ago
Built the change and installed in an OpenIndiana instance where I can get on the serial console. Then:
- rebooted the normal way (without
prom_debug) and confirmed that there is no spuriuos boot noise.
- rebooted, escaped at the loader,
boot, and confirmed that the new output is visible.
ok set prom_debug=true ok boot Loading unix... Loading /platform/i86pc/amd64/boot_archive... Loading /platform/i86pc/amd64/boot_archive.hash... Booting... | illumos prekernel set: /platform/i86pc/kernel/amd64/unix -B console=ttya ... ../../i86pc/os/startup.c:2276: psm_install() ../../i86pc/os/mp_implfuncs.c:405: 'swp->psw_infop->p_mach_idstring' is 'uppc' ../../i86pc/os/mp_implfuncs.c:408: psm_probe() ../../i86pc/os/mp_implfuncs.c:410: psm_probe() PSM_SUCCESS ../../i86pc/os/mp_implfuncs.c:405: 'swp->psw_infop->p_mach_idstring' is 'apix' ../../i86pc/os/mp_implfuncs.c:408: psm_probe() ../../i86pc/os/mp_implfuncs.c:416: psm_probe() FAILURE ../../i86pc/os/mp_implfuncs.c:405: 'swp->psw_infop->p_mach_idstring' is 'pcplusmp' ../../i86pc/os/mp_implfuncs.c:408: psm_probe() ../../i86pc/io/pcplusmp/apic.c:254: apic_probe() ... ../../i86pc/io/mp_platform_common.c:1041: hpet_acpi_init() ../../i86pc/io/hpet_acpi.c:153: no need to program the HPET ../../i86pc/io/mp_platform_common.c:1047: SUCCESS ... ../../i86pc/os/startup.c:2525: Boot pages released NOTICE: hma_vmx_init: CPU does not support VMX Hostname: oi0 oi0 console login:
Updated by Electric Monk over 1 year ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit fdcca78f421670bb8f04d68bc3f2762a4b5342be Author: Joshua M. Clulow <email@example.com> Date: 2020-09-12T23:51:32.000Z 13042 make prom_debug more useful outside startup.c Reviewed by: Dan McDonald <firstname.lastname@example.org> Reviewed by: Garrett D'Amore <email@example.com> Approved by: Robert Mustacchi <firstname.lastname@example.org>