mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-11 17:04:19 +01:00
- 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
This commit is contained in:
parent
c90625d230
commit
d8ef941c2f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=40555
@ -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 \
|
||||
${BASE}.bin: ${BASE}.sym
|
||||
cp ${.ALLSRC} ${.TARGET}
|
||||
strip ${.TARGET}
|
||||
|
||||
# Cannot use ${OBJS} above this line
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
${BASE}.sym: ${OBJS} ${LIBI386} vers.o
|
||||
${CC} ${LDFLAGS} -o ${.TARGET} ${BTXCRT} ${OBJS} vers.o \
|
||||
${LIBSTAND} ${LIBI386} ${LIBSTAND}
|
||||
|
||||
setdef0.o: setdefs.h
|
||||
|
||||
setdef1.o: setdefs.h
|
||||
# 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
|
||||
|
||||
.endif
|
||||
|
||||
CLEANFILES+= machine
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
# Linker set gymnastics
|
||||
setdefs.h: gensetdefs ${OBJS}
|
||||
@echo Generating linker sets
|
||||
@./gensetdefs ${OBJS} >setdefs.h
|
||||
|
||||
gensetdefs: gensetdefs.o
|
||||
${CC} -static gensetdefs.o -o $@
|
||||
|
||||
gensetdefs.o: gensetdefs.c
|
||||
${CC} -c $<
|
||||
|
||||
beforedepend ${OBJS}: machine
|
||||
|
@ -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
|
||||
};
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user