summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2020-05-28 15:06:37 +0000
committerYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2020-05-28 15:06:37 +0000
commitb798a658bbaa5333eb51ae6475bcc120e80c2dae (patch)
tree82dd5bb32fd6b68b3e01e5befb6c3356bebe05ae /sys/arch/amd64
parent646b8d1010dbb09ecf1cf4f618bfb6331651e1df (diff)
Call cninit() after parsing boot parameter to make cninit() possible
to select the VGA or the EFI framebuffer properly. Previous initializes VGA unconditionally, it caused serious problems like the video distortion and so on. As a downside of this commit, some early panic or debug messages will not be displayed. test Andrew Daugherity, jsg ok jsg kettenis
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/machdep.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index ad9fe694a64..de97b6c74f4 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.264 2020/05/16 14:44:44 kettenis Exp $ */
+/* $OpenBSD: machdep.c,v 1.265 2020/05/28 15:06:36 yasuoka Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -1395,11 +1395,6 @@ init_x86_64(paddr_t first_avail)
i8254_startclock();
/*
- * Attach the glass console early in case we need to display a panic.
- */
- cninit();
-
- /*
* Initialize PAGE_SIZE-dependent variables.
*/
uvm_setpagesize();
@@ -1421,6 +1416,8 @@ init_x86_64(paddr_t first_avail)
} else
panic("invalid /boot");
+ cninit();
+
/*
* Memory on the AMD64 port is described by three different things.
*
@@ -1927,8 +1924,6 @@ getbootinfo(char *bootinfo, int bootinfo_size)
bios_ddb_t *bios_ddb;
bios_bootduid_t *bios_bootduid;
bios_bootsr_t *bios_bootsr;
- int docninit = 0;
-
#undef BOOTINFO_DEBUG
#ifdef BOOTINFO_DEBUG
printf("bootargv:");
@@ -1983,9 +1978,6 @@ getbootinfo(char *bootinfo, int bootinfo_size)
comconsaddr = consaddr;
comconsrate = cdp->conspeed;
comconsiot = X86_BUS_SPACE_IO;
-
- /* Probe the serial port this time. */
- docninit++;
}
#endif
#ifdef BOOTINFO_DEBUG
@@ -2023,8 +2015,6 @@ getbootinfo(char *bootinfo, int bootinfo_size)
case BOOTARG_EFIINFO:
bios_efiinfo = (bios_efiinfo_t *)q->ba_arg;
- if (bios_efiinfo->fb_addr != 0)
- docninit++;
break;
case BOOTARG_UCODE:
@@ -2039,8 +2029,6 @@ getbootinfo(char *bootinfo, int bootinfo_size)
break;
}
}
- if (docninit > 0)
- cninit();
#ifdef BOOTINFO_DEBUG
printf("\n");
#endif