Index: Makefile =================================================================== RCS file: /e/cvsync/cvsync/src/sys/arch/sandpoint/stand/netboot/Attic/Makefile,v retrieving revision 1.1.2.1 diff -u -a -r1.1.2.1 Makefile --- Makefile 2 Jun 2007 08:44:36 -0000 1.1.2.1 +++ Makefile 17 Jun 2007 06:43:43 -0000 @@ -25,6 +25,7 @@ BINMODE= 444 RELOC= 1000000 +RELOC= 2000000 ENTRY= _start .BEGIN: Index: dev_net.c =================================================================== RCS file: /e/cvsync/cvsync/src/sys/arch/sandpoint/stand/netboot/Attic/dev_net.c,v retrieving revision 1.1.2.1 diff -u -a -r1.1.2.1 dev_net.c --- dev_net.c 2 Jun 2007 08:44:36 -0000 1.1.2.1 +++ dev_net.c 17 Jun 2007 06:53:29 -0000 @@ -13,6 +13,7 @@ #include #include +#include static int netdev_sock = -1; static int netdev_opens; @@ -42,8 +43,13 @@ } /* XXX always to use "netbsd" kernel filename */ - strcpy(bootfile, "/netbsd"); + strcpy(bootfile, LOADFILE); +#if 1 + printf(" ... net_open: filename: %s\n", bootfile); + printf(" ... net_open: server addr: %s\n", inet_ntoa(rootip)); + printf(" ... net_open: server path: %s\n", rootpath); +#endif if (nfs_mount(netdev_sock, rootip, rootpath) != 0) { error = errno; goto bad; Index: entry.S =================================================================== RCS file: /e/cvsync/cvsync/src/sys/arch/sandpoint/stand/netboot/Attic/entry.S,v retrieving revision 1.1.2.1 diff -u -a -r1.1.2.1 entry.S --- entry.S 2 Jun 2007 08:44:36 -0000 1.1.2.1 +++ entry.S 17 Jun 2007 06:53:04 -0000 @@ -1,7 +1,8 @@ -/* $NetBSD: entry.S,v 1.1.2.1 2007/06/02 08:44:36 nisimura Exp $ */ +/* $Id: 1,v 1.1.1.1 2008/03/12 10:49:18 makoto Exp $ */ #include #include +#include .text .globl _start @@ -34,6 +35,53 @@ sync isync #endif + /* we have three occasion + * (1) write this code to flash ( say 0xff00_0000 ) + * in this case the code will be copied to 0x0100_0000 by this code self + * (2) write this code to RAM ( say, 0x0110_0000 ) to test Flash version + * this will copy the self code to 0x0100_0000 + * (3) 2 steps boot, the name of this file is netbsd, and to be loaded + * on the address of this ELF code. + * The previous flash version of code will run on 0xff00_0000, that will + * copy to location (previous) RELOC defined in Makefile, say 0x0100_0000 + * and load this code to 0x0200_0000, in that case, copy won't be necessary. + * + * related variables and its value on each case: + * (1) (2) (3) + * (first step) ff00 0000 + * 0100 0000 + * flash ff00 0000 0110 0000 dont'care, no copy + * RELOC 0100 0000 0100 0000 0200 0000 + * + * (and loading) netbsd netbsd netbsd.1 + * + * define TWOSTEP in netboot.h file + */ + +#ifndef TWOSTEP + .set flash, 0xff010000 /* write to this address on flash */ + .set flash, 0x01100000 /* this will be used for test flash version on RAM */ + /* copy this code to RAM */ + lis 7, flash@h /* original place */ + ori 7, 7, flash@l + lis 8, _start@h /* location to execute */ + ori 8, 8, _start@l + + li 5, 16384 /* 64k bytes = 16k words */ + mtctr 5 +_ram_copy: + lwz 5, 0(7) + stw 5, 0(8) + addi 7, 7, 4 + addi 8, 8, 4 + bdnz _ram_copy # bc BO(16),BI(0)= blt, target +/* loop: b loop */ + lis 8, _ram_start@h + ori 8, 8, _ram_start@l + mtlr 8 + blr +# endif +_ram_start: /* make sure .bss gets zeroed. */ li 0,0 Index: main.c =================================================================== RCS file: /e/cvsync/cvsync/src/sys/arch/sandpoint/stand/netboot/Attic/main.c,v retrieving revision 1.1.2.3 diff -u -a -r1.1.2.3 main.c --- main.c 16 Jun 2007 16:17:53 -0000 1.1.2.3 +++ main.c 17 Jun 2007 14:55:30 -0000 @@ -476,7 +476,7 @@ } } } -#if 1 +#if 0 /* * //// IDE fixup -- case A //// * - "native PCI mode" (ide 0x09) Index: netboot.h =================================================================== RCS file: netboot.h diff -N netboot.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ netboot.h 17 Jun 2007 06:49:45 -0000 @@ -0,0 +1,14 @@ +#ifndef NETBOOT_H +#define NETBOOT_H +/* Change on this file to be effective, use make depend */ + +#undef TWOSTEP +#define TWOSTEP + +#ifdef TWOSTEP +#define LOADFILE "netbsd.1" +#else +#define LOADFILE "netbsd" +#endif + +#endif