1 1.1 nisimura /// notes about altboot /// 2 1.1 nisimura 3 1.11 phx $NetBSD: README.altboot,v 1.11 2012/04/26 19:59:36 phx Exp $ 4 1.1 nisimura 5 1.1 nisimura Altboot is a functional bridge to fill the gap between a NAS product 6 1.1 nisimura custom bootloader and the NetBSD kernel startup environment. Altboot 7 1.1 nisimura irons out and rectifies erroneously configured HW by product 8 1.3 phx bootloaders and prepares a sane runtime, better suited for booting 9 1.1 nisimura NetBSD kernels. 10 1.1 nisimura 11 1.1 nisimura - provides the foundation of a fast NetBSD porting cycle with functionalities 12 1.1 nisimura product bootloaders don't have. 13 1.1 nisimura - facilitates a flexible and clean NetBSD implementation tailoured 14 1.1 nisimura to target HW in detail, minimizing bumpy adjustments and hacks in 15 1.1 nisimura locore asm and machdeps in very early kernel startup stage. 16 1.1 nisimura - levels out differences among similar-but-not-the-same porting 17 1.1 nisimura targets to make it possible having common NetBSD kernels for them. 18 1.1 nisimura - builds and hands a bootinfo list to the NetBSD kernel. 19 1.1 nisimura 20 1.3 phx Altboot is known working on at least these models: 21 1.3 phx 22 1.7 phx - KuroBox or LinkStation with a popular U-Boot as replacement of 23 1.7 phx the vendor's proprietary one 24 1.1 nisimura 25 1.1 nisimura U-Boot 1.1.4 LiSt 2.1.0 (Sep 21 2006 - 00:22:56) LinkStation / KuroBox 26 1.1 nisimura 27 1.1 nisimura - Synology 101g+ with vendor custom PPCboot 28 1.1 nisimura 29 1.1 nisimura PPCBoot 2.0.0 (Mar 1 2005 - 15:31:41) 30 1.1 nisimura 31 1.6 phx - Synology 106j, 207, 407e with vendor custom PPCboot 32 1.5 phx 33 1.5 phx PPCBoot 2.0.0 (Jan 30 2007 - xx:xx:xx) 34 1.5 phx 35 1.2 phx - D-Link DSM-G600 with heavily restricted vendor custom U-Boot 36 1.2 phx 37 1.2 phx U-Boot 0.2.0 (May 26 2005 - 19:38:32) 38 1.2 phx 39 1.3 phx - QNAP TS-101 (V200) with vendor custom U-Boot 40 1.3 phx 41 1.3 phx U-Boot 1.1.2 (Aug 28 2005 - 13:37:25) QNAP System, Inc. 42 1.3 phx 43 1.7 phx - Iomega StorCenter with vendor custom U-Boot 44 1.7 phx 45 1.7 phx U-Boot 1.0.0 (Sep 2 2005 - 14:49:11) 46 1.7 phx 47 1.9 phx - Allnet 6250 and compatible with restricted vendor custom PPCboot 48 1.8 phx 49 1.8 phx PPCBoot 2.0.0-A9 (Feb 13 2006 - 14:56:11) 50 1.8 phx 51 1.10 nisimura - KURO-BOX/T4 vendor custom U-Boot 52 1.10 nisimura 53 1.10 nisimura U-Boot 2009.06-BUFFALO-svn1376 (Jul 11 2009 - 04:11:01) KURO-NAS/T4 54 1.10 nisimura 55 1.1 nisimura The standard use of altboot is to invoke it with a short script from 56 1.3 phx U-Boot/PPCboot, where the altboot.bin image is stored in an unoccupied 128KB 57 1.1 nisimura section of the target's HW NOR flash. Combined with standard 58 1.1 nisimura U-Boot/PPCboot functions, it is possible to boot a NetBSD kernel off 59 1.1 nisimura it right after power-on, without the help of manual intervention. Note 60 1.1 nisimura that the original U-Boot/PPCboot still remains useful and altboot works 61 1.1 nisimura as a functional extension for them. 62 1.1 nisimura 63 1.3 phx In case the firmware was crippled by the vendor so that it only boots 64 1.11 phx Linux U-Boot images (D-Link, Synology 2007), you can still use altboot by 65 1.11 phx overwriting the Linux kernel with altboot.img. 66 1.3 phx 67 1.7 phx Altboot passes the following bootinfo records to the NetBSD/sandpoint 68 1.11 phx kernel: 69 1.1 nisimura - processor clock tick value driving MPC8241/8245. 70 1.1 nisimura - serial console selection. 71 1.1 nisimura - booted kernel filename and which device it was fetched from. 72 1.1 nisimura - Ethernet MAC address, if target HW lacks SEEPROM to store a unit unique 73 1.1 nisimura value. 74 1.1 nisimura - product family indication. 75 1.1 nisimura - preloaded kernel module names (under development). 76 1.1 nisimura 77 1.4 phx When no arguments are given, altboot defaults to boot a kernel called 78 1.4 phx "netbsd" from the root partition of the first disk in multiuser mode. 79 1.4 phx 80 1.4 phx Boot arguments may be passed in three ways: 81 1.4 phx - On the command line, directly after the "go 0x1000000" command. 82 1.4 phx - From the U-Boot "bootargs" environment variable, when started by "bootm". 83 1.4 phx - By entering the interactive mode. 84 1.4 phx 85 1.4 phx The following boot arguments are recognized: 86 1.4 phx - multi boot into multiuser 87 1.4 phx - auto boot into multiuser 88 1.4 phx - single boot into singleuser 89 1.4 phx - ask ask for boot device 90 1.4 phx - ddb drop into the kernel debugger 91 1.4 phx - userconf change configured devices 92 1.4 phx 93 1.4 phx The following boot flags are recognized: 94 1.4 phx - norm boot normally 95 1.4 phx - quiet boot quietly 96 1.4 phx - verb boot verbosely 97 1.4 phx - silent boot silently 98 1.4 phx - debug boot with debug output 99 1.4 phx 100 1.4 phx Additionally the special argument "altboot" is recognized, which replaces 101 1.4 phx the actually running altboot program with the loaded binary file and 102 1.4 phx restarts itself. Mainly useful for altboot testing. 103 1.4 phx 104 1.4 phx Multiple arguments may be specified at once, although not all combinations 105 1.4 phx make sense. The format of an altboot command line is: 106 1.4 phx 107 1.11 phx [[<bootargs> ...] <devicename>:[<bootfile>] ...] 108 1.11 phx 109 1.11 phx Multiple boot devices and/or paths may be specified, which are booted one 110 1.11 phx after another until success. When no boot device is specified altboot tries 111 1.11 phx to boot from all disk devices with a valid NetBSD disklabel, starting with 112 1.11 phx unit 0. 113 1.4 phx 114 1.4 phx The following device names are supported: 115 1.4 phx - tftp boot from TFTP (address retrieved by DHCP) 116 1.4 phx - nfs boot from NFS (address retrieved by DHCP) 117 1.4 phx - wd[N[P]] boot from disk N, partition P, defaults to wd0a 118 1.4 phx - mem boot from memory 119 1.4 phx 120 1.4 phx For tftp and nfs the bootfile is determined by DHCP, when missing. 121 1.4 phx For wd it defaults to "netbsd". 122 1.4 phx For mem the bootfile is actually a hexadecimal address to load from and 123 1.4 phx is mandatory. 124 1.4 phx 125 1.1 nisimura ### ### ### 126