Главная » Просмотр файлов » Smartphone Operating System

Smartphone Operating System (779883), страница 15

Файл №779883 Smartphone Operating System (Symbian Books) 15 страницаSmartphone Operating System (779883) страница 152018-01-10СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

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

What couldhappen if this were done maliciously?9.Consider how platform security in Symbian OS might be effective.Describe how forcing a system call to present capabilities before it isserviced might protect a smartphone from harmful effects of software.4Processes and ThreadsMany people enjoy the circus. One act that I remember seeing as a childis a man who kept plates spinning on sticks. He would start one platespinning, then add more and more until he had an incredible numberof plates going at the same time.

He would spend his time running fromplate to plate, making sure all were spinning and none were rotating tooslowly. While he was running himself ragged, all the plates amazinglystayed in the air. In a sense, this circus performer is a shared resource,powering all the plates in the operating environment. If he spent his timegetting a single plate to spin perfectly, none of the other plates would gettheir turn. But if we accept the fact that plates do not spin perfectly andwe allow plates to slow down a bit, we can get an environment whereall plates are spinning.Computer operating systems are like the plate spinner. They have alimited set of CPUs (usually only one) that are to be used by manyprocesses at once. If an operating system were to let one process run tocompletion before others were allowed to use the CPU, the result wouldbe a slow system where very little would get done.

If all programs thatwanted the CPU were allowed to try to grab it, there would be chaosand very little would get done. Therefore, we must force all programs tocooperate and share the CPU in an orchestrated, organized fashion. Indoing so, we realize that a single program might take longer, but overall,all programs can use the processing power, in what looks like a parallelfashion.The concept of a process is part of this orchestrated system. A processis a program that is in a state of execution.

It forms the center point62PROCESSES AND THREADSof a system that shares the CPU and grants access to all programs thatneed it. This chapter examines this system of sharing the CPU and thecomponents that make it up. We start by looking at the big pictureand giving an overview of the components of the process model. Wethen focus on processes and how they can be manipulated – both bythe operating system and by users. We conclude the chapter by lookingspecifically at how the process model works on mobile phones based onSymbian OS.4.1 An Overview of the Process ModelBefore we discuss how the process model applies to various architectures,we should first define the components of the model.

The discussion ofprocesses sometimes suffers from what to call these components. If weconsider all processes, we can define several different types that could runon a system. Batch systems run jobs that complete without interruption.In Chapter 2, we defined user programs or applications as programs thatinteract with users and run on time-sharing systems. We will refer to everyexecuting program on a system as a process; a process may execute onbehalf of a user or the operating system.

Thus, any executing code (a job,a program or an application) is characterized as a process.ProcessesAs we stated previously, a process is an executing program. A process isdifferent from the program that defines it in several ways. First, a processis in a state of execution. This means that its code is being executed (oris waiting to be executed) by the CPU. Second, a process is obviouslymade up of more than just program code.

A process is defined by codethat executes, called the text section, but it is also characterized by aset of data (usually program variables), called the data section of theprocess, and the state of other hardware components it needs to run.These hardware components include the program counter (which holdsthe address of the instruction being executed in the process), temporaryregisters used to execute the process’s instructions, and the program stack(containing data required to run the program from a language point ofview: parameters, return addresses and local variables).The difference between a program and a process demonstrates itselfin many ways.

For example, a program is a passive entity; a processAN OVERVIEW OF THE PROCESS MODEL63is an active entity. A program can be thought of as the definition ofa process; several processes that derive their definitions from the sameprogram may be running on a computer. Each of those running processes,although associated with the same program, is different and unique. Theseprocesses would have the same text section, but their data sections wouldbe different.Process stateAs it executes, a process is said to be in one of several states (seeFigure 4.1). The state of a process is defined by what the process is doingat any given moment. We define process states as follows:• new : a process being created is in the new state – its text section isconstructed from the code in a program; its data section and stack areallocated in memory; and hardware components are initialized• ready : a process in the ready state is available for running on aprocessor but waiting for execution• running : a process in the running state is executing on a processor – itis manipulating the hardware allocated to it and the system is beingaltered according to its instructions• waiting : a process in the waiting state is suspended and waiting forsome external event to occur; the external event could be anythingfrom receipt of an interrupt to the completion of an I/O request• terminated : a process in the terminated state has completed its execution on a processor; when a terminated process is removed fromsystem tables and data storage, it ceases to be a process.Notice that the arcs in Figure 4.1 are labeled with the operation thatis performed to move a process between the states at either end.

