多莉宝贝下载:skyeye 配置

来源:百度文库 编辑:偶看新闻 时间:2024/04/27 20:43:28
skyeye的1.2.8好像有bug,运行linux的镜像没问题,但是运行uclinux的镜像就有地址错误,换成了1.2.6的就可以了。虽然一些镜像还有写问题。   Probably the most usage of SkyEye is to running linux on it anddebug and analyse the linux image.
If you want to
do this way, firstlyyou should make sure your processor is supported by SkyEye. Secondly,you po
ssibly have to
unselect some options in linux menuconfig since notall the peripherals of your hardware platform
 are supported by
SkyEye.If there is some unsupported hardware driver in your kernel image, maybeyour kernel
image is not stable
or not runnable on SkyEye. So it is recommended that only the uart and timer drivers are selected
 in your kernel
menuconfig.
Then you can compile your kernel source and get an image such as linux.elf.

Consequently , we need to write a skyeye.conf for your hardware platform. If you want to know
how to write it,
please read 3. SkyEye Command and skyeye.conf. If you just only see what looks like when your
 kernel image run
onSkyEye , just select a skyeye.conf from testcase of testsuite packagethat is same with your
 platform and copy it
to the directory that yourimage is placed.
Then we can launch our kernel image and skyeye by the following command:

skyeye -e linux.elf -c skyeye.conf

If lucky, you will see your kernel image is running , that just like your kernel runs on yout real
 hardware platform.......  要在skyeye上运行Linux,首先要设置内核,将不支持的硬件去掉,推荐只保留UART和时钟。然后写skyeye.conf配置硬件平台。 Now skyeye has four argument:
-e argument is to indicate the file name of kernel image run on SkyEye
-d argument means we can use gdb to remote debug this kernel .the default server TCP port
 is 12345.
-fargument is to indicate the config file name we will used.Ifskyeye.conf just is placed the
same directory with skyeye , you can omitit.-h argument just display help message.
skyeye.conf is used to config your skyeye simulation environment.According to various
config options, we can create many differentsimulators to simulate varions development
board. We can config architecture , processor, memory size ,netcard ,flash ,LCD etc to
meet our boards that we want to simulate.
Ifyou do not know how to indicate these options
 ,just refer to configfiles in the testsuite or your hardware manual of your platform.
-h argument just display help message. 现在关注skyeye.conf的格式:

SkyEye模拟的硬件配置和模拟执行行为由配置文件skyeye.conf中的选项确定。根据选项的功能,

skyeye.conf的选项分为

硬件配置选项和模拟执行选项。根据参数的个数,skyeye.conf的选项主要由两种组成:

  • 单参数选项行
    格式为:
    symbol: value
    symbol可以是硬件定义,如cpu、mach等,也可以是执行控制定义,如log等。
    value是symbol对应的值,可能是数字也可能是字符串。
  • 多参数选项行
    格式为:
    symbol:opt1=value1,opt2=value2,......
    opt1是参数名,value1是opt1对应的值,可能是数字也可能是字符串。

结合一个实例:

# skyeye config file for S3C44B0X
cpu: arm7tdmi
基本CPU核配置选项
目前存在的选项有:arm710、arm7tdmi、arm720t、arm920t、sa1100、sa1110、xscale
格式为
cpu: cpuname
注:cpuname表示一个代表cpu名字的字符串。
mach: s3c44b0x

具体的开发板(包括CPU扩展)配置选项
目前存在的选项有:at91、ep7312、adsbitsy,pxa_Lubbock、lpc、s3c4510b、s3c44b0、cs89712、sa1100、at91rm92
、sharp_lh7a400
格式为:
mach: machinename
注:cpuname表示一个代表基于特定CPU的开发板名字的字符串。 
# physical memory
#mem_bank: map=F, type=RW, addr=0x00000000, size=0x00200000, file=./u-boot.flash
mem_bank: map=F, type=RW, addr=0x00000000, size=0x00030000, file=./u-boot/u-boot.bin
mem_bank: map=F, type=RW, addr=0x00030000, size=0x000c0000, file=./u-boot/uImage
mem_bank: map=F, type=RW, addr=0x000f0000, size=0x00110000, file=./u-boot/uInitrd
mem_bank: map=M, type=RW, addr=0x0c000000, size=0x00800000
内存组配置选项
一个内存组内的地址是连续的,类型分为RAM SPACE, ROM SPACE, mapped IO SPACE
格式为:
mem_bank: map=M|I, type=RW|R, addr=0xXXXXXXXX, size=0xXXXXXXXX,file=imagefilename,boot=yes|no
  • map=M 表示 RAM/ROM SPACE, map=I 表示 mapped IO SPACE。
  • type=RW ,且如果map=M则表示RAM SPACE, type=R,且如果map=M则表示ROM SPACE。
  • addr=0xXXXXXX 表示内存组的起始物理地址(32bit,16进制)。
  • size =0xXXXXXX 表示内存组的大小(32bit,16进制) 。
  • file =imagefilename
    file的值imagefilename是一个字符串,实际上表示了一个文件,一般是一个可以执行的binary image格式的可执行程序
  • 或OS内核文件或是一个binary
  • image格
  • 式的根文件系统。如果存在这个文件,SkyEye会把文件的内容直接写到对应的模拟内存组地址空间中。
  • boot=yes/no,如果boot=yes,则SkyEye会把模拟硬件启动后的第一条指令的地址定位到对应的内存组的起始地址。  


