Reading Notes building embedded Linux systems Chapter 2

Source: Internet
Author: User

Continue to work hard and start to learn Chapter 2: Basic concepts.
For Embedded Linux, you need to be familiar with the Linux system first, there are many, there will be more Linux systems, so do not limit with a single type. At present, the three largest are red.
Hat, Novell (sles) and ubuntu. If we select the popular Linux version as the development platform (Windows or UNIX can be used as the workstation), we generally use the eclipse-based image development environment.
There are three types of setup: linked
Setup; pluggable storage setup, Standalone
Setup. Target requires the development environment, bootloader, kernel, root, and file system. In linked
During setup, some ofProgramConnect the host and target through the network cable or RS232, which is usually used for development commissioning,
The kernel can be obtained through TFTP, and the file system can be mounted through NFS to avoid a large number of copies during development. Removable
Storage
The setup method is often used for initialization. the bootloader is on the target, and the others are in pluggable storage media. In the first two methods, the development environment is on the host.
Standalone
The setup method is no different from our PC development. It is developed directly on the machine, and all the things are on the target, just as we did in Linux
VoIP monitoring instrument developed on the kernel. Linked and standalone can be used together.
There are three methods for debugging setup: serial port, network, and specific debug hardware. The serial port receives the baud rate limit and the limit for connecting to a terminal, but it is suitable
Perform kernel debugging. The serial port and network will use some basic I/O software on the target. For some new sections, these software does not exist during the kernel test. Therefore, we need
Special debug hardware, such as JTAG and BDM for CPU
Pin, these are relatively expensive compilers, and may need to establish a good partnership with the CPU manufacturer, sign for NDA.

The structure of the Linux operating system.
The underlying hardware includes at least 32-bit CPU (including MMU: Memory Management
Unit), Ram, I/O capabilities (debug debugging is allowed), and root filesystem (either local or network ).
Kernel is a true Linux. Underlying interfaces control hardware resources through independent hardware APIs, such as memory.
Pages: Processes operations on specific CPUs, memory operations on specific architectures, and basic device interfaces. Code Including header files, macros, and encapsulated functions. Senior Management
Provides abstract expressions for all UNIX-based systems, including processes, files, sockets, and signals. The underlying interfaces of kernel are common to different platforms.
Almost the same. "There is a BSP here. BSP should be the card support package for hardware control based on the underlying interface of the Linux kernel 』.
Between these two layers, the kernel needs to parse components to exchange data, which is the file system and network protocol. In embedded systems, Flash is often used as the storage medium. Different storage formats
Through different engines, the Linux Virtual File System (VFS) provides unified APIs for upper-layer use. Both fat and ext3 are VFS. Storage device manufacturers now provide a higher level
Abstract: Linux uses the ext File System for this development. In a file system, there must be at least one root
Filesystem is used to load the first app run in the system. It usually includes the module reprinting to provide a working directory for the process. The root file system can be a real hard
Storage device, or the system startup is the value to ram, which is generally the first method.
Deploying the so-called app directly on the kernel is not suitable and requires the support of Lib. GNU
C. For dynamic links, the related Lib is not used as the binary code of the app. You can share multiple apps together. C
LIB can be loaded together in RAM for sharing. However, some embedded operating system applications do not need to store the entire lib online.
The system startup design consists of three parts: bootloader, kernel, and INIT process. The bootloader is related to the underlying hardware. initialize the underlying hardware and enter the startup of the kernel.
Code. The startup code of the kernel varies greatly from platform to platform before a C code runtime environment starts. After the C environment is started, start_kernel () is run, which initializes the kernel high-level functions, mount the root file system and start the initial process.
The first CPU instruction is obtained from an address specified by the manufacturer. This address is usually a fixed storage device, Rom or flash chip. The above software is used
Bootstrap. Many Linux embedded systems use solid storage, including the initial Bootloader and related configurations (boot
Parameters), kernel and Root
Filesystem. Bootloader may prevent low-level solid-state storage addresses or high-level addresses. Therefore, many flash devices provide both high-level and low-level address configurations.
And usually provides a protection mechanism for the bootboader area. Although it is divided into four parts, the boot parameter can prevent sub-bootlader and kernel from
In root filesystem, in linux2.6, you can easily package the kernel and root file systems as an IMG if needed. Boot
Storage media can use devie
Programmer for initial programming. Out of the solid state storage device, there are two methods: disk and network. For disks
Load a second bootloader with larger and more functions, or directly obtain the kernel from the disk. The root file system or File System
System + kernel is placed on the network. He accesses the kernel through TFTP and mounts the root file system through NFS. This method is suitable for early debugging.
The physical address stored in the system differs greatly from the virtual address of the kernel (which becomes a logical address in the x86 system). Many hardware peripherals can obtain the physical address, but the physical address cannot pass
Obtain the virtual address. Therefore, if we need to set the kernel or develop our own driver, we need to understand these physical addresses. At startup, bootloader
Kernel reads to Ram and jumps to the kernel start
Routines, which will be executed by Linux later. When Linux runs, the program uses a virtual address, which will configure the kernel and the driver of the device.
Some driver information is stored in the kernel space, some are stored in the user space, and some operations require data interaction between the two.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.