Barie OS Assignment

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 19

BULE HORA UNIVERSITY

COLLEGE: INFORMATICS

DEPARTMENT: SOFTWARE ENGINEERING

COURSE TITLE : OPERATING SYSTEMS

COURSE CODE : SWENG - 3073

INDIVIDUAL ASSIGNMENT (1)

NAME : BARIE WAKJIRA

ID : RU1351/12

SUBMITTED DATE: APRIL 4/2022

SUBMITTED TO:INSTRUCTOR SOLAMU SHIRTAWI

CONTENTS page

Page | 1
INTRODUCTION………………………………………………………………………3

1.1 What is File System……………………………………………………………………………………………...4

1.2 Objective of File management System………………..............4

1.3 File structure………………………………………………………………………….4

1.4 File Attributes………………………………………………………………………..5

1.5 File Type……………………………………………………………………………......5

1.6 Functions of File…………………………………………………………………….6

1.7 Commonly used terms in File systems……………………………………6

1.8 File Access Methods……………………………………………………………….6

1.9 space allocation……………………………………………………………………..7

1.10 File Directories……………………………………………………………………..8

1.11 File Operations………………………………………………………………………………………………..9


2.1 Types of operating system ……………………………………………………10

3.1 Operating System Architecture……………………………………………..14

Summary:………………………………………….18
REFERENCE……………………………………………………19

Page | 2
INTRODUCTION
An operating system acts as an intermediary between the user of a computer and
computer hardware. The purpose of an operating system is to provide an environment
in which a user can execute programs conveniently and efficiently. 

An operating system is a software that manages computer hardware. The hardware


must provide appropriate mechanisms to ensure the correct operation of the computer
system and to prevent user programs from interfering with the proper operation of the
system. 

In this assignment, we will understand about the different file tribute, concepts of file
and its storage along with operations on files.

Operating systems are there from the very first computer generation and they keep
evolving with time.
we will also discuss some of the important types of operating systems which are most
commonly used as well as operating system architecture.

1.1 What is File System?


 A file is a collection of correlated information which is recorded on secondary or non-volatile
storage like magnetic disks, optical disks, and tapes.

Page | 3
 It is a method of data collection that is used as a medium for giving input and receiving output
from that program.
 In general, a file is a sequence of bits, bytes, or records whose meaning is defined by the file
creator and user.
 Every File has a logical location where they are located for storage and retrieval

1.2 Objective of File management System


 Here are the main objectives of the file management system:
 It provides I/O support for a variety of storage device types.
 Minimizes the chances of lost or destroyed data
 Helps OS to standardized I/O interface routines for user processes.
 It provides I/O support for multiple users in a multiuser systems environment.

Properties of a File System

Here, are important properties of a file system:

 Files are stored on disk or other storage and do not disappear when a user logs off.

 Files have names and are associated with access permission that permits controlled
sharing.

 Files could be arranged or more complex structures to reflect the relationship between
them.

1.3 File structure


A File Structure needs to be predefined format in such a way that an operating system understands. It
has an exclusively defined structure, which is based on its type.

Three types of files structure in OS:

 A text file: It is a series of characters that is organized in lines.

 An object file: It is a series of bytes that is organized into blocks.

 A source file: It is a series of functions and processes.

 When operating system defines different file structures, it also contains the code
to support these file structure. Unix, MS-DOS support minimum number of file
structure.

1.4 File Attributes

Page | 4
A file has a name and data. Moreover, it also stores meta information like file creation date and time,
current size, last modified date, etc. All this information is called the attributes of a file system.

Here, are some important File attributes used in OS:

 Name: It is the only information stored in a human-readable form.

 Identifier: Every file is identified by a unique tag number within a file system known as an
identifier.

 Location: Points to file location on device.

 Type: This attribute is required for systems that support various types of files.

 Size. Attribute used to display the current file size.

 Protection. This attribute assigns and controls the access rights of reading, writing, and
executing the file.

 Time, date and security: It is used for protection, security, and also used for monitoring

1.5 File Type


It refers to the ability of the operating system to differentiate various types of files like text files, binary,
and source files. However, Operating systems like MS_DOS and UNIX has the following type of files:

Character Special File

It is a hardware file that reads or writes data character by character, like mouse, printer, and more.

Ordinary files

 These types of files stores user information.

 It may be text, executable programs, and databases.

 It allows the user to perform operations like add, delete, and modify.

