Uploaded by shreyasmagadum69

UNIX vismay assignment

advertisement
Assign ment01
UNIx Operaing Systemn
yplain the rale af an operating system with the hep ofa
neat diag1am
dn Operating system (0s)
sCuelly iting behuren the
User N
USer A
usHs applicatiom pmytams
.Application Pogranm
and wmpukr handuvare
0 s ep.lott dhe computn
handuwar
adarzs
prdvicle
the compueter
wewnws to
set
of A enices
bystm is vu.
a
Spem Intefates and langtu
to
OpeatingSyskm
The hienanhial view of dhu
Computu ttandw@u
Cempukr Byskm i shewn
)The opevrating system functiens as
an
intorfae
b]w
a usvn
and
abraes
The Hiezarchical viw Lempukr Sukm!
cemputtr
Usually, tu opoating syskm pmvicles seme typical Sovie fo users
xecuh a program: shen
a
pvgnam is
exteuted,
thu Os
must load
thu 1nstructiens and data of povgnam into main
memny, initialize files and 3/0 devices, and
poup ane Geme othwr usownes
Ceate a pognam
for itt need .
7he operatfng should pmvide plutforma and
trols, 'such ds edi teu, to asslst ttu pmgramme
in creating, editing and
debugging proghania.
Openate files
t
For
he
fle managemunt ,
type
f
diount
ttu os must knew net onli
fllu but alo thu chanachel
difount storage dendces. H should ruice the
Shau and porottitiem mechansma o ffles
Con tre 7/0 devius
As there
are so
many
types of 1/0 devies în
Jhe computn system and each y thum has Hs
Own centrrl înstu bons, thu 0s must cen trl
I/0 deuies
.Mamge Systum
a
cewaBely
.
For mllti we compukr systems, th OS Can not
Only let its s s shne Sys tem sus0wncs but
and
Usns
aloo pnottct dystem
r s o w i u , incuding
C PU,
primay mumery, 1/0 devtces and daa, In erdr
to mak th executim ok OS
Detrct and
Nspond eTTOTS
A
eme errms
can
occuU
smobth and poupen.
when tu cempuler
Tunning, the openating systm mustdetect
eows and qive an apprmpriarte asponse in
time.
2. List thu types of UNIX 0penating Bystem avaiable
The
+ypes
OpeTating Systems
)System variant pnating SysBems
04
UNIX
Hwrd
Hp-UX
LInux
IRIX
)
BSD( Benkeley Softwau distributim) systtms
Mac
Os
Free
BsD
Solariis
Net BSD
x
(Dawin
3.
Summai ze
the
htstory
o
ONX 0perating Sysk
Mubics >A tHme sharing
opnaing systm uhieh wns
mevel bt guw too omplex for t own
900d
2) Ken
Thomps en o4 Bull labs>)Bll labs
withduaw frm Mulies supet
t e wmo te tu
flrst vnsien } UNIK
UNICs) Dn a PDp- 1
Soon foined t
by Dennu Rt hie.
3 PDP-7
No suth thing as a video
&no
display
keyboard.
A teletype was used to
communicate wi
Basically
a
glei fil
ek ctrmic
Display thvugh pinter
14 when
thu
tomputfng Sci en ces Reblanch
machinelahqu
eeded
en
a
wrd
a
th comp uter
type uwn ter
entor wanhel
than PDP-7, while
another
pnvwOY
5) As iu sysem ruw in
emplenity
mere u U .
and
6) In 1143, Veuien 4 UniY
was
rwi ten
) In 1980s, SVR4 added
hew
featwws
to ust Unix
departmed
ves eanch team wantd
in
hígh leuel language C.
The Unix Os wnt in tuwo
directiens, one for ommertial we
anod academic
ano
purpe One wa4 System Vaadantand
w
Bsp,
othw
Such
administrai m, nw ferma Tnten pro ces
as
com
m
file locking , System
un i
cahm iPc)
aIn 1980s, tomaniy Statd developîng Unix 0s, Such
Sun mtcT0
Systtms, Sun 0s ( Solaus), Micvsbit Xeniy
10) The IEEE's ortable Os
in!enfaze
oy UNIx POsix
es tablishud.
Linu7,
was
apepula
12)In
2000 s,
ulhas ed
as
os.
many
free
fre softuwnre
Unix 0s uwvu
frre Bs D and open -sow1
8pectffeaion
as
was
in 1992 and sbon
became
durelope d
sueh
open Solaus 6y Sun u
as
NelBs
(wsys ttms
D
4 Explain the
UNIX Soktoaru
dlaqram.
5 Applicaton s|
archikebune with
the
huly o
neet
Applicaten S Cempiles, cdi for
wnd pmCemorsftA
Eelnd_eb_beese
UNIX Sh elt
User med
UNIY SHEU
Stan dai um
tandanddbay ferk, öpen,cloe,yeac
Ianguah1anl
2
:
wite )
laguage linaAyCc, ce i, java ef)
Supiem
n cal
t t jac
&ystm cal inHerfau
UNIX
konel mwM managem ent
9memeny managmint ffle styytem ancl
OS
kemel mvcle
esystms
PHanduwnru CPU, RW,
dIIRI, keyboand,
20221tez meueD-RpM neturerd caiddiplay
th
Kernel
1.Kernel
The Unix
Jt
8.
0puatng system
kosnel
(ere bj tu
Sshm
mai n funchiens au
pnocoin managmunt
mumery managemant, ffle sysema and
1/0 systems.
Many applicatiens
Subsystmm and prgrams that
wd
Anigh
perfoman u 0} Syskm, Suh ay shull prvid:
editers
and
Sysem call
The Unix
Os pmvide functim calls
as
intunface Sysem calls, wlth wwm Pmuny (anknewn
use to invok
tiu exe cution
akonnl code.
So thu Sys em call
intofa e prmvids en trancs into
Uniy kund. Seme Seviws
înclude Llke Ceating
ttminabng prownes deleting, mading, untinq files
3)Standand Librari
and
Languag Libraies
4) Unix shell
Applications
The
wsn
fntonface
to UIx u
Umposed o
Standard ibraue
vatams
of
) Languau
libraie wst o
hunutns tha
au avdinble to
pmqnammvu fr uwe with
that they
soptware
develop.
The Unix shell
a com
manel Une intunfae er cUi1.
wun a USUr
a
type command and
th Shel
intopseh and tke cutca ttu psun enti kuy
The
comman
the Shell and
applicaiems
Cempilos, editom Centains
web bmwss etc,
all
d.
atiens Such
Such aas
applicatiens
aerd pm applic
ww ens tessos,ftp, telnet ane
5. Lis t aand
ezplain thu vle of kernel in UN X oprating syster
km.
The Cnix opénating
sustem
+s main funchins
kernd
thu
Cere of
tu
system
an
i) Process manaqement
) memmy managimnt
i) ffle system
iv) 7/o sys
em
ProCeSS management
A pa0Cess mamgement of tu UNIX op enating System u
ypically eponaible fr tasks : to create, suspend and
bermfnate pocen ts, to Switth their states, to schedule
t
CPu to execute multip.le pHOCeS ses concwvently Pn
time shauina System and to manage the comm unicatiom
beeueen
pocenés intor-ms communicaion, IP).
Memey management
Ths pant ef kern el job
u to
kup track o
which
parb of
memery ae in Use and which party are hot tn use
T o allocate memery to procerses when thy need l t ancd
de allocate it whin thuy finish thein tasks and put tts
memey back in rre spae fpet s0 that it can be rea locaked
x) File Sys tem
-
Files ane also managed by the konnel.
>
File
systema
thew au
u
stered tn dus,
Usually,
in
dirrckories
tilu and sub dioctis, In Únix a drectory
albo a Ale
The
kend man ages filu
and
Create and vemgie file
x) /0 I
sshm
n VNIY,
dire ctvries by ponftrming to
direetom'e and povtcet Wem
7/0 devias anu made to lDok like ilu andwr
accesed as such with same Dead & wite Syskm call
that au
ed w
acw all fles
1 / 0 dvfww wu connetted o
cempufou, Suth as lisks,
printos, cD-ROM, kyboand, duplay, nebeerk cands.
6.
he
Eaplain
syn tar to
a
pass
Cmmand in
The
basfc ules in mostt 04 thu
Type
(
cempefe tovrdt
prem
made
hare
eptions
Cem mands
The avgument t h u
wwks em. Thi
Options usualy come
optim has ts o u n
Cemmand
End
commands
meMe
ene
line,
each
command
can be
a
object that commancl
fAlen ame
blw cmmand, Dpim4, angument,
behore argumenu. 7n frw c a s. , a r
with
argument asso ciatd
f x f Sort -0 outputfile
er
an
name
angument
be spacus
Th vu must
7) Tuwo
vne
pu fxed
with twv dash
5
pompt)
in wlich command werks. Options r
tu
way
change
calleel hyphen)
with a dash
uttru
oyten stngle
4
shel
commands in lowon casea
3) OptHon
ome
cases
Line.
llnes
lines
tommand
UNIX
Genvnal frmat er
$Command l-optiom ()] avqumunt ()] ( -
The
Cormmand
npulfile
-n
can
be
uwrtten on the
same
Sepanated by Semicolon l;)
Enter
typin by resing
ky of
blu
kuyboaned
F. Wrfte
diktwwnces b/w Chanatfen
the
ven
Jnterfa ce
and
raphfcal isn Jntonfaa
Chana cten
)
Jntenfa ce (CUT);-
Tn CUI wsn has to inttract with the applicatims
by
)
ser
use
making
Tn CUT
only
o
bni task
A) CUI n o t easfen
)
CUT, whune
)
Example
(ommands.
Can vun
at
a
to navigate than
time
Guz
wsen has to type en kuybo and to proctn ol.
D0S, Unfx
=
Graphcal
In
Usen
interfa lýui) t
ce
GUI, ft
usen
fnkenfa ce which
applicatiema by ma~ing
use
usvn
intoract
wi th
raphics,
I
x) n
Tn GuI, mere than ene task can un slmultaneous ly
*GUT,
much
easivr to navigate thah CUI
Gur wthich maku ft possible to use a mouse ina tead
eyboand.
*Tt
u
vey
wsn
frtendly inenface.
Enample i- Windeuws, Lim ux.
8. With ezample , Explaln the syntax and comman ds us ed frr
file operatiens.
heu
ane
svval commands that can be used to manage
Copying file (Cp)
fles.
To copy a file, we Cp command.
Er- cp oldyile newftle .
)Kenaming file ( mu) T0 7ename file, we my comm and (meve),
Ex mv file1 fle 3.
)Deledinq flle ( 7m)To dlete a ffle, we tue m
Ex
x) Looking Insidu i les
Cmere
les)
m
com mand.
file 2.
Th ee aru u v way to look inside a Ple
on
sing mere"cemmand and o hur io e
$mere filk
Ex1
2
$less file 2
x)Jotninq and displayinq- Cat com man d s med fo doplay a ff le
files (cat)
Ex
cat file 1 file 2
x) Findin4 files ( find)-T0 find ffles, we find command.
fx
fnd test len to]
/4est/ file 1
tm
Pointing flle
Pinting
Hle tn
pafnie (Lp)
x)
test/ new file
pint
en
tile
prin tn,
Cemmand
Lp file lentr)
fx
To
a
ue
lp
lpr
With
for i'rectony pmatien
10
A
and com man da u s d
enample, explalh thu sntox
Speity
a
file
Apathn
p.
ame
Unix til sys em.
path
er
write Tts
dire cloy locatien,
ike tu addus of dlistcey
ile
in tha
thu diretery namy
name useslasheu l ) between
wd):
pointing WerkingTDirectery
o fnd which
pathn ame,
tu uwvr king diyeeltty
lkory i
Use pwd commancd
Expwd entn] /usensfpreseck/ wang.
Changing Direteny
lcd)
To change the
uworkfng directoy to any
dllrectery we cd cemmand.
cd /vseu/prvject/wanq/wwk lentr]
En
Creating a diyt ctory (mkdir):
To Crate a directerg vnden werHing dive Ctory,
usem kdir Cemmand.
mkdir myfile
E
Deleting a dtreebery (rmdir)
Te delete a directon, uue the vmdlr
Comman d.
Exs
m dir text
LisHng files in a diretry ( ls)
T
lfst all 4fles
oliret
e
ds
we
lenkn]
sub dirretrries n
Le cemmand.
trt
ple 1 file/
x
to.
Eaplain
with optios to diiplay onltne help
hu cenmmand
any Command.
T h e m an command can Shew tuu UNix refeenu nmanval pag
For examplu
Syntax
Cemmem
man
loptiom (s)]
Command ()
man-k kuywd ).
0p tYons
a
dale
man
To
wu
display all pagu that match dhe commands
speciyie d in Command (s),
) f T o diplay tiu pages that first matchs he
Cemmands speciied in cemman d{s);
)
-e
*) k
co mmond ls)Keywrd ()
To
7o Beanch
0o4
)P
pagn
x)-S m;-to
To
dsplay
display
UNIX
Summais
Reference
manual
or cemmands by a
page, Such a
ePg
S
eanch Section
exe cutes u job
1ve example for each.
can
fer
n
în
man
ual pag
ereground
be run in two
1) Fereground procrs
)
an el display
keywmd (s).
How shell
dpocess
of commands
comm ands velatcd to kyurd in
dioplay them
.
Summaue
and
pages
mere
and
batkqnoun6
uways 1
Back gneund prvws
When even
command b sued/typ ed
Cmats/starts a n w pmun.
a
tn
Onix,4
Method 1 fegnund prvce
in fegiound
and
kuygboand
tom
nput
pvees when starnked,
Eveny
nclves
ditault
y
Sends 0utput to the Screeh.
uns
Whun fssuing a pwd
Cem m and
#/u/prejecd/wang/ot
Ls pwd
when a
command
foregneun d
takbing
and ó
Can be
proce es
prvcws
run e r
b
running 1n
lot of time no 0therr
started because lhe
premp t woulel not be avallable until tlu prgiam
tinfshes prvcesing
Method 2 Backgnound proces
I t runs in
input
Thus,
wi th
and
the
and waits
ceming
out.
batkgieund without keyboasd
tfl keybond input à regufrte-
0ther pmwses
be den e
can
t u pov c n inning fn
ih
parallll
backqiounol si'ne
thy do not have to walt fr the previous
prows w
be compleled.
Adding
alemg with cemman d Storrb 1t a
batkgieund prm ci.
pwd &
since puwd does not want ang nput fovm teyboasd
it goes to stop State until mved to fregteund
and given any dafa inpuit
7hus, pwn'ng
0utput
[11 +
Enton
Dohe
ky
pwd
,' The fist inuinfwmatim
baikgvound poves
The Seurm d o pompt fer anothur eemmand.
Download