You are on page 1of 40

CHAPTER 2

BASIC OPERATING
SYSTEM CONCEPT
MANAGEMENT
At the end of this chapter…

 To introduce the notion of a process-a


program in execution, which forms the basis
of all computation.
 To describe the various features of
processes, including scheduling creation and
termination and communication.
 To describe communication in client-server
systems.
Different types of user interface

1. Command Interface (Antaramuka Berarahan)


 terminal (UNIX, Linux), command prompt

(MS-DOS)
 where the user provides the input by typing a

command string with the computer keyboard


and the system provides output by printing
text on the computer monitor.
 Used for system administration tasks etc.
2. Menu Interface (Antaramuka Menu)
 an interface characterized by the presence of a
menu button where commands are selected as
opposed to a command line where commands are
typed in.
 provides a very simple way for users to get started
with a product
 requires less hardware than other techniques.
 It is often the heart of a system where there are very
few hardware keys present.
 Typically one of the keys (or a item on a touch
screen) will be used to bring up a menu of choices.
 This list of choices will be traversed and a selection
made to perform the desired task.
3. Graphical User Interface (Antaramuka
Penguna Bergrafik)
 accept input via devices such as computer
keyboard and mouse and provide articulated
graphical output on the computer monitor.

 There are at least two different principles


widely used in GUI design: Object-oriented
user interfaces (OOUIs) and application
oriented interfaces
Graphical User Interface
(Antaramuka Penguna Bergrafik)
 Object-oriented user interfaces : the user
interacts explicitly with objects that represent
entities in the domain that the application is
concerned with. Many vector drawing
applications, for example, have an OOUI - the
objects being lines, circles and canvases
 Application Oriented Interfaces :
4. Voice Actuated Interface (Antaramuka
Pendorong Bersuara)
 which accept input and provide
output by generating voice prompts.
 The user input is made by pressing
keys or buttons, or responding
verbally to the interface.
5. Web Form Interface (Antarmuka
Berbentuk Web)
 also known as Web-based user interfaces or web user
interfaces (WUI)
 accept input and provide output by generating web
pages which are transmitted via the Internet and viewed
by the user using a web browser program.
 Newer implementations utilize Java, AJAX, Adobe Flex,
Microsoft .NET, or similar technologies to provide real-
time control in a separate program, eliminating the need
to refresh a traditional HTML based web browser.
 Administrative web interfaces for web-servers, servers
and networked computers are often called Control
panels.
6 Component of OS layer. **

 User interface – provide mechanism for sys


operator and user to communicate with the
OS & request OS services.
 File mgmt – provide routine that allow user /
pgrm to create, del, modify, manipulate file.
 Device mgmt – ctrl comm with sys peripheral
dev
 Processor / process mgmt – managing the
processor’s time.
 Memory mgmt – managing the sys memory
resource, allocate space to apps as needed,
ensuring tht those apps do not interfere with
each other.
 Comm services – support makes it possible
for one computer to comm with another.
Basic function perform by OS’s u/i

 User communicate with OS through


application program.
 Application prgm request OS services
through API.
 User or sys operator identifies the program to
be launch by issuing command.
 OS’s u/i accepts, interpret, carry out the
command
 Command tell the OS to perform single
service such as:
 Log a user onto the system

 Start an application

 Allocate a peripheral device


File System

The file system occupies a lower


storage operating system layer and
help keep track of the data and
program stored on disk and other
secondary storage devices.
FIGURE THE FILE SYSTEM LAYER
APPLICATION PROGRAM LAYER

USER INTERFACE LAYER

FILE SYSTEM LAYER

OTHER OPERATING SYSTEM LAYER

OPERATING SYSTEM

HARDWARE
DIRECTORY MANAGEMENT
 A disk can hold hundreds of different files and
program ,but if you want to load a particular
program , only that program will do , and if the
program needs data from a particular file , only
that file will do .

 The location (the start address ) of every file


stored on a disk can be found by searching the
disk’directory .
FIGURE THE LOCATION OF EVERY FILE STORED ON A DISK
CAN BE FOUND BY SEARCHING THE DISKS DIRECTORY

THE DISK DIRECTORY


LAUNCHING A PROGRAM
 Begin when a user types a command such as SPACEWAR or
clicks on the Spacewar icon.
 The user interface interprets the command and passes the
program name to the file system.
 Directory is in memory the file system searches it.
 Program is identified by name and following the program’s name
is its physical location on disk the track and sector address of its
first instructions.
 Program is loaded the file system notifies the user interface
which starts the program.
OPENING AND CLOSING DATA
FILES
 NORMALLY INSTEAD AND LAUNCHED TO OPERATOR OR USER
COMMANDS.

 DATA FILES ARE CREATED AND ACCESSED THROUGH


APPLICATION PROGRAM.

 TO CREATE A NEW FILE, THE USER ENTERS SOME DATA


THROUGH AN APPLICATION AND SAVE FILE.

 TO FIND AN EXISTING FILE, THE USER ISSUES AN OPEN


COMMAND.

 TO A CLOSE COMMAND, THE FILE SYSTEM UPDATES THE


