Symbian study notes

xiaoxiao2021-03-05  24

Part II: System Structure

Four software applications running on Symbian OS uses activity objects and customers-optimized hardware resources to the Event processing system: a CPU, 32-bit ARM a ROM (read-only memory), there is an operation The system and built-in middleware and application ROM disk are mapped to Z: disc, all files can be accessed via Z: disk. System RAM. System RAM is used in two aspects, one is used by the current active program and system core, and the other is a disk space as a "C" disk. The size of these two parts is changed, and some size cannot be retained. Since RAM usually only 8MB to 16MB, the memory may be used up, so there is often a bundle error or (write file) disk has fallen error IO device, including a touch screen, keyboard, memory card with digital pen, keyboard, memory card Put), RS232 serial port, infrared port, Bluetooth. The difference between the power supply, including the battery and the external power source Symbian OS and PC systems are as follows: Resource limit: CPU is too slow and too small memory without a hard disk, can't use virtual memory written to the hard disk, can not guarantee enough space save programs or data files The power supply is strict. The Symbian software environment is as follows: Server | Server | Application | Application | Application DLL | | ---- ----- Boundary | | | | | | | - -- ----- ----- Privilege Boundary Kernel Kernel works in the high level, manages all hardware resources of the machine. Other software modules provide access to these hardware resources, other applications work in user mode If you understand normal operating systems such as Linux, there is no distinguishing application with a normal operating system is a program with a user interface, in an independent process. Running this with a normal operating system is also a program that does not have a user interface. Service manages one or more resources, and provides the API to allow customers to access its service. Service customers can be a program or other services. A service is also running in a standalone process space. In Symbian, use the service form to provide functions similar to other operating systems or kernel programs. If the file system access is also a customer / service type. (Micron Nuclear) Engine is a part of operational data instead of interacting with the user. Usually you can divide a program into an engine section and a GUI section, and multiple Symbian's inner bands are doing this. An application engine can be a separate code module or a separate DLL, or several DLL. Engine and the border between the applications are the boundaries of the module or DLL. So there are four components types and three boundary types in Symbian. DLL or module components are very convenient to cross reference. They make the system modularly and keep the package. The permission boundary is more expensive for cross-references, but guarantees the system to hide the kernel and device process boundaries in the user. It is the most expensive in all intersections, which guarantees that the format of each program executable file in the RAM has two in Symbian. Types of executable: EXE, each program has a primary entry E32MAIN () (see the above example), running a DLL in a separate process, providing multiple portions, system or existing threads ( Process) There are two types of DLLs, shared library DLLs, providing fixed APIs for one or more programs, which are read to memory when the program starts. Polymorphism DLL, these DLLs implement abstract API, such as a printer driver, a Socket protocol, or an application. Their extensions are not .dll, but .prn or .prt or .app, etc.. They inherit from class associated with DLL and usually only read when they need them.

