The Symbian OS (779886), страница 56
Текст из файла (страница 56)
SeeFigure 9.37.Table 9.24 Serial Comms Server Plug-ins ComponentsComponent NameDevelopment NameSerial Port CSYECUARTUSB CSYECACMBluetooth CSYBTCOMMIrDA CSYIRCOMMThe Serial and IrDA CSY components were both present in ER5.• The Serial Port CSY component implements an RS232 virtual serialport abstraction for conventional serial communications and directlydrives the ECOMM.LDD and ECOMM.PDD logical and physicaldevice drivers.• The USB CSY component was introduced in Symbian OS v7.0 supporting a single-port configuration and extended to support multiplevirtual ports in Symbian OS v7.0s.
It provides a multiple serialport-like interface over a USB connection and directly drives theEUSBC.LDD and EUSBC.PDD logical and physical device drivers.Note that this is an implementation of USB intended for legacyapplications that require conventional serial support, rather than forUSB-aware applications.Serial CommsServer PluginsSerialPortCSYFigure 9.37USBCSYBluetoothCSYIrDACSYSerial Comms Server Plug-insSHORT-LINK SERVICES253• The Bluetooth CSY component was introduced in Symbian OS v6.1with the first Bluetooth implementation for Symbian OS. It is a plug-into C32 Serial Server and implements an RS232-like virtual serial portover a Bluetooth link using an RFComm socket.
Port configuration isperformed using the Bluetooth Manager APIs.• The IrDA CSY component implements the IrDA standard for serialcommunications, IrComm, emulating a serial port over an IrDA link.Internally, it uses an IrDA socket (IrDA.PRT), through a Socket Serversession, which in turn drives the ECUART.LDD and UCUART.PDDlogical and physical drivers to drive the infrared hardware.10The Base Services Layer10.1 IntroductionTo get Symbian OS up and running on new hardware, whether on areference board (from a supplier such as Intel or Texas Instruments) or onthe hardware for a new phone, you need to port the base layers of thesystem.The lowest level of the system contains the operating system kernel,device drivers, and the device-driver framework support, which provideoperating system primitives and hardware abstraction frameworks. Sittingjust above them are the low-level libraries, servers, and frameworksthat build on the kernel layer to create a programmable and usableoperating system.
Because Symbian OS is a microkernel system,1 the‘kernel side’, which runs in protected or privileged mode on the hostprocessor (‘supervisor’ mode on ARM processors), is kept as small aspossible. The kernel-side/user-side distinction roughly divides the base ofthe system into two layers.The Base Services layer is the higher of the two layers and it containsthe user-side servers, frameworks, libraries and utilities that build on thekernel layer to provide the basic operating system services.
Together, thetwo layers constitute the minimal system which can be booted, run andprogrammed on real hardware. In a monolithic operating-system design,most (and possibly all) of the Base Services would form part of the kernelimplementation. See Figure 10.1.10.2 PurposeThe Base Services layer extends the bare kernel into a basic softwareplatform that provides the foundation for the remaining operating system1In fact the design is not ‘pure’ microkernel, but borrows from both microkernel andmonolithic design principles (see Chapter 11).256THE BASE SERVICES LAYERUIFrameworkApplicationServicesOSServicesBaseServicesBase ServicesKernelServices &HardwareInterfaceFigure 10.1 Base Services layer in the system model componentsservices, and effectively encapsulates the user side of the ‘base’ operatingsystem.
It also provides the minimum services required to enable acomplete and self-contained basic build of the lower-level system, whichsupports only text-mode program execution and is used to create the firststage ‘base-port’ to new hardware.As well as providing foundational frameworks and utilities which areused both by system components and by applications, it also provides theoperating system libraries that support the programming model, in otherwords, which support the creation, loading, and running of programson the operating system and which implement many of the signatureSymbian OS idioms, for example the cleanup stack, active objects anddescriptors.10.3Design GoalsIn many (but not all) respects, Symbian OS offers a textbook exampleof a microkernel operating system architecture.2 The most significantexception is the inclusion of the two-level device-driver framework, and2See the rationale for and description of the microkernel pattern in [Buschmann et al.1998].OVERVIEW257device drivers themselves, on the ‘kernel side’ of the system.
A truemicrokernel design would move these into user space.The microkernel principle is to keep the kernel small;3 core functionality which is, however, above the level of the basic operating systemprimitives, is kept out of the kernel itself and instead is located in system servers. System servers extend the microkernel to provide necessaryservices, and also encapsulate any lower-level software and hardwaredependencies.
In Symbian OS, the core system servers that are requiredto create a complete but minimal running system on real hardware arelocated in the Base Services layer; the remaining system servers, whichare not essential for a basic hardware port but which are required toengineer a complete product based on Symbian OS, are located onelayer up, in the OS Services layer.The goals of the Base Services layer therefore are to provide efficientand effective extensions to the basic kernel functionality, which are in aconcrete sense complete (i.e. they enable a complete but minimal systemto be built), while being both portable and extensible.10.4 OverviewThe Base Services layer includes a number of essential frameworks andlibraries on which almost all higher-level services, as well as applications,have some direct or indirect dependencies.• The User Library provides the basic programming model for SymbianOS, including system-specific types (such as the CBase class andmanifest constant4 definitions), as well as the APIs that define theunique native idioms, for example active objects, descriptors andUIDs, libraries which provide DLL and executable entry point stubclasses, and so on.• The File Server includes file-system utilities and the concrete filesystem implementation plug-ins in use on a particular device.• The Store is a persistent storage framework.
The Base Services layeralso includes the DBMS implementation, as well as more recentadditions such as the Central Repository, which provides a singlelocation and set of APIs for managing all system settings.3The most significant immediate benefits of ‘small’ are portability, because all essentialhardware dependencies are encapsulated within the small core of the system, and smallmemory footprint, a small system consuming less ROM (where the system is ROM-based)and RAM (put simply, there is less system to load at runtime).
The additional goal ofsimplicity is also more likely to be realized in a small system than in a large one.4Those are named constants whose underlying definition can be varied at compile timefor different platforms; in Symbian OS, they include TInt, TReal, TBool and TAny.258THE BASE SERVICES LAYER• Other essential frameworks and libraries include the Plug-in Framework (ECOM), cryptographic libraries, Application Utilities (such asthe Basic Application Framework Library, BAFL), character encodingand conversion libraries, XML parsers,5 the power management andshutdown framework, as well as the low-level framework support usedby multimedia services to communicate with hardware-acceleratoradaptor plug-ins.
(The actual adaptors and the device drivers withwhich they interact are located lower down, at the kernel level.)• Components such as the Text Window Server and Text Shell arerequired to make the base system complete and to avoid dependencieson higher-level services, for example, graphics.Put simply, from a programming perspective, many of the most basiccharacteristics of the operating system are realized in the Base Serviceslayer.10.5ArchitectureThe Base Services layer of Symbian OS is in many ways the foundationallayer of the system, extending the microkernel and the lowest levelhardware-abstraction services provided by the kernel layer into a basicbut complete system. A number of critical services which in monolithicarchitectures would be included in the kernel itself, for example the filesystem and the user libraries which provide the programming model forthe operating system, are found here.
The key boundary which definesthe separation of these services from the kernel is the division betweenkernel (supervisor or privileged) and user (non-privileged) processes. In amonolithic system, most of these services would run as privileged kernelprocesses.The design decision to separate these services from the kernel andto implement them as user-side services is a distinguishing feature ofthe operating system, separating it from monolithic systems (Unix/Linux,Windows-derived systems) and putting it squarely in the tradition ofmicrokernel operating system design.From the perspective of applications and higher-level operating systemservices, the Base Services layer libraries and frameworks provide thelogical interface to the basic low-level operating system.
The Base Serviceslayer extends the raw hardware support and the basic kernel abstractionsof the low-level system and adds file-system support and the File Server,5XML is considered an essential service since XML is increasingly used as the basis forinternal configuration files and other essential data formats, for example, Central Repositoryentries.ARCHITECTURE259the User Libraries that support the programming model, a simple textwindow server and a text-based shell, and an assortment of other low-levelframeworks and utilities. Together, this is enough to support, test andvalidate a first-stage port to new hardware and it provides the foundationfor creating complete support for all device hardware. The boundarybetween the Base Services layer and the higher-level services in thelayers above it, therefore, is a concrete one: nothing above the BaseServices layer is required get a port running on specific hardware.The system model organizes the Base Services layer componentsinto a number of collections, divided broadly between the low-levelcomponents that interact closely with the kernel to provide basic services(the User Library, file-system support) and higher-level components thatbuild on these services (for example, Store, which provides the persistencemodel, the Cryptography Library and the Text Shell).The User LibraryIt is through the User Library that the fundamental abstractions implemented by the kernel, which together define the native programmingmodel for Symbian OS, are made available to clients.