Moduletitlecomputernetworksandoperatingsystems Summer Exam

Moduletitlecomputernetworksandoperatingsystems Summer Exam

ModuleCodeUFCEHX-20-2Year2010/11

ModuleTitleComputerNetworksandOperatingSystems Summer Exam

SECTIONA

Attemptallquestionsinthissection.

Provideanoutlineforthedatastructureforanoperatingsystemprocesscontrolblock.Ashortcommentmustidentifythepurposeofeachfieldinyourstruct.

(5Marks)

Brieflyexplainhowaprocessmightget ’preempted’ ifitisrunningunderapreemptivescheduler.Youranswershouldincludereferencetothetypeofqueueonwhichtheprocessmightgetplacedunderdifferentpreemptionconditions.

(5Marks)

Below istheoutputfromls –l.

total44

-rwxr-xr-x2rootroot 02001-01-0101:01file_a

-rwxr-xr-x1rootroot 4422001-01-0101:01file_b

drwxr-xr-x2rootroot40962001-01-0101:01file_c

brw-r--r--1rootroot4,52001-01-0101:01file_d

crw-r--r--1rootroot6,72001-01-0101:01file_e

prw-r--r--1rootroot 02001-01-0101:01file_f

crw-r--r--1rootroot8,92001-01-0101:01file_g

-rwxr-xr-x2rootroot 02001-01-0101:01file_h

DiscusshowUnixsystemssuchasGNU/Linuxidentifythetypeoffile
ordevicetotheuser.

(5Marks)

Describeanddiscuss thestandardbootsequenceofadesktopPCrunningaBIOS. Highlightsomeoftheproblemsordrawbacksofthisboottechnology.

(5Marks)

5)Brieflyoutlinetheobjectivesofmemorymanagementwithinamodernmulti-user,multi-processoperatingsystem.
(5Marks)

SECTIONB

Answeranyonequestioninthissection.

6)

i)DecisionshavetobemadewhenpartitioningadiskdrivepriortoinstallingGNU/Linux.Explain:

whyyoumightwanttocreateseveralpartitions.

(3Marks)

whichpartsofthefilesystemmighthavetheirownpartitions.
(4Marks)

whyyoumightneeda ’swap’ partitionandwhatitsroleis.
(4Marks)

whatmightaffectyourchoiceofblocksizewhenusinganext2filesystem. (4Marks)

ii)Answerthefollowingwithrespecttoeither

a)awebserverinstallationor

b)aprogramdevelopmentplatform.

WheninstallingGNU/Linuxforoneoftheaboveyouwillneedtomakedecisionsregardingthe

diskpartioning,

filesystemtype,

users,

software,etc

inordertomakesurethatyouhaveonlytherequiredpackagesandutilitiesinstalled.Describethedecisionsthatyouwould makeforyourchoseninstallationandjustifythem.
(10Marks)

7)Youhavebeencalledintoameetingwithyourdevelopmentteamtodiscussanewprojectthatthecompanyisthinkingofdeveloping. Youhavebeenaskedtoresearchtheopensourceoptionsinthatareaandbrieftheteam.
i) ProvidealistofannotatedadvantageanddisadvantagesforselectinganOpenSourcesolution. Givebriefdetailsandexamplesoftheargumentsformakingaselection.
(8 Marks)

ii)UsingasanexampleanOpenSourcedevelopmentyouarefamiliarwithdescribehowthedevelopmentismanagedandhowreleasesarecontrolled.
(7Marks)

iii)Virtualisationorhypervisorshavebecomemorepopularinrecentyearswithmanycompaniespromotingtheirownofferings. Describeanddiscussthevarietyofvirtualisationsolutionsavailable,withabriefexplanationoftheiradvantagesanddisadvantages. (10mark)

8)Aprocesscanbeconsideredasthebasiccomputationalelementinamoderncomputersystem.Ithasalifecycle,fromcreationtotermination,andduringitslifewillrequireresources.AnswerthefollowingwithrespecttoprocessesonaGNU/Linuxsystem.

