1 7. Operating Systems 7.1 Windows CE The Win32 API defines a consistent interface for the...

18
1 7. Operating Systems 7.1 Windows CE The Win32 API defines a consistent interface for the appli cation, while the Windows CE components encapsulate all ha rdware specific functionality in a platform independent ma nner. OEM H/W a OEM H/W b H/W Abstraction Layer a H/W Abstraction Layer a Windows CE Kernel Application Win32 API

Transcript of 1 7. Operating Systems 7.1 Windows CE The Win32 API defines a consistent interface for the...

1

7. Operating Systems

7.1 Windows CE

The Win32 API defines a consistent interface for the application, while the Windows CE components encapsulate all hardware specific functionality in a platform independent manner.

OEM H/W a OEM H/W b

H/W AbstractionLayer a

H/W AbstractionLayer a

Windows CE Kernel

Application

Win32 API

2

7.1.1 Operating System Configuration

three groups of operating system configurations

Handheld Professional PC and Handheld PC

Pocket PC

Automotive PC

Memory Management

All these memory resources are managed consistently by Windows CE and can be accessed through the Win32 API.

Windows CE manages the following memory access mechanisms:

• cacheable paged memory

• non-cacheable paged memory

• non-pageable non-cacheable memory

• non-pageable cacheable memory

3

Memory Maps of the Entire Virtual Address Space and the Virtual Address Space of one Process (p. 133).

A Windows CE device knows three different states:

Dead: the device is not powered, all volatile RAM data and code is lost.

Suspend: the clock is running. All applications and persistent data in RAM are maintained and other unused parts of the system are disconnected from the power supply. This is the default state, when the device is unused.

On:the device is fully operational. If the processor is idle, its frequency is lowered in order to save battery power.

Processes, Threads, and Interrupts

Windows CE is a 32 bit multitasking operating system. The kernel itself supports up to 32 processes. Within each process, an unlimited number of threads can run simultaneously.

A thread has one of eight priority levels assigned, which range from “idle” to “time critical”.

Interrupts are used to notify external events to the operating system, like events originating from peripherals.

4

User Interface The development and usage of the user interface is very similar to other Windows operating

systems.

handwriting recognizer accepting glyphs, script, or print letters.

Communication and Networking Windows CE supports a variety of communication technologies:

• Serial communication is one-to-one connection. For establishing a serial communication, the COM port is opened, and data is “streamed” from one device to the other.

• Network connections use one or many devices and provide more sophisticated and robust protocols, preventing the loss of data.

Peripherals and Device Drivers Windows CE differs between four kinds of drivers:

• Native drivers: power supply, keyboard

• Stream Interface drivers

• Drivers based on the Network Driver Interface specification

• USB(Universal Serial Bus)

5

Platform-Builder – Creating a Custom OS Depending on the capabilities of his device, different operating system components will be

included.

A minimum operating system configuration includes the core OS kernel and the essential parts of the GWES (Graphics, Windowing, and Event Subsystem). This minimum version has a footprint of about 256 kilobytes.

Microsoft provides the Windows CE Platform Builder. The Platform Builder includes all available modules and components of the operating system in binary form.

After the customized operating system has been generated on a development workstation, a binary image is loaded on the device. Additionally, a specific Software Development Kit (SDK) for the particular device is generated.

Developing Applications The Windows CE Toolkit and the Windows CE services supply a comprehensive set of

tools:

• Cross-compiler

• Simulator

• Resource Editor

• Debugging tools

6

How to Build a Customized Windows CE Version

7

코딩

컴파일

링킹

개발 환경

eMbedded Visual Tool 이설치된 개발자용 PC

대상 장치(Target Device)

에뮬레이터

다운로드

디버깅

실행

크로스 플랫폼

8

7.2 Palm OS

Palm OS Architecture

Application

UserInterface

MemorySystem

ManagementCommuni-

cations

Microkernel

Hardware

Licensee

Additions

9

Memory Management

All storage of a Palm device resides on so called memory cards.

The entire available memory is divided into multiple heaps:

• one single dynamic heap

• and multiple storage heap

The dynamic heap is used for memory allocation, global variables and application stacks. The dynamic heap has a fixed size, regardless of how much is used or needed by the applications.

