From: mickey Date: Fri, 26 Apr 1996 18:22:51 +0000 (+0000) Subject: Fix the code, so it compiles now. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=e61bd821cf052a024b38bcdb536745904080b7f7;p=openbsd Fix the code, so it compiles now. --- diff --git a/sys/arch/i386/netboot/Makefile b/sys/arch/i386/netboot/Makefile index 2e920904008..9382a3cc966 100644 --- a/sys/arch/i386/netboot/Makefile +++ b/sys/arch/i386/netboot/Makefile @@ -1,3 +1,4 @@ +# $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 @@ -9,7 +10,7 @@ ROM_SIZE = 16384 .SUFFIXES: .s .c .o .list .c.list: - $(CC) $(CFLAGS) $(INC) -S $< + $(CC) $(CFLAGS) $(INC) -nostdinc -S $< $(AS) $*.s -a -o /dev/null > $@ rm $*.s @@ -17,46 +18,46 @@ ROM_SIZE = 16384 @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 $@ + ./genprom $@ 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: @@ -71,3 +72,4 @@ cleandir: clean rm -f boot.bin boot.sym .include + diff --git a/sys/arch/i386/netboot/arp.c b/sys/arch/i386/netboot/arp.c index 10d8b1ffe9d..9d0daea342d 100644 --- a/sys/arch/i386/netboot/arp.c +++ b/sys/arch/i386/netboot/arp.c @@ -1,3 +1,4 @@ +/* $OpenBSD: arp.c,v 1.3 1996/04/26 18:22:58 mickey Exp $ */ /* $NetBSD: arp.c,v 1.5 1996/02/02 18:06:14 mycroft Exp $ */ /* @@ -12,7 +13,7 @@ #include "proto.h" #include "assert.h" -#include +#include "param.h" #include "packet.h" #include "ether.h" #include "inet.h" diff --git a/sys/arch/i386/netboot/main.c b/sys/arch/i386/netboot/main.c index 43884a2b9a2..1d36c124fc0 100644 --- a/sys/arch/i386/netboot/main.c +++ b/sys/arch/i386/netboot/main.c @@ -1,3 +1,4 @@ +/* $OpenBSD: main.c,v 1.4 1996/04/26 18:23:03 mickey Exp $ */ /* $NetBSD: main.c,v 1.6 1996/02/02 18:06:17 mycroft Exp $ */ /* @@ -57,7 +58,7 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "config.h" #include "nbtypes.h" #include "assert.h" -#include +#include "param.h" #include "packet.h" #include "ether.h" #include "inet.h" diff --git a/sys/arch/i386/netboot/packet.c b/sys/arch/i386/netboot/packet.c index 73c85d4339b..769bd17d76e 100644 --- a/sys/arch/i386/netboot/packet.c +++ b/sys/arch/i386/netboot/packet.c @@ -1,3 +1,4 @@ +/* $OpenBSD: packet.c,v 1.3 1996/04/26 18:23:07 mickey Exp $ */ /* $NetBSD: packet.c,v 1.4 1996/02/02 18:06:21 mycroft Exp $ */ /* @@ -11,7 +12,7 @@ #include "proto.h" #include "assert.h" -#include +#include "param.h" #include "packet.h" static packet_t *pool = (packet_t *)0; diff --git a/sys/arch/i386/netboot/start.s b/sys/arch/i386/netboot/start.s index 0bc14e124d9..bcb078d573f 100644 --- a/sys/arch/i386/netboot/start.s +++ b/sys/arch/i386/netboot/start.s @@ -1,3 +1,4 @@ +/* $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" @@ -14,10 +15,11 @@ 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 */ @@ -36,25 +38,26 @@ ENTRY(start) 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) */ @@ -91,9 +94,9 @@ xputc: /* print byte in %al */ .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 @@ -120,8 +123,10 @@ xputs: /* print string pointed to by cs:bx */ 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 */ diff --git a/sys/arch/i386/netboot/tftp.c b/sys/arch/i386/netboot/tftp.c index 0edd39e45e7..7daf0a1f0e0 100644 --- a/sys/arch/i386/netboot/tftp.c +++ b/sys/arch/i386/netboot/tftp.c @@ -1,3 +1,4 @@ +/* $OpenBSD: tftp.c,v 1.3 1996/04/26 18:23:16 mickey Exp $ */ /* $NetBSD: tftp.c,v 1.4 1996/02/02 18:06:23 mycroft Exp $ */ /* @@ -11,7 +12,7 @@ #include "proto.h" #include "assert.h" -#include +#include "param.h" #include "packet.h" #include "ether.h" #include "inet.h"