Make these compile with the old (a.out) toolchain.

This commit is contained in:
minoura 2001-09-27 14:08:27 +00:00
parent 9a679b0eb1
commit 7d1fc276fa
4 changed files with 22 additions and 11 deletions

View File

@ -1,4 +1,6 @@
# $NetBSD: Makefile,v 1.1 2001/09/27 10:14:49 minoura Exp $
# $NetBSD: Makefile,v 1.2 2001/09/27 14:08:27 minoura Exp $
.include <bsd.own.mk>
BOOT= boot
VERSION= 1.0
@ -27,8 +29,11 @@ CPPFLAGS+= -I$M/stand/libiocs -I${COMMONDIR}
CPPFLAGS+= -DTEXTADDR="0x${TEXT}"
CPPFLAGS+= -DBOOT=\"${BOOT}\" -DBOOT_VERS=\"${VERSION}\"
CFLAGS= -Wno-main -Os -m68020-60
.if ${OBJECT_FMT} == "ELF"
LDFLAGS= -N -static -T ${.CURDIR}/boot.ldscript
.else
LDFLAGS= -N -static -Ttext ${TEXT}
.endif
LIBIOCS!= cd $M/stand/libiocs && ${MAKE} print-objdir
LIBSA!= cd $M/stand/libsa && ${MAKE} print-objdir
LDLIBS= -L${LIBSA} -lsa -L${LIBIOCS} -liocs

View File

@ -1,4 +1,6 @@
# $NetBSD: Makefile,v 1.2 2001/09/27 13:27:54 minoura Exp $
# $NetBSD: Makefile,v 1.3 2001/09/27 14:08:27 minoura Exp $
.include <bsd.own.mk>
BOOT= boot_ufs
VERSION=1.0
@ -32,8 +34,12 @@ CPPFLAGS+= -DSCSI_ADHOC_BOOTPART
CPPFLAGS+= -DUSE_FFS #-DUSE_LFS
CPPFLAGS+= -I${COMMONDIR} -I${LIBIOCS}
AFLAGS= ${CFLAGS:M-[ID]*}
.if ${OBJECT_FMT} == "ELF"
LDFLAGS= -N -Bstatic -T ${.CURDIR}/${BOOT}.ldscript
LDFLAGS+= -noinhibit-exec # XXX
.else
LDFLAGS= -n -Bstatic -Ttext ${TEXT}
.endif
CLEANFILES= $(BOOT).x s.x x.s x.o

View File

@ -2,7 +2,7 @@
| author: chapuni(GBA02750@niftyserve.or.jp)
| Yasha
|
| $NetBSD: boot.S,v 1.1 2001/09/27 10:14:49 minoura Exp $
| $NetBSD: boot.S,v 1.2 2001/09/27 14:08:27 minoura Exp $
#include <machine/asm.h>
#include "iocscall.h"
@ -38,7 +38,7 @@ ASENTRY_NOPROFILE(entry0)
#define ASRELOC(var) _RELOC(_ASM_LABEL(var))
#define RELOC(var) _RELOC(_C_LABEL(var))
lea RELOC(__bss_start),%a1
lea RELOC(edata),%a1
bra _ASM_LABEL(entry)
| Disklabel= 404bytes

View File

@ -1,4 +1,4 @@
/* $NetBSD: exec_image.S,v 1.1 2001/09/27 10:14:50 minoura Exp $ */
/* $NetBSD: exec_image.S,v 1.2 2001/09/27 14:08:28 minoura Exp $ */
/*
* Copyright (c) 2001 Minoura Makoto.
@ -48,13 +48,13 @@ ENTRY_NOPROFILE(exec_image)
/* copy the trampoline to the last physical page. */
moval LASTADDR,%sp | tmpstack from end of physmem
leal %sp@(-4096),%a3 | use last phys page as tramp
lea %sp@(-4096),%a3 | use last phys page as tramp
movl #(end_trampoline-trampoline),%sp@-
peal %pc@(trampoline)
peal %a3@
pea %pc@(trampoline)
pea %a3@
jbsr _C_LABEL(memcpy) | memcpy() is still alive
leal %sp@(12),%sp
lea %sp@(12),%sp
jmp %a3@ | jump to tramp
@ -67,7 +67,7 @@ ASENTRY_NOPROFILE(trampoline)
|| %d7: boothowto
movl %d5,%sp@- | push last arg (esym)
movel LASTADDR,%sp@- | second arg (physsize)
peal %a5@ | first arg (firstpa)
pea %a5@ | first arg (firstpa)
cmpl %a4,%a5 | if (l == x)
beq L1 | copy not required