Skip to contentSkip to conversation

Hows to boot Linux Kernel from USB

U-Boot thaoth 6 participants 18 messages Sep 30, 2008 – Oct 3, 2008

lore
Share & tools
lore

thaoth

author
#0 lore raw

Hi All,

I would like to know how to boot linux kernel from USB. I have ported UBoot (support serial, USB driver) but didn't support CF card.

Would you please tell me how to boot Linux Kernel from USB Flash memory? I have many guide could help hows to boot Linux kernel from CF card or network but I didn't see help for USB Flash memory.

Here is step by step I did but didn't work.
- First initialization USB

=> usb start

- List file on USB Flash memory

=> fatls usb 0:1

  3876248   vmlinux.srec
  1348231   vmlinux
  2207942   vmlinux.bin

.
1277956 zimage

- load zImage into SDRAM memory at base address 0x8c000000 + 200000

=> fatload usb 0:1 200000 zimage
reading zimage
.
.
.
.
................................................................................
............................................

1277956 bytes read

=> bootm
Wrong Image Format for bootm command
ERROR: can't get kernel image!

This seems here is wrong command. I should load uImage (not zImage) into SDRAM memory. Google booting kernel from USB on the internet but I didn't see any help. :(

Thank you for answer
Best regards,

Signature · 2 lines
View this message in context: http://www.nabble.com/-UBoot--Hows-to-boot-Linux-Kernel-from-USB-tp19740267p19740267.html
Sent from the Uboot - Users mailing list archive at Nabble.com.
#1 lore raw

thaoth a ?crit :

Quoted 2 lines

This seems here is wrong command. I should load uImage (not zImage) into SDRAM memory.

Hmm... So why don't you ?

Amicalement,

Signature · 1 line
Albert.
author
#2 lore raw
Quoted 17 lines · Albert ARIBAUD

thaoth a ?crit :

Quoted 2 lines

This seems here is wrong command. I should load uImage (not zImage) into SDRAM memory.

Hmm... So why don't you ?

Amicalement,

Signature · 5 lines
Albert.
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

I have tried but not ookay. the same issue.

Signature · 2 lines
View this message in context: http://www.nabble.com/-UBoot--Hows-to-boot-Linux-Kernel-from-USB-tp19740267p19740403.html
Sent from the Uboot - Users mailing list archive at Nabble.com.
#3 lore raw

thaoth a ?crit :

Quoted 5 lines
Quoted 2 lines · Albert ARIBAUD

thaoth a ?crit :

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

This seems here is wrong command. I should load uImage (not zImage) into SDRAM memory.

Hmm... So why don't you ?

Amicalement,

I have tried but not ookay. the same issue.

(please trim signatures in your replies)

Can you retry and copy-paste the console output? Also, on your development host, can you do a 'file uImage' and copy the result ?

Amicalement,

Signature · 1 line
Albert.
author
#4 lore raw
Quoted 2 lines
Quoted 2 lines

Can you retry and copy-paste the console output?

...
(Re)start USB...
USB: scanning bus for devices... cannot reset port 1!?
2 USB Device(s) found
scanning bus for storage devices... 1 Storage Device(s) found
=> fatload usb 0:1 0x8e000000 uImage
reading uImage
.
.
.
.
................................................................................
............................................

1278020 bytes read
=> bootm
* kernel: default image load address = 0x8e000000 Wrong Image Format for bootm command
ERROR: can't get kernel image!
...

Quoted 1 line
Quoted 1 line

can you do a 'file uImage' and copy the result ?

...
[root at twiki boot]# file uImage
uImage: PPCBoot image
...

I tried and send you its log.

Thank you for answer
Best regards,

Signature · 2 lines
View this message in context: http://www.nabble.com/-UBoot--Hows-to-boot-Linux-Kernel-from-USB-tp19740267p19755115.html
Sent from the Uboot - Users mailing list archive at Nabble.com.
#5 lore raw

2008/10/1 thaoth <[email protected]>:

Quoted 24 lines
Quoted 2 lines
Quoted 2 lines

