From fbaa1a79766505d09f635cf6054b14b29da91067 Mon Sep 17 00:00:00 2001 From: niklas Date: Tue, 7 May 1996 15:23:35 +0000 Subject: [PATCH] Make sure config_init gets called before consinit, as at least one port actually uses config_* functions for console attachment. Document config_init should not call malloc as the move was over the mem-init function calls too. --- sys/kern/init_main.c | 5 +++-- sys/kern/subr_autoconf.c | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index bd2c5250ad1..a76698e3ffb 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init_main.c,v 1.7 1996/05/06 09:56:20 niklas Exp $ */ +/* $OpenBSD: init_main.c,v 1.8 1996/05/07 15:23:35 niklas Exp $ */ /* $NetBSD: init_main.c,v 1.84 1996/04/22 01:38:12 christos Exp $ */ /* @@ -171,17 +171,18 @@ main(framep) */ p = &proc0; curproc = p; + /* * Attempt to find console and initialize * in case of early panic or other messages. */ + config_init(); /* init autoconfiguration data structures */ consinit(); printf(copyright); vm_mem_init(); kmeminit(); disk_init(); /* must come before autoconfiguration */ - config_init(); /* init autoconfiguration data structures */ cpu_startup(); /* diff --git a/sys/kern/subr_autoconf.c b/sys/kern/subr_autoconf.c index ab73c7d2416..f72a1c5f364 100644 --- a/sys/kern/subr_autoconf.c +++ b/sys/kern/subr_autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_autoconf.c,v 1.5 1996/04/29 14:17:45 hvozda Exp $ */ +/* $OpenBSD: subr_autoconf.c,v 1.6 1996/05/07 15:23:36 niklas Exp $ */ /* $NetBSD: subr_autoconf.c,v 1.21 1996/04/04 06:06:18 cgd Exp $ */ /* @@ -91,7 +91,9 @@ struct devicelist alldevs; /* list of all devices */ struct evcntlist allevents; /* list of all event counters */ /* - * Initialize autoconfiguration data structures. + * Initialize autoconfiguration data structures. This occurs before console + * initialization as that might require use of this subsystem. Furthermore + * this means that malloc et al. isn't yet available. */ void config_init() -- 2.20.1