The storage heaps hold data and applications.

Storage Heap

System Globals

System Dynamic Allocation

Application Dynamic Allocation

Application Stack

Application Globals

Dynamic

Heap 64kB

10

The Memory Manager allocates, disposes, resizes, and locks chunks, which can be either be allocated within storage or dynamic memory. The Memory Manager allocates memory in chunks. Currently each single data chunk has a maximum size of 64 kB.

Palm OS does not use a traditional file system. Storage is structured into databases instead. Each database comprises multiple records and is managed by the Database Manager.

11

Events Palm OS is event driven. A main event loop for applications dispatches events to handler.

Event can be

• user interface actions, e.g. a tap on the touch screen,

• system notifications, e.g. a timer alarm,

• or application specific events, e.g. a “search”-request.

User Interface Palm OS supports the typical components of a graphical user interface: forms, menus,

tables, dialogs, buttons, and scrollbars can be implemented with the help of an user interface API.

Communication and Networking Infrared Communication

• Applications can access infrared communication is two ways:

- Using the Exchange Manager, which provides a transparent high-level interface for infrared communication.

- Using an infrared library, which provides a low-level interface to the Palm OS infrared communication capabilities.

12

Serial Communication

• There are three major function blocks, which base on the Serial Manager: Connection Management Protocol, Modem Manager, Serial Link Protocol. (p.147, Fig. 7.10)

• TCP/IP Communication

- The Net Library provides a socket API to access TCP and UDP services.

• Conduits

- Conduits are desktop programs which are used to perform the HotSync for a special kind of application or data.

Developing Applications

three programming languages: C, C++ and Java

Palm provides two packages for developing applications:

• The SDK includes the available application programming interface (API) for developing Palm OS applications.

• The CDK(Conduit Development Kit) supports the implementation of conduit, which enable the exchange and synchronization of data between a desktop application and an application running on a device.

13

7.3 Symbian OS

Symbian OS is a real-time, multitasking, pre-emptive, 32-bit operating system writtn using C++ with an object-oriented design.

Operating System Architecture

The core of the Symbian OS consists of the following major components: Base, Telephony, Security, Communications infrastructure, Application framework, Personal area network, Application engines, Messaging, and Java.

14

Application Architecture

Application GUI

Application View

Application Engine

The Application Engine contains the basic logic of the operation.

The Application View provides a simple graphical representation of the application data, such as the array of cells in a spread-sheet.

The Application GUI part is based on a application.

Developing Applications The following tools are required to write and test an Symbian OS application using Window

s:

• The Symbian C++ Software Development Kit (SDK) includes two Symbian OS Emulator for Windows, and a tailored build of the GNU C++ compiler which is used to build the binaries before they are downloaded to the Symbian OS device.

15

• Metrowerks CodeWarrior for Symbian or Microsoft Visual C++ is the environment used to test and debug the Symbian OS application on a Windows development workstation.

EPOC Development Process

C++source

Test inEmulator

ARMbinaries

Test ondevice

Compile with

GNU C++

Compile with

CodeWarrior or

Visual C++

Download with

PC Connect

16

7.4 Java Card

The Java Card platform is a smart card operating system, allowing the applications on a smart card to be written in Java.

The on-card executables are referred as Card applets and consist of a Java Card specific byte code, which is interpreted by the Java Card Runtime Environment.

Java Card Software Stack

17

Java Card Framework

The Java Card Framework consists of four packages.

Package Contents

java.lang A subset of the java programming language.

javacard.framework Classes and interfaces for the core functionality of a Java Card applet.

javacard.security Classes and interfaces for the Java Card security framework.

javacardx.cryptoExtension package containing security classes and interfaces for export-controlled functionality.

Lifetime of On-Card Applets and Objects

The applets installed in the card have a theoretically infinite lifetime. Only when explicitly de-installed they will terminate.

The objects created and owned by an applet are allocated in the EEPROM by default and thus are persistent.

When an applet is installed on the card, its installation method public static install(…) is called.

18

After an applet has been installed, it can be used by an off-card application.

Developing a Card Applet

The process for Developing a Card Applet