Главная » Просмотр файлов » Concepts with Symbian OS

Concepts with Symbian OS (779878), страница 63

Файл №779878 Concepts with Symbian OS (Symbian Books) 63 страницаConcepts with Symbian OS (779878) страница 632018-01-10СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 63)

This is generally software compiled for the hardware machinebeing emulated. Sometimes, depending on the way the virtual machine isimplemented, the software needs to be compiled in a special manner. If itdoes, it generally cannot take advantage of all features of hardware – realexecution and testing needs to be done on real hardware.Symbian OS provides a good example of this. In the emulated, virtualmachine environment, it provides for software development: the systemlibraries are delivered as Windows DLL-format files and the softwareunder development must be compiled specifically for the emulator environment. This is because the emulator does not execute a specifichardware’s instructions.

Since the hardware cannot be emulated exactly,304VIRTUAL MACHINESto test various parts of it (e.g., timers and real-time components) softwaremust be run on the actual smartphone target.Sometimes there is no clear difference between the operating system layer and the hardware layer. For example, on the Java virtualmachine, there is no operating system – just emulated hardware.

Sometimes, because certain operating systems are designed for many differenthardware platforms, only the operating system layer is present in thevirtual machine, assuming that it will run on the native host architecture.A virtual machine must emulate both user and privileged mode, butruns on the host machine in user mode. This means that system calls onthe virtual machine must be translated into appropriate system calls onthe host machine.

User mode operation on a virtual machine can executeon the virtual machine. Any access to privileged hardware – almost anysystem resource – must go through the host system.The Challenges of Virtual MachinesVirtual machines are interesting and effective in concept, but are difficultto implement in reality. The biggest challenge to implementation is theexact duplication required for emulation. The goal for implementationis to use exactly the same code for the operating system layer as in thetarget platform, but this is not always possible. If the hardware layer isneeded, exact duplication is again required, but very difficult to render.A good example is the Symbian OS emulator.

Symbian OS is designedto run on multiple platforms. However, the Windows emulator for Symbian OS required a special implementation with special restrictions(Chapter 7 discussed the special memory model developed for SymbianOS when it ran on the emulator). For many programs, the emulatedvirtual machine looks identical to the target hardware. However, certainprograms can only be tested on the target. Programs that work specifically with hardware, for instance, cannot be tested on the emulator. Also,programs that rely on processes cannot run on the emulator becausethe operating environment is one large process.

Since Symbian OS v9.1,these restrictions have mostly been eased; the design of Symbian OS hassince incorporated Windows as a target platform and the design of theemulator more closely resembles hardware.Virtual machines also suffer in terms of performance. Virtual machinesthat are not optimized are basically interpreters: they translate actions byprograms they are executing into actions that can be executed by the hostmachine. In a virtual-machine implementation with multiple layers, eachTHE JAVA VIRTUAL MACHINE AND SYMBIAN OS305layer is an interpreter. The Java Virtual Machine (JVM) is an example ofthis: Java is based on bytecode execution, but there is no computer systemthe JVM runs on that executes JVM instructions (‘bytecode’) directly.So each bytecode instruction must go through an interpretation, whereactual hardware instructions that implement each bytecode instruction areeventually executed on that bytecode instruction’s behalf. Each passagethrough an implementation layer represents a performance degradation.One of the most complex challenges to virtual-machine implementation is the access to the host machine’s system resources.

A major issuethat virtual-machine implementations must deal with is access to disk-filesystems. Consider a situation where the host system is running MicrosoftWindows with an NTFS file system but the virtual machine runs a Unixoperating system with a UFS file system. Clearly, these are incompatible.Consider again a situation where the virtual machine requires access toa peripheral, say a printer, that is being coordinated by the host operating system.

These situations all require special handling. Usually, virtualdevices are connected with physical devices through special interfacesthat merge the virtual machine with the host machine’s device mechanisms. Disks, however, are a special case. These are usually handled bycreating virtual disks that operate inside file space on physical disks. ALinux virtual machine might have a 10 GB virtual disk that is connectedto a 10 GB file on a physical disk. The Symbian OS emulator can provide drives that are actually files on the host’s system, as well as MMCemulation and an emulation of ROM.15.2The Java Virtual Machine and Symbian OSThe implementation of the JVM on Symbian OS provides an interestingcase study in the implementation of virtual machines.Before looking at implementation issues, we must clarify which JVMis implemented for the Symbian OS platform.

Symbian OS has supportedJava for quite a long time – since the days when Symbian OS was actually EPOC, implemented on handheld devices, not smartphones. EarlySymbian OS versions supported two types of JVM: PersonalJava and JavaPlatform, Micro Edition (Java ME). PersonalJava was an early attemptto pare down the Standard Edition of Java to fit into smaller platforms.It has largely been abandoned in favor of Java ME implementations.Java ME is a general specification of how Java fits on small platforms.Java ME is subdivided into configurations, profiles and optional packages.

