Concepts with Symbian OS (Symbian Books), страница 9

PDF-файл Concepts with Symbian OS (Symbian Books), страница 9 Основы автоматизированного проектирования (ОАП) (17689): Книга - 3 семестрConcepts with Symbian OS (Symbian Books) - PDF, страница 9 (17689) - СтудИзба2018-01-10СтудИзба

Описание файла

Файл "Concepts with Symbian OS" внутри архива находится в папке "Symbian Books". PDF-файл из архива "Symbian Books", который расположен в категории "". Всё это находится в предмете "основы автоматизированного проектирования (оап)" из 3 семестр, которые можно найти в файловом архиве МГТУ им. Н.Э.Баумана. Не смотря на прямую связь этого архива с МГТУ им. Н.Э.Баумана, его также можно найти и в других разделах. Архив можно найти в разделе "книги и методические указания", в предмете "основы автоматизированного производства (оап)" в общих файлах.

Просмотр PDF-файла онлайн

Текст 9 страницы из PDF

Storage is virtual when it is larger or has more attributes thanit physically has. Virtual storage is implemented as an extension of onelayer in the hierarchy on lower layers. Main memory can be thought of asvirtual cache storage. When cache fills up, it extends into main memory.Likewise, virtual main memory is implemented on disk space. Whenspace in main memory runs out, it overflows onto secondary storage. Aswith caching, virtual storage involves management: it must be organizedso that portions of it can be moved back and forth to the next storage layer.COMPUTER STRUCTURES33Hardware Access and ProtectionIn the early days of computing, before operating systems were used oncomputer systems, a single program ran to completion on a computer,using its resources as it saw fit. As computer usage evolved, operatingsystems were used to provide a consistent and standard interface to computing resources.

This meant that access to a single resource – the systemclock or the graphics display – had to be coordinated by the operatingsystem and shared with other applications vying for those resources.As all children learn, sharing is good. Sharing resources means thatthey can be used more efficiently and more completely. If resources areshared, all applications can appear to execute at the same time and arepresented with the illusion that they are the only application runningon the computer system. Consider, for example, sharing a networkconnection between two browsers, as shown in Figure 2.8.get page 1Computer#1get page 2Networkget page 3Usageget page 1get page 2Figure 2.8 Sharing a network seriallyComputer#234THE CHARACTER OF OPERATING SYSTEMSget page 1Computer#1get page 2get page 3Figure 2.9NetworkUsageget page 1Computer#2get page 2Sharing a network concurrentlyIn Figure 2.8, Computer 1 is served three pages from the web andComputer 2, which needs two pages, is forced to wait until Computer 1is done using the network.

Time is depicted from top to bottom. Thiskind of ‘one at a time’ serial usage is certainly the safest way to share aresource, but not the fastest. Consider the sharing scenario in Figure 2.9,where Computer 2 can use the network while Computer 1 is waitingbetween page fetches. The time is shorter but the information gatheredfrom the network is the same. As long as care is taken to make sure thatone computer’s actions does not change the other’s, then sharing can bedone in a safe manner.However, sharing can also be bad. If done poorly, the mechanismused for sharing can ruin the illusion – each concurrent program wouldfeel the effects of other programs. If it is not done correctly, data might bemanipulated by the wrong program.

A browser might receive data thatanother browser had requested.As we consider how to protect system resources from concurrentaccess, we also need to remember that the operating system is a competitor in this area. We have said that the operating system is simplyanother program running on the computer. In this sense, the operatingsystem competes for resources just like other programs that run. However, the operating system is a bit different – a bit more privileged – thanCOMPUTER STRUCTURES35‘normal’ programs because it must manage the other programs (as wellas itself).Let’s consider how protection is addressed in operating system design.To do this, we must consider how to protect programs from each otherand how to protect resources such as memory and the CPU.

This notonly applies to organized access to resources, but it also keeps errant ormalicious code from accessing resources in ways that could jeopardizethe operations of other programs.Protection modesWe must protect programs from each other; this includes protecting theoperating system from other programs. We need at least two separateways of operating: the operating system needs a privileged mode andother programs need a user mode of operation. User-mode operation isrestricted to tasks that all programs may perform. This includes mundanetasks such as arithmetical computation or executing statements in programcode.

