summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1997-07-18 00:52:10 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1997-07-18 00:52:10 +0000
commit75496ad2acb1bc5c4ed136cacadbfe3e03c045bf (patch)
treeced11a353e057f25d46dbbf2b2cef5226c66a279 /sys/arch/i386
parenta5293c2571018b1ae1cbd6af79548997a7e90b30 (diff)
most of the stuff is no in libsa, very tiny srt0
boot calls machdep() move to .bss again (;
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/stand/boot/boot.c30
-rw-r--r--sys/arch/i386/stand/boot/srt0.S104
2 files changed, 33 insertions, 101 deletions
diff --git a/sys/arch/i386/stand/boot/boot.c b/sys/arch/i386/stand/boot/boot.c
index 4c21944877b..52c9231c106 100644
--- a/sys/arch/i386/stand/boot/boot.c
+++ b/sys/arch/i386/stand/boot/boot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: boot.c,v 1.9 1997/05/31 15:48:24 mickey Exp $ */
+/* $OpenBSD: boot.c,v 1.10 1997/07/18 00:52:08 mickey Exp $ */
/*
* Copyright (c) 1997 Michael Shalayeff
@@ -36,10 +36,9 @@
#include <sys/reboot.h>
#include <sys/stat.h>
#include <libsa.h>
-#include <debug.h>
#include "cmd.h"
-char *kernels[] = {
+const char *const kernels[] = {
"bsd", "bsd.gz",
"obsd", "obsd.gz",
NULL
@@ -48,32 +47,25 @@ char *kernels[] = {
extern const char version[];
int boothowto;
u_int cnvmem, extmem;
-struct cmd_state cmd = {
- "", "bsd", "/etc/boot.conf", "/", (void *)0x100000, 5, ""
-};
+struct cmd_state cmd;
void
boot(bootdev)
dev_t bootdev;
{
- register char *bootfile = kernels[0];
+ register const char *bootfile = kernels[0];
register int i = 0, f;
-#ifdef DEBUG
- *(u_int16_t*)0xb8148 = 0x4730;
-#endif
- gateA20(1);
- cons_probe(); /* call console init before any io */
-#ifndef _TEST
- memprobe();
-#endif
-#ifdef DEBUG
- *(u_int16_t*)0xb8148 = 0x4f31;
-#endif
- debug_init();
+ machdep();
printf(">> OpenBSD BOOT: %u/%u k [%s]\n", cnvmem, extmem, version);
+ strncpy(cmd.image, bootfile, sizeof(cmd.image));
+ cmd.conf = "/etc/boot.conf";
+ cmd.cwd[0] = '/'; cmd.cwd[1] = '\0';
+ cmd.addr = (void *)0x100000;
+ cmd.timeout = 5;
+
devboot(bootdev, cmd.bootdev);
f = read_conf(&cmd);
while (1) {
diff --git a/sys/arch/i386/stand/boot/srt0.S b/sys/arch/i386/stand/boot/srt0.S
index db739633244..574e3ebf2d8 100644
--- a/sys/arch/i386/stand/boot/srt0.S
+++ b/sys/arch/i386/stand/boot/srt0.S
@@ -1,13 +1,9 @@
-/* $OpenBSD: srt0.S,v 1.8 1997/05/29 05:32:06 mickey Exp $ */
-/* $NetBSD: srt0.c,v 1.3 1994/10/27 04:21:59 cgd Exp $ */
+/* $OpenBSD: srt0.S,v 1.9 1997/07/18 00:52:09 mickey Exp $ */
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
+/*
+ * Copyright (c) 1997 Michael Shalayeff
* All rights reserved.
*
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -18,15 +14,13 @@
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * This product includes software developed by Michael Shalayeff.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
@@ -36,34 +30,27 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)srt0.c 5.3 (Berkeley) 4/28/91
*/
-
#include <machine/asm.h>
-#include <machine/psl.h>
-#define _LOCORE
-#include <machine/segments.h>
-#undef _LOCORE
- .globl _end
- .globl _edata
- .globl _boot
- .globl __rtt
+ .globl _C_LABEL(end)
+ .globl _C_LABEL(edata)
+ .globl _C_LABEL(boot)
+ .globl _C_LABEL(_rtt)
+ .globl _ASM_LABEL(pmm_init)
.text
- .globl start_boot
-start_boot:
+ .globl start
+start:
#ifdef DEBUG
movl $0xb80a0, %ebx
movl $0x07420742, (%ebx)
#endif
- call pmm_init /* init protected moded memory management */
-
+ call _ASM_LABEL(pmm_init)
#ifdef DEBUG
movl $0xb80a4, %ebx
movl $0x07520752, (%ebx)
#endif
-
popl %eax
cmpl $BOOTMAGIC, %eax
je 1f
@@ -74,60 +61,13 @@ start_boot:
1:
/* zero .bss */
xorl %eax, %eax
- movl $_end, %ecx
- subl $_edata,%ecx
- movl $_edata, %edi
+ movl $_C_LABEL(end), %ecx
+ subl $_C_LABEL(edata),%ecx
+ movl $_C_LABEL(edata), %edi
cld
rep; stosb
- call _boot
-
- .data
- .align 3
-_Idtr_reset:
- .word 0
- .long 0
-
- .text
-__rtt:
-#ifdef DEBUG
- movl $0xb8000, %ebx
- movl $0x4f514f51, (%ebx)
-#endif
- movw $0x1234, %ax
- movw %ax, 0x472 # warm boot
-
- /* Try to use the KBD to reboot system */
- movl $0xfe, %eax
- movl $0x64, %edx
- outb %al, %dx
- movl $1, %eax
- pushl %eax
- call _C_LABEL(usleep)
- popl %eax
-
- movl $0xfe, %eax
- movl $0x64, %edx
- outb %al, %dx
- movl $1, %eax
- pushl %eax
- call _C_LABEL(usleep)
- popl %eax
-
-#ifdef DEBUG
- movl $0xb8000, %ebx
- movl $0x07310731, (%ebx)
-#endif
-
- /* Try to cause a tripple fault... */
- lidt _Idtr_reset
- xorl %eax, %eax
- divl %eax, %eax
-
- /* Again... */
- int $0x8
+ call _C_LABEL(boot)
- /* Again... */
- movl $0, %esp # segment violation
- ret
+ jmp _C_LABEL(_rtt)