Forexample, a process moves from ‘new’ to ‘ready’ through the process ofcreation. Notice, too, that the diagram describes the path taken betweenstates. A process cannot move from the ‘new’ state immediately to a‘running’ state. Likewise, a process cannot be waiting for an externalevent and move directly to the ‘terminated’ state. Finally, it is importantto realize that, while only one process can be running on a singleprocessor at any given moment, many processes can be in the ‘waiting’and ‘ready’ states.64PROCESSES AND THREADSdatecrescheduReadyinterrupNewtedledRunningexitTerminatedeventcompletedWaitingFigure 4.1I/O or eventwaitProcess statesProcess control blockThere are several system components associated with a running process.These components are recorded by the operating system in a processcontrol block (PCB), as shown in Figure 4.2.

The PCB contains andrecords the various pieces of information that represent a process to theoperating system.The components of a PCB can be described as follows:• process state : the current state of the process as it is manipulated bythe operating system• process ID : an identifier – usually an integer – that uniquely identifiesthe process in the system• program counter : the program instruction being executed• CPU registers : other registers used by the executing program• parent ID : the identifier of the process’s parent process• children IDs : the identifiers of the process’s child processes• scheduling information : information pertinent to how often the process can use the processor• memory management information : this information is important forthe protection of memory areas; it includes the values of the base andlimit registers, page table identifiers, etc.• accounting information : timing information used by the operatingsystem, including the amount of time used by the process and thelimits on execution• I/O status : the status of I/O devices that are being used by the process.AN OVERVIEW OF THE PROCESS MODEL65process stateprocess IDprogram counterCPU registersparent IDchildren IDsscheduling infomemory management infoaccounting infoI/O statusFigure 4.2A process control blockThe PCB represents all facets of a process to the operating system.

Asinformation about processes is stored by the operating system, the PCBserves as the unit of storage. Each process, therefore, has its own PCBand, implied by looking at a PCB, its own set of registers, memory space,accounting entries, I/O interactions, and so forth.Process schedulingA process moves through all the states in Figure 4.1 while executingon a system. However, as we stated before, a process shares the CPUwith all other processes that are in the ready state. The operating systemscheduler is the element in an operating system that takes a process fromthe ready queue and allows it to execute for a while. The act of moving aprocess from state to state and eventually to termination is called processscheduling.66PROCESSES AND THREADSAs processes are created and enter the ready state, they enter a queuecalled the ready queue. The job of the scheduler is to take processesfrom this queue and allow them to execute for a time.

This queue isrepresented in the operating system as a linked list of PCBs (we can thinkof each PCB as being augmented to include pointers to implement thislinked list). All processes in the list that represent the ready queue areready to execute.The act of scheduling is represented by the removal of the head ofthe ready queue. Once a process is finished executing on the CPU, itis removed from execution. There are several ways to be removed fromexecution: a process could have exhausted the time slot it has been givenor it could be blocked while waiting for an I/O event. The process’sPCB is placed in the appropriate queue to await more processing.

Thereis, therefore, more than one queue in a system. Processes waiting forexternal events are placed in a device queue. Each device has its ownqueue. Processes could be waiting for a system event not tied to a device,since there is an event queue for these processes.So moving between states in an operating system amounts to movingPCBs between queues. A scheduler, then, moves processes from theready queue to execution and from execution to one of the queueson the system.

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

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

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

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