summaryrefslogtreecommitdiffstats
path: root/sys/boot/i386
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>1998-10-21 20:10:33 +0000
committermsmith <msmith@FreeBSD.org>1998-10-21 20:10:33 +0000
commitedf2081f844c6ed2f39cbb5d56aab38a37059db4 (patch)
tree03810df05910fc1668a4d0c48859277eb2769c3f /sys/boot/i386
parent702529216ce81262b87ad8903ed6d77eef2665da (diff)
downloadFreeBSD-src-edf2081f844c6ed2f39cbb5d56aab38a37059db4.zip
FreeBSD-src-edf2081f844c6ed2f39cbb5d56aab38a37059db4.tar.gz
- Enable PnP and ISA PnP code.
- Use the ISA PnP enumerator. - Use the new linker set code, throw out the gensetdefs stuff. - Produce an intermediate loader image that has symbols stripped, to aid - in debugging. - Supply ISA port access functions required for ISA PnP
Diffstat (limited to 'sys/boot/i386')
-rw-r--r--sys/boot/i386/loader/Makefile44
-rw-r--r--sys/boot/i386/loader/conf.c4
-rw-r--r--sys/boot/i386/loader/main.c37
3 files changed, 59 insertions, 26 deletions
diff --git a/sys/boot/i386/loader/Makefile b/sys/boot/i386/loader/Makefile
index 02fd2d0..6f85541 100644
--- a/sys/boot/i386/loader/Makefile
+++ b/sys/boot/i386/loader/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.11 1998/10/12 01:03:00 rnordier Exp $
+# $Id: Makefile,v 1.12 1998/10/14 07:08:16 peter Exp $
BASE= loader
PROG= ${BASE}
@@ -11,8 +11,8 @@ BINDIR?= /boot
SRCS= main.c conf.c
# Enable PnP and ISA-PnP code.
-#HAVE_PNP= yes
-#HAVE_ISABUS= yes
+HAVE_PNP= yes
+HAVE_ISABUS= yes
# Always add MI sources
.PATH: ${.CURDIR}/../../common
@@ -20,8 +20,7 @@ SRCS= main.c conf.c
CFLAGS+= -I${.CURDIR}/../../common
CFLAGS+= -I${.CURDIR}/../../.. -I.
-CLEANFILES+= vers.c vers.o ${BASE}.list setdef0.o setdef1.o setdefs.h \
- gensetdefs.o gensetdefs ${BASE}.bin
+CLEANFILES+= vers.c vers.o ${BASE}.list ${BASE}.bin
CFLAGS+= -Wall
LDFLAGS= -nostdlib -static -Ttext 0x1000
@@ -49,6 +48,9 @@ CFLAGS+= -I${.CURDIR}/../btx/lib
# BTX is expecting ELF components
CFLAGS+= -elf
+# New linker set code
+CFLAGS+= -DNEW_LINKER_SET
+
# Debug me!
#CFLAGS+= -g
#LDFLAGS+= -g
@@ -61,30 +63,26 @@ ${BASE}: ${BASE}.bin ${BTXLDR} ${BTXKERN}
btxld -v -f aout -e 0x100000 -o ${.TARGET} -l ${BTXLDR} -b ${BTXKERN} \
${BASE}.bin
-${BASE}.bin: ${OBJS} ${LIBI386} vers.o setdef0.o setdef1.o
- ${CC} ${LDFLAGS} -o ${.TARGET} ${BTXCRT} setdef0.o ${OBJS} vers.o setdef1.o \
- ${LIBSTAND} ${LIBI386} ${LIBSTAND}
+${BASE}.bin: ${BASE}.sym
+ cp ${.ALLSRC} ${.TARGET}
+ strip ${.TARGET}
-setdef0.o: setdefs.h
+# Cannot use ${OBJS} above this line
+.include <bsd.prog.mk>
-setdef1.o: setdefs.h
+${BASE}.sym: ${OBJS} ${LIBI386} vers.o
+ ${CC} ${LDFLAGS} -o ${.TARGET} ${BTXCRT} ${OBJS} vers.o \
+ ${LIBSTAND} ${LIBI386} ${LIBSTAND}
+
+# If it's not there, don't consider it a target
+.if exists(${.CURDIR}/../../../i386/include)
+beforedepend ${OBJS}: machine
machine:
ln -sf ${.CURDIR}/../../../i386/include machine
-CLEANFILES+= machine
-
-.include <bsd.prog.mk>
-
-# Linker set gymnastics
-setdefs.h: gensetdefs ${OBJS}
- @echo Generating linker sets
- @./gensetdefs ${OBJS} >setdefs.h
+.endif
-gensetdefs: gensetdefs.o
- ${CC} -static gensetdefs.o -o $@
+CLEANFILES+= machine
-gensetdefs.o: gensetdefs.c
- ${CC} -c $<
-beforedepend ${OBJS}: machine
diff --git a/sys/boot/i386/loader/conf.c b/sys/boot/i386/loader/conf.c
index d39d67f..b17a308 100644
--- a/sys/boot/i386/loader/conf.c
+++ b/sys/boot/i386/loader/conf.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: conf.c,v 1.6 1998/09/30 19:48:42 peter Exp $
+ * $Id: conf.c,v 1.7 1998/10/07 02:39:32 msmith Exp $
*/
#include <stand.h>
@@ -88,7 +88,7 @@ extern struct pnphandler isapnphandler;
/* extern struct pnphandler pcipnphandler;*/
struct pnphandler *pnphandlers[] = {
-/* &isapnphandler, */
+ &isapnphandler,
/* &pcipnphandler, */
NULL
};
diff --git a/sys/boot/i386/loader/main.c b/sys/boot/i386/loader/main.c
index b9e93f4..4847a6c 100644
--- a/sys/boot/i386/loader/main.c
+++ b/sys/boot/i386/loader/main.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: main.c,v 1.10 1998/10/03 18:27:50 rnordier Exp $
+ * $Id: main.c,v 1.11 1998/10/04 09:12:54 msmith Exp $
*/
/*
@@ -58,6 +58,8 @@ static struct bootinfo *initial_bootinfo;
struct arch_switch archsw; /* MI/MD interface boundary */
static void extract_currdev(void);
+static int isa_inb(int port);
+static void isa_outb(int port, int value);
/* from vers.c */
extern char bootprog_name[], bootprog_rev[], bootprog_date[], bootprog_maker[];
@@ -118,6 +120,8 @@ main(void)
archsw.arch_copyin = i386_copyin;
archsw.arch_copyout = i386_copyout;
archsw.arch_readin = i386_readin;
+ archsw.arch_isainb = isa_inb;
+ archsw.arch_isaoutb = isa_outb;
interact(); /* doesn't return */
}
@@ -195,3 +199,34 @@ command_heap(int argc, char *argv[])
printf("heap base at %p, top at %p\n", end, sbrk(0));
return(CMD_OK);
}
+
+/* ISA bus access functions for PnP, derived from <machine/cpufunc.h> */
+static int
+isa_inb(int port)
+{
+ u_char data;
+
+ if (__builtin_constant_p(port) &&
+ (((port) & 0xffff) < 0x100) &&
+ ((port) < 0x10000)) {
+ __asm __volatile("inb %1,%0" : "=a" (data) : "id" ((u_short)(port)));
+ } else {
+ __asm __volatile("inb %%dx,%0" : "=a" (data) : "d" (port));
+ }
+ return(data);
+}
+
+static void
+isa_outb(int port, int value)
+{
+ u_char al = value;
+
+ if (__builtin_constant_p(port) &&
+ (((port) & 0xffff) < 0x100) &&
+ ((port) < 0x10000)) {
+ __asm __volatile("outb %0,%1" : : "a" (al), "id" ((u_short)(port)));
+ } else {
+ __asm __volatile("outb %0,%%dx" : : "a" (al), "d" (port));
+ }
+}
+
OpenPOWER on IntegriCloud