gaston feng

嵌入式Linux 2.6 内核专题 - 嵌入式开发 - 中国Linux公社论坛
gaston feng | May 11, 2008 2:35:34 PM
[quote:c2eac828fb="zcs008"][quote:c2eac828fb="91program"]console=ttyS0
应该改为:
console=ttySAC0

内核对串口的命名改变了。[/quote]


bootloader 是U-BOOT 怎么改?
我改了,但是还是一样,

U-Boot 1.1.2 (Nov 13 2006 - 13:59:4


U-Boot code: 33F80000 -> 33F9B26C  BSS: -> 33F9F368

RAM Configuration:

Bank #0: 30000000 64 MB

Flash:  1 MB

NAND:  64 MB

In:    serial

Out:   serial

Err:   serial

008_uboot # printenv

bootdelay=3

baudrate=115200

ethaddr=08:01:3e:26:8a:5b

filesize=d857c

fileaddr=30008000

netmask=255.255.255.0

ipaddr=192.168.0.188

serverip=192.168.0.35

bootargs=console=ttySAC0,115200

stdin=serial

stdout=serial

stderr=serial


Environment size: 225/65532 bytes

008_uboot # tftp 0x30008000 zImage

TFTP from server 192.168.0.35; our IP address is 192.168.0.188

Filename 'zImage'.

Load address: 0x30008000

Loading: #################################################################

         #################################################################

         ############################################

done

Bytes transferred = 886140 (d857c hex)

008_uboot # bootm

## Booting image at 30008000 ...

Bad Magic Number

008_uboot # go 0x30008000

## Starting application at 0x30008000 ...

Uncompressing Linux.......................................................... done, booting the kernel.[/quote]

U-BOOT可以使用setenv命令更改命令参数
setenv bootargs console=ttySAC0,115200

u-boot go命令不能传递命令行参数给内核,因此会在运行HEAD.S中检测CPU类型时错误而终止运行
另外,在U-BOOT配制文件(INCLUDE\CONFIGS\XXX.H)中需要定义下面宏,使能U-BOOT传递命令参数给内核
#define CONFIG_SETUP_MEMORY_TAGS
#define CONFIG_INITRD_TAG
#define CONFIG_CMDLINE_TAG

U-BOOT的BOOTM命令只能引导附加U-BOOT信息的内核,U-BOOT会在内核前加64个字节信息.
在U-BOOT目录下的TOOLS目录中有MKIMAGE工具制作U-BOOT能够引导内核
在U-BOOT README文件中有描述如下

QUOTE:
Configuring the Linux kernel:
-----------------------------

No specific requirements for U-Boot. Make sure you have some root
device (initial ramdisk, NFS) for your target system.


Building a Linux Image:
-----------------------
...............

U-BOOT目录/tools/mkimage -A arm-O linux -T kernel -C none\
-a 30008000 -e 30008000  -n "Linux Kernel Image" -d zImage uImage
zImage 为LINUX压缩内核,这个在LINUX目录arch/arm/boot/makefile有介绍

QUOTE:
quiet_cmd_uimage = UIMAGE  $@
      cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \
                   -C none -a $(ZRELADDR) -e $(ZRELADDR) \
                   -n 'Linux-$(KERNELRELEASE)' -d $< $@

由于U-BOOT在内核前添加64个字节,所以引导时应该考虑这个64个字节
tftp 30007fc0 uImage
bootm 30007fc0
nboot 30007fc0 0 40000

QUOTE:
U-Boot 1.1.6 (Jan 15 2007 - 12:26:31)

DRAM:  64 MB
NAND:  64 MB
In:    serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:  0
#>> tftp 30007fc0 uImage

TFTP from server 192.168.1.10; our IP address is 192.168.1.20
Filename 'uImage'.
Load address: 0x30007fc0
Loading: #################################################################
         #################################################################
         #################################################################
         #######
done
Bytes transferred = 1029864 (fb6e8 hex)
Automatic boot of image at addr 0x30007fc0 ...
## Booting image at 30007fc0 ...
   Image Name:   Linux Kernel Image
   Created:      2007-01-12   5:48:00 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1029800 Bytes = 1005.7 kB
   Load Address: 30008000
   Entry Point:  30008000
   Verifying Checksum ... OK
OK

Starting kernel ...

Uncompressing Linux....................................................................... done, booting the kernel.
Linux version 2.4.18-rmk7-pxa1 (root@lqmpc2) (gcc version 2.95.2 20000516 (release) [Rebel.com]) #265 二 3月 8 18:41:32 CST 2005
CPU: ARM/CIRRUS Arm920Tsid(wb) revision 0
Machine: Stone-2410
On node 0 totalpages: 16384
zone(0): 16384 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: console=ttyS0,115200
TCNTB4 = 15843
Console: colour dummy device 80x30
Calibrating delay loop... 50.58 BogoMIPS
Memory: 64MB = 64MB total
Memory: 62100KB available (1718K code, 571K data, 76K init)
Dentry-cache hash table entries: 8192 (order: 4, 65536 bytes)
Inode-cache hash table entries: 4096 (order: 3, 32768 bytes)
Mount-cache hash table entries: 1024 (order: 1, 8192 bytes)
Buffer-cache hash table entries: 4096 (order: 2, 16384 bytes)
Page-cache hash table entries: 16384 (order: 4, 65536 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4



http://www.linuxfans.org/bbs/thread-112750-6-1.html

Comment: (no reply)
To post your comment, Please login first.