diff options
author | Tom Cosgrove <tom@cvs.openbsd.org> | 2007-04-27 10:08:35 +0000 |
---|---|---|
committer | Tom Cosgrove <tom@cvs.openbsd.org> | 2007-04-27 10:08:35 +0000 |
commit | a6fbb0d5794262d14d0b4dd073621abe323c5e1f (patch) | |
tree | 16bdf3529a71b9d93637ca61b4b32ad4221efd3d /sys/arch/i386/stand/libsa | |
parent | 0cf9d988c4916ba3299a05e1f4f8fb46b8f2c7ff (diff) |
Check for Control key held down when starting, and don't read boot.conf
if it is. This gives a way to recover from "switching to com0" when
there's no serial cable handy.
Bump version numbers.
A similar change will be made to amd64 boot soon.
ok toby@ deraadt@
Diffstat (limited to 'sys/arch/i386/stand/libsa')
-rw-r--r-- | sys/arch/i386/stand/libsa/bioscons.c | 13 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/biosdev.h | 3 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/libsa.h | 4 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/machdep.c | 9 |
4 files changed, 25 insertions, 4 deletions
diff --git a/sys/arch/i386/stand/libsa/bioscons.c b/sys/arch/i386/stand/libsa/bioscons.c index e565159fe75..9447abdadf4 100644 --- a/sys/arch/i386/stand/libsa/bioscons.c +++ b/sys/arch/i386/stand/libsa/bioscons.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bioscons.c,v 1.28 2007/01/02 16:29:27 tom Exp $ */ +/* $OpenBSD: bioscons.c,v 1.29 2007/04/27 10:08:34 tom Exp $ */ /* * Copyright (c) 1997-1999 Michael Shalayeff @@ -95,6 +95,17 @@ pc_getc(dev_t dev) return (rv & 0xff); } +int +pc_getshifts(dev_t dev) +{ + register int rv; + + __asm __volatile(DOINT(0x16) : "=a" (rv) : "0" (0x200) : + "%ecx", "%edx", "cc" ); + + return (rv & 0xff); +} + void pc_putc(dev_t dev, int c) { diff --git a/sys/arch/i386/stand/libsa/biosdev.h b/sys/arch/i386/stand/libsa/biosdev.h index 68fc0277e93..1c6629e356a 100644 --- a/sys/arch/i386/stand/libsa/biosdev.h +++ b/sys/arch/i386/stand/libsa/biosdev.h @@ -1,4 +1,4 @@ -/* $OpenBSD: biosdev.h,v 1.30 2003/09/16 03:43:11 fgsch Exp $ */ +/* $OpenBSD: biosdev.h,v 1.31 2007/04/27 10:08:34 tom Exp $ */ /* * Copyright (c) 1996 Michael Shalayeff @@ -60,6 +60,7 @@ bios_diskinfo_t *bios_dklookup(int); void pc_probe(struct consdev *); void pc_init(struct consdev *); int pc_getc(dev_t); +int pc_getshifts(dev_t); void pc_putc(dev_t, int); void pc_pollc(dev_t, int); void com_probe(struct consdev *); diff --git a/sys/arch/i386/stand/libsa/libsa.h b/sys/arch/i386/stand/libsa/libsa.h index 69a02d9c44a..56dea3b79c6 100644 --- a/sys/arch/i386/stand/libsa/libsa.h +++ b/sys/arch/i386/stand/libsa/libsa.h @@ -1,4 +1,4 @@ -/* $OpenBSD: libsa.h,v 1.43 2006/09/18 21:14:15 mpf Exp $ */ +/* $OpenBSD: libsa.h,v 1.44 2007/04/27 10:08:34 tom Exp $ */ /* * Copyright (c) 1996-1999 Michael Shalayeff @@ -78,3 +78,5 @@ extern bios_diskinfo_t bios_diskinfo[]; extern u_int32_t bios_cksumlen; #define MACHINE_CMD cmd_machine /* we have i386-specific commands */ + +#define CHECK_SKIP_CONF check_skip_conf /* we can skip boot.conf with Ctrl */ diff --git a/sys/arch/i386/stand/libsa/machdep.c b/sys/arch/i386/stand/libsa/machdep.c index 5dc8cf90680..1e77754e561 100644 --- a/sys/arch/i386/stand/libsa/machdep.c +++ b/sys/arch/i386/stand/libsa/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.35 2004/03/19 13:48:18 tom Exp $ */ +/* $OpenBSD: machdep.c,v 1.36 2007/04/27 10:08:34 tom Exp $ */ /* * Copyright (c) 2004 Tom Cosgrove @@ -28,6 +28,7 @@ */ #include "libsa.h" +#include "biosdev.h" #include <machine/apmvar.h> #include <machine/biosvar.h> @@ -61,3 +62,9 @@ machdep(void) } } } + +int check_skip_conf(void) +{ + /* Return non-zero (skip boot.conf) if Control "shift" key down */ + return (pc_getshifts(0) & 0x04); +} |