DIRECTORY TO INDICATE SUCH INFORMATION.
Primary functions performed by file
system.
 files are the logical storage unit mapped by
os onto the physical devices
 file atribute
 name
 Identifier type
 location
 size
 protection
 time, date and user identification
6 File Operation

File operations
 1. creating file

 2. writing file

 3. reading a file

 4. repositioning within a file

 5. deleting a file.

 6. truncating a file
 1. creating file
 steps necessary to create file
 space in file system must be found for the file
 entry for the new file must be be made in the directory
 2. writing file
 Need system call to specify name and information to be
written to the file
 System searches the directory to find the file location
through the file name.
 System must keep write pointer to the location in the file
where the next write is to take place.
 The write pointer must be updated whenever the write
occurs.
 3. reading a file
 Use system call to specifies the name of a file and
where (in memory) the next block of the file
should be put.
 The directory is searched for the associated entry,
and the system needs to keep the read pointer to
the location in the file.
 Once the read has taken place, the read pointer is
updated.
 Both read write operations use the same pointer,
saving space and reduce complexity.
 4. repositioning within a file
 The directory is search for the appropriate entry.
 Current-file-position pointer is repositioned to a
given value
 Need not involve any actual I/O.
 Also known as a file seek.
 5. Deleting file.
 Search the directory for file name first.
 Then, release all file space – so it can be reused
by other files, and erase the directory entry.
 6. Truncating a file
 Erase the content of file, but keep the attribute.
 Attribute remain unchanged except for file length.
LOGICAL AND PHYSICAL I/O
Logical I/O
 It is similar to process of reading and writing
data record.
 Request a for a specific logical unit of data.
 Does not indicate where or how data are
physically stored.
Physical I/O
 Act of physically transferring data between
peripheral and memory.
 Responsibility for a lower operating system
layer.
 Accept a logical request from application
program layer.
LOGICAL AND PHYSICAL
RECORD
 Physical record (unit of data that is transferred btw
peripheral device and memory)

Sector

Record

 Logical record (the unit of data processes by a single


iteration of an application program.)
 Hardware transfer a single physical record between
disk surface and memory.
 Between logical and physical i/o, a software must
either select a portion of a physical record or
combine to form logical record.
 Depend on system, task may perform by an access
method.
BLOCKING
 As example, a program process a single line
logical record on disk.

 Storing a 80 bytes of data.


Sector- 512 bytes
Record 1-80
Unused space
bytes

 Wasting 432 bytes per sector.


 To avoid of wasting data, a block method is use.
 This method leaving less unused space.

Sector-512 bytes

Unused
Record 1 Record 2 Record 3 Record 5 Record 6 space

 In this diagram, a block of data can be put in single


sector.
 This will reduce unused space
Spanned record
 Some application involve lengthy record.
 If the logical is bigger than sector, two or more
sector is needed to support a logical record.

Sector 0

Record 1 Record 2 Record 3

Sector 1

Record 4 Record 5 Record 6


 File system is responsible for allocating and managing spaces
on your disk.
 When a file is created its data is automatically stored in
series of consecutive sectors, but since many different files
share the same disk, that is not always possible.
 For an example, when we do our assignment on Monday and
then we edit it or make some addition to it on Wednesday. the
Monday data might occupy consecutive sectors, but data of
other data between Monday and Wednesday might lie
between this gap. And the file system bridges this gap.
 When a file is created the file system will records the
number of the file of first sector in the directory.
 When a sector is full the file allocation table is searched and
the next available free sector are allocated .
 Free sector are identified as “0” in the allocation table.
 To link the sector, the second sector number is recorded at
the first sector allocation table entry.
 The next slide will show you how the disk allocation
technique work.
FILE ALOCATION TABLE
DIRECTORY Sector Pointer
0 -1
File name First sector 1 -1
A 6 2 -1 System use
B 8 3 -1
C 10 4 -1
5 -1
6 7
7 9
8 -1
9 12
10 11
11 -1
12 -1
13 0
14 0
15 0 Free sector
Directory Management
 Work with directory
 establishes directory entry when create a file
 finds the file’s physical address when open a file at
directory
 delete the associated directory entry when delete a
file.

Disk Space Management


 work with file allocation table.
 Finds first available free sector when create a file
 Finds the necessary free space, assigns it to the
file, and notes the assignment in the file allocation
table.
 Directory and file allocation table are tightly linked.
 Directory and disk space management are example
of layering.
THE INPUT/OUTPUT
CONTROL SYSTEM
(1) The file system searches the directory and
finds the appropriate physical address.
(2) The system then passes the physical
address to the operating system’s device
management layer
(3) The device management that generates
primitive physical I/O command and
communicates directly with peripherals is
called input/output control system or
IOCS
 Few primitive operations are:
 Seek to a track
 Read a sector from that track
 Write a sector to that track
 Disk drive must be told exactly where and
which sectors to read / write.
The IOCS generates the primitive command
that control a peripheral device

Application program layer

User interface layer

File system layer

IOCS layer

Other operating system layer

Operating system

Hardware

You might also like