Annotation of wikisrc/ports/sandpoint/instsynology.mdwn, revision 1.7

1.2       jdc         1: <a name="introduction"></a>
1.1       mspo        2: Introduction
                      3: ============
                      4: 
                      5: This document describes in depth how to prepare your Synology
                      6: Diskstation for installing OS/sandpoint. The following models are
                      7: supported:
                      8: 
                      9: <table>
                     10: <tbody>
                     11: <tr class="odd">
1.7     ! jdc        12: <td align="left"><strong>Model</strong></td>
        !            13: <td align="left"><strong>CPU</strong></td>
        !            14: <td align="left"><strong>Clock</strong></td>
        !            15: <td align="left"><strong>Disk</strong></td>
        !            16: <td align="left"><strong>RAM</strong></td>
1.1       mspo       17: </tr>
                     18: <tr class="even">
                     19: <td align="left">DS-101g+</td>
                     20: <td align="left">MPC8241</td>
                     21: <td align="left">266MHz</td>
                     22: <td align="left">SATA</td>
                     23: <td align="left">64MB</td>
                     24: </tr>
                     25: <tr class="odd">
                     26: <td align="left">DS-106</td>
                     27: <td align="left">MPC8241</td>
                     28: <td align="left">266MHz</td>
                     29: <td align="left">SATA</td>
                     30: <td align="left">64MB</td>
                     31: </tr>
                     32: <tr class="even">
                     33: <td align="left">DS-106e</td>
                     34: <td align="left">MPC8241</td>
                     35: <td align="left">266MHz</td>
                     36: <td align="left">SATA</td>
                     37: <td align="left">32MB</td>
                     38: </tr>
                     39: <tr class="odd">
                     40: <td align="left">DS-106j</td>
                     41: <td align="left">MPC8241</td>
                     42: <td align="left">200MHz</td>
                     43: <td align="left">PATA</td>
                     44: <td align="left">32MB</td>
                     45: </tr>
                     46: <tr class="even">
                     47: <td align="left">DS-106x</td>
                     48: <td align="left">MPC8241</td>
                     49: <td align="left">266MHz</td>
                     50: <td align="left">SATA</td>
                     51: <td align="left">128MB</td>
                     52: </tr>
                     53: <tr class="odd">
                     54: <td align="left">CS/RS-406</td>
                     55: <td align="left">MPC8245</td>
                     56: <td align="left">400MHz</td>
                     57: <td align="left">SATA</td>
                     58: <td align="left">128MB</td>
                     59: </tr>
                     60: <tr class="even">
                     61: <td align="left">CS-406e</td>
                     62: <td align="left">MPC8241</td>
                     63: <td align="left">266MHz</td>
                     64: <td align="left">SATA</td>
                     65: <td align="left">64MB</td>
                     66: </tr>
                     67: <tr class="odd">
                     68: <td align="left">DS-107</td>
                     69: <td align="left">MPC8241</td>
                     70: <td align="left">266MHz</td>
                     71: <td align="left">SATA</td>
                     72: <td align="left">64MB</td>
                     73: </tr>
                     74: <tr class="even">
                     75: <td align="left">DS-107e</td>
                     76: <td align="left">MPC8241</td>
                     77: <td align="left">266MHz</td>
                     78: <td align="left">SATA</td>
                     79: <td align="left">32MB</td>
                     80: </tr>
                     81: <tr class="odd">
                     82: <td align="left">DS-207</td>
                     83: <td align="left">MPC8241</td>
                     84: <td align="left">266MHz</td>
                     85: <td align="left">SATA</td>
                     86: <td align="left">64/128MB</td>
                     87: </tr>
                     88: <tr class="even">
                     89: <td align="left">CS-407e</td>
                     90: <td align="left">MPC8241</td>
                     91: <td align="left">266MHz</td>
                     92: <td align="left">SATA</td>
                     93: <td align="left">64MB</td>
                     94: </tr>
                     95: <tr class="odd">
                     96: <td align="left">DS-108j</td>
                     97: <td align="left">MPC8241</td>
                     98: <td align="left">200MHz</td>
                     99: <td align="left">SATA</td>
                    100: <td align="left">32MB</td>
                    101: </tr>
                    102: <tr class="even">
                    103: <td align="left">DS-109j</td>
                    104: <td align="left">MPC8241</td>
                    105: <td align="left">266MHz</td>
                    106: <td align="left">SATA</td>
                    107: <td align="left">32MB</td>
                    108: </tr>
                    109: <tr class="odd">
                    110: <td align="left">DS-209j</td>
                    111: <td align="left">MPC8241</td>
                    112: <td align="left">266MHz</td>
                    113: <td align="left">SATA</td>
                    114: <td align="left">64MB</td>
                    115: </tr>
                    116: </tbody>
                    117: </table>
                    118: 
                    119: To install OS/sandpoint you will have to open the case, to get access to
                    120: the serial console, and connect a serial converter from TTL to RS232
                    121: signal levels.
                    122: 