i) Describe,withtheaidofastatediagramtheprocesslifecyclefromtheperspectiveoftheprocess.Youranswershouldincludeadefinitionofthestatesthataprocesscanoccupyaswellastheeventsthatmayoccur.

(10Marks)

Thefollowingalgorithm(i)attemptstoprovidemutualexclusionfortwoprocesses.Itpreventstwoprocessesoccupyingthecriticalregionbutissusceptibletodeadlock.Describethesequenceofeventsthatwouldleadtodeadlockbetweenthetwoprocesses.
(5Marks)

ii)Explainhowalgorithm(ii)cannotresultindeadlockandhowitalsoensuresthatonlyoneprocesscanenterthecriticalsection.Thealgorithmforprocess0isshown.

(10Marks)

ENDOFQUESTIONPAPER

1of10

ModuleCodeUFCEHX-20-2Year2010/11

ModuleTitleComputerNetworksandOperatingSystems Summer Exam

1

They should show most of the following fields for 5 marks.

1of9

ModuleCodeUFCEHX-20-2Year2010/11

ModuleTitleComputerNetworksandOperatingSystems Summer Exam

state

counter priority

* nexttask * prevtask * next_run * prev_run volatile env

exitcode uid/gid

: current state process is in

: cpu ticks remaining

: run level priority

:

: pointers to next, prev, task in linked list

:

position on run q.

pointer to data structure holding cpu register contents when not running.

value returned to parent on termination

:

1of9

ModuleCodeUFCEHX-20-2Year2010/11

ModuleTitleComputerNetworksandOperatingSystems Summer Exam

2

reference to preemption = eviction from cpu by scheduler (1) process makes sycall for I/O (1) and gets moved to wait Q (1) timer interrupt as time slice is up (1)

higher priority process needs to run (1)

3

discussion of devices appearing as files in the filesystem (1),

use of the same functions ( read, write, open etc) to access both devices and files (1),

use of in-memory inode to reference devices (1),

file types -,D,C,B,P,L,S (1), descriptions (1)

4

Details of how systems start up and the role of a BIOS. 1 POST. The problem of plug and play devices and the time bioses take to start. 1 File system awareness and the ability to load programs. 1 Loading the MBR. 1 Problems with 16 bit compatibility and 20 indexes. 1 PXE and UEFI. 1 Example of windows xp booting. Use of GRUB on Linux.1

5

Points from list below, but credit quality of answer where appropriate.

memory allocation should reflect code structure, data, code. (1)

should handle multi-level storage, cache through to backing store. (1)

ii)Address mapping, relocation on program load. coping with relocation on process swapping. (2)

Memory protection, runtime checking for out of bounds access. (1)

memory sharing, ge one copy of application, multiple process access to application code. Data - shar ing between processes. (2)

c)memory extension, virtual memory. (1)

placement policies in physical memory and fragmentation. (1)

7)responsiveness. (1)

6

1of9

1

They should show most of the following fields for 5 marks.

state

counter priority

* nexttask * prevtask * next_run * prev_run volatile env

exitcode uid/gid

: current state process is in

: cpu ticks remaining

: run level priority

:

: pointers to next, prev, task in linked list

:

position on run q.

pointer to data structure holding cpu register contents when not running.

value returned to parent on termination

:

2

reference to preemption = eviction from cpu by scheduler (1) process makes sycall for I/O (1) and gets moved to wait Q (1) timer interrupt as time slice is up (1)

higher priority process needs to run (1)

3

discussion of devices appearing as files in the filesystem (1),

use of the same functions ( read, write, open etc) to access both devices and files (1),

use of in-memory inode to reference devices (1),

file types -,D,C,B,P,L,S (1), descriptions (1)

4

Details of how systems start up and the role of a BIOS. 1 POST. The problem of

plug and play devices and the time bioses take to start. 1 File system awareness

and the ability to load programs. 1 Loading the MBR. 1 Problems with 16 bit

compatibility and 20 indexes. 1 PXE and UEFI. 1 Example of windows xp booting.

