CSC 182 SECTION B- ANSWERS
An operating system (OS) is a software program that manages the hardware and software resources of a computer.
It acts as an intermediary between the computer's hardware and the software applications that run on the computer.
Some of the key functions of an operating system include managing memory and processing power, controlling
input and output operations, managing and organizing files, and providing a user interface. Some examples of
popular operating systems include Windows, MacOS, Linux, and Android.
1B. A batch operating system processes jobs in a batch, or group, rather than processing them one at a time. This
means that multiple jobs are collected and processed together in one go, rather than individually. This allows for
efficient use of resources and can lead to faster processing times.
WHILE
A time-sharing operating system, on the other hand, allows multiple users to access and use the computer's
resources simultaneously. This is done by quickly switching between different users' tasks, giving the illusion
that each user has their own dedicated computer. This allows for better resource utilization and improved
interactivity for users.
In summary, batch operating systems are designed for efficient resource utilization by processing large amount
of data in one go, while time-sharing operating systems are designed for multiple users to access and share the
computer's resources at the same time.
1c. i. Memory Management: One of the most important functions of an operating system is managing the
computer's memory. This includes allocating and deallocating memory to different programs, as well as managing
the system's virtual memory (i.e. using a portion of the hard drive as an extension of physical memory). This
ensures that the computer's resources are used efficiently and that programs do not interfere with each other's
memory.
ii. Process Management: Operating systems are responsible for managing and coordinating the execution of
different processes. This includes creating, scheduling, and terminating processes, as well as allocating system
resources such as CPU time and memory to them. This ensures that the computer can efficiently run multiple
programs at the same time without conflicts.
iii. File Management: Operating systems also manage the organization and storage of files on a computer's hard
drive or other storage device. This includes creating, deleting, and managing access to files, as well as managing
the file system itself. This ensures that files are stored and retrieved efficiently and that users have appropriate
access to them.
2A. A Disk Operating System (DOS) is a type of operating system that is designed to run on personal computers
and servers. It uses a command-line interface (CLI) for interacting with the user. The three basic components of
DOS are:
i. The File System: The file system is responsible for organizing and managing files on the computer's hard drive
or other storage device. It keeps track of where files are stored, how they are organized, and how they can be
accessed. In DOS, the file system is typically organized into a hierarchical structure with a root directory and
subdirectories.
ii. The Command Interpreter: The command interpreter is responsible for interpreting and executing commands
that are typed into the command-line interface by the user. It takes the user's input, interprets it, and then performs
the appropriate action. In DOS, the command interpreter is typically referred to as the "Command Prompt" or
"CMD".
Source: Edem Joseph
iii. The Basic Input/Output System (BIOS): The BIOS is a small program that is stored on a chip on the computer's
motherboard. It is responsible for performing basic system functions such as booting the computer, initializing
hardware, and providing a interface for the operating system to interact with the computer's hardware.
Overall, these three components work together to provide the basic functionality of a DOS operating system. The
file system organizes and manages files, the command interpreter receives and executes commands, and the BIOS
provides basic system functions and hardware interface.
2b.
i. The cd command can be used to navigate to a specific directory by specifying the path to that directory. For
example, ‘cd Documents/’ will navigate to the Documents directory.
ii. The cd command can be used to navigate to the parent directory of the current directory by using the ‘..’
argument. For example,’ cd ..’ will navigate to the parent directory.
iii. The cd command can be used to navigate to the home directory of the current user by using the ~ argument.
For example, ‘cd ~’ will navigate to the home directory.
2C.
i. A command shell is a command-line interface (CLI) for interacting with an operating system. It is a program
that provides an interface for users to enter commands, which are then executed by the operating system.
ii. BASH (Bourne-Again SHell) is a specific type of command shell. It is an open-source Unix shell, which is
widely used on Linux and macOS. BASH provides a number of features and improvements over the original
Bourne shell, such as command line editing, command history, and built-in support for variables and functions.
In summary, a command shell is a general concept, while BASH is a specific implementation of a command shell.
Most commonly BASH is used on Linux and macOS operating system as default shell, but there are other shells
like ZSH, Fish, Csh, Tcsh, etc.
3a.
Multi-tasking on a uniprocessor is achieved through a technique called time-sharing. The operating system
allocates small slices of time, called time slices, to each process. Each process runs for a short period of time and
then is paused, allowing the next process to run. This rapid switching between processes gives the illusion that
multiple processes are executing simultaneously. This technique is known as context switching. The scheduler of
the operating system is responsible for deciding which process should run next and for how long.
3b.
1. ls - Lists the files and directories in a directory.
2. cd - Changes the current working directory.
3. mkdir - Creates a new directory.
4. rm - Deletes a file or directory.
5. echo - Prints the specified text to the console.
3c.
A file is a collection of data that is stored on a computer's hard drive or other storage device.
The command used to create a new file in an operating system such as Windows or Linux is typically ‘touch’ or
‘New-Item’ in PowerShell. The touch command creates an empty file with the specified name, or updates the
Source: Edem Joseph
timestamp of an existing file if it already exists. In Windows, you can also use the New-Item command in
PowerShell to create a new file.
Source: Edem Joseph