In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "what are the characteristics of the Linux2.6 kernel embedded system". In the daily operation, I believe that many people have doubts about the characteristics of the Linux2.6 kernel embedded system. The editor consulted all kinds of materials and sorted out the simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "what are the characteristics of the Linux2.6 kernel embedded system?" Next, please follow the editor to study!
1. Preemptable kernel
In previous kernel versions, including the2.4 kernel, it was not allowed to preempt tasks running in a kernel state (including user tasks that entered kernel mode through system calls) and had to wait for them to actively release CPU. This will inevitably lead to delays in some important tasks to wait for the system call to finish.
A kernel task can be preempted so that important user applications can continue to run. The main advantage of doing so is to greatly enhance the user interaction of the system.
The kernel is not a real RTOS (Real Time Operation System). It inserts preemption points into the kernel code, allowing the scheduler to abort the current process and call higher priority processes, and to avoid unreasonable system call delays by testing preemption points. The 2.6 kernel is preemptive to some extent and is more responsive than the 2.4 kernel. But not all kernel code snippets can be preempted, and key parts of kernel code can be locked to ensure that the data structure and state of CPU are always protected from preemption.
There is a contradiction between the software's need to meet the final time limit and the virtual memory request page scheduling. Slow page error handling will destroy the real-time responsiveness of the system, and the 2.6 kernel can compile non-virtual memory systems to avoid this problem, which is the key to solve the problem, but requires software designers to have enough memory to ensure the execution of tasks.
two。 Effective scheduler
Version 2.6 of the Linux kernel uses a new scheduler algorithm, called the O (1) algorithm, developed by Ingo Molnar, as shown in figure 1. It performs extremely well under high loads and scales well when there are many processors in parallel [2]. In the past, schedulers needed to find entire ready task queues and calculate their importance to determine which task to call next, and the time required varied with the number of task. The O (1) algorithm no longer scans all the tasks every time, but is put into an active queue when the task is ready, and the scheduler schedules the appropriate task every time, so each scheduling is a fixed time. When the task runs, it allocates a time slice, and when the time slice ends, the task discards the processor and transfers it to the expiration queue according to its priority. After all the tasks in the active queue are scheduled, the two queue pointers are exchanged, and the expired queue becomes the current queue, and the scheduler continues to schedule the tasks in the current queue with a simple algorithm. In the case of multiprocessors, this can improve the efficiency of SMP, balance the load of processors, and avoid the jump of processes between processors.
3. Synchronous prototype and shared memory
Multi-process applications need to share memory and peripheral resources. In order to avoid competition, mutexes are used to ensure that resources are accessed by only one task at a time. The provincial inux kernel uses a system call to determine whether a thread blocks or continues to execute to achieve mutual exclusion, and this time-consuming system call is not necessary when the thread continues to execute. The Fast User-Space Mutexes supported by Linux2.6 can detect whether a thread needs to be blocked from user space and only execute a system call to terminate the thread when needed. It also uses scheduling priority to determine the process to be executed [4]. The processors of the multiprocessor embedded system need to share memory, and the symmetrical multiprocessing technology uses the same priority for memory access, which limits the scalability and processing efficiency of the system to a great extent. Linux2.6 provides a new management method-NUMA (Non Uniform Memory Access). According to the topological layout of processors and memory, NUMA gives different processors different levels of permissions to solve memory preemption bottlenecks and improve throughput when memory competition occurs.
4.POSIX thread and NPTL
The new threading model is based on a 1:1 threading model (one kernel thread for one user thread), including kernel support for the new NPTL (Native POSIX Threading Library), which is a significant improvement over the previous kernel threading method. The kernel also provides POSIX signals and POSIX high-resolution timers. POSIX signals is not lost and can carry communication information between threads or processors. The embedded system requires the system to execute tasks according to the schedule. POSIX timer can provide 1kHz triggers to make all this simple, so that the progress can be effectively controlled.
5. Support of microcontroller
The Linux2.6 kernel adds support for a variety of microcontrollers. Previously, MMU-free processors could only take advantage of some improved branch versions, such as uClinux, but the 2.6 kernel has integrated it into the new kernel and began to support a variety of popular MMU-free microcontrollers, such as Dragonball, ColdFire, and Hitachi H8gam300. Linux still supports multitasking on non-MMU controllers, but does not have memory protection. At the same time, many popular controllers are supported, such as S3C2410 and so on.
6. Application oriented
Embedded applications have the characteristics of user customization, and the hardware designs are developed for specific applications, which brings problems to the system to support non-standardized design (such as IRQ management). In order to better implement it, a component-based operating system can be used. The subsystem architecture adopted by Linux2.6 is modular and can be customized with minimal impact on other parts. At the same time, Linux2.6 provides support for a variety of new technologies to achieve a variety of application development, such as Advanced Linux Sound Architecture (ALSA) and Video4Linux, which makes it more convenient for multimedia information processing; support for USB2.0, provides higher speed transmission, and adds Bluetooth wireless interface, audio data link and link-oriented data transmission L2CAP to meet the needs of short-distance wireless connections. It can also be configured as a purely user interface-free system without input and display in the 2.6 kernel.
At this point, the study on "what are the characteristics of Linux2.6 kernel embedded system" is over. I hope to be able to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.