1.2       jdc       123: <a name="serial_access"></a>
1.1       mspo      124: Accessing the serial interface
                    125: ==============================
                    126: 
1.2       jdc       127: <a name="locate_header"></a>
1.1       mspo      128: Locate the serial header
                    129: ------------------------
                    130: 
                    131: Open the case and search for a 6-pin header, which is labeled `COM1` or
                    132: `JP2`. The left photo shows a DS-101g+ and the right photo a DS-106j.
                    133: Note that the serial header is rotated by 180 degrees between these two
                    134: models:
                    135: 
                    136: <table>
                    137: <tbody>
                    138: <tr class="odd">
1.3       jdc       139: <td align="left"><img src="//www.netbsd.org/images/ports/sandpoint/syno_ser_header.jpg" alt=" Serial header in a DS-101g+ " /></td>
                    140: <td align="left"><img src="//www.netbsd.org/images/ports/sandpoint/syno_ser_header106.jpg" alt=" Serial header in a DS-106j " /></td>
1.1       mspo      141: </tr>
                    142: </tbody>
                    143: </table>
                    144: 
                    145: **Serial header pin assignments:**
                    146: 
                    147: <table>
                    148: <tbody>
                    149: <tr class="odd">
                    150: <td align="left"><table>
                    151: <tbody>
                    152: <tr class="odd">
1.7     ! jdc       153: <td align="left"><strong>Pin number</strong></td>
        !           154: <td align="left"><strong>Function</strong></td>
1.1       mspo      155: </tr>
                    156: <tr class="even">
                    157: <td align="left">1</td>
                    158: <td align="left">3.3V</td>
                    159: </tr>
                    160: <tr class="odd">
                    161: <td align="left">2</td>
                    162: <td align="left">GND</td>
                    163: </tr>
                    164: <tr class="even">
                    165: <td align="left">4</td>
                    166: <td align="left">TX</td>
                    167: </tr>
                    168: <tr class="odd">
                    169: <td align="left">6</td>
                    170: <td align="left">RX</td>
                    171: </tr>
                    172: </tbody>
                    173: </table></td>
1.3       jdc       174: <td align="left"><img src="//www.netbsd.org/images/ports/sandpoint/syno_ser_pins.jpg" alt="Header pin assignments" /></td>
1.1       mspo      175: </tr>
                    176: </tbody>
                    177: </table>
                    178: 
                    179: Watch out for the thick, white angle, which marks pin 1.
                    180: 
1.2       jdc       181: <a name="serial_cable"></a>
1.1       mspo      182: Connect a serial cable
                    183: ----------------------
                    184: 
                    185: The serial port on Synology NAS boxes is using 3.3V TTL levels, which
                    186: have to be converted into regular RS232 levels by a level shifter
                    187: circuit. If you are not anxious using a soldering iron you find detailed
                    188: instructions how to build such a converter here:
                    189: 
                    190: -   Serial adapter for 3.3V TTL
                    191: 
