Skip site navigation (1)Skip section navigation (2)
From:      Warner Losh <imp@FreeBSD.org>
Subject:   git: 1d7bdae9ca3c - main - kboot: Move console, acpi and smbios init

| raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=1d7bdae9ca3ca821e93386d85e87de491471cad7

commit 1d7bdae9ca3ca821e93386d85e87de491471cad7
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-05-19 16:41:52 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-05-20 04:05:40 +0000

    kboot: Move console, acpi and smbios init
    
    Move the console probing to as early as possible. There's no real
    support for anything but hostcons, and setting it up early will show
    other error messages.
    
    ACPI and SMBIOS probing can be done just after we have the console, so
    move it there. This allows other parts of the early code to use info
    from that, as well as overriding and env vars set by these things on the
    command line (smbios data may be wrong during initial development phases
    as the automated way to populate per-board data may not be established,
    etc).
    
    Sponsored by:           Netflix
---
 stand/kboot/kboot/main.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/stand/kboot/kboot/main.c b/stand/kboot/kboot/main.c
index e57446baa47d..ed5cad450000 100644
--- a/stand/kboot/kboot/main.c
+++ b/stand/kboot/kboot/main.c
@@ -342,16 +342,23 @@ main(int argc, const char **argv)
 	heapbase = host_getmem(heapsize);
 	setheap(heapbase, heapbase + heapsize);
 
+	/*
+	 * Set up console so we get error messages.
+	 */
+	cons_probe();
+
+	/*
+	 * Find acpi and smbios, if they exists. This allows command line and
+	 * later scripts to override if necessary.
+	 */
+	find_acpi();
+	find_smbios();
+
 	/* Parse the command line args -- ignoring for now the console selection */
 	parse_args(argc, argv);
 
 	parse_file("host:/kboot.conf");
 
-	/*
-	 * Set up console.
-	 */
-	cons_probe();
-
 	/* Initialize all the devices */
 	devinit();
 
@@ -394,13 +401,6 @@ main(int argc, const char **argv)
 	memory_limits();
 	enumerate_memory_arch();
 
-	/*
-	 * Find acpi, if it exists
-	 */
-	find_acpi();
-
-	find_smbios();
-
 	interact();			/* doesn't return */
 
 	return (0);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?>