Directory Files

 Directory contains files and other related information about those files. Its basically a folder to
hold and organize multiple files.

Special files

 These files are also known as device files.

 These files represent physical device like disks, terminals, printers, networks, tape drive etc.

Page | 5
These files are of two types −

 Character special files − data is handled character by character as in case of terminals or


printers.

 Block special files − data is handled in blocks as in the case of disks and tapes.

1.6 Functions of File


 Create file, find space on disk, and make an entry in the directory.

 Write to file, requires positioning within the file

 Read from file involves positioning within the file

 Delete directory entry, regain disk space.

 Reposition: move read/write position.

1.7 Commonly used terms in File systems


 Field:
 This element stores a single value, which can be static or variable length.
 DATABASE:
 Collection of related data is called a database. Relationships among elements of data are
explicit.
 FILES:
 Files is the collection of similar record which is treated as a single entity.
 RECORD:
 A Record type is a complex data type that allows the programmer to create a new data
type with the desired column structure.
 Its groups one or more columns to form a new data type.
 These columns will have their own names and data type.
1.8 File Access Methods
 File access is a process that determines the way that files are accessed and read into memory.
 Generally, a single access method is always supported by operating systems.
 Though there are some operating system which also supports multiple access methods.
 Three file access methods are:

 Sequential access

 Direct random access

 Index sequential access

Page | 6
 Sequential access
 A sequential access is that in which the records are accessed in some sequence, i.e., the
information in the file is processed in order, one record after the other.
 This access method is the most primitive one.
 Example: Compilers usually access files in this fashion.
 Direct/Random access

 Random access file organization provides, accessing the records directly.

 Each record has its own address on the file with by the help of which it can be directly
accessed for reading or writing.

 The records need not be in any sequence within the file and they need not be in adjacent
locations on the storage medium.

 Indexed sequential access

 This mechanism is built up on base of sequential access.

 An index is created for each file which contains pointers to various blocks.

 Index is searched sequentially and its pointer is used to access the file directlySpace Allocation

1.9 space allocation


 In the Operating system, files are always allocated disk spaces.
o Three types of space allocation methods are:

 Linked Allocation

 Indexed Allocation

 Contiguous Allocation

 Contiguous Allocation
 In this method,

 Every file users a contiguous address space on memory.

 Here, the OS assigns disk address is in linear order.

 In the contiguous allocation method, external fragmentation is the biggest issue.

 Linked Allocation
 In this method,

 Every file includes a list of links.

Page | 7
 The directory contains a link or pointer in the first block of a file.

 With this method, there is no external fragmentation

 This File allocation method is used for sequential access files.

 This method is not ideal for a direct access file.

 Indexed Allocation
 In this method,

 Directory comprises the addresses of index blocks of the specific files.

 An index block is created, having all the pointers for specific files.

 All files should have individual index blocks to store the addresses for disk space.

1.10 File Directories


A single directory may or may not contain multiple files. It can also have sub-directories inside
the main directory. Information about files is maintained by Directories. In Windows OS, it is
called folders.

Following is the information which is maintained in a directory:

 Name The name which is displayed to the user.

 Type: Type of the directory.

 Position: Current next-read/write pointers.

 Location: Location on the device where the file header is stored.

 Size: Number of bytes, block, and words in the file.

 Protection: Access control on read/write/execute/delete.

 Usage: Time of creation, access, modification

File types- name, extension


File Type Usual extension Function

Page | 8
Executable exe, com, bin or none ready-to-run machine- language program
Object obj, o complied, machine language, not linked
Source code c. p, pas, 177, asm, a source code in various languages
Batch bat, sh Series of commands to be executed
Text txt, doc textual data documents
Word processor doc,docs, tex, rrf, etc. various word-processor formats
Library lib, h libraries of routines
related files grouped into one file,
Archive arc, zip, tar
sometimes compressed.

1.11 File Operations


 A file is an abstract data type.
 For defining a file properly, we need to consider the operations that can be
performed on files.
 The operating system can provide system calls to create, write, read, reposition,
delete, and truncate files.
 There are six basic file operations within an Operating system.
 These are:
 Creating a file: There are two steps necessary for creating a file. First, space in
the file system must be found for the file. We discuss how to allocate space for
the file. Second, an entry for the new file must be made in the directory.
 Writing a file: To write to a file, you make a system call specify about both the