For their implementations, Symbian OS designers implemented306VIRTUAL MACHINESthe Mobile Information Device Profile (MIDP) with the Connected Limited Device Configuration (CLDC). The CLDC defines the base set ofapplication-programming interfaces and the Java Virtual Machine forresource-constrained devices such as mobile phones, pagers, and mainstream personal digital assistants. When put together with MIDP, itprovides a Java platform for developing applications to run on deviceswith limited memory, processing power and graphical capabilities.As we stated, the JVM is an interesting virtual machine in that it hasno operating system.

Its sole existence is to implement an operatingenvironment for program execution. Java applications are implementedas a set of classes that are dynamically loaded as needed by the virtualmachine. Java classes, in turn, are compiled to a sequence of bytecode’,which is Java’s terminology for assembly language. Java bytecode isdesigned to have short instructions that could be loaded from anywhere:from a disk drive or over a network.The Java Virtual Machine is an abstract computer that provides aninsulation layer between the Java program and the underlying hardwareplatform and operating system.The JVM can be divided into several basic parts that are implementedin software to emulate a virtual underlying hardware layer: bytecodeexecution stack, a small number of registers, the object heap and themethod area which stores streams of bytecode.

The JVM also provides amechanism of native access to the host operating system.The JVM reads sequences of bytecode, which is a sequence of assemblyinstructions for the JVM. Each instruction consists of an opcode thatinstructs the JVM on what needs to be done and the following instructionoperands provide the required information for the completion of thecommand. As well as having in-built support for several primitive types,the JVM bytecode set includes instructions that operate on operands asobjects in order to invoke instance and static-class methods.The JVM has its own architecture. While this architecture is a virtual architecture implemented in software, it nonetheless influences theinstruction set design of JVM bytecode.

The JVM is based on a stackdesign, which means that all data for computation must be pushed ontothe stack, so it can be used in calculation, and that the JVM needs noregisters for storing data. The combination of the emulated hardwarearchitecture, bytecode design and class-file format make a unique designthat is at a much higher level compared to real hardware. It has featuresthat enable fast interpretation of instructions: class-file-constant pools thatEXERCISES307allow loading and storing of constants by using short assembly instructions, a typed data stack and registers that hold the program counter andmanage the stack.In addition to emulating virtual hardware, the JVM provides a mechanism of native access to the host operating system.

This means that implementation areas and various capabilities that are out of the scope of thevirtual machine role as a bytecode execution engine can be implementedusing the operating system native APIs. Symbian OS takes advantageof this mechanism by providing its Java ME implementation access toits rich native APIs. For example, the javax.microedition.lcdui.TextField class is implemented as a native Symbian OS widget and soa Java program benefits from the underlying usage of the native AVKONwidget implementation on a Nokia phone or the UIQ widget implementation on a Sony Ericsson phone. The two run the same Java program, basedon the same interfaces and JVM, but with a different look derived fromthe manufacturer-dependent native implementation of the user interface.Access to system resources is granted through standard Java APIs such asthe Bluetooth API and the Messaging API.15.3SummaryThis chapter has given a broad overview of the concept of virtualmachines and how virtual machines can be used by operating systems.We began by defining virtual machines and outlining their advantagesand challenges.

We concluded the chapter by giving an example of howthe Java virtual machine is implemented on Symbian OS.Exercises1.Describe the sequence of actions or calls that must take place fora program in a virtual machine on virtual hardware to write to thevirtual machine’s disk drive.2.Consider memory management on a virtual machine. Would thehost or the virtual machine map the virtual machine’s logical addressrequests to physical addresses? Would the host or the virtual machinedo paging if an application on the virtual machine referenced a pagethat was not in memory?308VIRTUAL MACHINES3.What are the consequences of a poor emulation? Is it sufficientto simply state that a virtual machine ‘approximates’ an operatingenvironment?4.The JVM has an architecture that allows for very short bytecodeinstructions.

Why is this advantageous for Java?5.Does the design of Java have any implications for its performance onSymbian OS?Appendix AWeb Resourceshttp://developer.symbian.com/mainhttp://en.wikipedia.org/wiki/List of operating systemswww.imc.orgwww.kernelthread.com/mac/oshistorywww.knoppix.orgwww.levenez.com/unixwww.microsoft.com/windows/WinHistoryIntro.mspxwww.opengroup.orgwww.pushl.com/taskspywww.renegade-uiq.comwww.ubuntu.orgReferencesCampbell, J.

Характеристики

Тип файла
PDF-файл
Размер
1,2 Mb
Материал
Тип материала
Высшее учебное заведение

Список файлов книги

Свежие статьи
Популярно сейчас
А знаете ли Вы, что из года в год задания практически не меняются? Математика, преподаваемая в учебных заведениях, никак не менялась минимум 30 лет. Найдите нужный учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6289
Авторов
на СтудИзбе
315
Средний доход
с одного платного файла
Обучение Подробнее