summaryrefslogtreecommitdiffstats
path: root/sys/boot/alpha
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1999-04-16 21:22:55 +0000
committerpeter <peter@FreeBSD.org>1999-04-16 21:22:55 +0000
commit087d4857e56f150a8f549600150404f273efb895 (patch)
treecf4e27432c59d956f4e5784207180115ee8fef9d /sys/boot/alpha
parentc5fe612b8411a32a8e6e426fc1a70cba0cca3d31 (diff)
downloadFreeBSD-src-087d4857e56f150a8f549600150404f273efb895.zip
FreeBSD-src-087d4857e56f150a8f549600150404f273efb895.tar.gz
Bring the 'new-bus' to the i386. This extensively changes the way the
i386 platform boots, it is no longer ISA-centric, and is fully dynamic. Most old drivers compile and run without modification via 'compatability shims' to enable a smoother transition. eisa, isapnp and pccard* are not yet using the new resource manager. Once fully converted, all drivers will be loadable, including PCI and ISA. (Some other changes appear to have snuck in, including a port of Soren's ATA driver to the Alpha. Soren, back this out if you need to.) This is a checkpoint of work-in-progress, but is quite functional. The bulk of the work was done over the last few years by Doug Rabson and Garrett Wollman. Approved by: core
Diffstat (limited to 'sys/boot/alpha')
-rw-r--r--sys/boot/alpha/boot1/boot1.c54
-rw-r--r--sys/boot/alpha/libalpha/prom.c4
-rw-r--r--sys/boot/alpha/libalpha/start.S7
-rw-r--r--sys/boot/alpha/netboot/Makefile1
4 files changed, 58 insertions, 8 deletions
diff --git a/sys/boot/alpha/boot1/boot1.c b/sys/boot/alpha/boot1/boot1.c
index 9eac7ec..7346c5b 100644
--- a/sys/boot/alpha/boot1/boot1.c
+++ b/sys/boot/alpha/boot1/boot1.c
@@ -1,5 +1,5 @@
/*
- * $Id: boot1.c,v 1.2 1998/09/26 10:51:36 dfr Exp $
+ * $Id: boot1.c,v 1.3 1998/10/18 19:05:07 dfr Exp $
* From $NetBSD: bootxx.c,v 1.4 1997/09/06 14:08:29 drochner Exp $
*/
@@ -49,6 +49,18 @@ putchar(int c)
prom_putchar(c);
}
+int
+getchar()
+{
+ return prom_getchar();
+}
+
+int
+ischar()
+{
+ return prom_poll();
+}
+
void
puts(const char *s)
{
@@ -150,9 +162,37 @@ devclose()
}
void
+getfilename(char *filename)
+{
+ int c;
+ char *p;
+
+ puts("Boot: ");
+
+ while ((c = getchar()) != '\n') {
+ if (c == '\b') {
+ if (p > filename) {
+ puts("\b \b");
+ p--;
+ }
+ } else
+ *p++ = c;
+ }
+ *p = '\0';
+ return;
+}
+
+void
loadfile(char *name, char *addr)
{
int n;
+ char filename[512];
+ char *p;
+
+ restart:
+ puts("Loading ");
+ puts(name);
+ puts("\n");
if (openrd(name)) {
puts("Can't open file ");
@@ -161,9 +201,17 @@ loadfile(char *name, char *addr)
halt();
}
+ p = addr;
do {
- n = readit(addr, 1024);
- addr += n;
+ n = readit(p, 1024);
+ p += n;
+ if (ischar()) {
+ puts("Stop!\n");
+ devclose();
+ getfilename(filename);
+ name = filename;
+ goto restart;
+ }
twiddle();
} while (n > 0);
diff --git a/sys/boot/alpha/libalpha/prom.c b/sys/boot/alpha/libalpha/prom.c
index 535ce31..380326c 100644
--- a/sys/boot/alpha/libalpha/prom.c
+++ b/sys/boot/alpha/libalpha/prom.c
@@ -1,4 +1,4 @@
-/* $Id$ */
+/* $Id: prom.c,v 1.1.1.1 1998/08/21 03:17:42 msmith Exp $ */
/* $NetBSD: prom.c,v 1.3 1997/09/06 14:03:58 drochner Exp $ */
/*
@@ -41,7 +41,7 @@ static void prom_probe(struct console *cp);
static int prom_init(int);
void prom_putchar(int);
int prom_getchar(void);
-static int prom_poll(void);
+int prom_poll(void);
struct console promconsole = {
"prom",
diff --git a/sys/boot/alpha/libalpha/start.S b/sys/boot/alpha/libalpha/start.S
index 39c3e48..f42b5da 100644
--- a/sys/boot/alpha/libalpha/start.S
+++ b/sys/boot/alpha/libalpha/start.S
@@ -1,5 +1,5 @@
/*
- * $Id: start.S,v 1.1.1.1 1998/08/21 03:17:42 msmith Exp $
+ * $Id: start.S,v 1.2 1998/10/31 17:12:32 dfr Exp $
* From: $NetBSD: start.S,v 1.4 1998/03/28 00:54:15 cgd Exp $
*/
@@ -45,6 +45,7 @@
.set noreorder /* don't reorder instructions */
#define ENTRY_FRAME 32
+#define STACK_SIZE 8192
NESTED(start, 1, ENTRY_FRAME, ra, 0, 0)
br pv,Lstartgp
@@ -57,7 +58,7 @@ Lstartgp:
CALL(bzero)
#if defined(NETBOOT) || defined(LOADER)
- lda sp,stack + 8192 - ENTRY_FRAME
+ lda sp,stack + STACK_SIZE - ENTRY_FRAME
#endif
CALL(main) /* transfer to C */
@@ -84,5 +85,5 @@ LEAF(cpu_number, 0)
END(cpu_number)
#if defined(NETBOOT) || defined(LOADER)
-BSS(stack, 8192)
+BSS(stack, STACK_SIZE)
#endif
diff --git a/sys/boot/alpha/netboot/Makefile b/sys/boot/alpha/netboot/Makefile
index 927522c..4643add 100644
--- a/sys/boot/alpha/netboot/Makefile
+++ b/sys/boot/alpha/netboot/Makefile
@@ -15,6 +15,7 @@ SRCS+= main.c conf.c dev_net.c
.include <${.CURDIR}/../../common/Makefile.inc>
CFLAGS+= -mno-fp-regs
CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}
+CFLAGS+= -I${.CURDIR}/../../.. -I.
CFLAGS+= -I${.OBJDIR}
CFLAGS+= -DNETBOOT
OpenPOWER on IntegriCloud