name of the file along with the information to be written to the file.
 Reading a file: To read from a file, you use a system call which specifies the
name of the file and where within memory the next block of the file should be
placed.
 Repositioning inside a file: The directory is then searched for the suitable entry,
and the 'current-file-position' pointer is relocating to a given value. Relocating
within a file need not require any actual I/O. This file operation is also termed as
'file seek.'
 Deleting a file: For deleting a file, you have to search the directory for the
specific file. Deleting that file or directory release all file space so that other files
can re-use that space.
 Truncating a file: The user may wish for erasing the contents of a file but keep
the attributes same. Rather than deleting the file and then recreate it, this utility
allows all attributes to remain unchanged — except the file length — and let the
user add or edit the file content.

Page | 9
2.1 Types of Operating System
 An operating system is a type of software interface between the user and the device
hardware.
 It allows users to communicate with the device and perform the desired functions. 
 Operating systems use two components to manage computer programs and
applications.
 The kernel is the core inner component that processes data at the hardware level.
 It handles input-output management, memory and process management.
 The shell is the outer layer that manages the interaction between the user and the OS.
 The shell communicates with the operating system by either taking the input from the
user or a shell script.
 A shell script is a sequence of system commands that are stored in a file.

 Why is it important to know about operating


systems?
 Knowledge of operating systems is important for the following reasons:
 It allows you to understand the inner workings of a device.
 It enables you to fix minor issues with the device.
 It allows you to improve your coding skills.
 It allows you to determine what operating system is best for you.

Here are the different types of operating systems:-

 Batch operating system


 The users of a batch operating system do not interact with the computer
directly.
 Each user prepares his job on an off-line device like punch cards and submits it
to the computer operator.
 To speed up processing, jobs with similar needs are batched together and run as
a group.
 The programmers leave their programs with the operator and the operator then
sorts the programs with similar requirements into batches.

Page | 10
The problems with Batch Systems are as follows −

 Lack of interaction between the user and the job.


 CPU is often idle, because the speed of the mechanical I/O devices is slower than the
CPU.
 Difficult to provide the desired priority.

 Time-sharing operating systems


 Time-sharing is a technique which enables many people, located at various terminals, to use a
particular computer system at the same time.
 Time-sharing or multitasking is a logical extension of multiprogramming.
 Processor's time which is shared among multiple users simultaneously is termed as time-
sharing.
 The main difference between Multiprogrammed Batch Systems and Time-Sharing Systems is
that in case of Multiprogrammed batch systems, the objective is to maximize processor use,
whereas in Time-Sharing Systems, the objective is to minimize response time.
 Multiple jobs are executed by the CPU by switching between them, but the switches occur so
frequently. Thus, the user can receive an immediate response.
 For example, in a transaction processing, the processor executes each user program in a short
burst or quantum of computation.
 That is, if n users are present, then each user can get a time quantum.
 When the user submits the command, the response time is in few seconds at most.
 The operating system uses CPU scheduling and multiprogramming to provide each user with a
small portion of a time.
 Computer systems that were designed primarily as batch systems have been modified to time-
sharing systems.
 Advantages of Timesharing operating systems are as follows −
 Provides the advantage of quick response.
 Avoids duplication of software.
 Reduces CPU idle time.
 Disadvantages of Time-sharing operating systems are as follows −

 Problem of reliability.
 Question of security and integrity of user programs and data.
 Problem of data communication.

 Distributed operating System


 Distributed systems use multiple central processors to serve multiple real-time
applications and multiple users.

Page | 11
 Data processing jobs are distributed among the processors accordingly.
 The processors communicate with one another through various communication lines
(such as high-speed buses or telephone lines).
 These are referred as loosely coupled systems or distributed systems.
 Processors in a distributed system may vary in size and function.
 These processors are referred as sites, nodes, computers, and so on.
 The advantages of distributed systems are as follows −

With resource sharing facility, a user at one site may be able to use the resources
available at another.
 Speedup the exchange of data with one another via electronic mail.
 If one site fails in a distributed system, the remaining sites can potentially continue
operating.
 Better service to the customers.
 Reduction of the load on the host computer.
 Reduction of delays in data processing.
 Disadvantages of Distributed Operating System:  

 Failure of the main network will stop the entire communication

 To establish distributed systems the language which is used are not well defined yet

 These types of systems are not readily available as they are very expensive. Not only
