Please enable JavaScript.
Coggle requires JavaScript to display documents.
Operating Systems (Memory Management (Loading programs, Reusing memory…
Operating Systems
Memory Management
-
-
-
A PC allows a user to be multitasking. Each program, open file or copied clipboard item must be allocated a specific area of memory whilst the computer is running. Should a user wish to switch from one application to another in a separate window each application must be stored simultaneously. This is controlled by the OS.
Splitting memory
Paging
In a paging system, memory is divided into fixed size pages of 4Kb each. For example, a program which uses 15K of memory addresses could be stored as four separate pages anywhere in the memory space.
Segementation
Segmentation is the logical division of address space into varying length segments which depend on the program structure. As with paging, it is possible to load only a part of a program into memory initially.
Multitasking
Allows a user to run more than one task at once. For example, listening to music, whilst editing a word document and occasionally checking emails. An OS that can perform more than one task at once is a multitasking OS.
Virtual Memory
Because memory is not limitless the OS may need to swap pages which are inactive into the disk. So, a secondary storage is used as an extension of memory to make room for another instruction. If a large number of jobs are loaded and the computer has a lack of memory there may be a decline in performance as the pages are swapped.
Interrupts
An interrupt is a signal from a software program, hardware devices or internal clock to the CPU. A software interrupts occurs when a program terminates or requests OS services. A hardware interrupt occurs when an I/O operation is complete or an error like ‘printer out of paper’ occurs.
-
Stacks
If the CPU detects an interrupt and decides to execute, it puts the current instruction aside and works on the new one. If another interrupt happens and it is being executed, the instruction is placed into a stack with the other instruction. Then, when the CPU is finished with the interrupt, it works its way back through the stack until it finishes the stack or there is another interrupt.
Processor Scheduling
With computers able to run multiple applications simultaneously, the OS is responsible for allocating processor time to each one as they compete for the CPU. A computer with a single processor can only process one instruction at a time, but by carrying out small parts of multiple larger tasks in turn, the processor can give the appearance of carrying out several tasks at the same time.
Round Robin
In round robin scheduling, processes are dispatched on a FIFO basis. First in First out. With each process being given a limited amount of CPU time called a time slice. If the process does not complete before its time expires, the CPU moves on to the next process.
In order to do this is must set an interrupting clock to generate interrupts at specific times. This method helps to guarantee an alright response time for all users on the system. In some systems, a priority system may allow higher priority jobs to have more than one consecutive time slices.
Shortest time remaining
The process with the smallest estimated time to complete is run next. This reduces the number of waiting jobs and the number of small jobs waiting behind big jobs. Its disadvantage is that it requires knowledge of how long a job will take. Therefore, the user has to estimate the job time, which is possible for jobs that are run frequently.
-