u-boot下使用bootm引導核心心得 

來源:互聯網
上載者:User

 

u-boot使用的是打上:
http://www.hhcn.com/cgi-bin/topic.cgi?forum=3&topic=651&show=0
上keety大俠提供的補丁產生的u-boot-1.1.3這段時間不斷有人問我u-boot啟動核心的問題,記得在上次提供的u-boot源碼中提到了go的方案,不過其實u-boot本來有一種更好的方案:bootm
花了不少時間,查看了論壇上的文章,其中從這麼一個貼中找到解決方案:
http://www.linuxforum.net/forum/showflat.php?Cat=&Board=embedded&Number=555494&page=11&view=collapsed&sb=7&o=0&fpart=現在可以用bootm引導核心了,可能方法不一定是最好的,但起碼是可用的,現把解決方案介紹如下:1、首先,用u-boot/tools/mkimage這個工具為你的核心加上u-boot引導所需要的檔案頭,具體做法如下:
[root@localhost tftpboot]#mkimage -A arm -O linux -T kernel -C none -a 0x30000 -e 0x30008000 -d zImage zImage.img
Image Name:
Created:      Fri Jan 12 17:14:50 2007
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    1262504 Bytes = 1232.91 kB = 1.20 MB
Load Address: 0x00030000
Entry Point:  0x30008000這裡解釋一下參數的意義:
        -A ==> set architecture to 'arch'
        -O ==> set operating system to 'os'
        -T ==> set image type to 'type'
        -C ==> set compression type 'comp'
        -a ==> set load address to 'addr' (hex)
        -e ==> set entry point to 'ep' (hex)
        -n ==> set image name to 'name'
        -d ==> use image data from 'datafile'
        -x ==> set XIP (execute in place)
特別注意的是:
        -a後接的是載入地址,也就是你核心的核心在flash中的存放地址(按我的理解)
        -e後接的是運行地址,在sdram中運行核心的話一般是0x300080002、下載核心
U-Boot 1.1.3 (Jan 12 2007 - 16:16:36)U-Boot code: 33F80000 -> 33F9BAC0  BSS: -> 33F9FBAC
RAM Configuration:
Bank #0: 30000000 64 MB
Nor Flash: 512 kB
Nand Flash:  64 MB
In:    serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:  0
sbc2410=>tftp 0x30008000 zImage.img
TFTP from server 192.168.1.115; our IP address is 192.168.1.128
Filename 'zImage.img'.
Load address: 0x30008000
Loading: #################################################################
        #################################################################
        #################################################################
        ####################################################
done
Bytes transferred = 1262568 (1343e8 hex)sbc2410=> nand erase 30000 1d0000
NAND erase: device 0 offset 196608, size 1900544 ... OKsbc2410=> nand write 30008000 30000 1d0000
NAND write: device 0 offset 196608, size 1900544 ...  1900544 bytes written: OK3、最後,設定一下核心啟動所需要的參數:
sbc2410=> setenv bootargs noinitrd root=/dev/mtdblock/3 console=ttySAC0
sbc2410=> bootcmd=nand read 0x30008000 0x30000 0x1d0000;bootm 0x30008000
sbc2410=> saveenv
Saving Environment to NAND...
Erasing Nand...Writing to Nand... done4、重新複位,啟動資訊如下:
U-Boot 1.1.3 (Jan 12 2007 - 16:16:36)U-Boot code: 33F80000 -> 33F9BAC0  BSS: -> 33F9FBAC
RAM Configuration:
Bank #0: 30000000 64 MB
Nor Flash: 512 kB
Nand Flash:  64 MB
In:    serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:  0NAND read: device 0 offset 196608, size 1900544 ...  1900544 bytes read: OK
## Booting image at 30008000 ...
  Image Name:
  Image Type:   ARM Linux Kernel Image (uncompressed)
  Data Size:    1262504 Bytes =  1.2 MB
  Load Address: 00030000
  Entry Point:  30008000
  Verifying Checksum ... OK
OKStarting kernel ...Uncompressing Linux.............................................................Linux version 2.6.14 (root@localhost.localdomain) (gcc version 3.4.1) #2 Fri Ja7CPU: ARM920Tid(wb) [41129200] revision 0 (ARMv4T)
Machine: SMDK2410
Memory policy: ECC disabled, Data cache writeback
CPU S3C2410A (id 0x32410002)
S3C2410: core 202.800 MHz, memory 101.400 MHz, peripheral 50.700 MHz
S3C2410 Clocks, (c) 2004 Simtec Electronics
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
Built 1 zonelists
Kernel command line: noinitrd root=/dev/mtdblock/3 console=ttySAC0
irq: clearing subpending status 00000002
PID hash table entries: 512 (order: 9, 8192 bytes)
timer tcon=00500000, tcnt a509, tcfg 00000200,00000000, usec 00001e4c
Console: colour dummy device 80x30
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 64MB = 64MB total
Memory: 62208KB available (1925K code, 529K data, 108K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
softlockup thread 0 started up.
NET: Registered protocol family 16
USB Control, (c) 2006 sbc2410
S3C2410: Initialising architecture
SCSI subsystem initialized
usbcore: registered new driver usbfs
usbcore: registered new driver hub
S3C2410 DMA Driver, (c) 2003-2004 Simtec Electronics
DMA channel 0 at c4800000, irq 33
DMA channel 1 at c4800040, irq 34
DMA channel 2 at c4800080, irq 35
DMA channel 3 at c48000c0, irq 36
NetWinder Floating Point Emulator V0.97 (double precision)
devfs: 2004-01-31 Richard Gooch (rgooch@atnf.csiro.au)
devfs: devfs_debug: 0x0
devfs: boot_options: 0x1
yaffs Jan 11 2007 23:38:14 Installing.
s3c2410-lcd s3c2410-lcd: no platform data for lcd, cannot attach
s3c2410-lcd: probe of s3c2410-lcd failed with error -22
Console: switching to colour frame buffer device 80x25
fb0: Virtual frame buffer device, using 1024K of video memory
s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2410
s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2410
s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2410
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
usbcore: registered new driver ub
Cirrus Logic CS8900A driver for Linux (Modified for SMDK2410)
eth0: CS8900A rev E at 0xe0000300 irq=53, no eeprom , addr: 08: 0:3E:26:0A:5B
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c2410-nand: mapped registers at c4980000
s3c2410-nand: timing: Tacls 10ns, Twrph0 30ns, Twrph1 10ns
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bi)Scanning device for bad blocks
Bad eraseblock 1884 at 0x01d70000
Creating 4 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00000000-0x00020000 : "vivi"
0x00020000-0x00030000 : "param"
0x00030000-0x00200000 : "kernel"
0x00200000-0x04000000 : "root"
usbmon: debugfs is not available
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
mice: PS/2 mouse device common for all mice
ts: Compaq touchscreen protocol output
s3c2410 TouchScreen successfully loaded
UDA1341 audio driver initialized
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 2, 16384 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
TCP bic registered
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
NET: Registered protocol family 1
................................可以看到,核心已經跑起來了,大功告成!

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.