that the underlying software is highly complex and not understood well yet

 Examples of Distributed Operating System are- LOCUS, etc. 

 Network operating System


 A Network Operating System runs on a server and provides the server the capability to manage
data, users, groups, security, applications, and other networking functions.
 The primary purpose of the network operating system is to allow shared file and printer access
among multiple computers in a network, typically a local area network (LAN), a private network
or to other networks.
 Examples of network operating systems include Microsoft Windows Server 2003, Microsoft
Windows Server 2008, UNIX, Linux, Mac OS X, Novell NetWare, and BSD.
 The advantages of network operating systems are as follows −
 Centralized servers are highly stable.
 Security is server managed.
 Upgrades to new technologies and hardware can be easily integrated into the system.
 Remote access to servers is possible from different locations and types of systems.

Page | 12
 The disadvantages of network operating systems are as follows −

 High cost of buying and running a server.


 Dependency on a central location for most operations.
 Regular maintenance and updates are required.

 Real Time operating System


 A real-time system is defined as a data processing system in which the time interval
required to process and respond to inputs is so small that it controls the environment.
 The time taken by the system to respond to an input and display of required updated
information is termed as the response time.
 So in this method, the response time is very less as compared to online processing.
 Real-time systems are used when there are rigid time requirements on the operation of
a processor or the flow of data and real-time systems can be used as a control device in
a dedicated application.
 A real-time operating system must have well-defined, fixed time constraints, otherwise
the system will fail.
 For example, Scientific experiments, medical imaging systems, industrial control
systems, weapon systems, robots, air traffic control systems, etc.

 There are two types of real-time operating systems.


 Hard real-time systems
 Soft real-time systems
 Hard real-time systems
 Hard real-time systems guarantee that critical tasks complete on time.
 In hard real-time systems, secondary storage is limited or missing and the data is stored
in ROM.
 In these systems, virtual memory is almost never found.
 Soft real-time systems

Soft real-time systems are less restrictive.

A critical real-time task gets priority over other tasks and retains the priority until it
completes.
 Soft real-time systems have limited utility than hard real-time systems.
 For example, multimedia, virtual reality, Advanced Scientific Projects like undersea
exploration and planetary rovers, etc.
 Advantages of Real-Time OS:  

 Maximum Consumption: Maximum utilization of devices and system, thus more output


from all the resources

Page | 13
 Task Shifting: The time assigned for shifting tasks in these systems are very less. For
example, in older systems, it takes about 10 microseconds in shifting one task to
another, and in the latest systems, it takes 3 microseconds.

 Focus on Application: Focus on running applications and less importance to applications


which are in the queue.

 Real-time operating system in the embedded system: Since the size of programs are


small, RTOS can also be used in embedded systems like in transport and others.

 Error Free: These types of systems are error-free.

 Memory Allocation: Memory allocation is best managed in these types of systems.

 Disadvantages of Real-Time OS:  


 Limited Tasks: Very few tasks run at the same time and their concentration is very less
on few applications to avoid errors.
 Use heavy system resources: Sometimes the system resources are not so good and they
are expensive as well.
 Complex Algorithms: The algorithms are very complex and difficult for the designer to
write on.
 Device driver and interrupt signals: It needs specific device drivers and interrupts
signals to respond earliest to interrupts.
 Thread Priority: It is not good to set thread priority as these systems are very less prone
to switching tasks.
 Examples of Real-Time Operating Systems are: Scientific experiments, medical imaging
systems, industrial control systems, weapon systems, robots, air traffic control systems, etc.

3.1 Operating System Architecture


3.1. A monolithic OS architecture
 The core software components of an operating system are collectively known as the kernel.
 The kernel has unrestricted access to all of the resources on the system.
 In early monolithic systems, each component of the operating system was contained within the
kernel, could communicate directly with any other component, and had unrestricted system
access.
 While this made the operating system very efficient, it also meant that errors were more
difficult to isolate, and there was a high risk of damage due to erroneous or malicious code.

Page | 14
A monolithic OS architecture

3.2 A layered OS architecture


 As operating systems became larger and more complex, this approach was largely abandoned in
favour of a modular approach which grouped components with similar functionality into layers
to help operating system designers to manage the complexity of the system.
 In this kind of architecture, each layer communicates only with the layers immediately above
and below it, and lower-level layers provide services to higher-level ones using an interface that
hides their implementation.
 The modularity of layered operating systems allows the implementation of each layer to be
