Download presentation
Presentation is loading. Please wait.
1
UNIX System Overview
2
UNIX Architecture Kernel of os
Software that controls hardware resources & provides environment under which programs can run System calls - Interface to kernel Libraries of common functions – built on top of system calls Shell – interface for running other programs
3
UNIX Architecture
4
Logging In Login name Password file – usually in /etc/passwd
7 colon separated fields Encrypted password Numeric user id Numeric group id Comment field Home directory Shell program
5
Shells Command line interpreter – reads user input & executes commands
Bourne shell – written by Steve Bourne C shell – written by Bill Joy Korn shell – written by David Korn Bourne-again shell (bash) – GNU shell
6
File System Hierarchical arrangement of files & directories
Starts at root – symbolic name is / Directory – file that contains directory entries Directory entry – filename & file attribute Size, owner, permissions, date last modified, ...
7
File Names Slash (/) & null characters – cannot appear in a file name
. (current directory) & .. (parent directory) are automatically created
8
Pathname Sequence of 1 or more filenames separated by /'s & potentially starting with a / Start with / - absolute pathname Otherwise – relative pathname
9
Directories Working directory Current directory Home directory
Each user has home directory – subdirectory of home
10
Input & Output File descriptor – non-negative integer used by kernel
Predefined descriptors – automatically opened whenever new program is run Standard input Standard output Standard error
11
Input & Output Unbuffered I/O
Provided by functions open, read, write, lseek, close Standard I/O Buffered interface to unbuffered functions printf fgets
12
Programs & Processes Program – executable file on disk
Read into memory & executed by kernel Process – executing instance of a program Process id – unique numeric identifier Process control Fork Exec waitpid
13
Threads Threads within a process share address space Have own stack
Need to synchronize access to shared variables Each thread – own id
14
Error Handling System functions – usually return a numeric error flag - <error.h> Each thread needs its own copy of errno Errno – not reinitialized each time – only use if an error has occurred Never set to 0 strerror – returns pointer to error message perror – creates error message on standard error
15
Error Recovery 2 types of errors: fatal & nonfatal
Fatal error – no recovery possible Nonfatal – delay & try later
16
User Identification User ID - numeric value – assigned by system administrator when account is created root – id 0 Group id – assigned by system administrator Groups – collection of users with common characteristics Sharing of resources within group
17
Signals Technique to notify a process that a condition has occurred
Choices for dealing with signal Ignore Let default action occur Provide a function which is called
18
Time Values Calendar time – number of seconds since Epoch (Jan 1, 1970) time_t data type Process time – measures CPU resources used Measured in terms of clock ticks clock_t data type
19
Time Values Execution time of a process Wall Clock time
Amount of time for process to run User CPU time CPU time for user instructions System CPU time CPU time for kernel executing instructions for user time command
20
System Calls & Library Functions
System calls – functions to request services from kernel C library function with same name as system call
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.