Use of GRUB on Linux.1

5

Points from list below, but credit quality of answer where appropriate.

memory allocation should reflect code structure, data, code. (1)

should handle multi-level storage, cache through to backing store. (1)

Address mapping, relocation on program load. coping with relocation on process swapping. (2)

Memory protection, runtime checking for out of bounds access. (1)

memory sharing, ge one copy of application, multiple process access to application code. Data - shar ing between processes. (2)

memory extension, virtual memory. (1)

If both wish to enter then both flags will be 1 but turn can only be 0 or 1 so only one condition will be i)

To avoid log files/ user files/ temp files (1) from corrupting the core partitions( / /usr /lib etc) of the file system) eg by using up all available space.(1), to provide space for virtual memory (1)

The root file system ’/’ (1), /var as it holds all the log and spool directories (1). /home as users are unpredictable although users can veha imposed limits (quotas) (1). /tmp as it might fill unxpectedly (1), swap for virtual memory. Any reasonable discussion.

Swap is a section of space (partition) on a physical vice desuch as an IDE drive that is used by theoperating system used as part of the virtual memory system (2). Process pages ved are to and mo fromswap as space in real memory is needed (1). A process may ved befrm mo disc to swap when it is started if there is not enough real memory for it to run immediately (1)

ii)

marks from

partitioning must reflect purpose, log files for server can get ge, lar equally large dvelopment projects need large home space.

iv)stability and recovery is important for developers so reiser or ext3,

no ordinary users needed on web server, keep everything to a minimum, just utilities and libraries needed to run and maintain sver. keep drivers compiled into the kernel. need network tools etc. vaja stuff?

developers, set up groups & users. access control lists, version control/cvs/sub version for code control, development libraries as well as runtime libs. compilers/debuggers etc.

Any well argued points wrt the chosen installation should be credited. including reference to the lab work.

7

i)Open source check list. Cons. Licensing problems 1. Having a company to deal with, rather than an association. 1 The role os individuals in developments – Rieserfs. 1 Is it really cheaper? Some studies suggest otherwise. 1 Security. 1 Giving competitors advantages. 1 Pros. Cheaper/Free 1. Can have large development community 1 Results in better quality software. 1 More secure as fixes are made available straight away. 1. Allows companies flexibility in market – free and charged versions.1 Good way to develop/recruit talent 1. Companies are as dependent on individuals – Apple and Jobs. 1

Other points about maintenance, standards, open systems welcomed and given marks.

ii)Examples can be Linux kernel. The role of Linux Torvalds. The use of licenses – the problem of knowing what they mean in law. The development of trusted lieutenants – how new developers are inducted into the system. The example of Apache – how developers are brought into the development. The role of companies. All relies on the Internet, cvs or git type programs.

iii)Overview of the history of Virtual Machine Monitors. IBM and Multics background. The recent growth with VMWare, virtualbox and Xen. The versions of vmms – full virtualisation, partial and hardware virtulsation. Problems of VMM – contention for resources, complexity of SW. Reduced performance. Pros. Easy to trial SW. Limits damage to VMM. Security. Legacy SW. The use in server farms.

8i)Diagram as per ...

plus credit from the following

•process creation® on running queue. Scheduled for time slice on cpu in user mode, w so execut-no ing. Will stop executing because

preempted due to time count expiring or because of an interrrupt. causes switch or

voluntarily as it’s waitng on a resource. task_interruptible state

(eg waiting for a key press) or task_uninterruptible state

(waiting on file read).

or

stopped by signal from parent or other process.

or

terminated in which case it becomes a zombie.

2 marks for general explanation. Else : Process 0 is switched out xecuting after e flag[0] = 1. Process1 runs, executes flag[1] = 1, then gets switched out. Both processes w are unable no to proceed as each is waiting for the other to clear its flag. (5)

Only one can enter critical region as

P0 blocked when(flag[ 1] / == / 1)AND(turn == / 1)
and
P1 blocked when(flag[ 0] / == / 1)AND(turn == / 0)