Computer Science. The English Language Perspective - Беликова (1176925), страница 16
Текст из файла (страница 16)
Однако для решения каждой конкретнойзадачи в то время необходимо было заново написать нетолько код, реализующий алгоритм решения, но ипроцедуры ввода-вывода и другие процедуры управленияпроцессом вычисления. Существенные издержки такогоподхода вскоре стали очевидными:- код процедур ввода-вывода обычно является довольнообъемным и сложным в отладке;- необходимость каждый раз заново писать довольнобольшой вспомогательный код повышает трудоемкостьразработки прикладных программ.Поэтому для разрешения указанных проблем былисозданы специальные библиотеки процедур ввода-вывода(BIOS - Basic Input-Output System). Тщательно отлаженные иэффективные процедуры из BIOS можно было легкоиспользовать с любыми новыми программами, незатрачивая время и силы на разработку и отладкустандартных процедур для ввода и вывода данных.Таким образом, с появлением BIOS программноеобеспечение разделилось на системное и прикладноепрограммноеобеспечение.Причемприкладноепрограммноеобеспечениенепосредственно96ориентировано на решение полезных задач, в то время каксистемное программное обеспечение ориентированоисключительно на поддержку работы и упрощениеразработки прикладного программного обеспечения.Однако BIOS еще не является операционной системой,так как не выполняет важнейшую для операционнойсистемы функцию- управление процессом вычисленийприкладнойпрограммы.BIOSибиблиотекиматематических процедур, которые появились примерно вто же время, просто облегчали процесс разработки иотладки прикладных программ.
Тем не менее, созданиеBIOS стало первым шагом на пути к созданиюполноценной операционной системы.4. Give the summary of the text using the key terms.FUNCTIONSRead the following words and word combinations and usethem for understanding and translation of the text:memory management - управление памятьюthread - поток (единица диспетчеризации в современныхОС)to allocate - распределять, выделятьlogical address - логический адрес, адрес в виртуальнойпамятиphysical address - физический адресmapping - преобразование, отображениеto keep track - отслеживатьcontiguous - смежный, прилегающий, непрерывныйpartition - разделениеfixedpartitionстатическое(фиксированное)распределение памятиdynamic partition - динамическое распределение памяти97first fit - метод первого подходящегоbest fit - метод наилучшей подкачки, наилучшееразмещениеframe- рамка, фреймpaging - подкачка (замещение) страниц, страничнаяорганизация памятиdemand paging - замещение страниц по запросуprocess management - управление процессомprocess control block (PCB) - блок управления процессомcontext switch - контекстный коммутатор, переключениев зависимости от контекстаCPU scheduling - планирование (диспетчеризация)процессораnon-preemptiveschedulingневытесняющее(бесприоритетное) планированиеpreemptive scheduling - вытесняющее планированиеfull-fledged - полноценныйcoherence - согласованность, слаженностьsnooping - отслеживаниеdeadlock - взаимоблокировка, зависаниеWhile the architecture and features of operating systems differconsiderably, there are general functions common to almostevery system.
The “core” functions include “booting” thesystem and initializing devices, process management (loadingprograms into memory assigning them a share of processingtime), and allowing processes to communicate with theoperating system or one another (kernel). Multiprogrammingsystems often implement not only processes (runningprograms) but also threads, or sections of code within programsthat can be controlled separately.A memory management scheme is used to organize andaddress memory, handle requests to allocate memory, free upmemory no longer being used, and rearrange memory tomaximize the useful amount.98In a multiprogramming environment, multiple programs arestored in main memory at the same time. Thus, operatingsystems must employ techniques to:- track where and how a program resides in memory,- convert logical program addresses into actual memoryaddresses.A logical address (sometimes called a virtual or relative address)is a value that specifies a generic location, relative to theprogram but not to the reality of main memory.
A physicaladdress is an actual address in the main memory device. Whenthe program is eventually loaded into memory, each logicaladdress finally corresponds to a specific physical address. Themapping of a logical address to a physical address is calledaddress binding. Logical addresses allow a program to bemoved around in memory or loaded in different places atdifferent times. As long as we keep track of where the programis stored, we are always able to determine the physical addressthat corresponds to any given logical address.
There are threetechniques:- single contiguous memory management,- partition memory management,- paged memory management.Single contiguous memory management is the approach to memorymanagement in which the entire application program is loadedinto one continuous area of memory. Only one program otherthan the operating system can be processed at one time. Theadvantage of this approach is that it is simple to implement andmanage. However, memory space and CPU time are almostcertainly wasted. It is unlikely that an application programneeds all of the memory not used by the operating system, andCPU time is wasted when the program has to wait for someresource.A more sophisticated approach - partition memory management is to have more than one application program in memory at atime, sharing memory space and CPU time. Thus, memorymust be divided into more than two partitions.
There are two99strategies that can be used to partition memory: fixed partitionsand dynamic partitions. When using fixed partitions, mainmemory is divided into a particular number of partitions. Thepartitions do not have to be the same size, but their size is fixedwhen the operating system initially boots. The OS keeps a tableof addresses at which each partition begins and the length ofthe partition.When using dynamic partitions, the partitions are created to fitthe need of the programs. Main memory is initially viewed asone large empty partition.
As programs are loaded, space is“carved out”, using only the space needed to accommodate theprogram and leaving a new, smaller empty partition, whichmay be used by another program later. The OS maintains atable of partition information, but in dynamic partitions theaddress information changes as programs come and go. At anypoint in time in both fixed and dynamic partitions, memory isdivided into a set of partitions, some empty and some allocatedto programs.Which partition should we allocate to a new program? Thereare three general approaches to partition selection:- First fit, in which the program is allocated to the first partitionbig enough to hold it- Best fit, in which the program is allocated to the smallestpartition big enough to hold it- Worst fit, in which the program is allocated to the largestpartition big enough to hold it.Worst fit does not make sense to use in fixed partitions becauseit would waste the larger partitions.
First fit or best fit work forfixed partitions. But in dynamic partitions, worst fit often worksbest because it leaves the largest possible empty partition,which may accommodate another program later on.Partition memory management makes efficient use of mainmemory by having several programs in memory at one time.Paged memory management puts much more burden on theoperating system to keep track of allocated memory and to100resolve addresses.
But the benefits gained by this approach aregenerally worth the extra effort.In the paged memory management, main memory is dividedinto small fixed-size blocks of storage called frames. A process isdivided into pages that we assume are the same size as a frame.When a program is to be executed, the pages of the process areloaded into the various unused frames distributed throughmemory. Thus, the pages of a process may be scattered around,out of order, and mixed among the pages of other processes.
Tokeep track of all this, the OS maintains a separate page-maptable (PMT) for each process in memory; it maps each page tothe frame in which it is loaded.The advantage of paging is that a process no longer needs to bestored contiguously in memory. The ability to divide a processinto pieces changes the challenge of loading a process fromfinding one available large chunk of space to finding enoughsmall chunks.An important extension to the idea of paged memorymanagement is the idea of demand paging, which takesadvantage of the fact that not all parts of a program actuallyhave to be in memory at the same time.