modified without requiring any modification to adjacent layers.
 Although this modular approach imposes structure and consistency on the operating system,
simplifying debugging and modification, a service request from a user process may pass through
many layers of system software before it is serviced and performance compares unfavourably to
that of a monolithic kernel. Also, because all layers still have unrestricted access to the system,
the kernel is still susceptible to errant or malicious code.
 Many of today’s operating systems, including Microsoft Windows and Linux, implement some
level of layering.

Page | 15
A layered OS architecture

3.3 A microkernel OS architecture


 A microkernel architecture includes only a very small number of services within the kernel in an
attempt to keep it small and scalable.
 The services typically include low-level memory management, inter-process communication
and basic process synchronisation to enable processes to cooperate.
 In microkernel designs, most operating system components, such as process management and
device management, execute outside the kernel with a lower level of system access.
 Microkernels are highly modular, making them extensible, portable and scalable.
 Operating system components outside the kernel can fail without causing the operating system
to fall over.
 Once again, the downside is an increased level of inter-module communication which can
degrade system performance.

Page | 16
A microkernel OS architecture

3.4 Networked and Distributed Operating System

 A network operating system enables its processes to access resources (e.g., files) that reside on
other independent computers on a network.
 The structure of many networked and distributed operating systems is often based on the
client/server model.
 The client computers in such a network request resources—such as files and processor time—
via the appropriate network protocol.
 The servers respond with the appropriate resources.  A distributed operating system is a single
operating system that manages resources on more than one computer system.
 EX :- MIT's Chord operating system and the Amoeba operating system from the Vrije Universiteit
(VU) in Amsterdam.

Page | 17
Summary:
A file is a collection of correlated information which is recorded on secondary or non-volatile storage like
magnetic disks, optical disks, and tapes.

 It provides I/O support for a variety of storage device types.


 Files are stored on disk or other storage and do not disappear when a user logs off.
 A File Structure needs to be predefined format in such a way that an operating system
understands it.
 File type refers to the ability of the operating system to differentiate different types of files like
text files, binary, and source files.
 Create find space on disk and make an entry in the directory.
 Indexed Sequential Access method is based on simple sequential access
 In Sequential Access method records are accessed in a certain pre-defined sequence
 The random access method is also called direct random access

Three types of space allocation methods are:

 Linked Allocation
 Indexed Allocation
 Contiguous Allocation

Information about files is maintained by Directories

An operating system is a software that acts as an interface between the user and the computer hardware
and controls the execution of all kinds of programs.

A monolithic os is an operating system architecture where the entire operating system is working in kernel
space and is alone in supervisor mode.

As operating systems became larger and more complex, purely monolithic designs became unwieldy. The
layered approach to operating systems attempts to address this issue by grouping components that perform
similar functions into layers

In microkernel designs, most operating system components—such as process management, networking, file
system interaction and device management—execute outside the kernel with a lower privilege level. 
Microkernels exhibit a high degree of modularity, making them extensible, portable and scalable.

A network operating system enables its processes to access resources (e.g., files) that reside on other
independent computers on a network.  The structure of many networked and distributed operating
systems is often based on the client/server model..

Page | 18
REFERENCE
https://www.tutorialspoint.com/ operating_system/os_file_system.htm

https://www.technologyuk.net/ computing/computer-software/operating-systems/operating-system-
architecture.shtml

CS 370 Ð Computer architecture

Mano, M. Morris, and Kime, Charles R., Logic and Computer Design Fundamentals, 4th Ed, Prentice Hall,
2007.

M. Morris Mano. Digital Design, 3rd edition. Prentice-Hall, Upper Saddle River, NJ, 2002.

CS 570 Ð Operating systems

[VUS] Marko Vuskovic, Operating System Lecture


Notes http://medusa.sdsu.edu/cs570/Lectures/Table_of_Contents.htm

Andrew S. Tanenbaum. Modern Operating Systems, 2nd ed. Prentice Hall, Upper Saddle River, NJ,
2001.

Abraham Silberschatz, Peter Galvin, Greg Gagne. Operating System Concepts, 7th edition. John Wiley &
Sons, Inc., Hoboken, NJ, 2004.

CS 572 Ð Microprocessor architecture

John Hennessy and David Patterson, Computer Architecture: A Quantitative Approach. 4th edition.
Morgan Kaufmann, Amsterdam, Boston, 2007

Page | 19

You might also like