Now I will talk about the design schemes we adopt in eka2 and how they help us achieve our goals.
1.3.3 . 1 multi-thread preemptible Kernel
To reduce the thread execution period, we designed eka2 to be multi-threaded, allowing low-priority kernel operations to be preemptible by high-priority kernel operations.
Eka2 has five threads:
1. null thread -- idles CPU, and de-fragments Ram. This thread is also called idle thread
2. Manager thread-kill killed threads and processes (killed threads and processes) to delete asynchronous objects
3. DFC Thread 0: Run DFC as a driver for common devices such as comms, motherboard, and digital converter
4. DFC thread 1 -- run the microkernel clock queue
5. Timer thread-relative and absolute timers running Symbian OS (after (), ())
In chapter 3, threads, processes, and libraries, I will describe in depth the purpose of these five threads.
The nature of kernel multithreading also helps us achieve another goal-making the work of Device Driver writers easier. You often want to transplant device drivers from another operating system, however, eka1's single-threaded Device Driver Model means porting a multi-threaded device driver is not a simple task-you often have to design the driver from scratch. In eka2, the device driver can use DFC Thread 0 or create its own thread as needed. With these mechanisms, the design on other operating systems can be reused, and now the porting is simpler.
1.3.3 . 2. microkernel
We chose to have an independent microkernel, because it has the following advantages:
1. Very few and predictable interruptions and thread execution periods. This is because only the microkernel can disable interrupt and execute rescheduling (there are many exceptions in this regard, but they are not important here ). Most of the Symbian OS kernel and memory models are interrupted during operation and priority preemption is allowed. Because the microkernel only provides a simple small segment, we can easily decide the longest execution period for which to disable interruption and rescheduling.
2. better and simpler simulation. The Symbian OS simulator running in Windows has a lot of the same Code as the actual device, which means that the simulation in this case is more realistic than what was done on the eka1 simulator.
3. Support for Single-core calls. The microkernel allows an RTOS and Its GSM signal stack to run outside Symbian OS and Its PIM software, 1.3.2 Section 4 describes more details in this regard.
1.3.3 . 3 adequacy
The new kernel makes it easier to port the operating system to the new ASSP. Most of the dedicated processor code is on the microkernel, and the difference between memory and MMU is limited in the memory model.
Thanks to the memory model, it is easy to use the Direct Memory Model to transplant the operating system to the new CPU Structure in the early stages, and switch to the mobile or polymorphism model after a lot of debugging. It allows you to port the operating system in a few simple steps.
1.3.3 . 4 design limitations
The Design of Real-time performance in eka2 has two limitations:
1. To ensure a deterministic interrupted execution period, we cannot allow an infinite number of interrupted service programs to be bound to an interrupted resource. This is possible in eka1. Now, only one ISR (interrupt service routines) is bound to an interrupt ).
2. To ensure a limited number of context conversions, we must limit a thread to a maximum of eight blocks. In eka1, this number is not limited. (Block is a basic object for memory allocation in Symbian OS-Chapter 7 memory model will show more details about this .)
It is very important that not all eka2 services are restricted to real-time conditions. For example, there is no such limit for memory allocation and release. Chapter 2: real-time performance. This issue will be discussed.
========================================================== ========================================================== =====
Note: This article is translated by bequan from Symbian press's Symbian OS internals: Real-Time Kernal programming book. Anyone who needs to repost or reference, please first contact bequan via email (a-pangu@163.com or symbianchn@gmail.com), can be reposted or referenced after obtaining permission, otherwise it is deemed as infringement. When reprinting or referencing, please indicate the above translation information in the article.