system programs
Download
Report
Transcript system programs
CE01000-3 Operating Systems
Lecture 5
Overview of Unix/Linux operating
systems
Overview of Unix/Linux OS
In this lecture we shall give an overview of
1. History and development of Unix/Linux
operating systems – early versions; BSD;
Linux
2. Design/philosophy of approach of Unix/Linux
3. Overall design/structure of Unix/Linux
History of different versions of
Unix
Unix early History
First developed in 1969 by Ken Thompson
and Dennis Ritchie of the Research Group at
Bell Laboratories (AT&T); incorporated
features of other operating systems, especially
MULTICS.
Originally written for a small mini-computer
– PDP 7 (only 8K of main memory)
Small elegant operating system
Unix and C
Most of Unix version 4 (1973) was re-written
in C from previous version written entirely in
assembly language.
The C language was originally developed in
order to provide a high level language
implementation of the Unix system by Dennis
Ritchie
C evolved from 'B', developed by Ken
Thompson.
Early Advantages of Unix
Written in a high-level language
Distributed in source form
Provided powerful operatingsystem primitives that provided
multi-user OS that would run on
small mini-computers inexpensive platforms
Small size, modular, clean design
Commercialisation
Interactive Systems first commercial (1977)
Microsoft and SCO collaborated to port Unix
to the Intel 8086 architecture: XENIX –
ultimately unsuccessful as 8086 not powerful
enough at the time to properly support multiuser OS
1982 Bill Joy left Berkeley and founded Sun
Microsystems.
SunOS originally based on BSD 4.2
SunOS 5 became Solaris OS
Commercialisation (Cont.)
In 1982 AT&T broken up and able to market
Unix. Released System III in 1982 and System
V the following year.
System V UNIX introduced virtual memory
(different implementation from BSD), IPC
(shared memory, semaphores, message
queues), remote file sharing, shared libraries
and Streams.
Commercialisation (Cont.)
AIX from IBM
HP/UX from Hewlett Packard Corporation
ULTRIX from Digital Equipment
Corporation, followed by DEC OSF/1. DEC
purchased by Compaq.
Educational involvement in
development
Initially AT&T was unable to market Unix
as a product, so source code was made
available to universities for use in research
and education.
A development group at the University of
California at Berkeley were important in the
development of Unix and produced a
number of influential versions
Known as Berkeley Software Distributions
(BSD).
BSD Unix
2 BSD : introduced text editor vi
3 BSD : demand-paged virtual memory
4.0BSD : major performance improvements –
funded by DARPA to develop standard Unix
system for US government use
4.1BSD : job control, autoconfiguration
BSD Unix (Cont.)
4.2/4.3BSD : developed for VAX architecture
(important mini-computer architecture) reliable signals, fast filesystem, improved
networking (TCP/IP implementation),
sophisticated IPC primitives
4.4 BSD : stackable and extensible vnode
interface, network filesystem, log-structured
filesystem, other filesystems, POSIX support
and other enhancements.
Standard’s problem
Problem: Incompatible implementations of
APIs and core service components across the
different Unix variants. Software written for
one version of Unix would not necessarily run
on other versions.
Solution: Standard set of interfaces. Several
standards exist that define the system call
interface, shell and system utilities functions both syntax and semantics (how it operates).
Standard’s problem (Cont.)
IEEE POSIX (Portable Operating System
Interface for Unix computing environments or
portable OS for UNIX) specifications.
System V Interface Definition (SVID) from
AT&T
X/Open Portability Guide (XPG) from the
X/Open Consortium
Linux origins
Linux is a modem, free operating system
based on Unix standards.
First developed as a small but self-contained
kernel in 1991 by Linus Torvalds, with the
major design goal of Unix compatibility.
Its history has been one of collaboration by
many users from all around the world.
Linux origins (Cont.)
It has been designed to run efficiently and
reliably on common PC hardware, but also
runs on a variety of other platforms.
The core Linux operating-system kernel is
entirely original, but it can run much existing
free Unix software, resulting in an entire
Unix-compatible operating system free from
proprietary code.
The Linux Kernel
Version 0.01 (May 1991) had no networking,
ran only on 80386-compatible Intel processors
and on PC hardware, had extremely limited
device-drive support, and supported only the
Minix file system.
Linux Kernel (Cont.)
Linux 1.0 (March 1994) included new
features:
Support for Unix’s standard TCP/IP networking
protocols
BSD-compatible socket interface for networking
programming
Device-driver support for running IP over an
Ethernet
Enhanced file system
Support for a range of SCSI controllers for
high-performance disk access
Extra hardware support
Linux 2.0
2.0 added new capabilities:
Support for multiprocessor architectures
Improved memory-management code
Improved TCP/IP performance
Support for internal kernel threads, for handling
dependencies between loadable modules, and for
automatic loading of modules on demand.
Standardized configuration interface
Available for Motorola 68000-series processors,
Sun Sparc systems, and for PC and PowerMac
systems.
Unix Design Principles
Designed to be a time-sharing system
Multiuser/multitasking
Has a simple standard user interface (shell)
that can be replaced
Toolbox approach
Combine multiple simple commands instead of
using a single complex application
Designed by programmers for programmers
Unix Design Principles (Cont.)
File system with multilevel tree-structured
directories
Files are supported by the kernel as
unstructured sequences of bytes
Supports multiple processes; a process can
easily create new processes
High priority given to making system
interactive, and providing facilities for
program development
Linux Design Principles
Linux should be multi-user and multitasking
with a full set of Unix-compatible tools.
Its file system should adhere to traditional
Unix semantics, and fully implement the
standard Unix networking model.
Main goals are speed, efficiency, and
standardisation.
Linux is designed to be compliant with the
relevant POSIX standards
Unix/Linux structure
Typically layered but essentially 2 layers –
above and below kernel interface
Shells
System libraries
System programs and utilities
System call interface
Kernel
4.4BSD Layer Structure
Components of a Linux System
system
management
programs
user
processes
user utility
processes
system shared libraries
Linux kernel
loadable kernel modules
compilers
Unix/Linux Components
Unix/Linux have essentially similar set of
components.
The kernel - everything below the system-call
interface and above the physical hardware.
Provides file system, CPU scheduling, memory
management, and other OS functions through
system calls.
Unix/Linux Components (Cont.)
Kernel code executes in system mode with full
access to all the physical resources of the
computer.
All kernel code and data structures are kept in the
same single address space.
Unix/Linux Components (Cont.)
The system libraries define a standard set of
functions through which applications interact
with the kernel, and which implement much of
the operating-system functionality that does
not need the full privileges of kernel code.
The system programs use the kernelsupported system calls to provide useful
functions, such as compilation and file
manipulation.
System call interface
System calls define the programmer interface
to Unix
The programmer and user interface define the
context that the kernel must support.
Roughly three categories of system calls in
Unix.
File manipulation (same system calls also support
device manipulation)
Process control
Information manipulation.
File Manipulation
A file is a sequence of bytes; the kernel does
not impose a structure on files.
In Unix almost everything is represented by a
file
Files are organized in tree-structured
directories.
Directories are files that contain information
on how to find other files.
File Manipulation (Cont.)
Path name: identifies a file by specifying a
path through the directory structure to the file.
Absolute path names start at root of file system
Relative path names start at the current directory
System calls for basic file manipulation:
create, open, read, write, close, unlink,
trunc.
Typical Unix/Linux directory
structure
/
bin
sh
ls
etc
cat
passwd group
lib
usr
libc.so
bin
dev
ttya
man
tmp
home
null
local
kwalsh
egs
msiegen
cs316
mail
bin
stuff
Shells and Commands
Shell – the user process which executes
programs (also called command interpreter)
Called a shell, because it surrounds the kernel
The shell indicates its readiness to accept
another command by typing a prompt and the
user types a command on a single line
Examples
Bourne shell (bash)
C Shell (csh)
Shells and Commands (Cont.)
A typical command is an executable binary
object file
The shell travels through the search path to
find the command file, which is then loaded
and executed
The directories /bin and /usr/bin are
almost always in the search path
The shell usually suspends its own execution
until the command completes.
Shells and Commands (Cont.)
Programmers and users mainly deal with
already existing systems programs: the needed
system calls are embedded within the program
and do not need to be obvious to the user.
The most common systems programs are file
or directory oriented e.g. mkdir, rmdir, cd,
pwd, ls, cp, mv, rm
X Windows system provides basis for
development of GUI interfaces
Linux system specific
Linux uses many tools developed as part of
Berkeley’s BSD operating system, MIT’s X
Window System, and the Free Software
Foundation’s GNU project.
The main system libraries were started by the
GNU project, with improvements provided by
the Linux community.
Linux system specific (Cont.)
Linux networking-administration tools were
derived from 4.3BSD code; recent BSD
derivatives such as FreeBSD have borrowed
code from Linux in return.
The Linux system is maintained by a loose
network of developers.
Linux Distributions
Standard, precompiled sets of packages, or
distributions, include the basic Linux system,
system installation and management utilities,
and ready-to-install packages of common
Unix tools.
The first distributions managed these packages
by simply providing a means of unpacking all
the files into the appropriate places; modern
distributions include advanced package
management and automated installation.
Linux Distributions (Cont.)
Many distributions now available
Early distributions included Slackware.
Red Hat is common distributions from
commercial source.
Ubuntu
Debian
Suse
Many others
Linux licensing
The Linux kernel is distributed under the
GNU General Public License (GPL), the terms
of which are set out by the Free Software
Foundation.
Anyone using Linux, or creating their own
derivate of Linux, may not make the derived
product proprietary; software released under
the GPL may not be redistributed as a binaryonly product.
Linux kernel modules
A kernel module is a sections of kernel
code that can be compiled, loaded, and
unloaded independently of the rest of the
kernel.
A kernel module may typically implement a
device driver, a file system, or a networking
protocol.
Linux kernel modules (Cont.)
The kernal module interface allows third
parties to write and distribute, on their own
terms, device drivers or file systems that could
not be distributed under the GPL.
Kernel modules allow a Linux system to be set
up with a standard, minimal kernel, without
any extra device drivers built in. Linux can
then allow additional modules to be loaded and
integrated with the base system - tailored to
underlying hardware and needs of system
References
Operating System Concepts. Chapter 21 &
Appendix A.