Debugging in progress.
-/* $OpenBSD: Locore.c,v 1.3 1997/02/06 23:44:54 rahnds Exp $ */
+/* $OpenBSD: Locore.c,v 1.4 1997/02/18 22:36:40 rahnds Exp $ */
/* $NetBSD: Locore.c,v 1.1 1996/09/30 16:34:58 ws Exp $ */
/*
static void
setup();
+void _start();
+
#define __dead
+void const *__start[3] = { &_start, 0, 0};
+
__dead void
_start(vpd, res, openfirm, arg, argl)
void *vpd;
exit();
}
+
__dead void
_rtt()
{
-# $OpenBSD: Makefile,v 1.4 1997/02/06 23:44:55 rahnds Exp $
+# $OpenBSD: Makefile,v 1.5 1997/02/18 22:36:40 rahnds Exp $
# $NetBSD: Makefile,v 1.1 1996/09/30 16:34:59 ws Exp $
-SUBDIR= boot
+SUBDIR= boot boot.mac
SAREL=
KERNREL=
-# $OpenBSD: Makefile.inc,v 1.2 1996/12/28 06:31:09 rahnds Exp $
+# $OpenBSD: Makefile.inc,v 1.3 1997/02/18 22:36:40 rahnds Exp $
# $NetBSD: Makefile.inc,v 1.1 1996/09/30 16:34:59 ws Exp $
.if !defined(__stand_makefile_inc)
DEFS+= -DSTANDALONE -DRELOC=0x$(RELOC) -DLOADADDR=0x$(LOADADDR) \
-DFIREPOWERBUGS
CFLAGS+= $(INCLUDES) $(DEFS) $(EXTRACFLAGS)
-LDFLAGS= -X -N -Ttext $(RELOC) -e $(ENTRY)
+LDFLAGS?= -X -N -Ttext $(RELOC) -e $(ENTRY)
cleandir:
rm -rf lib machine
--- /dev/null
+# $OpenBSD: Makefile,v 1.1 1997/02/18 22:36:41 rahnds Exp $
+# $NetBSD: Makefile,v 1.1 1996/09/30 16:35:05 ws Exp $
+
+R= ..
+.PATH: $(.CURDIR)/$(R)
+RELOC= 4000
+ENTRY= __start
+LOADADDR= 4000
+PROG= boot.mac
+SRCS= Locore.c boot.c ofdev.c net.c netif_of.c alloc.c
+#CFLAGS+= -DDEBUG -DNETIF_DEBUG
+CFLAGS+= -DEXEC_ELF
+NOMAN=
+STRIP=
+MAKEELF= makeelf
+BINDIR= /usr/mdec
+OBJCOPY?= objcopy
+OBJCOPY_ARGS= -O aixcoff-rs6000 -R .stab -R .stabstr -R .comment
+LDFLAGS= -X -Ttext $(RELOC) -e $(ENTRY) -T ${.CURDIR}/ld.script
+
+LIBS!= cd $(.CURDIR)/$(R); $(MAKE) libdep
+
+$(PROG): $(OBJS) $(LIBS) hack-coff
+ $(LD) $(LDFLAGS) $(OBJS) $(LIBS) -o ${.TARGET}
+ ${OBJCOPY} ${OBJCOPY_ARGS} ${.TARGET}
+ hack-coff ${.TARGET}
+# ${MAKEELF} $(REAL_VIRT) a.out $(.TARGET)
+
+hack-coff: hack-coff.c
+ ${HOSTCC} -o hack-coff ${.CURDIR}/hack-coff.c
+
+.include <bsd.prog.mk>
--- /dev/null
+#include <stdio.h>
+
+char magic[2] = { 1, 0xb };
+char snos[12] = { 0, 1, 0, 1, 0, 2, 0, 0, 0, 0, 0, 3 };
+
+main(int ac, char **av)
+{
+ int fd;
+
+ if (ac != 2) {
+ fprintf(stderr, "Usage: hack-coff coff-file\n");
+ exit(1);
+ }
+ if ((fd = open(av[1], 2)) == -1) {
+ perror(av[2]);
+ exit(1);
+ }
+ if (lseek(fd, (long) 0x14, 0) == -1
+ || write(fd, magic, sizeof(magic)) != sizeof(magic)
+ || lseek(fd, (long) 0x34, 0) == -1
+ || write(fd, snos, sizeof(snos)) != sizeof(snos)) {
+ fprintf(stderr, "%s: write error\n", av[1]);
+ exit(1);
+ }
+ close(fd);
+ exit(0);
+}
--- /dev/null
+OUTPUT_ARCH(powerpc)
+SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
+/* Do we need any of these for elf?
+ __DYNAMIC = 0; */
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .hash : { *(.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .rel.text : { *(.rel.text) }
+ .rela.text : { *(.rela.text) }
+ .rel.data : { *(.rel.data) }
+ .rela.data : { *(.rela.data) }
+ .rel.rodata : { *(.rel.rodata) }
+ .rela.rodata : { *(.rela.rodata) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.bss : { *(.rel.bss) }
+ .rela.bss : { *(.rela.bss) }
+ .rel.plt : { *(.rel.plt) }
+ .rela.plt : { *(.rela.plt) }
+ .init : { *(.init) } =0
+ .plt : { *(.plt) }
+ .text :
+ {
+ *(.text)
+ *(.rodata)
+ *(.rodata1)
+ *(.got1)
+ }
+ .fini : { *(.fini) } =0
+ .ctors : { *(.ctors) }
+ .dtors : { *(.dtors) }
+ _etext = .;
+ PROVIDE (etext = .);
+ /* Read-write section, merged into data segment: */
+ . = (. + 0x0FFF) & 0xFFFFF000;
+ .data :
+ {
+ *(.data)
+ *(.data1)
+ *(.sdata)
+ *(.sdata2)
+ *(.got.plt) *(.got)
+ *(.dynamic)
+ CONSTRUCTORS
+ }
+ _edata = .;
+ PROVIDE (edata = .);
+ __bss_start = .;
+ .bss :
+ {
+ *(.sbss) *(.scommon)
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ }
+ _end = . ;
+ PROVIDE (end = .);
+}
+