summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorTom Cosgrove <tom@cvs.openbsd.org>2004-02-23 01:19:53 +0000
committerTom Cosgrove <tom@cvs.openbsd.org>2004-02-23 01:19:53 +0000
commitc405e11efb4948635a9f2969977ce6b2855e6628 (patch)
tree4a535710a3a378e693caccdec6252656be010f08 /sys/arch
parentf9429574c85acd0974ac93c2f82dd1ee0d430364 (diff)
- Pick up the /boot argc, argv in locore.S (though not currently used)
- Probe for console devices (incl serial) in /boot - Pass console device from /boot to kernel (temp via additional param) With this, boot> set tty com0 now works. "just don't break a build" deraadt@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/amd64/amd64/conf.c4
-rw-r--r--sys/arch/amd64/amd64/locore.S29
-rw-r--r--sys/arch/amd64/amd64/machdep.c12
-rw-r--r--sys/arch/amd64/stand/libsa/exec_i386.c6
-rw-r--r--sys/arch/amd64/stand/libsa/machdep.c8
5 files changed, 46 insertions, 13 deletions
diff --git a/sys/arch/amd64/amd64/conf.c b/sys/arch/amd64/amd64/conf.c
index 0723e17ad80..5f93b4620d3 100644
--- a/sys/arch/amd64/amd64/conf.c
+++ b/sys/arch/amd64/amd64/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.3 2004/02/10 01:31:21 millert Exp $ */
+/* $OpenBSD: conf.c,v 1.4 2004/02/23 01:19:52 tom Exp $ */
/*
* Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved.
@@ -448,7 +448,7 @@ struct consdev constab[] = {
#if 1 || NWSDISPLAY > 0
cons_init(ws),
#endif
-#if 0 && NCOM > 0
+#if NCOM + NPCCOM > 0
cons_init(com),
#endif
{ 0 },
diff --git a/sys/arch/amd64/amd64/locore.S b/sys/arch/amd64/amd64/locore.S
index 933dcd8db37..2d328dc7d51 100644
--- a/sys/arch/amd64/amd64/locore.S
+++ b/sys/arch/amd64/amd64/locore.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.S,v 1.5 2004/02/22 19:20:09 tom Exp $ */
+/* $OpenBSD: locore.S,v 1.6 2004/02/23 01:19:52 tom Exp $ */
/* $NetBSD: locore.S,v 1.2 2003/04/26 19:34:45 fvdl Exp $ */
/*
@@ -192,6 +192,8 @@ _C_LABEL(lapic_isr):
.globl _C_LABEL(bootinfo),_C_LABEL(atdevbase)
.globl _C_LABEL(proc0paddr),_C_LABEL(PTDpaddr)
.globl _C_LABEL(biosbasemem),_C_LABEL(biosextmem)
+ .globl _C_LABEL(bootapiver), _C_LABEL(bootargc), _C_LABEL(bootargv)
+ .globl _C_LABEL(boot_consdev)
.globl _C_LABEL(gdtstore)
_C_LABEL(cpu): .long 0 # are we 386, 386sx, or 486,
# or Pentium, or..
@@ -205,6 +207,10 @@ _C_LABEL(cpu_vendor): .space 16 # vendor string returned by `cpuid'
_C_LABEL(cpu_brand_id): .long 0 # brand ID from 'cpuid' instruction
_C_LABEL(esym): .quad 0 # ptr to end of syms
_C_LABEL(atdevbase): .quad 0 # location of start of iomem in virtual
+_C_LABEL(bootapiver): .long 0 # /boot API version
+_C_LABEL(bootargc): .long 0 # /boot argc
+_C_LABEL(bootargv): .quad 0 # /boot argv
+_C_LABEL(boot_consdev): .long 0 # console device (temporary)
_C_LABEL(proc0paddr): .quad 0
_C_LABEL(PTDpaddr): .quad 0 # paddr of PTD, for libkvm
#ifndef REALBASEMEM
@@ -246,7 +252,7 @@ tmpstk:
/*
* Some hackage to deal with 64bit symbols in 32 bit mode.
- * This may not be needed it things are cleaned up a little.
+ * This may not be needed if things are cleaned up a little.
*/
@@ -262,6 +268,8 @@ start: movw $0x1234,0x472 # warm boot
/*
* Load parameters from stack
* (howto, bootdev, bootapiver, esym, extmem, cnvmem, ac, av)
+ *
+ * XXX boot_consdev temporarily tacked on to the end
*/
movl 4(%esp),%eax
movl %eax, RELOC(boothowto)
@@ -276,11 +284,24 @@ start: movw $0x1234,0x472 # warm boot
movl %eax,(%ebp)
movl $KERNBASE_HI,4(%ebp)
1:
- movl 20(%esp), %eax
+ movl 20(%esp), %eax
movl %eax, RELOC(biosextmem)
- movl 24(%esp), %eax
+ movl 24(%esp), %eax
movl %eax, RELOC(biosbasemem)
+ movl 12(%esp), %eax
+ movl %eax, RELOC(bootapiver)
+ movl 28(%esp), %eax
+ movl %eax, RELOC(bootargc)
+ movl 32(%esp), %eax
+ movl $RELOC(bootargv), %ebx
+ movl %eax, (%ebx)
+ xorl %eax, %eax
+ movl %eax, 4(%ebx)
+
+ movl 36(%esp), %eax
+ movl %eax, RELOC(boot_consdev)
+
/* First, reset the PSL. */
pushl $PSL_MBO
popfl
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index 93e392c272e..32f50d58787 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.7 2004/02/21 03:00:23 deraadt Exp $ */
+/* $OpenBSD: machdep.c,v 1.8 2004/02/23 01:19:52 tom Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -1214,6 +1214,16 @@ init_x86_64(first_avail)
uvmexp.ncolors = 2;
#endif
+ /*
+ * XXX /boot temporarily passes an extra parameter for the
+ * console device.
+ */
+ {
+ extern dev_t boot_consdev;
+
+ cnset(boot_consdev);
+ }
+
avail_start = PAGE_SIZE; /* BIOS leaves data in low memory */
/* and VM system doesn't work with phys 0 */
#ifdef MULTIPROCESSOR
diff --git a/sys/arch/amd64/stand/libsa/exec_i386.c b/sys/arch/amd64/stand/libsa/exec_i386.c
index 0b814d9d3db..d1f78ac3cae 100644
--- a/sys/arch/amd64/stand/libsa/exec_i386.c
+++ b/sys/arch/amd64/stand/libsa/exec_i386.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_i386.c,v 1.1 2004/02/03 12:09:47 mickey Exp $ */
+/* $OpenBSD: exec_i386.c,v 1.2 2004/02/23 01:19:52 tom Exp $ */
/*
* Copyright (c) 1997-1998 Michael Shalayeff
@@ -37,7 +37,7 @@
#include "libsa.h"
#include <lib/libsa/loadfile.h>
-typedef void (*startfuncp)(int, int, int, int, int, int, int, int)
+typedef void (*startfuncp)(int, int, int, int, int, int, int, int, int)
__attribute__ ((noreturn));
void
@@ -68,6 +68,6 @@ run_loadfile(u_long *marks, int howto)
((int *)entry)[0], ((int *)entry)[1], ((int *)entry)[2], ((int *)entry)[3]);
/* stack and the gung is ok at this point, so, no need for asm setup */
(*(startfuncp)entry)(howto, bootdev, BOOTARG_APIVER,
- marks[MARK_END], extmem, cnvmem, ac, (int)av);
+ marks[MARK_END], extmem, cnvmem, ac, (int)av, cd.consdev);
/* not reached */
}
diff --git a/sys/arch/amd64/stand/libsa/machdep.c b/sys/arch/amd64/stand/libsa/machdep.c
index 440a14c09bd..ffc1f8e52d8 100644
--- a/sys/arch/amd64/stand/libsa/machdep.c
+++ b/sys/arch/amd64/stand/libsa/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.1 2004/02/03 12:09:47 mickey Exp $ */
+/* $OpenBSD: machdep.c,v 1.2 2004/02/23 01:19:52 tom Exp $ */
/*
* Copyright (c) 1997-1999 Michael Shalayeff
@@ -48,9 +48,11 @@ machdep(void)
printf("probing:");
/* probe for a model number, gateA20() neds ps2model */
gateA20(1); CKPT('1');
- memprobe(); CKPT('2');
+ /* initialise a console (and probe for com* devices) */
+ cninit(); CKPT('2');
+ memprobe(); CKPT('3');
printf("\n");
- diskprobe(); CKPT('3');
+ diskprobe(); CKPT('4');
CKPT('Z');
}