Operating System Presentation
Operating System Presentation
kernel
management of memory, processes, files, main inputs/outputs and
communication functionalities.
Shell
A peace of software provide interface for user.
file system
allowing files to be recorded in a tree structure.
Process management
Memory Management(OS)
Storage Management
File-System management
Q:then we can say that material on the hard disk is being process?
Ans:: the material in hard disk is not a process...
Batch system
Given All jobs together to CPU for processing.
Time-shared systems
It will share the job in period of time.
Program counter
Are the CPU free or not...
Stack
how many processes the CPU have now
Data section
What type information the CPU has...
Process state
Program counter
CPU registers
Input output status
CPU scheduling information
Memory-management information
Accounting information
• Process Creation:
• Process termination
• Cooperating processes
When ever the cpu become idle, the operating system must select one
of the processes in the ready queue not the FIFO) to be executed. the
selection process is carried out by the Short-term scheduler .the
scheduler selects from among the processes in memory that are ready
to execute, and allocated the cpu to one of them.
– switching context
– switching to user mode
– jumping to the proper location in the user program to
restart that program
CPU utilization
keep the CPU as busy as possible
Throughput
processes that complete their execution per time unit
Turnaround time
the interval from the time of submission of a process to the time of completion is
the turnaround time. Turnaround time is the sum of the periods spent waiting to
get into memory, waiting in the ready queue, executing on the CPU,and doing i/o.
Waiting time
amount of time a process has been waiting in the ready queue
Response time
amount of time it takes from when a request was submitted until the first
response is produced, not output (for time-sharing environment)
Each process gets a small unit of CPU time (time quantum or time
slice), is defined first. usually 10-100 milliseconds. After this time has
elapsed, the process is preempted and added to the end of the ready
queue.
Imagine if you had ten people sitting and working around your
desk, and each of those people put their paperwork all over the
desk. The desk would soon become unmanageable, with the
paperwork hard to find or even lost. Eventually all ten people
would probably not be able to complete their tasks. Somebody
needs to take control and organize the chaos – so on a
computer this management (memory management) one of the
jobs of the operating system.
Concept:
Main memory is usually too small to accommodate all the data
and programs permanently, the computer system must provide
secondary storage to back up main memory.
• Multiple-partition allocation
Hole – block of available memory
OS OS OS OS
process 9 process 9
process 8 process 10
• Best-fit: Allocate the smallest hole that is big enough; must search entire
list, unless ordered by size. Produces the smallest leftover hole.
• Worst-fit: Allocate the largest hole; must also search entire list. Produces
the largest leftover hole.
• External Fragmentation
free memory space is broken non-contiguous pieces, none big enough
to satisfy a request
• Internal Fragmentation
allocated memory may be slightly larger than requested memory; this
size difference is memory internal to a partition, but not being used.
OR
3. Byte sequence.
4. Record sequence.
5. Tree.
• Sequential Access:
In these systems a process could read all the
bytes or records in a file in order
• Random Access:
Files whose bytes or records can be read in any
order are called random access file.
• Regular files
are the once that contain user information.
• Time, Date, And User Identification: data for protection, security, and
usage monitoring
• Open: before using a file, a process must open it. The purpose of the
OPEN call is to allow the system to fetch the attributes and list of disk
address into main memory for rapid access on later calls.
• Read: data are from file. Usually the bytes come form the current position.
The caller must specify how much data are needed and must also provide
a buffer to put them in.
• Append: Mixing and merging the data of two or multi files and add them at
the end of the file.
• Seek: for random access files. Method is needed to specify from where to
take the data. Also mean searching and finding of data.
• Get Attributes: it’s about the honor and modification times. Cause professes
often need to read file attributes to do their work.
• Set Attributes: Some of the attributes are user settable and can be changed
after the file has been created.
• User IDs
identify users, allowing permissions and protections to be per-
user
• Group IDs
allow users to be in groups, permitting group access rights
• Remote file systems add new failure modes, due to network failure,
server failure
– Types of access
1. Read
2. Write
3. Execute
4. Append
5. Delete
6. List
• Name
• Type
• Address
• Current length
• Maximum length
• Date last accessed (for archival)
• Date last updated (for dump)
• Owner ID
• Protection information (discuss later)
• Efficiency
locating a file quickly
• Naming
convenient to users
– Two users can have same name for different files
– The same file can have several different names
• Grouping
logical grouping of files by properties, (e.g., all Java programs, all
games, …)
5. Acyclic-Graph Directories
1. Shared directory (Two programmers)
• Command line/Gui
• My Sql
• Administrator (root)
How Linux user accounts work
Where Linux user accounts are stored
Creating and managing user accounts from the
command line
By default, all user home directories are created
and maintained in the /home directory.
However, the root user’s home directory is /root
Login This is the username that is used to authenticate to the system.
Name This is the user’s full name.
Directory This is the user’s home directory.
Last Login This displays the last time the user logged in and where from.
• the first regular user account created on the system is always assigned
a UID of 1000. The next user account will be assigned a UID of 1001...
• /etc/passwd file. This has been the default configuration used by Linux
systems for many years.
• NIS This option stands for Network Information Service or user network
management.this option will also show that how many user I have in a
network.
• /etc/passwd This file contains the user account information for your
system.
Username:Password:UID:GID:Full_Name:Home_Directory:Default_Shel
• Username: The Username field simply identifies the username the user will
supply when logging in to the system
• Password: This is a legacy field. At one time, the user’s password was stored in
encrypted form in this field in the passwd file. However, for security reasons, the
password has been moved from /etc/passwd to /etc/shadow.
• GID This field references the group ID number of the user’s default group
• Home_Directory This field contains the path to the user’s home directory.
• Default_Shell This field specifies the shell that will be used by default
•
Username This is the user’s login name from /etc/passwd.
• Expire This field displays the number of days since January 1, 1970
after which the account will be disabled. In this example, it is set to a
null value, indicating the account never expires.
• To verify your /etc/passwd and /etc/shadow files, you can use the pwck
command at the shell prompt. This utility will verify each line in the two
files and make sure they are valid. Any errors are reported on the
screen.
• From time to time, you will need to modify an existing user account.
The syntax for usermod is very similar to that used by useradd.
Syntax:
usermod options username
Using userdel
Syntax:
userdel username
• Using groupadd
Syntax:
groupadd options groupname
• Using groupmod
• Syntax:
groupmod options group
• Using groupdel
Syntax:
groupdel group_name
• Managing ownership
• Managing permissions
• Implementing disk quotas