Can you retry and copy-paste the console output?

...
(Re)start USB...
USB: scanning bus for devices... cannot reset port 1!?
2 USB Device(s) found
scanning bus for storage devices... 1 Storage Device(s) found
=> fatload usb 0:1 0x8e000000 uImage
reading uImage
.
.
.
.
................................................................................
............................................

1278020 bytes read
=> bootm
* kernel: default image load address = 0x8e000000 Wrong Image Format for bootm command
ERROR: can't get kernel image!
...

Quoted 8 lines
Quoted 1 line
Quoted 1 line

can you do a 'file uImage' and copy the result ?

...
[root at twiki boot]# file uImage
uImage: PPCBoot image
...

I tried and send you its log.

What is the kernel version that you use?

Signature · 1 line
Nobuhiro Iwamatsu
author
#6 lore raw
Quoted 9 lines
Quoted 7 lines

[root at twiki boot]# file uImage
uImage: PPCBoot image
...

I tried and send you its log.

What is the kernel version that you use?

I'm using version 2.6.22.11.

Thank you for answer
Best regards,

Signature · 2 lines
View this message in context: http://www.nabble.com/-UBoot--Hows-to-boot-Linux-Kernel-from-USB-tp19740267p19755247.html
Sent from the Uboot - Users mailing list archive at Nabble.com.
#7 lore raw

2008/10/1 thaoth <[email protected]>:

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

[root at twiki boot]# file uImage
uImage: PPCBoot image
...

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

I tried and send you its log.

What is the kernel version that you use?

I'm using version 2.6.22.11.

I think that your linux kernel is too old.
Please use newest linux kernel or backport arch/sh/boot/Makefile to your kernel.

Best regards,
Nobuhiro

Signature · 1 line
Nobuhiro Iwamatsu
#8 lore raw

Hi,

Quoted 8 lines · Nobuhiro Iwamatsu

2008/10/1 thaoth <[email protected]>:

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

[root at twiki boot]# file uImage
uImage: PPCBoot image
...

I tried and send you its log.

What is the kernel version that you use?

Quoted 9 lines
Quoted 2 lines

I'm using version 2.6.22.11.

I think that your linux kernel is too old.
Please use newest linux kernel or backport arch/sh/boot/Makefile to your kernel.

Best regards,
Nobuhiro

Use zImage and put cmdline in the zImage and try with this.

load at an address
and go <address>

Regards Michael

#9 lore raw

Dear Michael,

Quoted 5 lines · In message <[email protected]> you wrote:

Use zImage and put cmdline in the zImage and try with this.

load at an address
and go <address>

No. Please do not make such recommendations.

Even if it should be working for you, this is not the correct way to boot Linux.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You know that feeling when you're leaning back  on  a  stool  and  it
starts to tip over? Well, that's how I feel all the time.
- Steven Wright
#10 lore raw

Hi,

Quoted 5 lines · Wolfgang Denk

Dear Michael,

Quoted 2 lines · In message <[email protected]> you wrote:

Use zImage and put cmdline in the zImage and try with this.

Quoted 8 lines
Quoted 2 lines

load at an address
and go <address>

No. Please do not make such recommendations.

Even if it should be working for you, this is not the correct way to boot Linux.

Sorry :)

of course this is not the correct way, I know but it can help him to
boot linux.

Quoted 4 lines

Best regards,

Wolfgang Denk

Regards Michael

author
#11 lore raw

I think I made a mistake; I didn?t describe my problem clearly. So, now I fix it.
My purpose is: find out a way to boot a Linux Kernel from USB (FAT16).

Here are the steps I?ve made:

1. Get some kernel images (zImage, uImage) which I built (kernel version
2.6.22.11).
2. Go to the board (T-Engine/SH7727) which is ported U-boot and try some
commands:

     a. usb start
     b. fatload usb 0:1 0x00200000 uimage
     c. bootm 0x00200000

And I always get this error:
Wrong Image Format for bootm command
ERROR: can't get kernel image!