# peripherals I/O mapping area
mem_bank: map=I, type=RW, addr=0x01c00000, size=0x00400000
 
# uart 0
uart: mod=stdio
 
# flash
flash: type=SST39VF160, base=0x00000000, size=0x00200000, dump=./u-boot.flash

skyeye的README没有更新很久了。以前不支持Flash,现在支持了:

有关 SkyEye 的 Flash 模拟在 skyeye.conf 配置中写法:

1. Flash 模拟配置

# 物理内存类型须为 F
mem_bank: map=F, type=RW,  addr=0x00000000, size=0x00200000, file=./u-boot.bin

# type 为模拟的型号,具体详 README
# base 为起始地址,同上面 addr
# size 为内存大小,下面为 2M
# dump 为写入数据时需保存的文件(可选),当 type=28F128J3A 时无效
flash: type=SST39VF160, base=0x00000000, size=0x00200000, dump=./flash.dump


2. NandFlash 模拟配置

# 物理内存类型须为 M
mem_bank: map=M, type=RW,  addr=0x00000000, size=0x00800000, file=./u-boot.bin

# type 为模拟应用 CPU 类型
# name 为模拟的型号
# dump 同上述
# 这里没有直接指定物理内存的起止,请参考相应文档或源码
nandflash: type=s3c2410x, name=K9F1208U0B, dump=./nand.dump

 

关于几种内存的比较:

ROM和RAM 指的都是半导体存储器,ROM是Read Only Memory的缩写,RAM是Random Access Memory的缩写。ROM在系统停止

供电的时候仍然可以保持数据

,而RAM通常都

是在掉电之后就丢失数据,典型的RAM就是计算机的内存。

RAM 有两大类,一种称为静态RAM(Static RAM/SRAM),SRAM速度非常快,是目前读写最快的存储设备了,但是它也非常昂贵,

所以只在要求很苛刻的地方使

用,譬如

CPU的一级缓冲,二级缓冲。另一种称为动态RAM(Dynamic RAM/DRAM),DRAM保留数据的时间很短,速度也比SRAM慢,不过

它还是比任何的ROM都要快,但从

价格上来说

DRAM相比SRAM要便宜很多,计算机内存就是DRAM的。

         DRAM 分为很多种,常见的主要有FPRAM/FastPage、EDORAM、SDRAM、DDR RAM、RDRAM、SGRAM以及WRAM等,

这里介绍其中的一种DDR RAM。

DDR RAM

(Date-Rate RAM)也称作DDR SDRAM,这种改进型的RAM和SDRAM是基本一样的,不同之处在于它可以在一个时钟读写两次数据,

这样就使得数据传输速度

加倍了。这是

目前电脑中用得最多的内存,而且它有着成本优势,事实上击败了Intel的另外一种内存标准-Rambus DRAM。在很多高端的显卡上,

也配备了高速DDR RAM

来提高带宽,这

可以大幅度提高3D加速卡的像素渲染能力。

    ROM 也有很多种,PROM是可编程的ROM,PROM和EPROM(可擦除可编程ROM)两者区别是,PROM是一次性的,也就是软件灌入后

,就无法修改了,这种

是早期的产品,

现在已经不可能使用了,而EPROM是通过紫外光的照射擦出原先的程序,是一种通用的存储器。另外一种EEPROM是通过电子擦出,

价格很高,写入时间很长,

