Embedded Linux Design: Kernel Analysis


0

The Linux kernel provides support for memory management, inter-process communication mechanisms, interrupt management, and TCP/IP networks. The directory structure separates the structure-dependent code allowing for greater reliability with underlying algorithms and with specific code calls for specific platforms. It allows adding support for device-specific functions in a fairly straightforward manner. Most desktop Linux vendors provide the kernel as part of their distributions. These cores include support for a wide variety of hardware available in modern computing systems. Many of these features are built into loadable modules at runtime, which are required by a variety of automated hardware discovery tools. This approach allows Linux vendors to support a wide variety of systems using a single pre-compiled Kernel package. Unlike desktop computers, servers, or their corporate counterparts, embedded Linux systems usually don’t have a virtual kernel. The reasons for this are multiple, such as the general kernel’s inability to manage some custom embedded systems, as well as keeping the kernel’s configuration as simple as possible. The simpler configuration is easier to define, and it usually requires a smaller amount of resources. Like any open source project, the Kernel is constantly evolving and unit updates for new devices are the major changes. Linux systems support a lot of computers currently available in the market, and its flexible open code makes it scalable and adaptable to different custom systems. The flexibility of these systems is well suited to the integrated technologies in various fields of industrial management and control. Kernel selection Embedded systems design requires hardware compatible with the chosen operating system—Linux in this case. The choice of distribution includes several basic modifications and configurations to adapt it to the desired functionality. When you start working with Linux, more than one kernel is available for download from the official website http://www.kernel.org/ (kernel upstream). There are several appropriately dated versions that are intended for use in various Linux distributions. An older series (eg version 2.4) is still in use on many devices and is occasionally updated with maintenance releases. Linux kernel development for embedded devices tends to be segmented according to the respective processor architecture. For example, Russell King leads a group of developers actively developing Linux for ARM-based devices (via the website http://www.arm.linux.org.uk). ARM developers build their work on the original Linux kernel and develop specific patches for ARM. These source code patches allow for new hardware support and fix existing bugs affecting the ARM architecture in the upstream kernel. From time to time, these patches are included in several kernels through an automated process. There is no doubt that the Linux 2.4 kernel is no longer relevant for new embedded projects, since it has long been replaced by the latest version 2.6. While the 2.6 kernel series is known for its optimizations for large servers, it also adds a rich set of configuration options for embedded devices with limited resources. Despite the many benefits of using the 2.6 kernel, it took a long time for it to become a staple of new embedded systems. New versions after 2.6 are currently used, and the choice of kernel version depends on many factors such as: application, hardware and cost. The new version may not always be a good option. The main Linux kernel 2.6 series is publicly available from kernel.org. There are two ways to get the source code of this kernel: as an archive, with which it is possible to decompile a specific version of the kernel. These versions are standalone and released for development. For example, you can get kernel version 2.6.20 in a file called linux-2.6.20.tar.bz2. Using the Software Configuration Manager (SCM) tool, to track development as well as other official releases. You can also view kernel changes using a variety of tools, such as the gtik graphical change monitor that allows you to track development every day. The official kernel version is generally preferred when it comes to new embedded projects; The overall goal of all developers is to make changes in a later version of the official kernel so that they are immediately available for future projects. Traditionally, embedded developers have chosen a specific version of the Linux kernel and stick with it until drastic changes are made. This means that the kernel will pause some tasks to ensure that each application can use the CPU. For example, if an application is running but is waiting for some data, the kernel will pause the application to allow another program to use the CPU resources. Otherwise, the system may waste resources on tasks that are waiting for data or another program to run. The kernel will then force programs to wait or stop using the CPU. Portable Linux kernel. Portability is one of the best features that makes Linux popular and suitable for running on a variety of processors and systems. Some of the supported processor types include AMD, ARM, Intel, and many more. Linux Kernel Architecture The Linux kernel infrastructure (Figure 1 and Figure 2) has remained unchanged despite the different versions. It is based on a two-level distinction: Kernel space and User space. Programs are in user space, while Kernel is in Kernel space. The kernel can be divided into three sub-levels: system invocation (read and write), architecture-less kernel code, and system architecture-dependent code (Board Support Package, BSP). Its architecture can be divided into the following subsystems: Hardware Abstraction Layer (HAL) Memory Manager File System Scheduling I/O Subsystems (I/O) Network Subsystems IPC Hardware Abstraction Layer (HAL) Virtualizes platform hardware so that different drivers can Easily transferred to any device. HAL is equivalent to the BSP protocol available on most real-time operating systems (RTOS), except that BSP on commercial RTOS usually has standard APIs that allow for easy portability. HAL supports the following hardware components: processor, cache, MMU, memory mapping, interrupt handling, DMA support, bus management, and power management. Figure 1: Linux Kernel in System Figure 2: Linux Kernel, General Layout In Embedded Systems, Board Support Package (BSP) is code to implement a specific function of a particular board, corresponding to a particular operating system. It is usually built with a bootloader that has minimal support for loading the operating system and device drivers for all the devices on the board. The memory manager is responsible for controlling access to hardware memory resources and providing dynamic memory to kernel subsystems such as drivers, file systems, and network stacks. Linux scheduler provides multitasking capabilities and evolves on kernel versions with the goal of providing a deterministic process scheduling policy. In Linux, different file systems are managed by a layer called VFS, or Virtual File System, which provides a consistent display of data stored on different devices in the system. Any Linux machine, whether it’s an embedded system or a server, needs at least one file system. The need for file systems stems from the fact that all low-level devices can be accessed as files. Linux I/O subsystems provide a simple, unified interface to devices. Three types of devices are supported: Network devices. Interprocess communication on Linux includes flags (for asynchronous communication), pipes, and sockets, as well as System V IPC mechanisms such as shared memory and message queues. Direct access to hardware in general can be quite complex, as the kernel implements hardware abstractions like the Abstaction Layer described above. The goal of these abstracts is to provide a unified interface in order to simplify the work of developers. As a function of HAL, the kernel can be divided into three main categories: Monolithic kernel: directly implement full hardware abstraction. Microkernel: Provides a narrow set of abstractions and implementations for more functionality. Hybrid Kernels: Similar to a microkernel with added features to increase performance. You can find here the first episode of this series. .


Like it? Share with your friends!

0

What's Your Reaction?

hate hate
0
hate
confused confused
0
confused
fail fail
0
fail
fun fun
0
fun
geeky geeky
0
geeky
love love
0
love
lol lol
0
lol
omg omg
0
omg
win win
0
win
Joseph

0 Comments

Your email address will not be published.