Author: Chen Yu (yuchen@tsinghua.edu.cn) Tsinghua University
I. Skyeye configuration options
The hardware configuration and execution behavior simulated by Skyeye are determined by the options in the configuration file Skyeye. conf. Based on the options, Skyeye. conf options are divided into hardware configuration options and simulated execution options. Based on the number of parameters, the options of Skyeye. conf are mainly composed of two types:
- Single Parameter option line
Format:
Symbol: Value
Symbol can be defined by hardware, such as CPU and Mach, or execution control, such as log.
Value is the value corresponding to the symbol, which may be a number or a string.
- Multi-parameter option line
Format:
Symbol: opt1 = value1, opt2 = value2 ,......
Opt1 is the parameter name, value1 is the value corresponding to opt1, and may be a number or string.
Currently, the configuration of Skyeye. conf is defined as follows:
- Basic CPU core configuration options
Existing Options include arm710, ARM7TDMI, arm720t, ARM920T, sa1100, sa1110, and XScale.
Format:
CPU: cpuname
Note: cpuname indicates a string that represents the CPU name.
For example:
CPU: ARM7TDMI
- Specific Development Board (including CPU extension) configuration options
Currently, the following options are available: at91, EP7312, adsbitsy, pxa_lubbock, LPC, cloud4510b, cloud44b0, cs89712, sa1100, at91rm92, and sharp_l1_a400.
Format:
Mach: machinename
Note: cpuname indicates a string that represents the name of a development board based on a specific CPU.
For example:
Mach: at91
- Memory group configuration options
The addresses in a memory group are consecutive and can be divided into RAM space, Rom space, and mapped Io space.
Format:
Mem_bank: Map = M | I, type = RW | r, ADDR = 0 XXXXXXXXX, size = 0 XXXXXXXXX, file = imagefilename, boot = Yes | No
- Map = m indicates RAM/ROM space, and map = I indicates mapped Io space.
- Type = RW. If map = m, it indicates Ram space, type = R, and if map = m, it indicates Rom space.
- ADDR = 0 xxxxxxx indicates the starting physical address (32bit, hexadecimal) of the memory group ).
- Size = 0 xxxxxxx indicates the size of the memory group (32bit, hexadecimal ).
- File = imagefilename
The file value imagefilename is a string that actually represents a file, generally, it is an executable program in binary image format, an OS Kernel File, or a root file system in binary image format. If this file exists, Skyeye will directly write the file content to the corresponding simulated memory group address space.
- Boot = yes/no. If boot = Yes, Skyeye locates the address of the first command after the simulated hardware is started to the start address of the corresponding memory group.
For example:
Mem_bank: Map = m, type = RW, ADDR = 0x00000000, size = 0x00004000
Mem_bank: Map = m, type = r, ADDR = 0x01400000, size = 0x00400000, file =./boot. Rom
Mem_bank: Map = m, type = RW, ADDR = 0x10000000, size = 0x00000800, file =./loader. Bin, boot = Yes
- Configuration of network chip 8019as
Format: NIC: State = On/Off MAC = XX: XX ethmod = tuntap/vnet hostip = dd. dd
Note: XX indicates two hexadecimal numbers, and DD indicates two decimal numbers.
- State indicates whether the network chip starts to work after the simulation starts.
- Mac indicates the MAC address of the simulated Nic
- Ethmod indicates the network simulation mode on the host where Skyeye is located. Currently, there are two modes: tuptap and vnet. Tuntap is a point-to-point virtual network implementation supported by Linux kernel. vnet is a more functional virtual hub-Based Network implemented by Skyeye.
- Hostip indicates the IP address used by the host to interact with Skyeye.
For example:
Net: State = on, Mac = 0: 4: 3: 2: 1: F, ethmod = tuntap, hostip = 10.0.0.1
- LCD Configuration
LCD: State = ON/OFF
State = on indicates that the LCD is connected; State = off indicates that the LCD is closed.
For example:
LCD: State = on
- UART control options of Skyeye
The UART option controls the input/output characters of Skyeye on another terminal connected to a serial port.
Format:
UART: fd_in = indevname, fd_out = outdevname
- Fd_in = indevname indicates the name of the device file used for input. The value is the actual serial device file/dev/ttysx.
- Fd_out = outdevname indicates the name of the device file used for output. The value is the actual serial device file/dev/ttysx.
For example:
UART: fd_in =/dev/ttys0, fd_out =/dev/ttys0
- Log control options of Skyeye
The log option is used to control the execution status information of the hardware system output by Skyeye, including the execution command value, register value, and various hardware statuses when each command is executed.
Format:
Log: logon = 0 | 1, logfile = filename, start = number1, end = number2, length = Number3
- Logon = 0 | 1 | 2 | 3. If the value is equal to 0, no record is performed. If the value is equal to 1, the command and command address stream are recorded, if the value is 2, the command and command address and the content of the main register are recorded. If the value is 3, the command and command address and all register content are recorded.
- The value of logfile = filename is a string that indicates the name of the file used to record information.
- The value of START = number1 is a decimal integer> = 0, indicating that records are started when the system executes the number1 command.
- End = number2 its value is a> = 0 decimal integer, indicating that the system stops recording when it executes the number2 command
- Length = Number3 the value is a> = 0 decimal integer, indicating that only the information of the last Number3 commands executed by the system is recorded.
Format:
Log: logon = 0, logfile =/tmp/sk1.log, start = 100000, end = 200000, length = 100
Figure 0 1 logical structure of Skyeye hardware simulation
The hardware logical structure simulated by the Skyeye target simulation module is shown in Figure 0-1.
Ii. install and use Skyeye
1. Install Skyeye
Currently, Skyeye runs well in the Linux operating system. Skyeye can also run in windows through the mingw or cywgin software.
The following uses the Skyeye installation in the RedHat 9.0 environment as an example:
First, release the skyeye-x.x.x.src.tar.bz2 package (X. x. X indicates the version number of Skyeye. perform the steps described in the README or readme file ("#" in the following command is a shell prompt, and you do not need to enter it ):
(1) decompress the source code package (the hypothetical skyeye-x.x.x.src.tar.bz2 is placed in the "/usr/src" directory of the Local Machine). A Skyeye directory is generated in the current directory.
#cd /usr/src
# tar xjvf skyeye-x.x.x.src.tar.bz2
(2) enter the extract Skyeye directory and configure Skyeye
# Cd Skyeye
For versions earlier than Skyeye 0.6.0, run the following command for Configuration:
# ./configure --target=arm-elf --prefix=/usr/local --without-gtk-prefix --without-gtk-exec-prefix --disable-gtktest
If your Skyeye version is later than 0.6.0, LCD simulation is supported. To support LCD simulation, run the following command:
# ./configure --target=arm-elf --prefix=/usr/local
(3) then compile and install (after the following commands are correctly executed and the command ends normally, the/usr/local/bin/Skyeye execution program in the system is the installed Skyeye software .)
# make
# make install
Note the following points during compilation and installation:
- If you are using Mandrake Linux, you may encounter some errors related to Readline, ncurse, termcap, and other libraries during Skyeye compilation. You need to run the following command:
ln -s /usr/include/ncurses/termcap.h /usr/local/include/termcap.h
- Then re-compile
- If you are using Debian Linux, do not use GCC 2.95 or GCC 3.0. Use GCC 3.2 or later.
- The GCC version number used in your system should be greater than or equal to 2.96.
- If the Skyeye version is later than 0.6.0, you need to install GTK in your system (for LCD simulation ).
2. Use of Skyeye
Next we will use Skyeye to simulate a development board based on Atmel at91x40 and run μClinux to explain how to use Skyeye.
Step 2 install the cross-compiling environment and configure μClinux
Install the cross compiler first. Note that it is best to use the root user to perform the following operations. Set arm-elf-tools-2002.1619.tar.gz (20011219 indicates the time when the tool was generated. You can also select the updated arm-elf-tools .) In the root directory of the Local Machine, use the tarcommand to open it (the hypothetical arm-elf-tools-20042619.tar.gz is placed under the root directory "/" of the local machine ). The specific command ("#" in the following command is a shell prompt, and you do not need to enter it) is as follows:
#cd /
# tar /zxvf arm-elf-tools-20011219.tar.gz
Unbind uclinux-dist-20020927.tar.gz (assuming the software package is placed in the root directory of the Local Computer). For example, to unbind it from/usr/src/uClinux-Dist/, run the following command:
# cd /usr/src
# tar zxvf /uClinux-dist-20020927.tar.gz
Run the following command in the/usr/src/uClinux-Dist/directory:
- Commands available in graphical mode
# make xconfig
- Available commands in Command Line Mode
# make menuconfig
In these two interfaces, select GDB/armulator in the vendor/product options, and select 2.4.x in the kernel version. If other options are not changed, save the configuration and exit, and select Save and exit.
Step 2 compile and generate a file system for μClinux and an application
Solution
If you want to generate a Linux kernel execution file with debugging information, run the following command after the first step is completed:
# make dep; make linux
The Linux Kernel File With the elf execution file format is generated in the/usr/src/uClinux-Dist/linux-2.4.x directory. To generate a file system, run the following command:
# make romfs; make image
If the romfs. IMG file exists under/usr/src/uClinux-Dist/images/, the file system is successfully generated.
Solution B
To generate a Linux kernel execution file with debugging information and a Linux kenel execution file image and a disk image file romfs. IMG, run the following command:
# make dep; make
That's all. Check whether the romfs file exists in/usr/src/uClinux-Dist/images. IMG is in the/usr/src/uClinux-Dist directory. If yes, the compilation and installation are successful.
Step 2 run and debug the μClinux kernel with Skyeye
Assume that the working directory of Skyeye is located in/usr/src/uClinux-Dist. First, make some preparations:
Create the Skyeye hardware configuration file Skyeye. conf for the at91x40 Development Board in the working directory. A simple method is to extract a line starting with "For at91 (1) special for uClinux" from the README file in the Skyeye software package, starting with the third line below it, 9 rows in total) as Skyeye. conf:
cpu: arm7tdmimach: at91mem_bank: map=M, type=RW, addr=0x00000000, size=0x00004000mem_bank: map=M, type=RW, addr=0x01000000, size=0x00400000mem_bank: map=M, type=R, addr=0x01400000, size=0x00400000, file=./boot.rommem_bank: map=M, type=RW, addr=0x02000000, size=0x00400000mem_bank: map=M, type=RW, addr=0x02400000, size=0x00008000mem_bank: map=M, type=RW, addr=0x04000000, size=0x00400000mem_bank: map=I, type=RW, addr=0xf0000000, size=0x10000000 |
In this way, we can run the following command to check whether the Skyeye. conf file in the/usr/src/uClinux-Dist directory is consistent with the above content:
# more /usr/src/uClinux-dist/skyeye.conf
To establish a file system connection, run the following command in the/usr/src/uClinux-Dist directory:
#ln -s images/romfs.img boot.rom
This is basically the same as the content in Skyeye. conf. You can pay attention to the 5th lines in Skyeye. conf.
After completing the above preparations, you can use Skyeye to run and debug the μClinux kernel. We can try the following commands ("#" and "(Skyeye) "The following string must be input by the user ):
# cd /usr/src/uClinux-dist# /usr/local/bin/skyeye linux-2.4.x/linux(SkyEye)target simcpu info: armv3, arm7tdmi, 41007700, fff8ff00, 0 mach info: name at91, mach_init addr 0x813ebc0SKYEYE: use arm7100 mmu opsLoaded ROM ./boot.romConnected to the simulator.(SkyEye)loadLoading section .init, size 0xa000 vma 0x1000000Loading section .text, size 0xc5cb0 vma 0x100a000Loading section .data, size 0x8320 vma 0x10d0000Start address 0x1000000Transfer rate: 7077504 bits/sec.(SkyEye)runStarting program: /usr/src/uClinux-dist/linux-2.4.x/linux Linux version 2.4.19-uc1 (root@hpclab.cs.tsinghua.edu.cn) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgear.com/)) #1 Sun Sep 5 12:00:39 HKT 2004Processor: Atmel AT91M40xxx revision 0Architecture: EB01…… |
You can also set breakpoints for the kernel for debugging before run.
Pay attention to the following points when using Skyeye:
A. Be sure to execute Skyeye in the directory where memmap. conf (configuration file for earlier versions of the skyeye-0.2) or Skyeye. conf (configuration file for later versions of the skyeye-0.2) and boot. Rom are located.
B. memmap. conf and Skyeye. conf are both the hardware configuration files of Skyeye. Memmap. conf is applicable to versions earlier than skyeye0.2, while Skyeye. conf is used for Versions later than skyeye0.2.
C. when running the hardware configuration with network options, note that the user must be the root user, and the ifconfig command can be found in the current executable path.
D. when running hardware configurations with network options, you need to compile and install the kernel module Tuo. O (in the RedHat system, this module is in/lib/modules/2.4.x/kernel/Drivers/NET/tun. o)
E. Read skyeye.conf.txt to get the meaning of the configuration options of Skyeye. conf.
F. see the skyeye-binary-testutils-x.x.x.tar.bz2 Software Package (X. x. X indicates the version number. conf to configure a specific hardware simulation environment, and you can try to use Skyeye to run the compiled operating system kernel in this software package.
Here are some examples of Skyeye. conf:
FOR AT91 (0) special for ucosii-------------------------------------------cpu: arm7tdmimach: at91mem_bank: map=M, type=RW, addr=0x00000000, size=0x00004000mem_bank: map=M, type=RW, addr=0x01000000, size=0x00400000mem_bank: map=M, type=R, addr=0x01400000, size=0x00400000mem_bank: map=M, type=RW, addr=0x02000000, size=0x00400000mem_bank: map=M, type=RW, addr=0x02400000, size=0x00008000mem_bank: map=M, type=RW, addr=0x04000000, size=0x00400000mem_bank: map=I, type=RW, addr=0xf0000000, size=0x10000000FOR AT91 (1) special for μClinux-------------------------------------------#skyeye config file samplecpu: arm7tdmimach: at91mem_bank: map=M, type=RW, addr=0x00000000, size=0x00004000mem_bank: map=M, type=RW, addr=0x01000000, size=0x00400000mem_bank: map=M, type=R, addr=0x01400000, size=0x00400000, file=./boot.rommem_bank: map=M, type=RW, addr=0x02000000, size=0x00400000mem_bank: map=M, type=RW, addr=0x02400000, size=0x00008000mem_bank: map=M, type=RW, addr=0x04000000, size=0x00400000mem_bank: map=I, type=RW, addr=0xf0000000, size=0x10000000#set nic info state=on/off mac=xx:xx:xx:xx:xx:xx ethmod=tuntap/vnet hostip=dd.dd.dd.ddnet: state=on, mac=0:5:3:2:1:f, ethmod=tuntap, hostip=192.168.2.1FOR ep7312 (1) special for linux-------------------------------------------cpu: arm720tmach: ep7312mem_bank: map=I, type=RW, addr=0x80000000, size=0x00010000mem_bank: map=M, type=RW, addr=0xc0000000, size=0x00200000mem_bank: map=M, type=RW, addr=0xc0200000, size=0x00200000, file=./initrd.imgmem_bank: map=M, type=RW, addr=0xc0400000, size=0x00c00000FOR StrongArm SA1100 (1) speciall for linux-------------------------------------------cpu: sa1100mach: sa1100mem_bank: map=I, type=RW, addr=0x80000000, size=0x40000000mem_bank: map=M, type=RW, addr=0xc0000000, size=0x00800000mem_bank: map=M, type=RW, addr=0xc0800000, size=0x00400000, file=./initrd.imgmem_bank: map=M, type=RW, addr=0xc0c00000, size=0x01400000mem_bank: map=I, type=RW, addr=0xe0000000, size=0x08000000#0xe0000000 128M cache flush memory bank |
Iii. Summary
This article describes the hardware configuration options of the Skyeye hardware simulation platform and how to install and use Skyeye. If you are familiar with the use of Skyeye, the development and debugging of the operating system will be improved, in particular, I have a deeper understanding of how the operating system and drivers interact with embedded hardware systems.
References
- This article is written in chapter 3 of "Software Analysis and Practice of embedded systems open source code-Based on Skyeye and ARM development platform". If you are interested in Skyeye open source projects, read this book.
- Skyeye hardware simulation platform, Part 1: Skyeye Introduction