+# $OpenBSD: Makefile,v 1.2 1996/04/26 18:22:51 mickey Exp $
# $NetBSD: Makefile,v 1.4 1994/10/27 04:20:59 cgd Exp $
# uncomment one of these as appropriate for the board being used
.SUFFIXES: .s .c .o .list
.c.list:
- $(CC) $(CFLAGS) $(INC) -S $<
+ $(CC) $(CFLAGS) $(INC) -nostdinc -S $<
$(AS) $*.s -a -o /dev/null > $@
rm $*.s
@echo $(AS) -o $*.o $< [$(DEFINES)]
-@trap "/bin/rm -f $*.i X$*.c; exit 0" 0 1 2 3 10 15; \
/bin/rm -f X$*.c; \
- ln $*.s X$*.c; \
- $(CC) -E $(CFLAGS) X$*.c > $*.i; \
+ ln -s $< X$*.c; \
+ $(CC) -I${.CURDIR} -E $(CFLAGS) -nostdinc X$*.c > $*.i; \
if [ $$? != 0 ]; then :; \
else \
$(AS) $*.i -o $@; \
fi
+
.s.list:
@echo $(AS) -o $*.o $< [$(DEFINES)]
-@trap "/bin/rm -f $*.i X$*.c; exit 0" 0 1 2 3 10 15; \
/bin/rm -f X$*.c; \
- ln $*.s X$*.c; \
- $(CC) -E $(CFLAGS) X$*.c > $*.i; \
+ ln -s $< X$*.c; \
+ $(CC) -E $(CFLAGS) -nostdinc X$*.c > $*.i; \
if [ $$? != 0 ]; then :; \
else \
$(AS) $*.i -a -o /dev/null > $@; \
fi
# the relocation address (hex)
-RELOC = 98000
-CFLAGS = -O $(DEFINES) -nostdinc
-DEFINES = -DRELOC=0x$(RELOC) -DROM_SIZE=$(ROM_SIZE) -DTRACE=0 -Dprinte=printf \
+RELOC= 98000
+CFLAGS= -O2 $(DEFINES)
+DEFINES=-DRELOC=0x$(RELOC) -DROM_SIZE=$(ROM_SIZE) -DTRACE=0 -Dprinte=printf \
-DDEBUG -DUSE_BOOTP -DUSE_RARP #-DPhysBcopy=bcopy -DPhysBzero=bzero
+NOMAN= noman
-OBJS = start.o main.o cga.o kbd.o packet.o tftp.o arp.o \
+PROG= genprom
+BOOT_OBJS+= start.o main.o cga.o kbd.o packet.o tftp.o arp.o \
$(ETH_OBJ) misc.o asm.o
-all: boot.bin
+all: genprom boot.bin
-boot.bin: $(OBJS) genprom
- ${LD} -e _start -N -T ${RELOC} $(OBJS)
+boot.bin: $(BOOT_OBJS)
+ ${LD} -e _start -N -T ${RELOC} ${BOOT_OBJS}
cp a.out boot.sym
rm -f $@
strip a.out
dd if=a.out of=boot.v ibs=32 skip=1 obs=1024b
- genprom <boot.v >$@
+ ./genprom <boot.v >$@
rm -f a.out boot.v
-genprom: genprom.c
- $(CC) -o $@ -DROM_SIZE=$(ROM_SIZE) genprom.c
-
# copy to dos floppy for testing (faster than burning an eprom)
dostest: boot.bin
mcopy -n boot.bin a:
rm -f boot.bin boot.sym
.include <bsd.prog.mk>
+
+/* $OpenBSD: start.s,v 1.2 1996/04/26 18:23:12 mickey Exp $ */
/* $NetBSD: start.s,v 1.4 1994/10/27 04:21:25 cgd Exp $ */
#include "asm.h"
ENTRY(start)
1:
cli
- # save the bios return address in these registers until protected
- # mode %ds is set up
- # mov (%esp), %edx
- # mov 2(%esp), %ebp
+ /* save the bios return address in these registers until protected
+ * mode %ds is set up
+ * mov (%esp), %edx
+ * mov 2(%esp), %ebp
+ */
pop %dx /* return offset */
pop %ebp /* return segment */
push %dx /* return offset */
push %ds
-#if 0
+#if notdef
jmp ret16
#endif
#ifdef CHECK_386
- # check if 386 or later
- # from Intel i486 programmer\'s reference manual, section 22.10
- # Care must be taken with the first few instructions to ensure
- # operations are compatible with 386 progenitors - no operand
- # or address size overrides, all operations must be 16 bit.
- # Real mode not well supported by gas so it looks a bit crufty
-
- # TBD - there is little stack space, although the routine below
- # uses only two bytes; might set up new stack first thing, then
- # check processor type - would mean carrying sp, ss in two gp
- # registers for a while. also make alternate provisions for saving
- # ds: below.
-
+ /*
+ * check if 386 or later
+ * from Intel i486 programmer's reference manual, section 22.10
+ * Care must be taken with the first few instructions to ensure
+ * operations are compatible with 386 progenitors - no operand
+ * or address size overrides, all operations must be 16 bit.
+ * Real mode not well supported by gas so it looks a bit crufty
+ *
+ * TBD - there is little stack space, although the routine below
+ * uses only two bytes; might set up new stack first thing, then
+ * check processor type - would mean carrying sp, ss in two gp
+ * registers for a while. also make alternate provisions for saving
+ * ds: below.
+ */
pushf
pop %ebx
.byte 0x81, 0xe3 /* (and 0x0fff, %ebx) */
.byte 0xbb /* (mov $0x1, %ebx) %bh=0, %bl=1 (blue) */
.word 0x0001
movb $0xe, %ah
- # sti
+ /* sti */
int $0x10 /* display a byte */
- # cli
+ /* cli */
data32
popa
ret
bad_cpu_msg: .asciz "netboot: cpu cannot execute '386 instructions, net boot not done.\n\r"
Lcpu_ok:
- # at this point it is known this can execute 386 instructions
- # so operand and address size prefixes are ok
+ /*
+ * at this point it is known this can execute 386 instructions
+ * so operand and address size prefixes are ok
+ */
#endif /* CHECK_386 */
/* copy rom to link addr, prepare for relocation */