diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2000-02-18 17:10:11 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2000-02-18 17:10:11 +0000 |
commit | cd40c4af7f6b2f76a48c527c36bb576d98a06696 (patch) | |
tree | 60444d9e267112645647f8db34053856f3b7f5db | |
parent | 21a8622379f6a3e8e6dd8a4228fb1180469bf121 (diff) |
full support for a serial console.
iface addition: pass serial speed from /boot.
tested on 4 /boot+kernel permutations.
also, niklas@ said he likes it
bugs: any printfs before cninit() will go to the
default console, which is mon/kbd, but are usually
only sorts of debugging messages (like bios_memmap load).
-rw-r--r-- | sys/arch/i386/i386/bios.c | 10 | ||||
-rw-r--r-- | sys/arch/i386/include/biosvar.h | 8 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/exec_i386.c | 8 |
3 files changed, 21 insertions, 5 deletions
diff --git a/sys/arch/i386/i386/bios.c b/sys/arch/i386/i386/bios.c index 370ec5685c7..87d63319cca 100644 --- a/sys/arch/i386/i386/bios.c +++ b/sys/arch/i386/i386/bios.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bios.c,v 1.25 1999/10/26 18:16:48 mickey Exp $ */ +/* $OpenBSD: bios.c,v 1.26 2000/02/18 17:10:09 mickey Exp $ */ /* * Copyright (c) 1997-1999 Michael Shalayeff @@ -211,7 +211,13 @@ bios_getopt() break; #endif case BOOTARG_CONSDEV: - cnset(*(dev_t *)q->ba_arg); + if (q->ba_size >= sizeof(bios_consdev_t)) + { + bios_consdev_t *cdp = (bios_consdev_t*)q->ba_arg; + extern int comdefaultrate; /* ic/com.c */ + comdefaultrate = cdp->conspeed; + cnset(cdp->consdev); + } break; default: diff --git a/sys/arch/i386/include/biosvar.h b/sys/arch/i386/include/biosvar.h index 1348fcd5399..96d15834394 100644 --- a/sys/arch/i386/include/biosvar.h +++ b/sys/arch/i386/include/biosvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: biosvar.h,v 1.32 2000/02/03 13:42:40 mickey Exp $ */ +/* $OpenBSD: biosvar.h,v 1.33 2000/02/18 17:10:09 mickey Exp $ */ /* * Copyright (c) 1997-1999 Michael Shalayeff @@ -138,7 +138,11 @@ typedef struct _bios_pciinfo { u_int32_t pci_lastbus; /* Number of last PCI bus */ } bios_pciinfo_t; -#define BOOTARG_CONSDEV 5 /* dev_t */ +#define BOOTARG_CONSDEV 5 +typedef struct _bios_consdev { + dev_t consdev; + int conspeed; +} bios_consdev_t; #if defined(_KERNEL) || defined (_STANDALONE) diff --git a/sys/arch/i386/stand/libsa/exec_i386.c b/sys/arch/i386/stand/libsa/exec_i386.c index 2d52968fb52..afa6ae63103 100644 --- a/sys/arch/i386/stand/libsa/exec_i386.c +++ b/sys/arch/i386/stand/libsa/exec_i386.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_i386.c,v 1.24 1998/09/27 17:41:18 mickey Exp $ */ +/* $OpenBSD: exec_i386.c,v 1.25 2000/02/18 17:10:10 mickey Exp $ */ /* * Copyright (c) 1997-1998 Michael Shalayeff @@ -59,6 +59,12 @@ machdep_exec(xp, howto, loadaddr) dev_t bootdev = bootdev_dip->bootdev; size_t ac = BOOTARG_LEN; caddr_t av = (caddr_t)BOOTARG_OFF; + bios_consdev_t cd; + extern int com_speed; /* from bioscons.c */ + + cd.consdev = cn_tab->cn_dev; + cd.conspeed = com_speed; + addbootarg(BOOTARG_CONSDEV, sizeof(cd), &cd); makebootargs(av, &ac); |