Concepts with Symbian OS (779878), страница 11
Текст из файла (страница 11)
In Symbian OS, one really has no idea howthe file object is implemented; one simply creates an RFile object anduses its methods.Symbian OS has other inherited features. It is a multitasking andmultithreaded operating system. Many processes can run concurrently,they can communicate with each other and utilize multiple threads thatrun internal to each process. The operating system has a file systemcompatible with Microsoft Windows (technically, a FAT32 file system); itsupports other file-system implementations through a plug-in interface. Ituses TCP/IP networking as well as several other communication interfaces,such as serial, infrared and Bluetooth.Symbian OS has some unique features that come from its focus onthe smartphone platform.
Because of limited (or, in most cases, no) diskstorage, no virtual memory is implemented. Symbian OS has a pluggablemessaging architecture – one where new message types can be inventedand implemented by developing modules that are dynamically loaded bythe messaging server.Consider the way system calls work in Symbian OS. There are two typesof system call. An executive call makes a request for the kernel to execute3Note that the origins of Symbian OS can be found in EPOC (as stated in Chapter 1) andEPOC was not designed for smartphones. However, when Symbian OS was designed as areplacement for EPOC, it was indeed intended for smartphones and was designed with thistarget platform in mind.SUMMARY43an operation in privileged mode on behalf of the user-space requestor. Anexecutive call causes a software interrupt, which is serviced by branchingthe operation into kernel code.
The interrupt is serviced and control ispassed back to the user. Executive calls can modify kernel-space objectsbut cannot create or delete them. Operations such as memory allocationor thread creation need to be done by kernel-server requests. There isa server that protects kernel resources and requests to manipulate thoseresources need to go through that server. Server requests are themselvesexecutive calls.• The kernel structure of Symbian OS has a microkernel design.
Minimalsystem functions and data are in the kernel with many system functionsspread out into user-space servers. The servers get their jobs done bymaking executive calls into the kernel when necessary.• Symbian OS supports the use of virtual machines: the implementationof a ‘computer within a computer’. The implementation of the Javaprogramming language and the run-time environment needed to runJava is done through this mechanism.• Communication structures in Symbian OS are easily extended. Modules can be written to implement anything from user-level interfacesto new protocol implementations to new device drivers. Because ofthe microkernel design, these new modules can be introduced andloaded into the operation of the system dynamically.• Symbian OS has been designed at its core with APIs specialized formultimedia.
Multimedia devices and content are handled by specialservers and by a framework that lets the user implement modules thatdescribe new and existing content and what to do with it.2.4 SummaryThis chapter has been about the concepts and structures that make up thecharacter of an operating system. Operating systems evolve over time asthe hardware they run on and the needs of users evolve.We discussed several concepts that are implemented in operatingsystems. We looked at system structures, including kernels, the interruptsystem and how applications become processes running on a CPU.
Welooked at the different kinds of device I/O and how interrupts are used to44THE CHARACTER OF OPERATING SYSTEMSimplement them. We had an overview of storage structures, including thestorage hierarchy and the ideas involved in caching and file systems. Welooked at system protection strategies, from protection modes to waysof protecting memory and CPU usage.
We reviewed communicationstructures, implemented by sockets.The chapter concluded by taking examples of operating system character: we looked at IBM OS/360, Unix and Symbian OS.The next chapter begins our closer look at these operating systemcomponents by looking at processes and scheduling.Exercises1.Consider the following services and classify them as taking place inthe kernel or outside the kernel. Do this for both microkernel andhybrid kernel systems.a. Opening and closing filesb.
Writing to a registerc. Reading a memory celld. Receiving a text messagee. Playing a sound bite.2.Software interrupts are useful for many things. We discussed timersas an example of software interrupts. Think of other examples ina computer system of software interrupts. (Hint: Think of softwareinterrupts as events.)3.With software interrupts, what form does the interrupt vector take?Where is it stored?4.Context-switching is expensive because of the ‘context’ that isswitched. Try to identify as many parts of this context as you can.5.Often people think of ‘protection’ as ‘security’.
We discussed waysto protect user programs and the operating system from each other.In what ways could the protection mechanisms we discussed be aform of security?6.We gave a few examples of device I/O types. Can you developmore examples for each I/O type? Explain your answers.EXERCISES7.45Which of the following operations should be done in the kernel asprivileged mode?a. Reading and writing filesb. Sending a text messagec.
Taking a picture with the camerad. Notifying a program about data receivede. Switching processes on the CPUf. Reading from a memory cell.8.What would a system look like without a privileged mode? Couldsuch an operating system be useful? How would it be possible toimplement protection?9.Systems typically have multiple caches built into the hardware; wecalled them L1 and L2. Why is multilevel caching useful?10.Survey the concepts and structures we discussed in this chapter.In what ways would hardware be useful to help implement aspecific structure? For example, how could hardware help withcontext-switching or memory protection?11.How would you classify a kernel that implemented the variousforms of the OS/360 operating systems?12.As we discussed, Symbian OS uses two levels of kernel spaceoperations: the executive call and the kernel-server request.
Whywould this be necessary? Why should executive calls be barredfrom creating objects in the kernel? (Hint: think about the usefulnessof the servers in a microkernel.)13.Symbian OS has an object-oriented design. Survey our discussionof Symbian OS and flag places where object orientation wouldcomplement the design strategies.14.Symbian OS is designed for use on smartphones. Consider a smartphone platform and identify the forms of communication that itwould use. For each of these forms of communication, identify thetype of device I/O that could be used to implement that form.15.Consider your answer to the previous question. Must Symbian OS bea real-time operating system? Are there portions of system operationthat do not have to operate in real time? How does the microkerneldesign of Symbian OS help reduce the need for real-time operation?3Kernel StructureA computer network is functioning at its best when no one notices it.When it is working properly, computers communicate with each otherwith ease and users pay no attention to how their web browser works orthat email must travel long distances to get to their computers.
In reality,there are many subsystems that co-operate to make a working networkfunction properly. When a web browser requests a web page and itsimply appears, it is easy to ignore the complicated layered structure thatunderlies the ease of a network’s function.The same can be said of the kernel structure of an operating system.When it works well, it is easy to ignore that it is even there.
However, thestructure of an operating system’s kernel is at center of its character andessential to its proper function. It is useful to examine what a kernel iscomprised of and how a kernel works. This chapter examines a kernel inseveral ways. We discuss how a kernel is put together, that is, what partsmake up a kernel. We then discuss how system calls interact with kernelcode and what paths a system call might make through the kernel.
Wefollow with a similar discussion about interrupts. We wrap up the chapterby taking a hard look at an example: the Symbian OS kernel.3.1 How a Kernel Is Put TogetherThe design of a kernel is very important to the performance of thecomputer it runs on. We discussed kernel design – especially monolithickernels and microkernels – and we noted how certain kernel designs work48KERNEL STRUCTUREbetter on specific types of computer platform. For example, we saw howkernels with a microkernel design work better on smartphone devices.Symbian OS is an operating system that has a microkernel architecture. Itis great example of a kernel that has a layered structure. We provide anoverview of that structure in this section.It is interesting to look at kernel design as a set of pieces.
Onlysome of those pieces are actually running at any given time. From thisperspective, there are two types of component that a kernel is built from:active components and passive components. We examine them in thissection.Kernel StructureA kernel is built in layers. The layers of a kernel structure reflect thefunctionality of that part of the kernel.