写入很慢。

     举个例子 ,手机软件一般放在EEPROM中,我们打电话,有些最后拨打的号码,暂时是存在SRAM中的,不是马上写入通过记录

(通话记录保存在

EEPROM中),因为

当时有很重要工作(通话)要做,如果写入,漫长的等待是让用户忍无可忍的。

     FLASH 存储器又称闪存,它结合了ROM和RAM的长处,不仅具备电子可擦出可编程(EEPROM)的性能,还不会断电丢失数据

同时可以快速读取数据

(NVRAM的优势),

U盘和MP3里用的就是这种存储器。在过去的20年里,嵌入式系统一直使用ROM(EPROM)作为它们的存储设备,然而近年来Flash

全面代替了ROM(EPROM)

在嵌入式系统中的

地位,用作存储Bootloader以及操作系统或者程序代码或者直接当硬盘使用(U盘)。

        目前Flash主要有两种 NOR Flash和NADN Flash 。NOR Flash的读取和我们常见的SDRAM的读取是一样,用户可以

直接运行装载在NOR FLASH

里面的代码,这样

可以减少SRAM的容量从而节约了成本。NAND Flash没有采取内存的随机读取技术,它的读取是以一次读取一快的形式来进行的,

通常是一次读取512个字节,

采用这种技术的

Flash比较廉价。用户不能直接运行NAND Flash上的代码,因此好多使用NAND Flash的开发板除了使用NAND Flah以外,还作

上了一块小的NOR Flash来

运行启动代码。

     一般 小容量的用NOR Flash,因为其读取速度快,多用来存储操作系统等重要信息,而大容量的用NAND FLASH,最常见的

NAND FLASH应用是嵌入式

系统采用的DOC

(Disk On Chip)和我们通常用的“闪盘”,可以在线擦除。目前市面上的FLASH 主要来自Intel,AMD,Fujitsu和Toshiba,

而生产NAND Flash的主要

厂家有Samsung

和Toshiba。

 

可见,flash虽然可以当作Rom,但是norflash里的代码可以直接运行,而nandflash可以当作磁盘使用,因为它们是可擦除的,

只是不想Ram,是随机读取的。

 

README里的例子

APPENDIX A: the content of skyeye.conf

#--------------------------------------------------------------------------------
# memmap.conf and skyeye.conf are all skyeye's hardware configuration files.
# memmap.conf is for skyeye-v0.2.5-
# skyeye.conf is for skyeye-v0.2.5+
# usually you don't need to change them.
# for example, a AT91's configuration file is shown below:
#--------------------------------------------------------------------------------
# below is the cpu config info
# cpu: maybe arm7tdmi or arm720t
cpu: arm7tdmi

#--------------------------------------------------------------------------------
# below is the machine(development board) config info
# machine(develop board) maybe at91 or ep7312
mach: at91

#-------------------------------------------------------------------------------
#NOTICE: this parameter is useless for skyeye-V0.3.1+
# have 7 memory bank (include RAM, ROM, mapped IO space)
# below is the memory config info
mem_num: 7
# map=M means ram/rom, map=I means mapped IO space,
# type=RW means can be read or written,
# type=R means read only,
# addr=0x..... means the mem bank's beginning address,
# size=0x..... means the mem bank's memory size, 
# file=... is the filesystem image file, used for uclinux4skyeye or armlinux4skyeye
mem_bank: map=M, type=RW, addr=0x00000000, size=0x00004000
mem_bank: map=M, type=RW, addr=0x01000000, size=0x00400000
mem_bank: map=M, type=R, addr=0x01400000, size=0x00400000, file=./boot.rom
mem_bank: map=M, type=RW, addr=0x02000000, size=0x00400000
mem_bank: map=M, type=RW, addr=0x02400000, size=0x00008000
mem_bank: map=M, type=RW, addr=0x04000000, size=0x00400000
mem_bank: map=I, type=RW, addr=0xf0000000, size=0x10000000

#now, add more options on mem_bank
mem_bank: map=M, type=RW, addr=0x10000000, size=0x00000800, file=./loader.bin,boot=yes

PS:好像和上面的memnum: 7矛盾?因为有8块mem.
#start binary program at 0x100000000

