您的位置:首页 > 运维架构 > Linux

让vdsp与uclinux共舞(4):加载uclinux

2009-11-01 23:42 369 查看
快乐虾 http://blog.csdn.net/lights_joy/ lights@hb165.com

本文适用于
ADSP-BF561
Visual DSP++ 5.0(update 6)
Bfin-uclinux-2009r1.6


欢迎转载,但请保留作者信息


现在我们希望尝试用vdsp控制uclinux,为了降低点难度,首先尝试一个比较简单的内核,在内核中关闭SMP支持和PLL配置。
本来以为只要在vdsp中加载linux.initramfs,然后跳转到__start开始执行就OK了,只是当执行到setup_arch的时候就跑飞了,暂时不知道什么原因,算了,先用咱的土办法吧。
先使用前文提到的方法在VDSP下控制住uboot,或者直接用vdsp加载编译好的uboot,然后在uboot的命令行下引导uclinux内核:
bfin>tftp 2800000 192.168.33.105:uImage
dm9000 i/o: 0x2c000000, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 00:0c:f1:34:92:80
operating at 100M full duplex mode
TFTP from server 192.168.33.105; our IP address is 192.168.33.200
Filename 'uImage'.
Load address: 0x2800000
Loading: *#################################################################
#################################################################
#################################################################
#################################################################
##
done
Bytes transferred = 3833355 (3a7e0b hex)
bfin>bootm 2800000
## Booting kernel from Legacy Image at 02800000 ...
Image Name: Linux-2.6.28.10-ADI-2009R1
Image Type: Blackfin Linux Kernel Image (gzip compressed)
Data Size: 3833291 Bytes = 3.7 MB
Load Address: 00001000
Entry Point: 001b5664
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
Starting Kernel at = 001b5664
Linux version 2.6.28.10-ADI-2009R1 (wmz@localhost.localdomain) (gcc version 4.1.2 (ADI svn)) #34 Sun Nov 1 22:05:10 CST 2009
bootconsole [early_shadow0] enabled
Board Memory: 48MB
Kernel Managed Memory: 32MB
Memory map:
fixedcode = 0x00000400-0x00000490
text = 0x00001000-0x00131af0
rodata = 0x00131af0-0x0017fff8
bss = 0x00180000-0x0019559c
data = 0x0019559c-0x001a8000
stack = 0x001a6000-0x001a8000
init = 0x001a8000-0x0075f000
available = 0x0075f000-0x01eff000
DMA Zone = 0x01f00000-0x02000000
Hardware Trace Active and Enabled
Boot Mode: 2
Blackfin support (C) 2004-2009 Analog Devices, Inc.
Compiled for ADSP-BF561 Rev 0.5
Blackfin Linux support by http://blackfin.uclinux.org/ Processor Speed: 499 MHz core clock and 99 MHz System Clock
NOMPU: setting up cplb tables
Instruction Cache Enabled for CPU0
Data Cache Enabled for CPU0 (write-back)
Built 1 zonelists in Zone order, mobility grouping off. Total pages: 7873
Kernel command line: console=ttySS1,57600n7 root=/dev/mtdblock0 mem=32m max_mem=48m
Configuring Blackfin Priority Driven Interrupts
PID hash table entries: 128 (order: 7, 512 bytes)
console [ttySS1] enabled, bootconsole disabled
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory available: 23904k/32768k RAM, (5852k init code, 1218k kernel code, 474k data, 1024k dma, 292k reserved)
Calibrating delay loop... 997.37 BogoMIPS (lpj=1994752)
Security Framework initialized
Mount-cache hash table entries: 512
Blackfin Scratchpad data SRAM: 4 KB
Blackfin L1 Data A SRAM: 16 KB (15 KB free)
Blackfin L1 Data B SRAM: 16 KB (16 KB free)
Blackfin L1 Instruction SRAM: 16 KB (5 KB free)
Blackfin L2 SRAM: 128 KB (128 KB free)
net_namespace: 288 bytes
NET: Registered protocol family 16
Blackfin DMA Controller
ezkit_init(): registering device resources
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
NET: Registered protocol family 1
msgmni has been set to 46
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler cfq registered
bfin-dma: initialized
simple-gpio: now handling 48 GPIOs: 0 - 47
Serial: Blackfin serial driver
bfin-uart.1: ttyBF0 at MMIO 0xffc00400 (irq = 35) is a BFIN-UART
bfin-sport-uart.1: ttySS1 at MMIO 0xffc00900 (irq = 32) is a SPORT1
brd: module loaded
dm9000 Ethernet Driver, V1.31
eth0: dm9000a at 2c000000,2c000004 IRQ 117 MAC: 00:00:12:34:56:78 (platform data)
physmap platform flash device: 00800000 at 20000000
physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
Amd/Fujitsu Extended Query Table at 0x0040
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
RedBoot partition parsing not available
Using physmap partition information
Creating 3 MTD partitions on "physmap-flash.0":
0x00000000-0x00040000 : "bootloader(nor)"
0x00040000-0x00200000 : "linux kernel(nor)"
0x00200000-0x00800000 : "file system(nor)"
bfin-spi bfin-spi.0: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_base@ffc00500, dma channel@34
i2c-gpio i2c-gpio.0: using pins 1 (SDA) and 0 (SCL)
bfin-wdt: initialized: timeout=20 sec (nowayout=0)
mmc_spi spi0.5: ASSUMING 3.2-3.4 V slot power
mmc_spi spi0.5: SD/MMC host mmc0, no DMA, no WP, no poweroff
TCP cubic registered
NET: Registered protocol family 17
mmc_spi spi0.5: requested mode not fully supported
mmc_spi spi0.5: can't change chip-select polarity
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
Freeing unused kernel memory: 5852k freed
mmc0: host does not support reading read-only switch. assuming write-enable.
mmc0: new SDHC card on SPI
mmcblk0: mmc0:0000 SD16G 14.9 GiB
mmcblk0: p1
_____________________________________
a8888b. / Welcome to the uClinux distribution /
d888888b. / _ _ /
8P"YP"Y88 / | | |_| __ __ (TM) |
8|o||o|88 _____/ | | _ ____ _ _ / // / |
8' .88 / | | | | _ /| | | | / / |
8`._.' Y8. / | |__ | | | | | |_| | / / |
d/ `8b. / /____||_|_| |_|/____|/_//_/ |
dP . Y8b. / For embedded processors including |
d8:' " `::88b / the Analog Devices Blackfin /
d8" 'Y88b /___________________________________/
:8P ' :888
8a. : _a88P For further information, check out:
._/"Yaa_: .| 88P| - http://blackfin.uclinux.org/ / YP" `| 8P `. - http://docs.blackfin.uclinux.org/ / /.___.d| .' - http://www.uclinux.org/ `--..__)8888P`._.' jgs/a:f - http://www.analog.com/blackfin
Have a lot of fun...


BusyBox v1.13.4 (2009-10-31 23:39:36 CST) built-in shell (msh)
Enter 'help' for a list of built-in commands.

root:/>
在VDSP下中断a核的执行,然后使用File -> Load symbol从vmlinux文件中加载符号信息,看看:



嘿嘿,很符合我们的期待啊,default_idle!~
接着我们搜寻sys_open,然后设置一个hardware break point,让a核继续运行,在命令行下使用ls,此时将在sys_open上中断下来:




试试单步运行,NO PROBLEM,YEAH!
本来想跑一个profile数据看看,只可惜得到这样的结果:




显然是不正确的,估计VDSP还需要一些额外的信息才行!
退出VDSP,内核将继续运行!

下面再试试在内核中加入详细的dwarf调试信息,看看能否做源码级的跟踪。





1 参考资料

让vdsp与uclinux共舞(3):boot kernel(2009-10-31)
让vdsp与uclinux共舞(2):vdsp的影响(2009-10-31)
让VDSP与uclinux共舞(1):开篇(2009-10-30)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: