ALDE111 - Student Tutorial Letter and Assessment Plan - 2023
ALDE111 - Student Tutorial Letter and Assessment Plan - 2023
ALDE111 - Student Tutorial Letter and Assessment Plan - 2023
Sources: Forouzan, B. Foundations of Computer Science, 3rd edition; Pinard/Romer/Morley, CMPTR, 3rd edition
1. Introduction
A computer is a system composed of two major components: hardware and software. Computer hardware is the
physical equipment. Software is the collection of programs that allows the hardware to do its job.
Computer software is divided into two broad categories: the operating system and application programs (Figure
7.1). Application programs use the computer hardware to solve users' problems. The operating system, on the other
hand, controls the access to hardware by users.
An operating system is an interface between the hardware of a computer and the user (programs or
humans) that facilitates the execution of other programs and the access to hardware and software
resources.
The problem can be solved if the operating system is stored (by the manufacturer) in part of memory using ROM
technology. The program counter of the CPU (see Chapter 5) can be set to the beginning of this ROM memory.
When the computer is turned on, the CPU reads instructions from ROM and executes them. This solution,
however, is not very efficient, because a significant part of the memory would needs to be composed of ROM
and could not therefore be used by other programs. Today's technology needs to allocate just a small part of
memory to part of the operating system.
The solution adopted today is a two-stage process. A very small section of memory is made of ROM and holds a
small program called the bootstrap program. When the computer is turned on, the CPU counter is set to the
first instruction of this bootstrap program and executes the instructions in this program. This program is only
responsible for loading the operating system itself, or that part of it required to start up the computer, into RAM
memory. When loading is done, the program counter in the CPU is set to the first instruction of the operating
system in RAM and the operating system is executed. Figure 7.2 illustrates the bootstrap process.
2. Components
Today's operating systems are very complex. An operating system needs to manage different resources in a
computer system. It resembles an organization with several managers at the top level. Each manager is responsible
for managing their department, but also needs to cooperate with others and coordinate activities. A modern
operating system has at least four duties: memory manager, process manager, device manager, and file manager.
Like many organizations that have a department that is not necessarily under any specific manager, an operating
system also has such a component, which is usually called a user interface or a shell . The user interface is
responsible for communication outside the operating system. Figure 7.3 shows the typical components of an
operating system.
Although the memory size of computers has increased tremendously in recent years, so has the size of the
programs and data to be processed. Memory allocation must be managed to prevent applications from running
out of memory. Memory management includes management of multiprogramming and virtual memory.
In multiprogramming , more than one program is in memory at the same time, and they are executed
concurrently, with the CPU switching rapidly between the programs. Figure 7.5 shows memory in a
multiprogramming environment.
A program is a nonactive set of instructions stored on disk (or tape). It may or may not become a job.
A program becomes a job from the moment it is selected for execution until it has finished running and
becomes a program again.
A process is a program in execution. It is a program that has started but has not finished. In other words, a
process is a job that is being run in memory. It has been selected among other waiting jobs and loaded into
memory.
Figure 7.12 State diagram with boundaries between program, job, and process
The process manager uses schedulers and queues to manage processes. Process management involves
synchronizing different processes with different resources. This may potentially create resource deadlock or
starvation. Deadlock occurs when the operating system does not put resource restrictions on processes:
starvation can happen when the operating system puts too many resource restrictions on a process.
The device manager, or input/output manager, is responsible for access to input/output devices. There are
limitations on the number and speed of input/output devices in a computer system. Because these devices are
slower in speed compared with the CPU and memory, when a process accesses an input/output device, the
device is not available to other processes for a period of time. The device manager is responsible for the efficient
use of input/output devices.
A detailed discussion of device managers requires advanced knowledge of operating system principles and is
beyond the scope of this book. However, we can briefly list the responsibilities of a device manager:
The device manager monitors every input/output device constantly to ensure that the device is functioning
properly. The manager also needs to know when a device has finished serving one process and is ready to
serve the next process in the queue.
The device manager maintains a queue for each input/output device or one or more queues for similar
input/output devices. For example, if there are two fast printers in the system, the manager can have one
queue for each or one queue for both.
The device manager controls the different policies for accessing input/output devices. For example, it may
use FIFO for one device and shortest length first for another.
The file manager controls access to files. Access is permitted only by permitted applications and/or users,
and the type of access can vary. For example, a process (or a user that calls a process) may be allowed to
read from a file but is allowed to write to it (that is, change it). Another process may be allowed to execute a
file and a process, but not allowed to read its contents, and so on.
The file manager supervises the creation, deletion, and modification of files.
The file manager can control the naming of files.
The file manager supervises the storage of files: how they are stored, where they are stored, and so on.
The file manager is responsible for archiving and backups.
3.1. DOS
DOS (Disk Operating System) was the dominant operating system for personal computers during the 1980s and
early 1990s. DOS traditionally used a command line interface, although later versions of DOS supported a menu-
driven interface. It was originally developed by Microsoft Corporation, but is no longer updated. However,
computers running the Windows operating system, can still execute DOS commands and users can issue these
commands using the Command Prompt window:
3.2. Windows
Windows has been the predominant operating system for personal computers for many years, and holds about
90% of the market. Microsoft created the original version of Windows – Windows 1.0 – in 1985 in an effort to
meet the needs of users frustrated by having to learn and use DOS commands.
Windows 95, 98, Me, XP, Vista, 7, and 8 offered improvements for personal computers (support for
new hardware like DVDs, improved multimedia and networks, improved GUI, etc.).
Other versions (Windows Server and Windows Phone) supported other devices.
Windows 10 is the latest version of Windows and is designed for all devices, from smartphones to tablets to
personal computers to servers.
3.3. OS X
OS X (formally called Mac OS X) is the proprietary operating system for <ac computers made by Apple. It is based
on the UNIX operating systems and set the original standard for graphical user interfaces.
3.4. UNIX
Unix was developed in the late 1960s at AT&T Bell Laboratories as an operating system for midrange servers.
Computer systems ranging from personal computers to mainframes can run UNIX, and it can support a variety of
devices – this flexibility gives it an advantage over competing operating systems in some situations. However,
UNIX is more expensive, requires a higher level of technical knowledge, and tends to be harder ti install,
maintain, and upgrade than most other commonly used operating systems.
3.5. Linux
Linux (pronounced with a short i sound) is an operating system developed by Linus Torvalds in 1991. It was
release to the public as open source software, which is a program whose source code is available to the public
and may be modified to improve or customise it. Although Linux originally used a command line interface, most
recent versions use a graphical user interface. The advantage of Linux is that it is less expensive and much more
customizable than Windows and Linux are available for a wide variety of computers, from personal computers to
servers to mobile devices. For example, Android, an operating system widely used with smartphone, is based in
Linux. So is Chrome OS, the first cloud operating system designed for devices that will be sued primarily online.
3.6. iOS
The mobile operating system designed for the Apple IPhone, iPad and iPod touch is iOS. It is based on OS x,
supports multi-touch input, and has a variety of built-in apps and features.
3.7. Android
Android is a Linux-based operating system developed by the Open Handset Alliance, a group that includes
Google and more than 30 technology and mobile companies. Android us essentially tied with iOS as the most
widely used mobile operating system. Recent versions of Android support multi-touch input and has a variety of
built-in apps with more than one million additional apps available via the Google Play store. In addition to being
used with Android smartphones, Android is the operating system used with Android tablets, Android Wear smart
watches, and some smart TV’s.