#----------------------------------------------------------------------------------
# below is the net config info
#
# type: cs8900a, rtl8019, rtl8019_16, s3c4510b
# mac=.... means the mac addr in simulated NIC,
# ethmod=tuntap/vnet means the virtual driver used in host evnironment,
# hostip=... means the ip address in host environment to interactive with skyeye.
# format: type=xxxx mac=xx:xx:xx:xx:xx:xx ethmod=tuntap/vnet hostip=dd.dd.dd.dd
#
# *********NOTICE**********
# If you run two more skyeyes at the same time,
# please use different skyeye.conf for each skyeye instance, and only one
# skyeye run first and related skyeye.conf content has hostip value:
#     ......
#     net: ... ethmod=vnet, hostip=ddd.ddd.ddd.ddd
#  other skyeye.conf should has content(hostip[0] should be 0):
#     ......
#     net: ... ethmod=vnet, hostip=0.ddd.ddd.ddd
net: type=rtl8019, mac=0:4:3:2:1:f, ethmod=tuntap, hostip=10.0.0.1

格式为 nic: state=on/off mac=xx:xx:xx:xx:xx:xx ethmod=tuntap/vnet hostip=dd.dd.dd.dd
注:xx表示两位16进制数,dd表示两位10进制数

  • state表示模拟开始后,网络芯片是否开始工作
  • mac表示模拟的nic的mac地址
  • ethmod表示skyeye所处主机上的网络模拟方式, 目前有tuptap和vnet两种模式。tuntap是linux kernel支持的一个点
  • 到点虚拟网络实现,vnet是
  • skyeye实现的一
  • 个功能更多的一个基于虚拟HUB的网络。
  • hostip表示主机方与skyeye交互用的ip地址

#------------------------------------------------------------------------------------
# below is the uart config info
#
# mod: stdio, pipe(fd_in/fd_out), net
# converter: dcc
#
# example:
# uart: mod=stdio
# uart: mod=stdio, converter=dcc
# uart: fd_in=/dev/ttyS0, fd_out=/dev/ttyS0
# uart: mod=pipe, desc=/dev/ttyS0
# uart: mod=pipe, desc_in=/dev/tty8, desc_out=/dev/tty9
# uart: mod=net, desc_in=192.168.1.163:21, desc_out=192.168.1.163:1121
#
# now you can use them to connect real serial port.
# you can add an option to skyeye.conf as below:
uart: fd_in=/dev/ttyS0, fd_out=/dev/ttyS0
#then use a terminal connect host's COM1, you can see the output in the terminal.

#-----------------------------------------------------------------------------------
#add log parameter which is used to recode the instr. flow and regs when
#program are running.
log: logon=0, logfile=/tmp/sk1.log, start=100000, end=200000

格式为 nic: state=on/off mac=xx:xx:xx:xx:xx:xx ethmod=tuntap/vnet hostip=dd.dd.dd.dd
注:xx表示两位16进制数,dd表示两位10进制数

  • state表示模拟开始后,网络芯片是否开始工作
  • mac表示模拟的nic的mac地址
  • ethmod表示skyeye所处主机上的网络模拟方式, 目前有tuptap和vnet两种模式。tuntap是linux kernel支持的一个点
  • 到点虚拟网络实现,vnet是
  • skyeye实现的一
  • 个功能更多的一个基于虚拟HUB的网络。
  • hostip表示主机方与skyeye交互用的ip地址
    #logon = 0 or 1 0:doesn't log, 1 do log
    #logfile: the filename which have the log info
    #start: the start point of instruction flow to log, should >=0
    #end:   the end   point of instructio flow to log

#-----------------------------------------------------------------
# below is the lcd config info
# type: au1100, ep7312, pxa, s3c2410x, s3c44b0x
# mod: gtk, win32, beos
lcd: type=ep7312, mod=gtk

#-----------------------------------------------------------------
# below is the touchscreen config info
touchscreen: type=skyeye, base=0xff00b000, size=0x20, int=17

#-----------------------------------------------------------------
# below is the sound config info
# It's recommended to turn on DBCT at the same time.
#
# example:
sound: type=s3c44b0x, mod=pcm, channels=2, bits_per_sample=16, samples_per_sec=22050

#-----------------------------------------------------------------
# below is the flash config info
# type: 28F128J3A, SST39LF160, SST39VF160, Am29LV160T-8, Am29LV160T-16,
#       Am29LV160B-8, Am29LV160B-16, Am29LV800T-8, Am29LV800T-16,
#       Am29LV800B-8, Am29LV800B-16
# dump: write to file when data written.
#
# example:
flash: type=Am29LV160T-16, base=0x00000000, size=0x02000000, dump=Am29.dump