It is technically shown that static load and dynamic load in the normal system are not different, but it is different from functionally, one is to implement some special function, from a certain type inherited DLL, The other is that the ordinary DLL code is executed if the program code is on the ROM, otherwise it is necessary to read the RAM (different from the ordinary operating system, the normal operating system needs to be read in the RAM can be executed directly on the hard disk) Including three types of binary data: program code read-only static data can be written in Symbian. EXE and .DLL are different. EXE is unable to share, if it is executed in RAM, then ordinary PC system There is no difference, if executed in the RAM, then it is shared in the RAM to write static data. DLL is shared. When the DLL reads in the memory, it is assigned to a special address, the second thread When this DLL is required, it can only be accessed to visit the already existing COPY. The address of the DLL in all the processes that use it is the same. The Symbian system maintains a reference count that will not be unloaded when there is no other thread reference. The DLL on the ROM is directly optimized on the ROM like the EXE on the ROM. Symbian is operated as follows; most system support Through the number of ports provided by the name and passing the DLL, since the name is too long, the space is wasted, Symbian only provides access to digital access, of course, you can pass the name LINK at LINK. That is to say, there is no name access method in .dll, in. LIB (boot library, boot Linker's correct link DLL, this is the concept used in Windows, every creation of a DLL under Win creates a user boot link with the same name. LIB), your program LINK is LINK Yes .LIB, LINK, the compiler will automatically turn the code of the reference DLL into a digital reference. If the DLL is read to RAM, that relocation information (what address to the DLL LOAD) must also be included in the executable file format, this The impact is that you cannot put a program executed in the ROM to the program executed in the RAM. (More OEM manufacturers in the ROM, so ordinary developers don't have to care) Most applications have their own EXE to create a process, Other programs use dynamic library (DL) L form, calling their own threads in the primary service thread, multi-Polymorphic DLL, has a primary entry point newApplication (), this entry point creates and returns one Inherit the object from CeikApp Science. Such a program is called by apprun.exe, and the App file name is incorporated. The power management power must be efficiently used when the system is turned off, and the determination program can still be run. Such as auntie, after shutting down, when it is still turned off, the key data should be able to save the device driver, although it generally does not understand it, but understanding is still a very useful device driver working in two levels. The first one is Interrupt Services (ISR), ISR must be short and can't do a lot, because it may appear at any time, even in kernel services. Usually it simply notify the device generated an interrupt and set a flag, requiring the core as a second phase of the processing to run a delayed function call (DELAYED FUNCTION CALL DFC) When the kernel scheduling DFC.DFC can use most core APIs, usually Just work, notify the user thread to notify the IO operation The Timer `Kernel support real machine 64Hz clock is the highest priority interrupt, which can pass User :: after or RTIME :: after access. The clock is interrupted when shutdown, so if you request a 5S timed operation, then run 2S, shut down, then it will wait for the 3S kernel to support the date / time clock, you can use User :: AT or RTime: : At. This timer is very accurate.

When turning off, if time is time, it will turn on, which is very suitable for the alarm. Memory Symbian uses a memory management unit (Memory Management Unit MMU) Manage Memory ROM being mapped to z: disk, is mapped to a fixed address. Physical RAM is divided by the MMU in the 4K page, each physical page can be used: the virtual address space of the user process. The virtual address space of the kernel service, the drive letter is C:, the RAM disk can only be accessed by file service process If the DLL is not in the ROM, then it is read to RAM, the DLL is read into the RAM, the page is marked as read only only Read. MMU's page conversion table. If you want to understand, learn the operating system principle Free page table Each process is divided into three categories: system range memory, such as the system's ROM or DLL process in the RAM or DLL process range Memory, such as a process. EXE image and its writeable static data each thread's memory, including thread stack and thread default heap (why the reason for using thread default stack is just to improve memory allocation and release speed, from From the perspective of development, it is not distinguished from memory in the system). Note that there is no exchange file, so all memory is used directly. At the same time, there may be no internal memory or disk (C is full of errors, the default stack of each thread is small, only 12K, so do not put too much things in Symbian, the general object is in the stack Allocated. After the thread is created, its stack size will not change again. Threads can be allocated from the thread or user :: alloc from the thread default heap. If you want to allocate memory from other stacks, you can only use the New Dynamic Library ( DLL) Symbian does not support writeable static data, so you can't use a writable global variable or static variable inside. Why don't you support it? If you support, when you support this DLL, you need to call this DLL. This process allocates a separate heap, and the minimum unit of the heap is 4K. There are many piles in the system, so there are many programs, so the memory consumer fund is very big. So, it is not very inconvenient to develop this time? You must save your own status in the DLL, interacting in order to solve this problem, the Symbian introduces thread local data (see DLL :: TLS DLL ;; SetTLS). But call TLS performance is slower. The maximum size of TLS is 1.8K is usually used. File: C: Flash RAM disk Z: ROM disk D: Memory rod Event processing Event processing model as shown below: KeyBorad | ------- - | Interrupt | KERNEL / Driver - - ISR / DFC | Key Event | | Window Serv - Handle Key Event ---- Update Window | | | KEY EVENT DRAW | Request Application ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Handle ---- Key Event Use the activity object in Symbian to handle the event in the Symbian OS, all Symbian OS threads are event processors, each thread has an active scheduled object, plus one or more Active objects handle events from devices or other programs. Each activity object has a virtual member function runl (), in which events are handled in this function. Multi-task and seizuen Symbian OS implement preemptive multi-threaded. Active object is used to implement non-seizuated multitasking articles in a single thread: http://symbian.org.cn/bbs/viewtopic.php? T = 897

转载请注明原文地址:https://www.9cbs.com/read-38062.html

New Post(0)