The Operating Systems And Computer Architecture

Print   

02 Nov 2017

Disclaimer:
This essay has been written and submitted by students and is not an example of our work. Please click this link to view samples of our professional work witten by our professional essay writers. Any opinions, findings, conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of EssayCompany.

For this part of the assignment, researching and evaluating the process scheduling algorithms, discuss about memory and memory management systems. And evaluate file management systems.

Process Scheduling Algorithms

An Operating system performs many functions, batch system jobs, time shared user programs or tasks, and these are called processes. A process is a program that is stored in memory (PCB, see Appendix), and is in progress (execution). A process must be executed in a certain manner (silberschatz et al., 2009), as a process runs (executes) it changes states, these states are:-

NEW the process is being created

RUNNING instructions are being executed

WAITING the process is waiting for some event to occur

READY the process is waiting to be assigned to a processor

TERMINATED the process has finished execution

CPU Scheduler selects from among the processes in memory that are ready to execute and allocates the CPU one of them. A CPU scheduling decisions may take place when a process:-

Switches from running to waiting state

Switches from running to ready state

Switches from waiting to ready state

Terminates

The criteria for any scheduling are:-

CPU Utilisation – keeping the CPU as busy as possible

Throughput- the number of processes that complete their execution per time unit

Turnaround Time- the amount of time to execute a particular process

Waiting Time- the amount of time a process has been waiting in the ready queue

Response Time- the amount of time it takes from when a request was submitted until the first response is produced. (silberschatz et al., 2009),

The scheduling algorithm optimization criteria are:-

Max CPU utilization

Max throughput

Min turnaround time

Min waiting time

Min response time. (silberschatz et al., 2009),

These following algorithms are said to be nopreemptive which means (THAKUR, n.d.). All jobs in memory are executed one by one when the first job is completed the second job will be executed.

First Come First Served (FCFS) is a nopreemptive scheduling algorithm that handles jobs according to their arrival time, the sooner they arrive the sooner they’re served. With FCFS as a new job enters the system its PCB is linked to the end of the READY queue and it is removed from the front of the queue when the processor becomes available after it has processed all of the jobs before it in the queue (Flynn & McHoes, 1991)

P2

P3

P1

The arrival of the processes in order of P2 P3 P1 Waiting time for P1 = 6; P2 = 0; P3 = 3

Average waiting time: (6 + 0 + 3)/3 = 3 (silberschatz et al., 2009),

Shortest Job First (SJF) is a nopreemptive scheduling algorithm that handles jobs based on the length of their CPU cycle time. It’s easier to implement in batch environments where the estimated CPU time required to run the job is given by each user at the start of job. (Flynn & McHoes, 1991)

P2

P4

P1

P3

P1= 5 P2= 2 P3= 6 P4= 4

The average waiting time is (2+6+11+17)/4 = 9 (Flynn & McHoes, 1991)

Preemptive tasks are usually assigned with priorities. At time it is necessary to run a certain task that has a higher priority before another task although it is running. Therefore, the running task is interrupted for some time and resumed later when the priority task has finished its execution. This is called preemptive scheduling (careerride.com, n.d.).

Round Robin (RR) is one of the oldest, simplest, fairest and most widely used of the entire algorithms, because in the Round Robin scheduling, processes are dispatched in a FCFS manner but given a limited amount of CPU time called a time slice or a quantum. If a process does not complete before its CPU-Time expires, the CPU is preempted and given to the next process waiting in a queue. The preempted process is then placed at the back of the ready list. Round Robin is preemptive (at the end of the time-slice) therefore it is effective in time-sharing environments in which the system needs to guarantee reasonable response times for interactive users. The only issue with the round robin scheme is the length of the quantum. Setting the quantum too short causes too many context switches and lower the CPU efficiency. On the other hand, setting the quantum too long may cause poor response time and approximates FCFS. In any event, the average waiting time under RR scheduling is often quite long (Muhammad, n.d.).

Priority scheduling each process is assigned a priority, and priority is allowed to run. Equal-Priority processes are scheduled in FCFS order. The shortest-Job-First (SJF) algorithm is a special case of general priority scheduling algorithm. Priority scheduling can be either preemptive or non preemptive.

