Transplant of Linux and Embedded System of Boot Loader and LED Driver
Transplant of Linux and Embedded System of Boot Loader and LED Driver
Transplant of Linux and Embedded System of Boot Loader and LED Driver
Transplant of Linux and Embedded System of Boot Loader and LED Driver
Abstract—The widely used 32-bits embedded CPU not only functions more complex, so entirely by the programmer to
satisfies the need of high-speed provides processing, but also manage the overall system capacity is clearly insufficient,
a platform which makes the embedded speedily systems run And for each additional one feature is necessary to re-
steadily, and credibly. The use of the embedded operating design system, resulting in a tremendous waste of
system greatly accelerates the software development and resources and duplication of effort. Meanwhile, along with
enhances the system's stability and security. It plays an
the development of computer technology and integrated
important role in the embedded field. As its advantage of
circuits, hardware provided conditions are getting better
price, tiny kernel and rich resource, Linux has been widely
used in embedded system than the Windows in “black”. The and better, so choose an embedded operating system has
new coming 2.6 kernel has a lot of specialties for embedded become an inevitable trend.
applications, and also has some improving in arithmetic of Embedded systems embedded operating system is to
scheduling. All these make Linux to be a hot point in support the work of the operating system. It is the nature of
embedded system. This paper introduced the S3C2410x CPU knowledge systems and technology with general-purpose
and the system structure. Based on this, it mainly researched operating system, there is not much difference, generally
the development of system software. Firstly the paper used for more complex embedded system software
described how to establish the cross compiling environment, development [1]. Be able to effectively manage a complex
after that analyzed the working process of the embedded system resources to complete the process management,
boot loader, and based on the analyses of the Linux kernel processor scheduling, memory management, device
structure the paper discussed the methods of kernel porting management, interrupt handling tasks such as operating
and configuration. Then the paper presented theory of Linux systems; be able to hardware virtualization, allowing
device drivers, and designed several key device drivers, and developers to the driver from the busy port and
gave the detail implement scheme. maintenance freed; able to provide library functions,
drivers, tools and applications. Embedded operating
Keywords-embedded system; Boot Loader; Linux 2.6; system is important to the operation of an embedded
transplant; LED driver
system, environment and development platform, whether it
is efficient, stable, secure and so will have a direct bearing
I. INTRODUCTION on the success or failure of embedded systems has become
With the Internet's development and post-PC era, an embedded system design and development priorities.
embedded systems have become the focus of the current IT But Linux was originally developed for desktop
industry. As embedded system is of low power machines, which is used in embedded systems have some
consumption, small size, performance, reliability, industry- differences, such as memory capacity and limited
oriented applications, high and prominent feature of the compared to desktop computers, so how to transform
current, it has been widely infiltrated into science, Linux into a small capacity, high stability and easy the
engineering, military technology, business culture and the development of embedded operating system becomes a
arts, entertainment, as well as people's every aspect of critical issue. This also means that the embedded Linux
daily life and so on. We can imagine that some people may operating system, used in digital products and industrial
have never had any contact with computers, but can not control fields of a lot of work needs to be done[2].
imagine that he never had any contact with embedded
systems. Because embedded systems are everywhere, from II. BASED ON S3C2410X INTRODUCTION OF
EMBEDDED HARDWARE SYSTEM
the family's washing machines, refrigerators, bicycles, cars,
to the office of the remote conferencing system, etc., this is Embedded operating system and drivers transplant,
part of embedded products. Currently embedded need to be transplanted to the target hardware platform is
technology has become a hot research and application. more in-depth understanding. This optional use of
Early embedded applications is relatively simple, Samsung's embedded development platform based on
generally only in order to achieve some specific functions ARM920T core S3C2410x microprocessors, is designed
to meet the needs of a specific occasion, such as used in for PDA, Internet equipment, and handheld devices such
highly specialized types of industrial control, aircraft and as the development of high-performance, low-power
missiles and other weapons and equipment in, etc. In these microprocessor. This chapter analyzes the main
systems, running software is a simple control loop, so in characteristics of S3C2410x microprocessor, the system's
general do not use the operating system, but as the overall structure and characteristics, and a brief
application areas of embedded systems has expanded its introduction of the system of storage space allocation.
734
Authorized licensed use limited to: TU Ilmenau. Downloaded on June 16,2024 at 10:00:35 UTC from IEEE Xplore. Restrictions apply.
kernel with the ROOT FS was used; In addition, the future operation of the device control. Such as the application
system update will also use this mode. Working in this requires the use of equipment, with the system call open ()
mode, the Boot Loader to its end users usually provides a opens a device file, and build up the target device
simple command interface[6]. connection. For the implementation of the application
After the system power-on or reset, CPU is usually process is concerned, to establish a connection on the
from a pre-arranged by the manufacturer's address on the performance of an already open file. We can use after VFS
instruction fetch. CPU-based embedded systems usually Virtual File System calls related to the device handler in. A
have built a solid-state storage devices (such as: ROM, typical driver has the following features:
E2PROM, or FLASH, etc.) are mapped to this pre- (1) By a series of functions and data structure, it has to
arranged address. Thus, in the system after power, CPU communicate with hardware devices ,at the same time it
will be the preferred implementation of the Boot Loader has to follow the Unified interface provided by operating
program. Shown in Figure 1 shall be also equipped with a system kernel.
Boot Loader, the kernel boot parameters, the kernel image (2) Self-contained components that can be dynamically
and ROOT FS image of a typical solid-state storage device added to the operating system kernel or removed by the
space allocation chart[7]. kernel.
(3) It is to manage the user program and data flow
IV. SOFTWARE PLATFORM between peripherals and control flow.
Due to the tireless efforts of a large number of software (4) Belongs to the kernel part customized through the
elite, Linux in embedded systems applications more and device file to deal with the user program.
more widely. 2.6 kernel in a large number of new features B. LED Driver Development
to make them more suitable for embedded systems. It is
based on tried and innovative considerations, the system (1) Character device driver based on the right LED
uses a 2.6.11 kernel, as well as YAFFS file system. The control. Showed that some use is a 8X8 light-emitting
system's hardware circuit is based on SMDK2410, and its diode dot-matrix, we are frequently asked for
related knowledge points, have been the other detail. dissemination of information, display of Chinese
The following introduces the software environment characters dot matrix LED display usually has a number of
migration tasks. blocks of LED dot matrix display modules, 8X8 dot matrix
(1) Access to Linux kernel source file and its display modules, each 64 independent of the light-emitting
corresponding patch diodes, in order to reduce the pin and easy to package a
Linux kernel's official website is www.kemel.org. Any variety of LED matrix display module have adopted the
change on the kernel to update this site has been subject to. form of an array row cloth, that the ranks of the
(2) To obtain the source code YAFFS intersection of the line wherever there display LED. Thus,
Http://husaberptoby-churchill.com/h can obtain the LED dot matrix display module of the display driver can
necessary source code. only use dynamic driving method, each line can only lit
(3) Start transplantation LED (of the form yang dot matrix LED display module),
Extract the source files, and marked with the or an LED (total Yin Type LED dot matrix display
corresponding patch. We assume that all documents are module).
saved in the (2) I/O Interface
/home/yourmame directory In this development board, the entire LED display
#cd /home/yourmame module type as an I/O for control. DATA [0 ... 7], DATA
#tar-zxvf linux-2.6.11.12.tar.gz [8 ... 15] system data lines corresponding to the low 16-bit,
#cp -a ./linux-2.6.11.12 /usr/src LED_LOCK signal from the system bus write signal and
#cp patch-2.6.11.12.tar.gz /usr/src/ address signals derived by the combination of simple logic
#mkdir /usr/local/arm/ in the CPLD board to complete , control of the display
#tar -jxvf arm-linux-gcc-3A1.tar. 6z2 module's I / O address 0x20000000.
#cp ./3.4.1 /usr/local/ann/ S3C2410 LED driver:
#tar-zxvf yaffs.tar.gz #include <linux/config.h>
#cp -a ./yaffs fusr/src/linux-2.6.11.12/fslyaffs #include <linux/kernel.h>
#cd /usr/sre/linux-2.6.11.12/ #include <linux/module.h>
#zcat../patch-2.6.11.12.tar.gz!patch -pl -f #include <linux/sched.h>
#include <linux/interrupt.h>
V. LED MATRIX DRIVER DEVELOPMENT #include <linux/timer.h>
#include <linux/init.h>
A. OverviewLinux Driver #include <linux/delay.h>
After determining the basic functions of the kernel, the #include <linux/modversions.h>
remaining work is to develop the user's specific device #include <linux/version.h>
driver. With the support of device driver, hardware devices #include <asm/io.h>
can work properly. The driver actually controls the 1 / 0 #include <asm/irq.h>
devices, which contains a series of functions that are used #include <asm/hardware.h>
to control the peripheral. Linux will be the right function #define SimpleLED_MAJOR 97
of the operation of equipment in the form of a unified devfs_handle_t dev_handle;
interface to the file expression. Therefore, in Linux, all of int
the devices are files; the file can be achieved through the SimpleLED_temp_count = 0;
735
Authorized licensed use limited to: TU Ilmenau. Downloaded on June 16,2024 at 10:00:35 UTC from IEEE Xplore. Restrictions apply.
static long ioremap_addr; outw(0x55AA, ioremap_addr);
ssize_t SimpleLED_read(struct file *file, char printk("remap address = &x\n", ioremap_addr);
*buf, size_t count, loff_t *f_ops) return ret;
{ }
printk("s3c2410 : device file_read operation!\n"); int __init s3c2410_SimpleLED_init(void)
return count; {
} int ret = -ENODEV;
ssize_t SimpleLED_write(struct file *file, char ret = HW_SimpleLED_init();
*buf, size_t count, loff_t *f_ops) if (ret)
{ {
printk("s3c2410 : device file_write operation!\n"); return ret;
outw(count, ioremap_addr); }
return count; return 0;
} }
ssize_t SimpleLED_ioctl(struct inode *inode, int init_module()
struct file *file, unsigned int cmd, long data) {
{ s3c2410_SimpleLED_init();
printk("s3c2410 : device file_ioctl operation!\n"); }
} void cleanup_module()
ssize_t SimpleLED_open(struct inode *inode, {
struct file *file) devfs_unregister_chrdev(SimpleLED_MAJOR,
{ "SimpleLED");
return 0; devfs_unregister(dev_handle);
} }
ssize_t SimpleLED_release(struct inode *inode,
struct file *file) VI. CONCLUSIONS
{ Embedded technology development is inseparable with
outw(0x0000, ioremap_addr); operating systems, computer architecture, VLSI and other
return 0; basic subjects, at the same time, embedded systems
} development provide a broader development platform for
struct file_operations SimpleLED_ops communications, navigation and other applied sciences.
{ The design selected GX-ARM9-2410EP experimental
open : SimpleLED_open, system of Beijing's innovative company as the hardware
read : SimpleLED_read, platform, through the initial design, post-commissioning,
write : SimpleLED_write, transplant the embedded system Boot Loader based on
ioctl : SimpleLED_ioctl, S3C2410 and the operating system Linux 2.6 kernel, as
release : SimpleLED_release, well as LED dot-matrix driver development.
}; As the new 2.6 kernel has begun to make new
static int __init HW_SimpleLED_init(void) improvements in the new driver programme, we can used
{ new functions, in order to achieve the flexibility of the
int ret = -ENODEV; module.
int delay;
ret = devfs_register_chrdev(SimpleLED_MAJOR, REFERENCES
"SimpleLED", &SimpleLED_ops); [1] G. Eason, B. Noble, and I. N. Sneddon, “On certain integrals of
if (ret < 0) Lipschitz-Hankel type involving products of Bessel functions,”
{ Phil. Trans. Roy. Soc. London, vol. A247, pp. 529–551, April 1955.
(references)
printk("s3c2410 : init_module failed
with %d\n",ret); [2] Song, Yanzhao. Embedded operating system presentation and the
principle of selection. .2005,23 Industrial control computer (5): 41-
return ret; 43
} [3] Zhong Xichang. Embedded operating system in China's
else development status and pre-A Information Technology and
{ Standardization .2006,7 (6): 6-10.
printk(KERN_INFO"s3c2410 [4] Yang Rong, Wang Lin Dou, information appliances based on
SimpleLED register success!!\n"); embedded Linux operating system, analysis and application. East-
} 101
[5] Jiao Quan, Huang Rural Health, Bao-jun. U-Boot Porting the
S3C2410. Electronic design applications, 2006,3:126-128
dev_handle = devfs_register(NULL,
"SimpleLED", DEVFS_FL_DEFAULT,\ [6] Zhang Jin, JIANG Wei. U-Boot boot process analysis and
transplant step. Electric Power Automation Equipment, 2005,25 (7):
SimpleLED_MAJOR, 0, S_IFCHR, 68-71
&SimpleLED_ops, NULL);
,
[7] Bill Weinberg. Embedded Linux Is A Hit In Wireless
ioremap_addr = ioremap(0x20000000, 0x0F); Entertainment[J] Wireless System Design, ]an 2003.29-32.
736
Authorized licensed use limited to: TU Ilmenau. Downloaded on June 16,2024 at 10:00:35 UTC from IEEE Xplore. Restrictions apply.