Privileged-mode operation allows a program to do tasks only theoperating system should do. These tasks include working with systemdevices or managing which program should be run.Managing these modes efficiently and rapidly requires hardware support. Most hardware architectures include at least the two modes we havedefined and they sometimes support multiple user modes. The hardwaremay implement this by adding a bit, or a set of bits, to indicate the currentmode of operation.

By setting the mode bit, the mode of the instructionbeing executed can be determined easily. In addition to mode bits, thereare certain instructions that are considered privileged instructions. It isassumed that only processes with privileged access execute privilegedinstructions and the hardware enforces this by checking the mode bitsbefore executing these instructions.Consider some situations where modes are important.

When a computer starts up at system-boot time, the hardware starts out in privilegedmode. This makes sense because the operating system is initializing itselfand the system resources. Once the operating system is running andstarts applications, each application executes in user mode.

When aninterrupt occurs and the operating system must service a need from adevice or resource, the operating system is running and the hardware isplaced in privileged mode. Since the interrupts drive when the operatingsystem takes over the management of the computer, the operating systemis always in privileged mode when it controls the processor. Whenevercontrol is given to another program, the mode is switched to user mode.36THE CHARACTER OF OPERATING SYSTEMSAs we have seen, there are many times when a user-mode programneeds to access a system resource that only the operating system canmanage. Since a user-mode program cannot change to privileged modeby itself, it must ask the operating system to perform the privileged-modeoperation.

User-mode programs do this by making a system call intooperating system code. Control is passed to the operating system andthe operating system handles the privileged-mode action as it sees fit.When it is done with the operation, the operating system passes controlback to the user-mode program, changing the protection mode in theprocess. This method of using system calls means that all privileged-modeoperations are still handled by the operating system.What if There Is no Hardware Support for ProtectionModes?Early architectures such as the Intel 8088 architecture (on which MSDOS was implemented) did not have mode bits built into the hardware,which meant that there were no privileged instructions.

No privilegedinstructions meant that any process could manipulate any systemresource. In early versions of MS-DOS, for example, user programscould manipulate operating system tables and change operating systemcode!Protecting memoryPrograms must be protected from each other, as we saw in the previoussection. This includes restricting memory-space usage to only thoseprograms that should use it. Since there are many ways to use memory,this kind of protection must guard against several types of usage.We must protect user programs from changing the memory of otherprograms.

This means that, while multiple users have data in memoryat the same time, users’ memory spaces must be protected from eachother. In addition, programs might be able to corrupt operating systemmemory or even change interrupt vectors. User code needs to be hemmedin – cordoned off from the rest of the memory.While we can build memory protection into APIs or into operatingsystem code, this is not enough because there are multiple ways to corruptmemory. To properly protect memory, we need to determine the rangeof addresses that a process or interrupt vector can use, protect memoryCOMPUTER STRUCTURES37outside the address range and ensure that nothing can run outside thecontrol of the operating system.

Instead of setting up protection to keepother usages out, we set up protection to keep each process usage in.This is typically done in conjunction with hardware. When a particularpiece of code is executing, the operating system sets two registers: a baseregister holds the lowest address that can be used by the executing codeand a limit register holds the number of memory addresses that can beaddressed. Setting these registers is reserved only for the operating system;it does this through the use of privileged instructions.

Working with theseregisters is part of the work of the operating system as it manipulatesprocesses to share the CPU.Protecting the CPUThe many programs that run at the same time on a computer share theCPU; this sharing includes the operating system. As we structure theway that this sharing is done, we must make sure that the operatingsystem always gets control of the CPU back from a program – even if thatprogram has bugs or goes into an infinite loop.Consider what happens if we do not protect the CPU in this way.A program that gets into an infinite loop may never relinquish controlof execution and the computer would be frozen.

If this happened on amobile phone while a conversation was going on, the phone would simplyfreeze and the conversation could not continue. Even worse, consider ifsystem code had a bug that caused a user program in privileged mode tostart writing to protected memory, corrupting operating system tables.To prevent this from happening, operating systems often use twoconcepts. First, we can use a timer to cause an interrupt that transferscontrol back to the operating system.

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