分类: LINUX
2009-12-14 19:07:27
一. RedBoot简介
RedBoot是基于eCos操作系统的,它的可移植性很高,移植的主要工作在于硬件抽象层的修改,硬件抽象层对处理器的结构和系统硬件平台进行抽象,主要包括三大模块-体系结构抽象层,变体抽象层和平台抽象层。体系结构抽象层主要是指eCos所支持的具有不同体系结构的处理器系列,如ARM系列,PowerPC系统,MIPS系列等等。变体抽象层指的是处理器处理器系列中某款处理器在Cache,MMU和FPU等方面所具有的特殊性。平台抽象性则是对当前系统硬件平台的抽象,包括了平台的启动,芯片选择与配置,定时设备,I/O寄存器访问以及中断寄存器等等。其中平台抽象层代码是移植的重点。
RedBoot能通过网口或串口下载并执行嵌入式应用程序,包括嵌入式linux和eCos应用程序。RedBoot还可以和GDB通过网口或串口来调试应用程序。
二. RedBoot命令
alias—manipulate command line aliases
alias {name} [value]
如: RedBoot> alias frank "Who are you? %{joe}"
Update RedBoot non-volatile configuration - continue (y/n)? n
RedBoot> = %{frank}
Who are you? This is Joe
baudrate—set the baud rate for the system serial console
baudrate [-b rate]
如: RedBoot>baudrate
RedBoot>baudrate -b 115200
cache—control hardware cache
cache [on | off]
如:RedBoot>cache
RedBoot>cache on
RedBoot>cache off
channel—select the system console channel
channel [-l | channel_number]
如:RedBoot>channel
RedBoot>channel 99
RedBoot>channel -l
cksum—compute POSIX checksums
cksum {-b location} {-l length}
如:RedBoot>cksum -b 0x100000 -l 0x100
disks—list available disk partitions
disks
如:RedBoot>disks
dump—display memory
dump {-b location} [-l length] [-s] [-1][-2][-4]
如:RedBoot>dump -b 0x100000 -2
help—display help on available commands
help [topic]
如:RedBoot>help
RedBoot>help fis
iopeek—read I/Olocation
iopeek [-b location] [-1][-2][-4]
如:RedBoot>iopeek -b 0x3f8 -4
iopoke—write I/O location
iopoke [-b location][-1][-2][-4][-v value]
如:RedBoot>iopoke -b 0x2000 -v 0x123 -2
gunzip—uncompress GZIP compressed data
gunzip {-s source}{-d destination}
如:gunzip -s 0x100000 -d 0x200000
ip_address—set IP addresses
ip_address [-b][-l local_ip_address][/netmask_length]][-h server_ip_address][-d DNS_server_ip_address]
如:RedBoot>ip_address
RedBoot>ip_address -l 192.168.1.32/24 -d 192.168.1.101 -h 192.168.1.104
load—download programs or data to the RedBoot platform
load [-v][-d][-r][-m[[xmodem | ymodem] | http | tftp | disk]][-h server_ip_address][-f location][-b location][-c channel][file_name]
-v:quiet -d:non-compressed data -r:formatted(S-records,ELF image,etc)
-f: address in flash to load the data -b:address in memory to load the data
如:RedBoot>load redboot.ROM -b 0x8c400000 -m HTTP -h 192.168.1.104
mcmp—compare two segments of memory
mcmp {-s location}{-d location}{-l length}[-1 | -2 | -4]
-s: location for start of data -d: location for start of data
如:RedBoot>mcmp -s 0x100000 -d 0x200000 -l 0x20 -2
mcopy—copy memory
mcopy {-s source}{-d destination}{-l length}[-1| -2 | -4]
如:mcopy -s 0x100000 -d 0x200000 -2 -l 0x20
mfill—fill ram with a specified patterm
mfill {-b location}{-l length}{-p value}[-1 | -2 | -4]
-b: location in memory for start of data -p: data value to fill with
如:mfill -b 0x100000 -l 0x20 -p 0xDEADFACE
ping—verify network connectivity
ping [-v][-i local_ip_address][-l length][-n count][-t timeout][-r rate]{-h server_ip_address}
-v :quiet -l:the length of the ICMP data payload -n:control the number of packets to be sent -t:how long to wait for the round-trip to complete,specified in milliseconds
-r:how fast to deliver packets
如:ping -h 192.168.1.101 -v -n 4
reset—reset the device
reset
如:reset
version—display redboot version information
version
如:version
fis init – initialize Flash Image System(FIS)
fis init [-f]
-f: all blocks of flash memory(except for the boot blocks)will be erased as part of the initialization procedure.It should normally only be executed once, when RedBoot is first installed on the hardware.
如:RedBoot>fis init
RedBoot>fis init -f
fis list – list Flash Image System directory
fis list [-c][-d]
-c: show image checksum instead of memory address
-d: show image data length instead of amount of flash occupied by image
如:RedBoot>fis init
RedBoot>fis init -c
RedBoot>fis init -d
fis free – free flash image
fis free
如:RedBoot>fis free
fis create – create flash image
fis create {-b data_address}{-l length}[-f flash_address][-e entry][-r relocation_address][-s data_length][-n][name]
-b: address of data to be written to the flash
-l: length of flash area to occopy
-f: address of flash area to occupy
-e: entry address for an executable image,used by the fis load command
-r:address where the image should be relocated to by the fis load command
-s:actual length of data written to image.this is used to control the range over which the checksum is made
-n:when set , no image data will be written to the flash. Only the FIS directory will be updated.
Name: name of flash image
如:RedBoot>fis create RedBoot -f 0xa0000000 -b 0x8c400000 -l 0x20000
fis load – load flash image
fis load [-b load_address][-c][-d][name]
-b: address the image should be loaded to
-c: compute and print the checksum of the image data after it has been loaded into memory
-d: decompress gzipped image while copying it from flash to RAM
name: the name of the file , as shown in th FIS directory
如:RedBoot>fis load RedBoot[RAM]
fis delete – delete flash image
fis delete {name}
name:name of image that should be deleted
如:RedBoot>fis delete RedBoot
fis lock –lock flash area
fis lock {-f flash_address}{-l length}
-f flash_address: address of area to be locked
-l length: length of area to be locked
如:RedBoot>fis lock -f 0xa0040000 -l 0x20000
fis unlock – unlock flash area
fis unlock {-f flash_address}{-l length}
-f flash_address:address of area to be unlocked
-l length: length of area to be unlocked
如:RedBoot>fis unlock -f 0xa0040000 -l 0x20000
fis erase – erase flash area
fis erase {-f flash_address}{-l length}
-f flash_address:address of area to be erased
-l length: length of area to be erased
如:fis erase -f 0xa0040000 -l 0x20000
fis write – write flash area
fis write {-b mem_adddress}{-l length}{-f flash_address}
-b mem_address: address of data to be written to flash
-l length: length of data to be written
-f flash_address: address of flash to write to
如:RedBoot:fis write -b 0x0606f000 -l 0x1000 -f 0x00020000
go – execute a program
go [-w timeout][-c][-n][start_address]
-w timeout: how long to wait before starting execution
-c : go with caches enabled
-n: go with network interface stopped
start_address: address in memory to begin execution
如:RedBoot>go -w 10 0x40040
exec – execute a linux kernel
exec [-w timeout][-r ramdisk_address][-s ramdisk_length][-b load_address{-l load_length}][-c kernel_command_line][entry_point]
-w timeout: time to wait before starting execution
-r ramdisk_address: address in memory of”initrd”-style ramdisk-passed to linux kernel
-s ramdisk_length: length of ramdisk image- passed to linux kernel
-b load_address:address in memory of the linux kernel image
-l load_length:length of linux kernel image
-c kernel_command_line :command line to pass to the linux kernel
-x :boot kernel with endianess opposite of redboot endianess
entry_address starting address for linux kernel execution
如:RedBoot>exec -b 0x100000 -l 0x800000 -c“noinitrd root=/dev/mtdblock3 console=ttySA0”