"Writing Embedded Operating Systems Step by Step" Reading Notes 1—Skyeye Introduction, Installation and HelloWorld

Publisher:GoldenHarmonyLatest update time:2024-11-18 Source: cnblogs Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

I have recently been reading "Writing Embedded Operating Systems Step by Step". I feel that this book is very good. Many parts are explained very clearly and are highly operational. I plan to read, practice and take notes at the same time, hoping to gradually become familiar with the underlying things of embedded operating systems, and eventually tailor a practical real-time embedded operating system. The alternative tailoring objects include ucos, RTlinux and uClinux.

SkyEye Introduction

"SkyEye is an instruction-level simulator that can simulate a variety of embedded development boards and support a variety of CPU instruction sets. The operating system running on SkyEye is unaware that it is running in a virtual environment, and developers can debug the operating system and system software through SkyEye. Since SkyEye's goal is not to verify hardware logic, but to assist in the development, debugging and learning of system software, there are some differences in the implementation of SkyEye compared to the real hardware environment. SkyEye does not guarantee that the timing of the clock beat is exactly the same as the hardware, and some hardware simulations that are transparent to the software have been simplified to a certain extent. The benefit of this is that SkyEye has a higher execution efficiency." For detailed introduction, see [here](http://www.ibm.com/developerworks/cn/linux/l-skyeye/part1/)


SkyEye Installation

It can be installed directly in Linux, and Cygwin must be installed first in Windows. You can find a lot of information on Google.
Two methods:
1.sudo apt-get install skyeye, version is 1.2.5
2. Compile and install it yourself.
My system is Ubuntu12.10, 64-bit. I have been trying for a long time, from 0.9 to the latest version, but I have never compiled and installed it successfully.
The reasons are as follows:
1. GCC and other versions have requirements
2. 64-bit Ubuntu needs to be compatible with 32-bit packages
3. For different Ubuntu versions, some macro definitions and functions need to be modified accordingly.
I have no choice but to temporarily use version 1.2.5 installed from the software source. No major problems have been found for the time being. The shortcoming is that it does not support the ARM920T used in the book well. It seems that the address mapping is incorrect, and the information printed out by the serial port cannot be displayed on the terminal. So I am now using the S3C44B0X of the ARM7TDMI architecture. For the examples mentioned in the book, the memory address in the code needs to be modified according to the chip manual.
Regarding installation, you can find a lot of information and solutions to common problems on Google, so I won’t go into details here.

HelloWorld
refers to [Hello world test under Skyeye](http://www.mculover.com/post/103.html)
1. Create a helloworld.c file: [root@localhost root]#vi helloworld.c

2. Enter the code: #define UTXH0 ((volatile unsigned int *)(0x01d00020))

//The serial port 0 send register address of S3C44B0X is UTXH0
void helloworld(void){
const char *p="HelloWorld!rn";
while(*p){
*UTXH0=*p++;
}
while(1);
}
3. Cross-compile. Use the arm-elf-gcc cross-compiler recommended in the book.
4. Compile the source code to generate the .o target file: [root@localhost root]#arm-elf-gcc -O -c helloworld.c, the newly generated helloworld.o file will appear in the current directory.
5. Link the target file to generate an executable file. Here, an elf format with a lot of information is generated: [root@localhost root]#arm-elf-ld -e helloworld -Ttext 0x00000000 helloworld.o -o helloworld. The newly generated helloworld file will appear in the current directory.
6. Compile the elf file into a .bin file: [root@localhost root]#arm-elf-objcopy -O binary helloworld helloworld.bin. The newly generated helloworld.bin file will appear in the current directory.
7. Create a skyeye.conf file in the current directory: [root@localhost root]#vi skyeye.conf
Input:

cpu:arm7tdmi
mach:s3c44b0
#2M Flash ROM
mem_bank:map=M,type=RW,addr=0x00000000,size=0x00200000,file=./helloworld.bin#IO Addr
mem_bank:map=I,type=RW,addr=0x01c00000,size=0x00400000

8. Run. Enter skyeye in the terminal
1


Reference address:"Writing Embedded Operating Systems Step by Step" Reading Notes 1—Skyeye Introduction, Installation and HelloWorld

Previous article:The relationship between BootLoader and kernel image
Next article:ECS operating system: hardware platform porting and driver programming

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号