A preemptive priority algorithm will preemptive the CPU if the priority of the newly arrival process is higher than the priority of the currently running process.

A non-preemptive priority algorithm will simply put the new process at the head of the ready queue.

A major problem with priority scheduling is indefinite blocking or starvation. A solution to the problem of indefinite blockage of the low-priority process is aging. Aging is a technique of gradually increasing the priority of processes that wait in the system for a long period of time (Muhammad, n.d.).

Multilevel Queue scheduling processes are permanently assigned to one queue. The processes are permanently assigned to one another, based on some property of the process, such as

Memory size

Process priority

Process type

The Algorithm chooses the process from the occupied queue that has the highest priority, and run that process either Preemptive or Non-preemptively. Each queue has its own scheduling algorithm or policy.

E.g. If there is a time slice between the queues then each queue gets a certain amount of CPU times, which it can then schedule among the processes in its queue. For instance;

80% of the CPU time to foreground queue using RR.

20% of the CPU time to background queue using FCFS.

Since processes do not move between queues so this policy has the advantage of low scheduling overhead, but it is inflexible (Muhammad, n.d.).

Multilevel Feedback Queue Scheduling algorithm allows a process to move between queues. It uses many ready queues and associates a different priority with each queue. The Algorithm chooses to process with highest priority from the occupied queue and run that process either preemptively or non- preemptively. If the process uses too much CPU time it will moved to a lower-priority queue. Similarly, a process that waits too long in the lower-priority queue may be moved to a higher-priority queue may be moved to a highest-priority queue. Note that this form of aging prevents starvation (Muhammad, n.d.).

Memory Management

Memory management is the process of controlling and coordinating computer memory, assigning portions called blocks to various running programs to optimize overall system performance. Memory management resides in hardware, in the OS (operating system), and in programs and applications.

In hardware, memory management involves components that physically store data, such as RAM (random access memory) chips, memory caches, and flash-based SSDs (solid-state drives). In the OS, memory management involves the allocation (and constant reallocation) of specific memory blocks to individual programs as user demands change. At the application level, memory management ensures the availability of adequate memory for the objects and data structures of each running program at all times. Application memory management combines two related tasks, known as allocation and recycling.

When the program requests a block of memory, a part of the memory manager called the allocator assigns that block to the program. When a program no longer needs the data in previously allocated memory blocks, those blocks become available for reassignment. This task can be done manually (by the programmer) or automatically (by the memory manager) (Gibilisco, 2012)

Several methods have been devised that increase the effectiveness of memory management. Virtual memory systems separate the memory addresses used by a process from actual physical addresses, allowing separation of processes and increasing the effectively available amount of RAM using paging or swapping to secondary storage. The quality of the virtual memory manager can have an extensive effect on overall system performance (Wikipedia, 2012)

File Systems

File systems are an integral part of any operating systems with the capacity for long term storage. Before any files can be stored on a hard disk it must be formatted so that the platters, tracks, sectors, clusters and cylinders (appendix) have a structure. In modern operating systems where it is possible for several users to access the same files simultaneously it has also become necessary for such features as access control and different forms of file protection to be implemented. A file could represent a program, a document or in some cases part of the file system itself. In modern computing it is quite common to be several different storage devices attached to the same computer. The arrangement of data within the file is then decided by the program creating it. The file systems also store a number of attributes for the files within it. In most modern file systems the name consists of three parts, its unique name, a period and an extension. For example the file ‘bob.jpg’ is uniquely identified by the first word ‘bob’; the extension jpg indicates that it is a jpeg image file. The file extension allows the operating system to decide what to do with the file if someone tries to open it. The operating system maintains a list of file extension associations. In some file systems, files can only be stored as one contiguous block. This simplifies storage and access to the file as the system then only needs to know where the file begins on the disk and how large it is. (Ocmodshop, 2009) File Allocation Table (FAT) is a table that the operating system uses to locate files on a disk. Due to fragmentation, a file may be divided into many sections that are scattered around the disk. The FAT keeps track of all these pieces. In OS systems, FATs are stored in hidden files, called FAT files. FAT, FAT32, NTFS. FAT32 increases the number of bits used to address clusters and also reduces the size of each cluster. The result is that it can support larger disks (up to 2 terabytes) and better storage efficiency (less slack space) (Escotal.Com, 2012)

