Académique Documents
Professionnel Documents
Culture Documents
INDIVIDUAL ASSIGNMENT TECHNOLOGY PARK MALAYSIA HARDWARE SOFTWARE SYSTEMS AND NETWORKS-(CT014-3-1) INTAKE : UC2F1107IT NAME : K.T.B TP022209 WEIGHTAGE : 50%
1|Page
2|Page
3|Page
4|Page
5|Page
6|Page
Processes terminate; normally exit, voluntarily on an error, involuntarily on an error, terminated (killed) by the actions a user or a process. UNIX maintains the information about a process in two areas: the process table and the user area, or u area. The user area of a process is located at the upper end of the process's address space and is accessible only when running in kernel mode. It contains a pointer to the process table entry; signal settings, the descriptor table, current working directory, unmasks setting. It may be swapped to disk. Only a few system commands are needed when implementing a process control in UNIX. They are: int getpid();int getppid();int fork();int exit(int);int wait(int*);int exec(); fork is the call which is used to create a new process The basic unit of software that the operating system deals with in scheduling the work done by the processor is either a process or a thread, depending on the operating system. Each process is represented in the operating system as a process control block see (figure 1.3) below
7|Page
A scheduling algorithm is the algorithm which dictates how much CPU time is allocated to Processes and Threads. Scheduling algorithms aim to achieve fairness, efficiency, maximizing throughput and minimizing turnaround time. The main reason for CPU scheduling is to utilize its resources 100% to never let it be idle, another reason is the need for processes to perform I/O operations in the normal course of computation. Since I/O operations ordinarily require orders of magnitude more time to complete than do CPU instructions, multiprogramming systems allocate the CPU to another process whenever a process invokes an I/O operation. There are quite a number of scheduling algorithms and they can be categorized into two being pre-emptive and non pre-emptive algorithms.
Pre-emptive vs Non-preemptive algorithms
Preemptive algorithms
with the highest priority should always be the one currently using the processor. If a process is currently using the processor and a new process with a higher priority enters, the ready list, the process on the processor should be removed and returned to the ready list until it is once again the highest-priority process in the system. Processes releases CPU upon receiving a command. Some of the pre-emptive algorithms examples are; round robin, multilevel queue and multilevel feedback queue. In round robin the ready queue is treated like a circular queue and kept as a FIFO; With MLQ, each process is permanently assigned to one queue based on type, priority etc. In multilevel feedback queue processes are separated by CPU burst time.
Non pre-emptive algorithms are designed so that once a process enters the running state (is allowed a process); it is not removed from the processor until it has completed its service time. Some of the examples are; shortest job first (SJF), first come first serve (FCFS) also known as first in first out (FIFO) and priorities. FIFO strategy assigns priority to processes in the order in which they request the processor. The process that requests the CPU first is allocated the CPU first. When a process comes in, add its PCB to the tail of ready queue. When running process terminates, dequeue the process (PCB) at head of ready queue and run it. In priority scheduling, processes are allocated to the CPU on the basis of an externally assigned priority. The key to the performance of priority scheduling
8|Page
9|Page
Section2: Registers
Reasons for registers
A register is temporary high speed storage located in the CPU that holds the data the processor is currently working on. Most modern computer processors contain more than one kind of registers. Register is a special- purpose memory. This memory is vital for moving data in and out of the main memory and to process the data. When CPU executes the instructions, there is a transfer of information between various units of the computer system. CPU uses these registers to handle the process of execution effectively and efficiently. They are a part of the central processing unit but cannot be considered as a part of main memory. They can hold only one piece of data at a time. Registers receive the information, hold it temporarily and pass it on as directed by the control unit.
Register size
Various members of the 80x 86 families have different register sizes. The number of registers that a CPU has and the size of each (number of bits) help determine the power and speed of a CPU Registers are normally measured by the number of bits they can hold, for example, an "8bit register" or a "32-bit register". Understanding the size of registers and the data that you can place in them is very important when using assembler. A 32-bit Intel or compatible processor has three native data sizes that can be used by the normal integral instructions, BYTE, WORD, and DWORD corresponding to 8-bit, 16-bit and 32-bit.
Types of registers
Modern x86 computer processors have eight 32-bit general purpose registers, as depicted in Figure 4: register types. Registers work under the direction of the control unit to accept, hold, and transfer instructions or data and perform arithmetic or logical comparisons at high speed. The control unit uses a data storage register the way a store owner uses a cash register as a temporary, convenient place to store what is used in transactions. A central processing unit contains different kinds of registers that can be classified accordingly to their content or instructions that operate in them. There are eight(8) general purpose registers in most modern processors namely; Base Register (EBX), Counter Register (ECX),Data Register (EDX),Source Index (ESI),Destination Index (EDI), Base Pointer (EBP),Stack Pointer (ESP),The accumulator
10 | P a g e
12 | P a g e
CONCLUSION
The eight general-purpose registers in the x86 processor family each have a unique purpose. Each register has special instructions and opcodes which make fulfilling this purpose more convenient or efficient. The UNIX operating system handles its programs with a very memory efficient memory management system. It is able to run large programs without the need to have large physical memory which is the Random Access Memory (RAM). This in turn, will benefit the users of the UNIX operating system. This is because firstly, the user does not have to buy larger RAM which can be expensive. Secondly, the user will be able to run more programs simultaneously as the UNIX operating system has the ability to manage many programs and processes well ineffectively
13 | P a g e
14 | P a g e
The registers in a standard CPU is considered as volatile memory. When there is sudden power cut, then the data stored in the registers will be lost. Limitations 1. Size of Random Access Memory When a program is run, it will occupy space on the RAM. Because of its fixed amount of RAM in computer, only a limited amount of programs are able to be run at one time. Even though, the user will be able to upgrade the RAM, the user might still be limited to the amount of RAM the operating system can detect due to its32 bit.2. 2. Size of Virtual Memory The amount of virtual memory in the operating system is limited to the amount allocated. Although user has the ability to manipulate the amount of virtual memory, it is still limited by the space in the disk.3. 3. Speed of Random Access Memory Even though it may take a the CPU a very small amount of time to carry out its instruction cycle, the computer will be slowed down by the time it take the information that is already processed to be retrieved by the RAM
15 | P a g e
16 | P a g e
17 | P a g e
Figure iv : PCB
18 | P a g e
19 | P a g e
20 | P a g e
http://computer.howstuffworks.com/computer-memory2.htm. [Accessed 30 August 2011]. The Art of Picking Intel Registers. 2011. The Art of Picking Intel Registers. [ONLINE] Available at:http://www.swansontec.com/sregisters.html. [Accessed 02 September 2011]. Cooling, J.E. Software Design for Real-Time Systems. Chapman & Hall, London, UK: 1995. Stallings, William. Operating Systems: Internals and Design Principles. Upper Saddle River, NJ: Prentice Hall, 1998. What is UNIX? 2011. What is UNIX? [ONLINE] Available
at:http://www.unix.org/what_is_unix.html. [Accessed 10 September 2011]. Process Control in UNIX. 2011. Process Control in UNIX. [ONLINE] Available at: http://cs.oberlin.edu/~jdonalds/341/lecture05.html. [Accessed 10 September 2011] Operating Systems: CPU Scheduling. 2011. Operating Systems : CPU Scheduling. [ONLINE] Available
at:http://www1bpt.bridgeport.edu/sed/projects/cs503/Spring_2001/kode/os/schedulin g.htm#context1. [Accessed 10 September 2011] Scheduling in the 4.2BSD Unix OS. 2011. Scheduling in the 4.2BSD Unix OS. [ONLINE] Available at:http://www.cim.mcgill.ca/~franco/OpSys-304-427/lecturenotes/node46.html. [Accessed 10 September 2011] Operating Systems : CPU Scheduling. 2011. Operating Systems : CPU Scheduling. [ONLINE] Available
21 | P a g e