Uploading a Kernel via the Serial Port

WARNING: uploading a kernel via the serial port takes about 20 minutes and uploading a ram disk image can take about 70 minutes, if interrupted will leave your unit inoperable until the procedure is completed correctly. U-boot if used incorrectly can leave your unit completely inoperable, even beyond recovery by this procedure. Since this procedure requires hooking up a serial port, your warranty is already void, but doing anything mentioned here will futher void it. While care has been taken to ensure the following procedure is correct we offer no gurantee that it will not destroy your hardware and burn down your domcile.

Das U-Boot is a GPL'ed cross-platform boot loader, it is a small piece of software that executes soon after powering up a computer. It will initialize the basic hardware and, if not interrupted, load and execute the Linux Kernel.

By entering a character soon after u-boot starts outputting messages you can interrupt the boot process and communicate directly with u-boot. The version of u-boot supplied with the DSM G600 is severly restricted in the commands it supports, pretty mouch the only useful command is loadb. The loadb provided by D-Link is non-standard in that instead of loading a binary into RAM, it will take a binary and load it as a kernel and/or a ramdisk image. For loading a kernel, the command is:

loadb k

If you want to load ram disk image instead of kernel then the command is:

loadb r

Loadb uses the kermit protocol to upload the image. While minicom claims to provide the kermit protocol it does not appear to work with u-boot, so the kermit program is suggested.

Kermit, the program, is an very complex application and it's use is beyond the scope of this document. This link describes it's use with a full-featured u-boot.

My .kermrc file looks like:

set line /dev/ttyS0
set speed 9600
set carrier-watch off
set handshake none
set flow-control none
robust
set file type bin
set rec pack 1000
set send pack 1000
set window 5

U-Boot command prompt

After starting kermit and connecting the serial port, power-up the unit, when u-boot starts displaying messages press the space-bar. U-boot will display something like:

U-Boot 0.2.0 (May 11 2005 - 18:56:16)

CPU:   MPC8245 V1.2 at 170.503 MHz:
Board: Sandpoint 8245
DRAM:  32 MB
FLASH: FUJI_DL323BE 
In:    serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:  0 
=> 

You are now at the u-boot command prompt. Assuming the kernel you want to load is /tftpboot/pImage, enter the u-boot command

loadb k

U-boot will respond with:

## Ready for binary (kermit) download ...

Now type Ctrl=\c (control backslash follwoed by “c”) to return the the kermit prompt and type:

send /tftpboot/pImage

Next you will see transfer statistics:

C-Kermit 8.0.209, 17 Mar 2003, serv.penthouse.lan [192.168.1.20]

   Current Directory: /root
Communication Device: /dev/ttyS0
 Communication Speed: 9600
              Parity: none
         RTT/Timeout: 01 / 04
             SENDING: /tftpboot/pImage => PIMAGE
           File Type: BINARY
           File Size: 3008666
        Percent Done:
                          ...10...20...30...40...50...60...70...80...90..100
 Estimated Time Left: 01:05:31
  Transfer Rate, CPS: 760
        Window Slots: 1 of 1
         Packet Type: D
        Packet Count: 28
       Packet Length: 1000
         Error Count: 0
          Last Error:
        Last Message:

X to cancel file, Z to cancel group, <CR> to resend last packet,
E to send Error packet, ^C to quit immediately, ^L to refresh screen.

U-boot will now upload the image, when the upload is complete, type “connect” to reconnect to u-boot to monitor the next step (which will occur automatically). After uploading the image u-boot will check the image, if it is a u-boot compatible image and not too large it will program it into flash.

## Total Size      = 0x002de89a = 3008666 Bytes
## Start Addr      = 0x00100000
Un-Protect Flash Bank # 1
Erase Ramdisk from 0xffc10000 to 0xffefffff ....... done
Erased 47 sectors
Ramdisk Size = 3008666
Copy to Flash... done
Protect Flash Bank # 1
=>

Next you can use bootm command or cycle power to execute the new kernel, (be sure the programming is done before removing the power).

=> bootm FFF10000 FFC20000

Personal Tools