I didn?t set ?bootargs? and root file system because I think they will have no effect
NOTE:
CFG_SDRAM_BASE = 0x8c000000
CFG_LOAD_ADDR = 0x8e000000
Some results, I checked:

Quoted 2 lines
Quoted 2 lines

[root at twiki boot]# file uImage
uImage: PPCBoot image

I also tried: mkimage -A sh -O linux -T kernel -C gzip -a 0x8e000000 -e 0x8e000000 -n Linux -d linux.bin.gz uImage

best regards

Signature · 2 lines
View this message in context: http://www.nabble.com/-UBoot--Hows-to-boot-Linux-Kernel-from-USB-tp19740267p19772124.html
Sent from the Uboot - Users mailing list archive at Nabble.com.
author
#12 lore raw

Hi,

I tried to boot with ext2 file system and get this result:
=> usb start
(Re)start USB...
USB: scanning bus for devices... cannot reset port 1!?
2 USB Device(s) found
scanning bus for storage devices... 1 Storage Device(s) found
=>ext2load usb 0:1 0x00200000 uImage
??.
1045127 bytes read
=> bootm 0x8c200000
* kernel: cmdline image address = 0x8c200000
## Booting kernel from Legacy Image at 8c200000 ...

   Image Name:   Linux-2.6.22.11
   Image Type:   SuperH Linux Kernel Image (gzip compressed)
   Data Size:    974852 Bytes = 952 kB

Load Address: 8c002000
Entry Point: 8c002000
Verifying Checksum ... Bad Data CRC
ERROR: can't get kernel image!

Could you tell me an advice?

NOTE: I think I can have a problem with ?Load Address: 8c002000? ?

Best regard.

Signature · 2 lines
View this message in context: http://www.nabble.com/-UBoot--Hows-to-boot-Linux-Kernel-from-USB-tp19740267p19777398.html
Sent from the Uboot - Users mailing list archive at Nabble.com.
author
#13 lore raw

Hi,

Do i have a problem with "Verifying Checksum ... Bad Data CRC??

Best regard.

Signature · 2 lines
View this message in context: http://www.nabble.com/-UBoot--Hows-to-boot-Linux-Kernel-from-USB-tp19740267p19790840.html
Sent from the Uboot - Users mailing list archive at Nabble.com.
#14 lore raw

Hi,

Quoted 7 lines · thaoth

Hi,

Do i have a problem with "Verifying Checksum ... Bad Data CRC??

Best regard.

Have you try to load your image using tftpboot and put it in memory? Are you sure that you don't have any problem with memory initialization?

Regards
Michael

author
#15 lore raw

Hi Michael,

Quoted 1 line

Have you try to load your image using tftpboot and put it in memory?

My board don't have Eth port, so we can't try tftpboot

Quoted 1 line

Are you sure that you don't have any problem with memory initialization?

i think i don't have any problem with memory initialization, because i can see my image(using iminfo) on memory.

Best regards,

Signature · 2 lines
View this message in context: http://www.nabble.com/-UBoot--Hows-to-boot-Linux-Kernel-from-USB-tp19740267p19792984.html
Sent from the Uboot - Users mailing list archive at Nabble.com.
#16 lore raw
In reply to thaoth

thaoth a ?crit :

Quoted 5 lines
Quoted 1 line
Quoted 1 line

can you do a 'file uImage' and copy the result ?

...
[root at twiki boot]# file uImage
uImage: PPCBoot image

When I look at my own uImages, they come out as:

$ file /var/lib/tftpboot/uImage
/var/lib/tftpboot/uImage: u-boot/PPCBoot image

Not sure this is important though.

What version of u-boot mkimage are you using and how do you invoke it?

Amicalement,

Signature · 1 line
Albert.
#17 lore raw
In reply to thaoth
Quoted 5 lines · thaoth

=> bootm
Wrong Image Format for bootm command
ERROR: can't get kernel image!

This seems here is wrong command. I should load uImage (not zImage) into

Thats it! Get yourself an uImage!

Markus

Signature · 3 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de")