1.3       jdc       192: <img src="//www.netbsd.org/images/ports/sandpoint/syno_ser_adapter.jpg" alt="Serial adapter installed" /></td>
1.2       jdc       193: 
1.1       mspo      194: This picture shows the installed serial adapter. When the installation
                    195: is completed, and the Diskstation is available over the network, you can
                    196: remove the serial adapter again. You will only need it in emergency
                    197: situations.
                    198: 
                    199: Another option is to buy such a converter. There are solutions for a
                    200: standard RS232 interface and for an USB interface. Look out for:
                    201: 
                    202: -   RS232 level shifter / breakout board (MAX3232 based)
                    203: -   USB to TLL serial level shifter / breakout board (FT232 based)
                    204: 
1.2       jdc       205: <a name="install"></a>
1.1       mspo      206: First installation
                    207: ==================
                    208: 
1.2       jdc       209: <a name="firmware_access"></a>
1.1       mspo      210: Accessing the Firmware
                    211: ----------------------
                    212: 
                    213: Provided the serial converter is installed and working correctly you
                    214: should be able to connect to the firmware's serial console. Synology is
                    215: using [PPCBoot](http://ppcboot.sourceforge.net/). Most models have
                    216: version `2.0.0` installed, but the newer ones have network support and
                    217: limited functionality ([read below](#post_install)).
                    218: 
                    219: Now you can connect with any terminal program to the Diskstation's
                    220: serial console. The easiest approach may be to use OS's `tip(1)` command
                    221: to make a direct console connection at 115200bps.
                    222: 
                    223:     # tip -115200 console
                    224: 
                    225: Note that when using a serial connection via USB you may have to make an
                    226: entry for `/dev/ttyU0` in `/etc/remote`. Immediately after switching
                    227: your Diskstation on it will beep shortly, and you should see the
                    228: following messages. Type CTRL-C within one second to avoid autobooting.
                    229: In old firmwares (2005) you have three seconds and may press any key.
                    230: 
                    231:     PPCBoot 2.0.0 (Jan 30 2007 - 14:27:41)
                    232: 
                    233:     CPU:   MPC8245 Revision 1.4 at 199.999 MHz: 16 kB I-Cache 16 kB D-Cache
                    234:     I2C:   ready
                    235:     DRAM:  DRAM BANK = 1
                    236:     MAX_DRAM_SIZE = 2000000
                    237:     MCCR1 = 75a80000
                    238:     MCCR4 = 35363331
                    239:     MSAR1 = 0
                    240:     EMSAR1 = 0
                    241:     MEAR1 = 1f
                    242:     EMEAR1 = 0
                    243:     MSAR2 = 0
                    244:     EMSAR2 = 0
                    245:     MEAR2 = 0
                    246:     EMEAR2 = 0
                    247:     MBER = 32000001
                    248:     PICR1 = 141b98
                    249:     PICR2 = 40604
                    250:     32 MB
                    251:     addr_sp=1f2ff78, id=1f2ff98, addr=1fc0000
                    252:     FLASH: flash id = 49
                    253:     vendor = 1, flash id = 49 (flash_id:49)
                    254:      2 MB
                    255:     *** Warning - bad CRC, using default environment
                    256: 
                    257:     In:    serial
                    258:     Out:   serial
                    259:     Err:   serial
                    260:     Net:   SK98#0
                    261:     Press Ctrl+C to abort autoboot in 1 second
                    262: 
1.2       jdc       263: <a name="altboot"></a>
1.1       mspo      264: altboot
                    265: -------
                    266: 
                    267: The `altboot(8)` utility functions as a bridge between the Synology
                    268: firmware and the OS kernel startup environment. NAS firmware often
                    269: provides no means to boot a kernel from disk or from the network and
                    270: doesn't initialize all hardware correctly. We will also use it to pass a
                    271: bootinfo list to the kernel.
                    272: 
                    273: The `altboot` boot loader has to be loaded into RAM at `0x1000000` and
                    274: started using PPCBoot / U-Boot. Usually there are three ways to invoke
                    275: it:
                    276: 
                    277: -   loadb
                    278:     to load a binary file via serial line in
                    279:     kermit
                    280:     mode
                    281: -   tftpboot
                    282:     to load a binary file over the network with TFTP protocol
                    283: -   start it from the flash memory
                    284: 
                    285: The last option is prefered once the installation is completed, but
                    286: obviously it is not possible for the first time boot. Newer firmwares
                    287: (2007) support the use of the network interface by setting the `ipaddr`
                    288: and `serverip` environment variables with `setenv`. Once you have set up
                    289: TFTP and DHCP ([read below](#altboot_install)) you can download
                    290: `altboot` like this:
                    291: 
1.6       jdc       292: <pre>
                    293: _MPC824X &gt; <strong>setenv ipaddr=192.168.0.106</strong>
                    294: _MPC824X &gt; <strong>setenv serverip=192.168.0.5</strong>
                    295: _MPC824X &gt; <strong>setenv netmask=255.255.255.0</strong>
                    296: _MPC824X &gt; <strong>tftpboot 0x1000000 altboot.bin</strong>
                    297: ARP broadcast 1
                    298: TFTP from server 192.168.0.5; our IP address is 192.168.0.106
                    299: Filename 'altboot.bin'.
                    300: Load address: 0x1000000
                    301: Loading: ###############
                    302: done
                    303: Bytes transferred = 74732 (123ec hex)
                    304: </pre>
1.1       mspo      305: 
                    306: The old firmware (2005) doesn't activate the network at all, so we have
                    307: to download `altboot` into RAM with Kermit protocol over the serial
                    308: line.
                    309: 
                    310: Install `kermit(1)` from `pkgsrc(7)` or compile and install it yourself.
                    311: To set up the file transfer you have to provide the following commands
                    312: to `kermit`:
                    313: 
                    314:     set line /dev/tty00
                    315:     set speed 115200
                    316:     set carrier-watch off
                    317:     set flow-control none
                    318:     robust
                    319:     set file type bin
                    320: 
                    321: For convenience you can write them into a file which you can pass as an
                    322: argument to `kermit`.
                    323: 
                    324: Load `altboot` into memory using Kermit protocol. The binary is
                    325: relocated at `0x1000000`, so type:
                    326: 
1.6       jdc       327: <pre>
                    328: _MPC824X &gt; <strong>loadb 1000000</strong>
                    329: ## Ready for binary (kermit) download ...
                    330: </pre>
1.1       mspo      331: 
                    332: Now quit your terminal program and launch `kermit cmdfile`. When you are
                    333: already running `kermit`, enter the command mode by typing `CTRL-\`
                    334: followed by `C`. Then send `altboot.bin`. Reconnect when the transfer is
                    335: finished.
                    336: 
                    337:     C-Kermit 8.0.211, 10 Apr 2004, for NetBSD 1.6
                    338:      Copyright (C) 1985, 2004,
                    339:       Trustees of Columbia University in the City of New York.
                    340:     Type ? or HELP for help.
                    341:     (/tmp/) C-Kermit>
                    342: 
1.2       jdc       343: <a name="altboot_install"></a>
1.1       mspo      344: Boot the INSTALL kernel with altboot
                    345: ------------------------------------
                    346: 
                    347: Now you can use `altboot` to launch the `netbsd-INSTALL` kernel for
                    348: installing OS. You may choose to load it with TFTP or from NFS. For TFTP
                    349: you have to enable `tftpd(8)` in `/etc/inetd.conf`, and for NFS there is
                    350: a documentation at [The Network File
                    351: System](http://www.NetBSD.org/docs/guide/en/chap-net-services.html#chap-net-services-nfs).
                    352: But in both cases you have to set up a DHCP server, which is explained
                    353: in the [DHCP Howto](http://www.NetBSD.org/docs/network/dhcp.html). An
                    354: appropriate `dhcpd.conf` entry could look like this:
                    355: 
                    356:             host ds101g {
                    357:                     hardware ethernet 00:11:32:xx:xx:xx;
                    358:                     fixed-address 192.168.0.101;
                    359:                     next-server 192.168.0.1;
                    360:                     option root-path "/export/ds101g/root";
                    361:             }
                    362: 
                    363: The `root-path` option is only needed when using NFS and should match
                    364: your exported NFS directory. Uncompress `netbsd-INSTALL.gz` from the
                    365: OS/sandpoint distribution and copy it into the NFS or TFTP directory.
                    366: Then start the DHCP, NFS or TFTP server and boot the installation kernel
                    367: from the firmware either with
                    368: 
1.6       jdc       369: <pre>
                    370: _MPC824X &gt; <strong>go 1000000 tftp:netbsd-INSTALL</strong>
                    371: </pre>
1.1       mspo      372: 
                    373: or from NFS:
                    374: 
1.6       jdc       375: <pre>
                    376: _MPC824X &gt; <strong>go 1000000 nfs:netbsd-INSTALL</strong>
                    377: </pre>
1.1       mspo      378: 
                    379: Our bootloader configures the hardware, determines the IP address, loads
                    380: the kernel via network and launches it:
                    381: 
                    382:     ## Starting application at 0x01000000 ...
                    383: 
                    384:     >> NetBSD/sandpoint altboot, revision 1.5 (Fri Feb 18 23:21:15 CET 2011)
                    385:     >> Synology DS, cpu 265 MHz, bus 132 MHz, 64MB SDRAM
                    386:     channel 0 present
                    387:     wd0: <SAMSUNG HD502HI> DMA LBA LBA48 476940 MB
                    388:     wd0: no disklabel
                    389:     MAC address 00:11:32:xx:xx:xx
                    390:     100Mbps-FDX
                    391:     loading "netbsd-INSTALL" 5089380+110916=0x4f5d6c
                    392:     entry=0x00090000, ssym=0x005859a8, esym=0x00585d6c
                    393:     ksyms: Symbol table not found
                    394:     ksyms: String table not found
                    395:     ksyms: Perhaps the kernel is stripped?
                    396:     Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
                    397:         2006, 2007, 2008, 2009, 2010, 2011
                    398:         The NetBSD Foundation, Inc.  All rights reserved.
                    399:     Copyright (c) 1982, 1986, 1989, 1991, 1993
                    400:         The Regents of the University of California.  All rights reserved.
                    401: 
                    402:     NetBSD 5.99.43 (INSTALL) #5: Mon Jan 10 10:58:12 CET 2011
                    403:         frank@compaq.owl.de:/home/frank/netbsd/current/src/sys/arch/sandpoint/compile/obj/INSTALL
                    404:     total memory = 65536 KB
                    405:     avail memory = 58028 KB
                    406:     OpenPIC Version 1.2: Supports 1 CPUs and 26 interrupt sources.
                    407:     mainbus0 (root)
                    408:     cpu0 at mainbus0: 8245 (Revision 0.4), ID 0 (primary)
                    409:     cpu0: HID0 0x90c000<DOZE,DPM,ICE,DCE>, powersave: 1
                    410:     eumb0 at mainbus0
                    411:     com0 at eumb0 unit 0: ns16550a, working fifo
                    412:     com0: console
                    413:     ociic0 at eumb0
                    414:     iic0 at ociic0: I2C bus
                    415:     rs5c372rtc0 at iic0 addr 0x32: RICOH RS5C372[AB] Real-time Clock
                    416:     satmgr0 at eumb0 unit 1: button manager (synology)
                    417:     pci0 at mainbus0 bus 0
                    418:     pchb0 at pci0 dev 0 function 0
                    419:     pchb0: vendor 0x1057 product 0x0006 (rev. 0x14)
                    420:     satalink0 at pci0 dev 13 function 0: Silicon Image SATALink 3512 (rev. 0x01)
                    421:     satalink0: using irq 16 for native-PCI interrupt
                    422:     atabus0 at satalink0 channel 0
                    423:     atabus1 at satalink0 channel 1
                    424:     ohci0 at pci0 dev 14 function 0: vendor 0x1033 product 0x0035 (rev. 0x43)
                    425:     ohci0: interrupting at irq 17
                    426:     ohci0: OHCI version 1.0
                    427:     usb0 at ohci0: USB revision 1.0
                    428:     ohci1 at pci0 dev 14 function 1: vendor 0x1033 product 0x0035 (rev. 0x43)
                    429:     ohci1: interrupting at irq 17
                    430:     ohci1: OHCI version 1.0
                    431:     usb1 at ohci1: USB revision 1.0
                    432:     ehci0 at pci0 dev 14 function 2: vendor 0x1033 product 0x00e0 (rev. 0x04)
                    433:     ehci0: interrupting at irq 17
                    434:     ehci0: companion controllers, 3 ports each: ohci0 ohci1
                    435:     usb2 at ehci0: USB revision 2.0
                    436:     skc0 at pci0 dev 15 function 0: irq 18
                    437:     skc0: Marvell Yukon Lite Gigabit Ethernet rev. (0x9)
                    438:     sk0 at skc0 port A: Ethernet address 00:11:32:xx:xx:xx
                    439:     makphy0 at sk0 phy 0: Marvell 88E1011 Gigabit PHY, rev. 5
                    440:     makphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto
                    441:     biomask 8000038 netmask 8000038 ttymask 8000038
                    442:     satalink0: port 0: device present, speed: 1.5Gb/s
                    443:     wd0 at atabus0 drive 0: <SAMSUNG HD502HI>
                    444:     wd0: 465 GB, 969021 cyl, 16 head, 63 sec, 512 bytes/sect x 976773168 sectors
                    445:     uhub0 at usb0: vendor 0x1033 OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
                    446:     uhub1 at usb1: vendor 0x1033 OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
                    447:     uhub2 at usb2: vendor 0x1033 EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
                    448:     boot device: sk0
                    449:     root on md0a dumps on md0b
                    450:     root file system type: ffs
                    451:     erase ^H, werase ^W, kill ^U, intr ^C, status ^T
                    452:     Terminal type? [vt100]
                    453: 
                    454: Just follow the usual procedure to install a OS system.
                    455: 
1.3       jdc       456: <img src="//www.netbsd.org/images/ports/sandpoint/install_window.jpg" alt="Sandpoint installation window" /></td>
1.2       jdc       457: 
                    458: <a name="post_install"></a>
1.1       mspo      459: Post installation steps
                    460: =======================
                    461: 
                    462: After a successful installation you want to make the system boot
                    463: standalone when switched on, without the need for a serial console. So
                    464: you have to find a way to make your firmware automatically boot
                    465: `altboot` and the kernel.
                    466: 
                    467: Note that newer Synology models, especially those from 2007, may have
                    468: the `saveenv` command disabled. If you have one of those skip forward to
                    469: [this](#new_firmware) section.
                    470: 
                    471: Old firmware (2005)
                    472: -------------------
                    473: 
                    474: When you have an old firmware you just have to modify the `bootcmd`
                    475: setting in PPCBoot's environment and write the `altboot.bin` binary to
                    476: any free location of the Flash ROM.
                    477: 
                    478: To find a suitable place on the flash you can use the `flinfo` command
                    479: and look out for empty sectors `(E)`. On my Synology box I have chosen
                    480: `0xff400000`. Replace that in all the following commands if you have
                    481: chosen a different address.
                    482: 
                    483: Load `altboot.bin` into memory at `0x1000000` again, as explained above.
                    484: Then execute the following commands to write it to Flash ROM:
                    485: 
1.6       jdc       486: <pre>
                    487: _MPC824X &gt; <strong>protect off all</strong>
                    488: Un-Protect Flash Bank # 1
                    489: _MPC824X &gt; <strong>erase ff400000 ff41ffff</strong>
                    490: Erase Flash from 0xff400000 to 0xff41ffff 
                    491: . done
                    492: Erased 1 sectors
                    493: _MPC824X &gt; <strong>cp.b 1000000 ff400000 18000</strong>
                    494: Copy to Flash... done
                    495: _MPC824X &gt; <strong>protect on all</strong>
                    496: Protect Flash Bank # 1
                    497: </pre>
1.1       mspo      498: 
                    499: Finally adapt the `bootcmd` environment string to auto-boot `altboot`
                    500: and start the `netbsd` kernel (which is the default name) from `wd0` on
                    501: each reboot:
                    502: 
1.6       jdc       503: <pre>
                    504: _MPC824X &gt; <strong>setenv bootcmd cp.b ff400000 1000000 18000\; go 1000000 wd0:</strong>
                    505: _MPC824X &gt; <strong>saveenv</strong>
                    506: Saving Environment to Flash...
                    507: unProtect FFF40000 ... FFF5FFFF
                    508: Un-Protected 1 sectors
                    509: Erasing Flash...
                    510: . done
                    511: Erased 1 sectors
                    512: Writing to Flash... done
                    513: Protected 1 sectors
                    514: </pre>
1.1       mspo      515: 
                    516: The `\` is important for `setenv` not to misinterpret the `;` as the end
                    517: of the command.
                    518: 
                    519: New firmware (2007)
                    520: -------------------
                    521: 
                    522: Without a working `saveenv` command the only way to make your system
                    523: automatically boot OS is to replace the Linux kernel on flash by
                    524: `altboot.img`, which is our bootloader in PPCBoot image format, faking a
                    525: Linux kernel.
                    526: 
                    527: When viewing the environment variables with `printenv` you can see that
                    528: the `bootcmd` is calling `bootm` to load the Linux kernel. The first
                    529: address is the location which we have to overwrite with `altboot.img`.
                    530: Here it is `0xffc00000`, which you have to replace in all the following
                    531: commands, in case your `bootcmd` differs.
                    532: 
                    533:     bootcmd=bootm FFC00000 FFE00000
                    534: 
                    535: Load `altboot.img` into memory, for example at `0x1000000` again, as
                    536: explained [above](#altboot). You might want to backup the Linux kernel
                    537: image first. Then execute the following commands to overwrite it with
                    538: `altboot.img`:
                    539: 
1.6       jdc       540: <pre>
                    541: _MPC824X &gt; <strong>protect off all</strong>
                    542: Un-Protect Flash Bank # 1
                    543: _MPC824X &gt; <strong>erase ffc00000 ffc1ffff</strong>
                    544: Erase Flash from 0xffc00000 to 0xffc1ffff 
                    545: . done
                    546: Erased 1 sectors
                    547: _MPC824X &gt; <strong>cp.b 1000000 ffc00000 18000</strong>
                    548: Copy to Flash... done
                    549: _MPC824X &gt; <strong>protect on all</strong>
                    550: Protect Flash Bank # 1
                    551: </pre>
1.1       mspo      552: 
                    553: Optionally you may think about replacing the Linux RAM disk image at the
                    554: second address (`0xffe00000` in the example above) by an empty PPCBoot
                    555: image, like [this](dummy.img.gz) one (do not forget to uncompress it
                    556: with `gunzip(1)`). Or use `mkubootimage` to make your own dummy. Write
                    557: it to flash as shown above. This will speed up the boot process, but is
                    558: not really required.
                    559: 
                    560: Have fun with your mini OS server!

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb