DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2008-12-11 14:53:22

baarney
Member
From: Sydney
Registered: 2008-02-05
Posts: 29

How to send kernel image

I'm trying to upload a new kernel image into memory (not re-write the flash yet), but not having any success.

$ kermit -l /dev/ttyS0 -b 115200
C-Kermit>set carrier-watch off
C-Kermit>set flow-control none
C-Kermit>connect

...

Marvell>> loadb 0x03800000
## Ready for binary (kermit) download to 0x00100000 at 115200 bps...

...

C-Kermit>send /bin kernel.uimage

*************************
SEND-class command failed.
Packets sent: 2
Retransmissions: 11
Timeouts: 0
Damaged packets: 0
Fatal Kermit Protocol Error: Too many retries

Can anyone tell me what I'm doing wrong here, and how to load an image?

Cheers,

Offline

 

#2 2008-12-14 06:48:45

mpalmer
Member
From: Australia
Registered: 2008-10-19
Posts: 13

Re: How to send kernel image

baarney wrote:

I'm trying to upload a new kernel image into memory (not re-write the flash yet), but not having any success.

$ kermit -l /dev/ttyS0 -b 115200
C-Kermit>set carrier-watch off
C-Kermit>set flow-control none
C-Kermit>connect

...

Marvell>> loadb 0x03800000
## Ready for binary (kermit) download to 0x00100000 at 115200 bps...

...

C-Kermit>send /bin kernel.uimage

*************************
SEND-class command failed.
Packets sent: 2
Retransmissions: 11
Timeouts: 0
Damaged packets: 0
Fatal Kermit Protocol Error: Too many retries

Can anyone tell me what I'm doing wrong here, and how to load an image?

Cheers,

Have you tried not futzing around with the flow control and such?  I've never had to do that on my kermit runs, and it's always worked for me.

Incidentally, giving a destination doesn't work on the DNS-323; you're best off just giving 'loadb' without arguments and then copying the data from 0x00100000 to somewhere else in memory.

Offline

 

#3 2008-12-15 12:12:09

baarney
Member
From: Sydney
Registered: 2008-02-05
Posts: 29

Re: How to send kernel image

The flow control appears to default to rts/cts which does not even let me break into the u-boot shell, probably because these are not connected on my serial cable. A lot of trial and error has come up with the following set of commands, which allow me to successfully send the image:

set line /dev/ttyS0
set speed 115200
set carrier-watch off
set flow-control xon/xoff
set handshake none
set prefixing all
set streaming off
set parity space

Not sure if all of these commands are necessary, but it works, so that's good enough for me!

Cheers,

Offline

 

#4 2012-09-30 09:24:40

Homelab
Member
Registered: 2011-12-21
Posts: 8

Re: How to send kernel image

Hi! I'm sorry, I do not know English. (= Google Translate)
I have a DNS-323-B1, which gives the following message:
** MARVELL BOARD: RD-88F5182-NAS-2 LE

U-Boot 1.1.1 (Nov 27 2006 - 14:25:52) Marvell version: 1.7.3

DRAM CS[0] base 0x00000000   size  64MB
DRAM Total size  64MB
[8192kB@ff800000] Flash:  8 MB
Addresses 20M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (20M - 16M): Done
*** Warning - bad CRC, using default environment


Soc: MV88F5182 Rev 2
CPU: ARM926 (Rev 0) running @ 500Mhz
SysClock = 166Mhz , TClock = 166Mhz


USB 0: host mode
USB 1: host mode
PCI 0: PCI Express Root Complex Interface
PCI 1: Conventional PCI, speed = 33000000
Hit any key to stop autoboot:  0

## Booting image at ff820000 ...
Bad Magic Number
Marvell>> <INTERRUPT>
Marvell>>

The loadb k, send uKernel not work because the Kermit "Fatal Kermit Protocol Error: Too many retries" message stops. / parameters for flow control, parity etc. is set to /

Does anyone have any ideas?

Please Step by Step....
Or trash it? ...

Last edited by Homelab (2012-09-30 09:56:38)

Offline

 

#5 2013-05-03 15:07:35

djtaz
Member
Registered: 2010-04-03
Posts: 33

Re: How to send kernel image

do u happen to have a copy of uKernel and uRamdisk that i can use ? I cant seem to make them myself for some reason , keep gettign errors

Offline

 

#6 2013-05-31 17:53:22

Mijzelf
Member / Developer
Registered: 2008-07-05
Posts: 709

Re: How to send kernel image

You can easily extract it from the firmware file. I downloaded the file here:
ftp://ftp.dlink.eu/Products/dns/dns-323 … 120110.zip
Unzipped, and looked at the contents:

Code:

binwalk DNS-323_C1_FW_v1.10_04062011 | grep -v LZMA

DECIMAL         HEX             DESCRIPTION
-------------------------------------------------------------------------------------------------------
64              0x40            uImage header, header size: 64 bytes, header CRC: 0xF9A904F, created: Mon Nov 30 05:43:29 2009, image size: 1490204 bytes, Data Address: 0x8000, Entry Point: 0x8000, data CRC: 0x76C77329, OS: Linux, CPU: ARM, image type: OS Kernel Image, compression type: none, image name: Linux-2.6.12.6-arm1
12492           0x30CC          gzip compressed data, from Unix, last modified: Mon Nov 30 05:06:09 2009, max compression
1490332         0x16BD9C        uImage header, header size: 64 bytes, header CRC: 0x2EF1E9C, created: Wed Apr  6 13:03:39 2011, image size: 5507627 bytes, Data Address: 0x800000, Entry Point: 0x800000, data CRC: 0x755313AB, OS: Linux, CPU: ARM, image type: RAMDisk Image, compression type: gzip, image name: Ramdisk
1490396         0x16BDDC        gzip compressed data, was "ramdisk_el", from Unix, last modified: Wed Apr  6 12:59:53 2011
^C

Now the sizes of the images, and startpoints are known, extract them:

Code:

tail -c +65 DNS-323_C1_FW_v1.10_04062011 | head -c 1490268 >uKernel
tail -c +1490333 DNS-323_C1_FW_v1.10_04062011 | head -c 5507691 >uInitrd

Offset +1 because tail takes the 'n-th' byte. Size + 64 because we also want the header.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB