Вы находитесь на странице: 1из 21

Operating System Lab

_____________________________________________________________________________________________________________________________
_
EXERCISE-1

Introduction to Operating System

An operating system (commonly abbreviated OS and O/S) is the software component of a computer
system that is responsible for the management and coordination of activities and the sharing of the
resources of the computer. The operating system acts as a host for application programs that are run on
the machine. As a host, one of the purposes of an operating system is to handle the details of the
operation of the hardware. This relieves application programs from having to manage these details and
makes it easier to write applications. Almost all computers, including hand-held computers, desktop
computers, supercomputers, and even modern video game consoles, use an operating system of some
type. Some of the oldest models may however use an embedded OS that may be contained on a
compact disk or other storage device.

Technology
An operating system is a collection of technologies which are designed to allow the computer to
perform certain functions. These technologies may or may not be present in every operating system,
and there are often differences in how they are implemented. However as stated above most modern
operating systems are derived from common design ancestors, and are therefore basically similar.

Boot-strapping

In most cases, the operating system is not the first code to run on the computer at startup (boot) time.
The initial code executing on the computer is usually loaded from firmware, which is stored in read
only memory (ROM). This is sometimes called the BIOS or boot ROM.

Program execution

An operating system's most basic function is to support the running of programs by the users. On a
multiprogramming operating system, running programs are commonly referred to as processes. Process
management refers to the facilities provided by the operating system to support the creation, execution,
and destruction of processes, and to facilitate various interactions, and limit others.

1
Operating System Lab
_____________________________________________________________________________________________________________________________
_
Interrupts

Interrupts are central to operating systems as they allow the operating system to deal with the
unexpected activities of running programs and the world outside the computer. Interrupt-based
programming is one of the most basic forms of time-sharing, being directly supported by most CPUs.
Interrupts provide a computer with a way of automatically running specific code in response to events.
Even very basic computers support hardware interrupts, and allow the programmer to specify code
which may be run when that event takes place.

Protected mode and supervisor mode

When a computer first starts up, it is automatically running in supervisor mode. The first few programs
to run on the computer, being the BIOS, bootloader and the operating system have unlimited access to
hardware. However when the operating system passes control to another program, it can place the CPU
into protected mode.

Memory management

Among other things, a multiprogramming operating system kernel must be responsible for managing all
system memory which is currently in use by programs. This ensures that a program does not interfere
with memory already used by another program. Since programs time share, each program must have
independent access to memory.

Multitasking

Multitasking refers to the running of multiple independent computer programs on the same computer;
giving the appearance that it is performing the tasks at the same time. Since most computers can do at
most one or two things at one time, this is generally done via time sharing, which means that each
program uses a share of the computer's time to execute.

Disk access and file systems

Access to files stored on disks is a central feature of all operating systems. Computers store data on
disks using files, which are structured in specific ways in order to allow for faster access, higher
reliability, and to make better use out of the drive's available space. The specific way files are stored on
a disk is called a file system, and enables files to have names and attributes. It also allows them to be
stored in a hierarchy of directories or folders arranged in a directory tree.

Device drivers

A device driver is a specific type of computer software developed to allow interaction with hardware
devices. Typically this constitutes an interface for communicating with the device, through the specific
computer bus or communications subsystem that the hardware is connected to, providing commands to
and/or receiving data from the device, and on the other end, the requisite interfaces to the operating
system and software applications. It is a specialized hardware-dependent computer program which is
also operating system specific that enables another program, typically an operating system or
applications software package or computer program running under the operating system kernel, to
interact transparently with a hardware device, and usually provides the requisite interrupt handling
necessary for any necessary asynchronous time-dependent hardware interfacing needs.

2
Operating System Lab
_____________________________________________________________________________________________________________________________
_

Networking

Currently most operating systems support a variety of networking protocols, hardware, and applications
for using them. This means that computers running dissimilar operating systems can participate in a
common network for sharing resources such as computing, files, printers, and scanners using either
wired or wireless connections. Networks can essentially allow a computer's operating system to access
the resources of a remote computer to support the same functions as it could if those resources were
connected directly to the local computer.

Examples of Operating Systems


Microsoft Windows

The Microsoft Windows family of operating systems originated as an add-on to the older MS-DOS
operating system for the IBM PC. Modern versions are based on the newer Windows NT kernel that
was originally intended for OS/2. Windows runs on x86, x86-64 and Itanium processors. Earlier
versions also ran on the DEC Alpha, MIPS, Fairchild (later Intergraph) Clipper and PowerPC
architectures (some work was done to port it to the SPARC architecture).

The most widely used version of the Microsoft Windows family is Windows XP, released on October
25, 2001.

In November 2006, after more than five years of development work, Microsoft released Windows
Vista, a major new operating system version of Microsoft Windows family which contains a large
number of new features and architectural changes. Chief amongst these are a new user interface and
visual style called Windows Aero, a number of new security features such as User Account Control,
and few new multimedia applications such as Windows DVD Maker.

Microsoft has announced a new version codenamed Windows 7 will be released in late 2009 - mid
2010

Plan 9

Ken Thompson, Dennis Ritchie and Douglas McIlroy at Bell Labs designed and developed the C
programming language to build the operating system UNIX. Programmers at Bell Labs went on to
develop Plan 9 and Inferno, which were engineered for modern distributed environments. Plan 9 was
designed from the start to be a networked operating system, and had graphics built-in, unlike UNIX,
which added these features to the design later. Plan 9 has yet to become as popular as UNIX
derivatives, but it has an expanding community of developers. It is currently released under the Lucent
Public License. Inferno was sold to Vita Nuova Holdings and has been released under a GPL/MIT
license.

UNIX and UNIX-like operating systems

UNIX-like systems run on a wide variety of machine architectures. They are used heavily for servers in
business, as well as workstations in academic and engineering environments. Free software UNIX
variants, such as GNU, Linux and BSD, are popular in these areas. The market share for Linux is

3
Operating System Lab
_____________________________________________________________________________________________________________________________
_
divided between many different distributions. Enterprise class distributions by Red Hat or Novell are
used by corporations, but some home users may use

Mac OS X

Mac OS X is a line of proprietary, graphical operating systems developed, marketed, and sold by Apple
Inc., the latest of which is pre-loaded on all currently shipping Macintosh computers. Mac OS X is the
successor to the original Mac OS, which had been Apple's primary operating system since 1984. Unlike
its predecessor, Mac OS X is a UNIX operating system built on technology that had been developed at
NeXT through the second half of the 1980s and up until Apple purchased the company in early 1997.

Real-time operating systems

A real-time operating system (RTOS) is a multitasking operating system intended for applications with
fixed deadlines (real-time computing). Such applications include some small embedded systems,
automobile engine controllers, industrial robots, spacecraft, industrial control, and some large-scale
computing systems.

Embedded systems

Embedded systems that have fixed deadlines use a real-time operating system such as VxWorks, eCos,
QNX, and RTLinux. Some embedded systems use operating systems such as Palm OS, Windows CE,
BSD, and Linux, although such operating systems do not support real-time computing.

Hobby development

Operating system development or OSDev for short, as a hobby has a large cult-like following. As such,
operating systems, such as Linux, have derived from hobby operating system projects. The design and
implementation of an operating system requires skill and determination, and the term can cover
anything from a basic "Hello World" boot loader to a fully featured kernel. One classical example of
this is the Minix Operating System—an OS that was designed by A.S. Tanenbaum as a teaching tool
but was heavily used by hobbyists before Linux eclipsed it in popularity.

Other

Older operating systems which are still used in niche markets include OS/2 from IBM; Mac OS, the
non-UNIX precursor to Apple's Mac OS X; BeOS; XTS-300. Some, most notably AmigaOS and RISC
OS, continue to be developed as minority platforms for enthusiast communities and specialist
applications. OpenVMS formerly from DEC, is still under active development by Hewlett-Packard.

4
Operating System Lab
_____________________________________________________________________________________________________________________________
_

EXERCISE-2

Study of Windows 2000 Operating System

Windows 2000 is a line of operating systems produced by Microsoft for use on business desktops,
notebook computers, and servers. Released on February 17, 2000, it was the successor to Windows NT
4.0, and is the final release of Microsoft Windows to display the "Windows NT" designation. It was
succeeded by Windows XP for desktop systems in October 2001 and Windows Server 2003 for servers
in April 2003.

The Windows 2000 bootsplash.

Four editions of Windows 2000 were released: Professional, Server, Advanced Server, and Datacenter
Server. Additionally, Microsoft sold Windows 2000 Advanced Server Limited Edition and Windows
2000 Datacenter Server Limited Edition, which were released in 2001 and run on 64-bit Intel Itanium
microprocessors.

New and updated features

Windows 2000 introduced many of the new features of Windows 98 and Windows 98 SE into the NT
line, such as the Windows Desktop Update, Internet Explorer 5, Outlook Express, NetMeeting, FAT32
support, Windows Driver Model, Internet Connection Sharing, Windows Media Player, WebDAV
support etc. Certain new features are common across all editions of Windows 2000, among them NTFS
3.0, the Microsoft Management Console (MMC), Automated System Recovery, UDF support, the
Encrypting File System (EFS), Logical Disk Manager, Image Color Management 2.0, support for
PostScript 3-based printers, OpenType (.OTF) and Type 1 PostScript (.PFB) font support, the Data
protection API (DPAPI), an LDAP/Active Directory-enabled Address Book, usability enhancements
and multi-language and locale support.

Windows Explorer

Windows Explorer has been enhanced in several ways in Windows 2000. It is the first Windows NT
release to include Active Desktop, first introduced as a part of Internet Explorer 4.0 (specifically

5
Operating System Lab
_____________________________________________________________________________________________________________________________
_
Windows Desktop Update), and only pre-installed in Windows 98 by that time. It allowed users to
customize the way folders look and behave by using HTML templates, having the file extension HTT.
This feature was abused by computer viruses that employed malicious scripts, Java applets, or ActiveX
controls in folder template files as their infection vector. Two such viruses are VBS/Roor-C and
VBS.Redlof.a. The "Web-style" folders view, with the left Explorer pane displaying details for the
object currently selected, is turned on by default in Windows 2000. For certain file types, such as
pictures and media files, the preview is also displayed in the left pane. Until the dedicated interactive
preview pane appeared in Windows Vista, Windows 2000 had been the only Windows release to
feature an interactive media player as the previewer for sound and video files. However, such a
previewer can be enabled in Windows Me and Windows XP through the use of third-party shell
extensions, as the updated Windows Explorer allows for custom thumbnail previewers and tooltip
handlers. The default file tooltip displays file title, author, subject and comments; this metadata may be
read from a special NTFS stream, if the file is on an NTFS volume, or from an OLE structured storage
stream, if the file is a structured storage document. All Microsoft Office documents since Office 95
make use of structured storage, so their metadata is displayable in the Windows 2000 Explorer default
tooltip. File shortcuts can also store comments which are displayed as a tooltip when the mouse hovers
over the shortcut. The shell introduces extensibility support through metadata handlers, icon overlay
handlers and column handlers in Explorer Details view.

The right pane of Windows 2000 Explorer, which usually just lists files and folders, can also be
customized. For example, the contents of the system folders aren't displayed by default, instead
showing in the right pane a warning to the user that modifying the contents of the system folders could
harm their computer. It's possible to define additional Explorer panes by using DIV elements in folder
template files[45] Other Explorer UI elements that can be customized include columns in "Details" view,
icon overlays, and search providers: the new DHTML-based search pane is integrated into Windows
2000 Explorer, unlike the separate search dialog found in all previous Explorer versions. This degree of
customizability is new to Windows 2000; neither Windows 98 nor the Desktop Update could provide it.
The Indexing Service has also been integrated into the operating system and the search pane built into
Explorer allows searching files indexed by its database.

NTFS 3.0

Microsoft released the version 3.0 of NTFS (sometimes incorrectly called NTFS 5 in relation to the
kernel version number) as part of Windows 2000; this introduced disk quotas (provided by
QuotaAdvisor), file-system-level encryption, sparse files and reparse points. Sparse files allow for the
efficient storage of data sets that are very large yet contain many areas that only have zeros. Reparse
points allow the object manager to reset a file namespace lookup and let file system drivers implement
changed functionality in a transparent manner. Reparse points are used to implement volume mount
points, junctions, Hierarchical Storage Management, Native Structured Storage and Single Instance
Storage. Volume mount points and directory junctions allow for a file to be transparently referred from
one file or directory location to another.

Encrypting File System

The Encrypting File System (EFS) introduced strong file system-level encryption to Windows. It
allows any folder or drive on an NTFS volume to be encrypted transparently by the user. EFS works
together with the EFS service, Microsoft's CryptoAPI and the EFS File System Runtime Library
(FSRTL). To date, its encryption has not been compromised.

Basic and dynamic disk storage

6
Operating System Lab
_____________________________________________________________________________________________________________________________
_
Windows 2000 introduced the Logical Disk Manager for dynamic storage. All versions of Windows
2000 support three types of dynamic disk volumes (along with basic disks): simple volumes, spanned
volumes and striped volumes:

Accessibility

Microsoft increased the usability of Windows 2000 over Windows NT 4.0 for people with visual and
auditory impairments and other disabilities. They included several utilities designed to make the system
more accessible, although many of these features were already available with previous versions of
Windows:

Languages and locales

Windows 2000 introduced the Multilingual User Interface (MUI). Besides English, Windows 2000
incorporates support for Arabic, Armenian, Baltic, Central European, Cyrillic, Georgian, Greek,
Hebrew, Indic, Japanese, Korean, Simplified Chinese, Thai, Traditional Chinese, Turkic, Vietnamese
and Western European languages. It also has support for many different locales.

Games

Windows 2000 included version 7.0 of the DirectX API, commonly used by game developers on
Windows 98. The last version of DirectX that Windows 2000 supports is DirectX 9.0c (Shader Model
3.0), that shipped with Windows XP Service Pack 2. Currently, Microsoft publishes quarterly updates
to DirectX 9.0c; these updates contain bug fixes to the core runtime and some additional libraries such
as D3DX, XAudio 2, XInput and Managed DirectX components. The majority of games written for
recent versions of DirectX can therefore run on Windows 2000.

System utilities

The Windows 2000 Computer Management console can perform many system tasks. It is pictured here
starting a disk defragmentation.

Recovery Console

The Recovery Console is run from outside the installed copy of Windows to perform maintenance tasks
that can neither be run from within it nor feasibly be run from another computer or copy of Windows
2000. It is usually used to recover the system from problems that cause booting to fail, which would
render other tools useless.

Server family features

The Windows 2000 server family consists of Windows 2000 Server, Windows 2000 Advanced Server,
and Windows 2000 Datacenter Server.

Distributed File System

The Distributed File System (DFS) allows shares in multiple different locations to be logically grouped
under one folder, or DFS root. When users try to access a network share off the DFS root, the user is
really looking at a DFS link and the DFS server transparently redirects them to the correct file server

7
Operating System Lab
_____________________________________________________________________________________________________________________________
_
and share. A DFS root can only exist on a Windows 2000 version that is part of the server family, and
only one DFS root can exist on that server.

Active Directory

A new way of organizing Windows network domains, or groups of resources, called Active Directory,
is introduced with Windows 2000 to replace Windows NT's earlier domain model. Active Directory's
hierarchical nature allowed administrators a built-in way to manage user and computer policies and
user accounts, and to automatically deploy programs and updates with a greater degree of scalability
and centralization than provided in previous Windows versions. It is one of the main reasons many
corporations migrated to Windows 2000. User information stored in Active Directory also provided a
convenient phone book-like function to end users. Active Directory domains can vary from small
installations with a few hundred objects, to large installations with millions. Active Directory can
organize and link groups of domains into a contiguous domain name space to form trees. Groups of
trees outside of the same namespace can be linked together to form forests.

Volume fault tolerance

Along with support for simple, spanned and striped volumes, the server family of Windows 2000 also
supports fault-tolerant volume types. The types supported are mirrored volumes and RAID-5 volumes:

Architecture of Windows 2000

The architecture of Windows NT, a line of operating systems produced and sold by Microsoft, is a
layered design that consists of two main components, user mode and kernel mode. It is a preemptive,
reentrant operating system, which has been designed to work with uniprocessor and symmetrical multi
processor (SMP)-based computers. To process input/output (I/O) requests, they use packet-driven I/O,
which utilizes I/O request packets (IRPs) and asynchronous I/O. Starting with Windows XP, Microsoft
began making 64-bit versions of Windows available—before this, these operating systems only existed
in 32-bit versions.

Programs and subsystems in user mode are limited in terms of what system resources they have access
to, while the kernel mode has unrestricted access to the system memory and external devices. The
Windows NT kernel is known as a hybrid kernel. However some kernel developers disagree, arguing
that all essential parts of the system are executed in kernel mode, thus making it a monolithic kernel
that is structured similarly to a microkernel. The architecture comprises a simple kernel, hardware
abstraction layer (HAL), drivers, and a range of services (collectively named Executive), which all
exist in kernel mode.

User mode in Windows NT is made of subsystems capable of passing I/O requests to the appropriate
kernel mode software drivers by using the I/O manager. Two subsystems make up the user mode layer
of Windows NT: the Environment subsystem (which runs applications written for many different types
of operating systems), and the Integral subsystem (operates system specific functions on behalf of the
environment subsystem). Kernel mode in Windows NT has full access to the hardware and system
resources of the computer. The kernel mode stops user mode services and applications from accessing
critical areas of the operating system that they should not have access to.

The Executive interfaces with all the user mode subsystems. It deals with I/O, object management,
security and process management. The kernel sits between the Hardware Abstraction Layer and the
Executive to provide multiprocessor synchronization, thread and interrupt scheduling and dispatching,
and trap handling and exception dispatching. The kernel is also responsible for initializing device

8
Operating System Lab
_____________________________________________________________________________________________________________________________
_
drivers at bootup. Kernel mode drivers exist in three levels: highest level drivers, intermediate drivers
and low level drivers. Windows Driver Model (WDM) exists in the intermediate layer and was mainly
designed to be binary and source compatible between Windows 98 and Windows 2000. The lowest
level drivers are either legacy Windows NT device drivers that control a device directly or can be a PnP
hardware bus.

Editions

Microsoft released various editions of Windows 2000 for different markets and business needs:
Professional, Server, Advanced Server and Datacenter Server. Each was packaged separately.

Windows 2000 Professional was designed as the desktop operating system for businesses and power
users. It is the client version of Windows 2000. It offers greater security and stability than many of the
previous Windows desktop operating systems. It supports up to two processors, and can address up to 4
GB of RAM. The system requirements are a Pentium processor of 133 MHz or greater, at least 32 MB

9
Operating System Lab
_____________________________________________________________________________________________________________________________
_
of RAM, 650 MB of hard drive space, and a CD-ROM drive (recommended: Pentium II, 128 MB of
RAM, 2 GB of hard drive space, and CD-ROM drive).

Windows 2000 Server SKUs share the same user interface with Windows 2000 Professional, but
contain additional components for the computer to perform server roles and run infrastructure and
application software. A significant new component introduced in the server SKUs is Active Directory,
which is an enterprise-wide directory service based on LDAP. Additionally, Microsoft integrated
Kerberos network authentication, replacing the often-criticised NTLM authentication system used in
previous versions. This also provided a purely transitive-trust relationship between Windows 2000
domains in a forest (a collection of one or more Windows 2000 domains that share a common schema,
configuration, and global catalog, being linked with two-way transitive trusts). Furthermore, Windows
2000 introduced a Domain Name Server which allows dynamic registration of IP addresses. Windows
2000 Server supports up to 4 processors, requires 128 MB of RAM and 1 GB hard disk space, however
requirements may be higher depending on installed components.

Windows 2000 Advanced Server is a variant of Windows 2000 Server operating system designed for
medium-to-large businesses. It offers clustering infrastructure for high availability and scalability of
applications and services, including main memory support of up to 8 gigabytes (GB) on Physical
Address Extension (PAE) systems and the ability to do 8-way SMP. It supports TCP/IP load balancing
and enhanced two-node server clusters based on the Microsoft Cluster Server (MSCS) in Windows NT
Server 4.0 Enterprise Edition. Limited number of copies of an IA-64 version, called Windows 2000
Advanced Server, Limited Edition were made available via OEMs. System requirements are similar to
those of Windows 2000 Server; however they may need to be higher to scale to larger infrastructure.

Windows 2000 Datacenter Server is a variant of Windows 2000 Server designed for large businesses
that move large quantities of confidential or sensitive data frequently via a central server. Like
Advanced Server, it supports clustering, failover and load balancing. Its minimum system requirements
are normal, but it was designed to be capable of handing advanced, fault-tolerant and scalable hardware
—for instance computers with up to 32 CPUs and 64 GBs RAM, with rigorous system testing and
qualification, hardware partitioning, coordinated maintenance and change control. Limited number of
copies of an IA-64 version, called Windows 2000 Datacenter Server, Limited Edition were made
available via OEMs. System requirements are similar to those of Windows 2000 Advanced Server;
however they may need to be higher to scale to larger infrastructure.

Service packs

Windows 2000 has received four full service packs and one rollup update package following SP4,
which is the last service pack. These were: SP1 on 15 August 2000, SP2 on 16 May 2001, SP3 on 29
August 2002 and SP4 on 26 June 2003. Microsoft phased out all development of its Java Virtual
Machine (JVM) from Windows 2000 in SP3. Internet Explorer 5.01 has also been upgraded to the
corresponding service pack level.

10
Operating System Lab
_____________________________________________________________________________________________________________________________
_

EXERCISE: 3

Administration of WINDOWS 2000 (including DNS, LDAP, Directory Services)

DNS:

The Domain Name System (DNS) associates various sorts of information with so-called domain
names; most importantly, it serves as the "phone book" for the Internet by translating human-readable
computer hostnames. The most basic use of DNS is to translate hostnames to IP addresses. The Domain
Name System (DNS) distributes the responsibility for assigning domain names and mapping them to IP
networks by allowing an authoritative server for each domain to keep track of its own changes,
avoiding the need for a central registrar to be continually consulted and updated

Active directory services:

Active Directory Service (ADS) is a Windows 2000 namespace that is integrated with the Domain
Name Service (DNS). ADS run only on domain controllers. In addition to storing and making data
available, ADS protects network objects from unauthorized access and replicates objects across a
network so that data is not lost if one domain controller fails. Active Directory (AD) is an
implementation of LDAP directory services by Microsoft for use primarily in Windows environments.
Its main purpose is to provide central authentication and authorization services for Windows based
computers. Active Directory also allows administrators to assign policies, deploy software, and apply
critical updates to an entire organization. Active Directory stores information and settings relating to an
organization in a central, organized, accessible database. Active Directory networks can vary from a
small installation with a few hundred objects, to a large installation with millions of objects.

Active Directory was previewed in 1996, released first with Windows 2000 Server edition, and revised
to extend functionality and improve administration in Windows Server 2003.

Active Directory was called NTDS (NT Directory Service) in older Microsoft documents

Directory services:

A directory service (DS) is a software application — or a set of applications — that stores and
organizes information about a computer network's users and network resources, and that allows
network administrators to manage users' access to the resources. Additionally, directory services act as
an abstraction layer between users and shared resources.

11
Operating System Lab
_____________________________________________________________________________________________________________________________
_
A directory service should not be confused with the directory repository itself; which is the database
that holds information about named objects that are managed in the directory service. In the case of the
X.500 distributed directory services model, one or more namespaces (trees of objects) are used to form
the directory service. The directory service provides the access interface to the data that is contained in
one or more directory namespaces. The directory service interface acts as a central/common authority
that can securely authenticate the system resources that manage the directory data.

Like a database, a directory service is highly optimized for reads and provides advanced search
possibilities on many different attributes that can be associated with objects in a directory. The data that
is stored in the directory is defined by an extendible and modifiable schema. Directory services use a
distributed model for storing their information and that information is usually replicated between
directory servers.

LDAP

The Lightweight Directory Access Protocol, or LDAP, is an application protocol for querying and
modifying directory services running over TCP/IP.

A directory is a set of objects with similar attributes organized in a logical and hierarchical manner. The
most common example is the telephone directory, which consists of a series of names (either of persons
or organizations) organized alphabetically, with each name having an address and phone number
attached. Due to this basic design (among other factors) LDAP is often used by other services for
authentication.

An LDAP directory tree often reflects various political, geographic, and/or organizational boundaries,
depending on the model chosen. LDAP deployments today tend to use Domain name system (DNS)
names for structuring the topmost levels of the hierarchy. Deeper inside the directory might appear
entries representing people, organizational units, printers, documents, groups of people or anything else
which represents a given tree entry.

12
Operating System Lab
_____________________________________________________________________________________________________________________________
_

EXERCISE: 4

Study of LINUX operating system.


Linux (IPA pronunciation: /ˈlɪnʊks/, lin-uks) is a Unix-like computer operating system. Linux is one of
the most prominent examples of free software and open source development; its underlying source code
can be freely modified, used, and redistributed by anyone.

The Linux kernel was first released to the public on 17 September 1991, for the Intel x86 PC
architecture. The kernel was augmented with system utilities and libraries from the GNU project to
create a usable operating system, which later led to an alternate term, GNU/Linux. Linux is now
packaged for different uses in Linux distributions, which contain the sometimes modified kernel along
with a variety of other software packages tailored to different requirements. Design

Linux is a modular Unix-like operating system. It derives much of its basic design from principles
established in Unix during the 1970s and 1980s. Linux uses a monolithic kernel, the Linux kernel,
which handles process control, networking, and peripheral and file system access. Device drivers are
integrated directly with the kernel.

Much of Linux's higher-level functionality is provided by separate projects which interface with the
kernel. The GNU userland is an important part of most Linux systems, providing the shell and Unix
tools which carry out many basic operating system tasks. Atop these tools graphical user interfaces can
be placed, usually running via the X Window System.

LINUX Kernel:

The Linux kernel includes true multitasking, virtual memory, shared libraries, demand loading, shared
copy-on-write executables, proper memory management, and TCP/IP networking.

Today Linux is a module-loading monolithic kernel. Device drivers and kernel extensions typically run
in ring 0, with full access to the hardware, although some run in user space. Unlike standard monolithic
kernels, device drivers are easily configured as modules, and loaded or unloaded while running the
system. Also unlike standard monolithic kernels, device drivers can be pre-empted under certain
conditions. This latter feature was added to handle hardware interrupts correctly, and to improve
support for symmetric multiprocessing. Preemption also improves latency, increasing responsiveness
and making Linux more suitable for real-time applications.

The Linux kernel is composed of five main subsystems:

13
Operating System Lab
_____________________________________________________________________________________________________________________________
_
1.The Process Scheduler (SCHED) is responsible for controlling process access to the CPU. The
scheduler enforces a policy that ensures that processes will have fair access to the CPU, while ensuring
that necessary hardware actions are performed by the kernel on time.

2.The Memory Manager (MM) permits multiple process to securely share the machine's main memory
system. In addition, the memory manager supports virtual memory that allows Linux to support
processes that use more memory than is available in the system. Unused memory is swapped out to
persistent storage using the file system then swapped back in when it is needed.

3. The Virtual File System (VFS) abstracts the details of the variety of hardware devices by presenting
a common file interface to all devices. In addition, the VFS supports several file system formats that are
compatible with other operating systems.

4. The Network Interface (NET) provides access to several networking standards and a variety of
network hardware.

5. The Inter-Process Communication (IPC) subsystem supports several mechanisms for process-to-
process communication on a single Linux system.

Some of the popular LINUX distributions are:

Debian

14
Operating System Lab
_____________________________________________________________________________________________________________________________
_
SuSE

Mandrake

Slackware

Xandros

Red Hat