WHAT HAPPENS IN A WORD DOCUMENT

The shortcut link is clicked on the word document and the explorer.exe program starts and then looks for the file extension that targets the file associated within the yesterday. INK shortcut file. (File System) and System Process. The target file is yesterday.docx (File System). Explorer searches the file system to locate the file on disk and the associated program (found in the registry) is evoked (winword.exe) (Memory) and new process (winword.exe). Once the winword.exe program code is running, it is no longer an executable but it is its own process (Process). Winword.exe will look at the normal.dotx template file and load it into memory, then load the yesterday.docx into memory (Memory). Winword.exe then looks at the OS to check for the date and time from the system clock (Process). Winword.exe will change the date and time on the document to the date and time updated from the system clock and display the document with the new date and time (Process). The OS interrupts the winword.exe program, a background system program that has finished downloading files invokes this interrupt the system program has a higher priority than the winword.exe program (Process). Winword.exe is then taken out of the foreground and placed in the background. The system update now then becomes the foreground program (Process). The windows update dialogue box displays on screen. The system process will go into the waiting for input state. Winword.exe will proceed to stay in wait state until input has started. Once the input has been received the system process will terminate and the winword.exe will become a foreground process once again (Process). Winword.exe then proceeds to wait for an input to update the word document and then overwrites the file (File System) and stores it on disk (Memory) as today.docx and with its associated program in the registry.

Bibliography

careerride.com, n.d. What is pre-emptive and non-preemptive scheduling? [Online] Available at: http://careerride.com/OS-preemptive-scheduling.aspx [Accessed November 2012].

Escotal.Com, 2012. HARD DRIVES. [Online] Available at: http://www.escotal.com/harddrive.html [Accessed December 2012].

Flynn, M. & McHoes, M., 1991. Understanding operating systems. [Online] Available at: http://booklists.narod.ru/S_Software_manuals/Flynn__McIver_McHoes._Understanding_operating_systems__1991__T__C__362s_.1.htm [Accessed November 2012].

Gibilisco, 2012. Memory management. [Online] Available at: http://whatis.techtarget.com/definition/memory-management [Accessed December 2012].

Muhammad, R.b., n.d. operating systems. [Online] Available at: http://www.personal.kent.edu/~rmuhamma/OpSystems/os.html [Accessed December 2012].

Ocmodshop, 2009. File Systems Explained. [Online] Available at: http://www.ocmodshop.com/file-systems-explained/ [Accessed December 2012].

Silberschatz, galvin & gagne, 2009. In operating systems concepts. 8th ed. USA. p.3.1.

THAKUR, n.d. what is process? explain process scheduling. [Online] Available at: http://ecomputernotes.com/fundamental/disk-operating-system/what-is-process-explain-process-scheduling [Accessed November 2012].

The Linux Information Project, 2006. Context Switch Definition. [Online] Available at: http://www.linfo.org/context_switch.html [Accessed December 2012].

Wikipedia, 2012. Memory management. [Online] Available at: http://en.wikipedia.org/wiki/Memory_management [Accessed December 2012].



rev

Our Service Portfolio

jb

Want To Place An Order Quickly?

Then shoot us a message on Whatsapp, WeChat or Gmail. We are available 24/7 to assist you.

whatsapp

Do not panic, you are at the right place

jb

Visit Our essay writting help page to get all the details and guidence on availing our assiatance service.

Get 20% Discount, Now
£19 £14/ Per Page
14 days delivery time

Our writting assistance service is undoubtedly one of the most affordable writting assistance services and we have highly qualified professionls to help you with your work. So what are you waiting for, click below to order now.

Get An Instant Quote

ORDER TODAY!

Our experts are ready to assist you, call us to get a free quote or order now to get succeed in your academics writing.

Get a Free Quote Order Now