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

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

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

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

In thefirst, conventional DMA cycle, the data transfer uses the bus to transferall data from or to memory without CPU attention. Since the system busis in use, the CPU does no external operations. In the cycle-stealing DMAtransfer, the system can use those CPU cycles where the CPU does nottransfer any data to or from the memory on the system bus. The bus cyclesare stolen from the CPU and used by the DMA controller to transfer data.PollingTo facilitate the transfer of data, the operating system must pay attentionto the transfer system.

For systems using registers and memory access, thisattention amounts to a constant monitoring, a checking that continuallywatches components in the system and reacts to changes in system states.This constant monitoring is called polling.Polling happens with the register method of data transfer by monitoringthe bits in the status register. There is usually a bit, called the busy bit,that indicates that data is in the process of being transferred.

When thatbit clears, the data is completely transferred. Note that, because theprocessor operates at a speed faster than the data transfer, it is likely thatthe operating system does a lot of checking before the data transfer iscomplete. Polling happens on both sides with the register method. Thebus controller polls the status register and reacts to various settings. Forexample, there is typically a command-ready bit that indicates that acommand is waiting in the control register for the bus controller to use.In the memory-mapped I/O method, polling still takes place. Onemight think that the use of memory would mean that registers are not204INPUT AND OUTPUTused.

However, only the data itself is placed in memory, not the commandand status registers. Therefore, the operating system must continually pollthe register set.Polling is usually detrimental to system performance. The constantchecking of the operating system must be woven into cycles that the operating system goes through to switch the context of processes. Checking isdone regardless of the state of the registers and regardless of whether a datatransfer is actually taking place. This constant checking, including uselesschecking of empty registers, drags down the performance of a system.Direct-memory access avoids the polling penalty.

An operating systemusing DMA does not have to poll but instead waits on devices to inform itwhen data is ready. This frees up the operating system to attend to otherthings and operations such as context switching get more attention and,hence, run faster. Data transfer is attended to when the bus controllersignals that data is ready.InterruptsSeveral of the operations mentioned above rely on some sort of signalingbetween devices and the operating system. This interrupt mechanism isan important part of operating system implementation.Interrupts usually work through a dedicated hardware wire calledthe interrupt-request line. The CPU checks this line at the end of thefetch–execute cycle, after it has completed an instruction execution.When an interrupt is signaled, the interrupt-request line has voltageon it. When this condition is detected, the CPU diverts execution toan interrupt-service routine (or routines).

We discussed the handling ofinterrupts in Section 3.3.As they pertain to I/O, interrupts save the CPU from polling. Usinginterrupts as a way to alert the operating system to when to process datais a major contribution to performance.9.3 I/O Software IssuesIt is the job of system software to shape the view of the hardware forthe user and programmer. As usual, this shape is derived by the useof abstraction: the interfaces to hardware are defined so that access isstandardized and the implementation of standard access is left to systemdesigners and device-driver writers.I/O SOFTWARE ISSUES205Unfortunately, there is a large variety of ‘standard’ interfaces, depending on the operating system being used.

Device manufacturers mustsupply a number of device drivers that adapt to the various systems inuse. Devices can be characterized in a number of ways, depending onthe system:• character-stream or block : character-stream devices deliver data ascharacters, byte by byte; block devices deliver data in blocks of bytes• sequential or random-access : sequential devices deliver data in afixed order as specified by the device; random-access devices candeliver data in any order requested by the operating system• synchronous or asynchronous : synchronous devices transfer data inpredictable time periods, often coordinated by the system clock;asynchronous devices are more unpredictable, delivering data whenit is ready rather than in fixed intervals• sharable or dedicated : sharable devices can be accessed and usedconcurrently by several processes; dedicated devices communicatewith one process at a time• speed of operation : device speeds vary widely, from mere bytes persecond to gigabytes per second.• read-only, write-only and read–write : some devices perform bothreading and writing operations, while others implement only one ofthese.Many times, operating systems hide these differences and presentonly a few general types to the user.

In addition, some operating systemsprovide a kind of backdoor way to access all devices. So while abstractionis in wide use, there are ways to skirt the abstraction and directly addresseach device. In Linux, for example, the ioctl() system call is a way topass command data directly to a device, rather than using the standardinterfaces.Kernel I/O StructureKernels provide many types of service related to I/O, usually devoting anentire subsystem to handling I/O.I/O scheduling is important to efficient I/O handling.

The order inwhich applications issue requests for I/O is not usually the best order for206INPUT AND OUTPUTthe most efficient operations. If we allow an operating system to rearrangethe ordering of I/O requests, better performance and better sharing cantake place. The kernel usually maintains a queue of requests for eachdevice. When an application issues an I/O system call, that request isqueued. The kernel chooses to issue the requests in an order that, forexample, minimizes the movement of the hard-disk read arm or can beserviced by a single block read rather than several smaller reads.Kernels often use buffers to transfer data and smooth the differencesbetween device speeds.

Buffering allows the operating system to compensate for the speed difference between the CPU and devices. Data fromslower devices accumulates in a buffer until the buffer is full, at whichtime the faster receiver is notified. Kernels often use double buffering byprocessing the first buffer and allowing the device to fill up a second one.(Displays benefit from double buffering because they can display imageswithout the flickering caused by new buffer retrieval.) Buffers allow datafrom devices with different transfer sizes to be exchanged. Multiple blocksof data can fill a buffer and then be transferred using different block sizesand the data is removed from the buffer.

Buffers also support differences inthe concepts that applications have toward data models. One applicationmay model its data one way and that influences how data is copied, readand written. Another application may have a different model and differentways to move data. When these applications exchange data though thekernel, buffering helps to allow each application to use its model withouttrauma.

Finally, buffering also helps with simple data storage. Rings orcircle buffers allow producers and consumers of data to go about theirfunctions at different speeds without stopping to ensure the other side iskeeping up.Operating system kernels usually maintain a cache with copies of dataused. As we have discussed before, caches are fast memories that arepositioned between the kernel and external devices. They act as buffers tomake access to data faster than actually retrieving it from the device.

Diskcaches are a good example: reads from a disk drive look for the data firstin a disk cache. If the data is in the cache, the read operation can happenmuch more rapidly. Write operations happen this way too. Writes to acache are buffered, with the cache performing the slower write operationand the kernel going on to do other things.

The combination of bufferingand caching is a powerful way to remedy the disparity of speeds andperformance between devices and the CPU.Sometimes, buffering happens so often that it gets a special name. Aspool is a buffer that holds the output for a device – usually a printer – thatI/O SOFTWARE ISSUES207cannot work with interleaving data streams. Printers can only serve onejob at a time, but several applications may want to print at the same time.This issue is solved by buffering the jobs waiting to print in the printerspool.

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

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

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

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