LINUX basic commands:

1. ls( Lists the contents of a directory)

a) ls : List files in the current working directory except those starting with . and only show the

file name.

b) ls –al : List all files in the current working directory in long listing format showing

permissions, ownership, size, and time and date stamp.

2. touch( Creates an empty file)

a) Touch filename( creates an empty file with the given filename)

3. cat( creates a file providing contents also, or display an already existing file, or concatenate two
already existing files)

a) cat>filename : Asks for contents, press ctrl D to end file

b) cat filename : displays contents of file

c) cat file1 file2 file3 : concatenates contents of file1 and file2 and stores then in file3.

4.cd( Change directory)

a) cd fullpathofdestinationdirectory

5. mkdir( make directory)

a) mkdir directoryname

6. rmdir( Removes a directory)

a) rmdirectoryname

7. cp( Copy a file)

a) cp file1 file2 : Creates file2 having same contents as file1)

8. pwd( prints working or current directory)

9. In( Creates a symbolic link or shortcut)

15
Operating System Lab
_____________________________________________________________________________________________________________________________
_
a) In-s sourcefileordirectory destinationfileordirectory

10. chmode( Used to change permissions of a file or directory)

a) chmode ugo+x filename

11. find( To search for a file or directory)

a) find dirtosearch-name”*.txt( searches all text files in specified directory)

12. grep( searching for a pattern in a file)

a) grep patterntobesearched filename

13. ps( Displsyes currently executing processes)

14. who( Displayes all the information about currently logged on users. The user name, terminal
number and the date and time that each user logged onto the system)

15. whoami( Displayes which user is logged in)

16. bc( Opens a binary calculator)

17. cal( Displyes calander)

18. date( Displays Date)

19. echo( prints the String or value of variables passed to it on to monitor)

20. man( Displayes help on command passed to it)

21. info( Displayes help on command passed to it)

22. wc( Used to count the number of characters, words, lines in a file)

23. sort( Used to display contents of a file in sorted order)

24. head( Displays required number of lines from begning of file)

25. tail( Displays required no. of lines from the end of file)

26. tr( Translate character)

27. sed( Stream editor, used to edit a file such as substitute a string for another string)

28. awk( searches for a pattern in a file by processing one line at a time and perform actions as given)

Pipelines:

Pipelining is basically the process of joining two or more commands in such a way that output of one
command is forwarded to another command as input. Thus in case of pipelining, data passes in
sequence through a series of commands. Pipeline symbol is’|’

16
Operating System Lab
_____________________________________________________________________________________________________________________________
_
For example,

Cat file1|wc ( contents of file1 are passed to wc command)

Filters:

Filters are those commands that accept some input, process it or manipulate it in some way or the other
and produces the result.

Commonly used files are:

Sort, head, tail, grep, wc, cat, sed, tr, awk

Filters can be used in stand alone mode or can be used in combination with pipes and redirection.

17
Operating System Lab
_____________________________________________________________________________________________________________________________
_

EXERCISE: 5

Administration of LINUX Operating System.


The root account:

Linux differentiates between different users. What they can do to each other and the system is
regulated. File permissions are arranged so that normal users can't delete or modify files in directories
like /bin and /usr/bin. Most users protect their own files with the appropriate permissions so that other
users can't access or modify them. Each user is given an account that includes a user name and home
directory. In addition, there are special, system defined accounts which have special privileges. The
most important of these is the root account, which is used by the system administrator. By convention,
the system administrator is the user, root.

There are no restrictions on root. He or she can read, modify, or delete any file on the system, change
permissions and ownerships on any file, and run special programs like those which partition a hard
drive or create file systems. The basic idea is that a person who cares for the system logs in as root to
perform tasks that cannot be executed as a normal user. Because root can do anything, it is easy to
make mistakes that have catastrophic consequences.

Booting the system:

Using LILO: LILO is a separate boot loader which resides on your hard disk. It is executed when the
system boots from the hard drive and can automatically boot Linux from a kernel image stored there.
LILO can also be used as a first-stage boot loader for several operating systems, which allows you to
select the operating system you to boot, like Linux or MS-DOS. With LILO, the default operating
system is booted unless you press Shift during the boot-up sequence, or if the prompt directive is given
in the lilo.conf file.

Shutting down:

Shutting down a Linux system can be tricky. The kernel keeps track of the disk read/write data in
memory buffers. If you reboot the system without giving the kernel a chance to write its buffers to disk,
you can corrupt the file systems. The easiest way to shut down is with the shutdown command. The
format of the command is .

18
Operating System Lab
_____________________________________________________________________________________________________________________________
_

EXERCISE: 6

AWK programming.

Awk (also written as awk and AWK) is a utility that enables a programmer to write tiny but effective
programs in the form of statements that define text patterns that are to be searched for in each line of a
document and the action that is to be taken when a match is found within a line. awk comes with most
Unix-based operating systems such as Linux, and also with some other operating systems, such as
Windows 95/98/NT.

An awk program is made up of patterns and actions to be performed when a pattern match is found.
awk scans input lines sequentially and examines each one to determine whether it contains a pattern
matching one specified by the user. When the matching pattern is found, awk carries out the
instructions in the program. For example, awk could scan text for a critical portion and reformat the
text contained in it according to the user's command. If no pattern is specified, the program will carry
out the command on all of the input data. awk breaks each line into fields, which are groups of
characters with spaces acting as separators so that a word, for example, would be a field. A string is
encased in backslashes and actions to be performed are encased in curly brackets. The lines are
numbered in order of their appearance, with "0" referring to the entire line. "$" is the symbol for field.
So, for example, to search for a line containing the word "nutmeg," and to print each line in which the
word occurs, the awk program would consist of:

/nutmeg/ { print $0 }.

Programs in awk are different from programs in most other languages, because awk programs are data-
driven; that is, you describe the data you wish to work with, and then what to do when you find it.
Most other languages are procedural; you have to describe, in great detail, every step the program is to
take. When working with procedural languages, it is usually much harder to clearly describe the data
your program will process. For this reason, awk programs are often refreshingly easy to both write and
read.

How to Run awk Programs

There are several ways to run an awk program. If the program is short, it is easiest to include it in the
command that runs awk, like this:

awk 'program' input-file1 input-file2 ...

When the program is long, it is usually more convenient to put it in a file and run it with a command
like this:
19
Operating System Lab
_____________________________________________________________________________________________________________________________
_
awk -f program-file input-file1 input-file2 ...

Comments in awk Programs

A comment is some text that is included in a program for the sake of human readers; it is not really
part of the program. Comments can explain what the program does, and how it works. Nearly all
programming languages have provisions for comments, because programs are typically hard to
understand without their extra help.

In the awk language, a comment starts with the sharp sign character, `#', and continues to the end of the
line. The `#' does not have to be the first character on the line. The awk language ignores the rest of a
line following a sharp sign.

A Very Simple Example

The following command runs a simple awk program that searches the input file `BBS-list' for the string
of characters: `foo'. (A string of characters is usually called a string. The term string is perhaps based
on similar usage in English, such as "a string of pearls," or, "a string of cars in a train.")

awk '/foo/ { print $0 }' BBS-list

When lines containing `foo' are found, they are printed, because `print $0' means print the current line.
(Just `print' by itself means the same thing, so we could have written that instead.)

Example:
ls -lg | awk '$6 == "Nov" { sum += $5 }
END { print sum }'

This command prints the total number of bytes in all the files in the current directory that were last
modified in November (of any year). The `ls -lg' part of this example is a system command that gives
you a listing of the files in a directory, including file size and the date the file was last modified. Its
output looks like this:

-rw-r--r-- 1 arnold user 1933 Nov 7 13:05 Makefile


-rw-r--r-- 1 arnold user 10809 Nov 7 13:03 gawk.h
-rw-r--r-- 1 arnold user 983 Apr 13 12:14 gawk.tab.h
-rw-r--r-- 1 arnold user 31869 Jun 15 12:20 gawk.y
-rw-r--r-- 1 arnold user 22414 Nov 7 13:03 gawk1.c
-rw-r--r-- 1 arnold user 37455 Nov 7 13:03 gawk2.c
-rw-r--r-- 1 arnold user 27511 Dec 9 13:07 gawk3.c
-rw-r--r-- 1 arnold user 7989 Nov 7 13:03 gawk4.c

The first field contains read-write permissions, the second field contains the number of links to the file,
and the third field identifies the owner of the file. The fourth field identifies the group of the file. The
fifth field contains the size of the file in bytes. The sixth, seventh and eighth fields contain the month,
day, and time, respectively, that the file was last modified. Finally, the ninth field contains the name of
the file.

20
Operating System Lab
_____________________________________________________________________________________________________________________________
_
The `$6 == "Nov"is an expression that tests whether the sixth field of the output from `ls -lg' matches
the string `Nov'. Each time a line has the string `Nov' for its sixth field, the action `sum += $5' is
performed. This adds the fifth field (the file size) to the variable sum. As a result, when awk has
finished reading all the input lines, sum is the sum of the sizes of files whose lines matched the pattern.

In this example, the value of sum would be 80600.

INDEX

Sr. No. Topic Date Signature

1 Introduction to Operating System.

2 Study of WINDOWS 2000 Operating System.

3 Administration of WINDOWS 2000

4 Study of LINUX Operating System.

5 Administration of LINUX Operating System.

6 AWK Programming.

21

Вам также может понравиться