Operating system concepts ninth edition (2012), chapter 1 solution e1

6

Click here to load reader

Transcript of Operating system concepts ninth edition (2012), chapter 1 solution e1

Page 1: Operating system concepts ninth edition (2012), chapter 1 solution e1

1 | P a g e

Chapter One

Solved by Navid Daneshvaran, Software Engineering Student at Kharazmi University, Tehran

Please tell me if you see mistakes in solving problems

Contact Info:

E-Mail: [email protected]

1.1

1. The operating system controls hardware and coordinates its use among the various application

program for the various users.

2. In user view is designed mostly for ease of use, with some attention paid to performance.

3. In system view, we can view an operating system as a resource allocator.

1.2

GIU waste resource of the operating system but for interaction with user it is useful.

1.3

In real-time operating system programmer must notice that response time is the most important

part of the system and if response time exceeds the required time, the system should not do that

job. So the programmer should schedules program to prevent response time to exceed the

required time.

1.4

If applications are included in operating system, its performance will be more efficient but we

will have security problem in which applications access to hardware and if we consider the

concept of the application, it is an application and must be in a higher level than operating

system.

1.5

In kernel mode we have more access to hardware than user mode. In application program, user

should not access to hardware and its purpose is to just solving user problem. But in operating

system we want to access to hardware to allocate resource to application and that’s why this two

modes provide rudimentary protection system.

Page 2: Operating system concepts ninth edition (2012), chapter 1 solution e1

2 | P a g e

1.6

a. privileged

b. not privileged

c. privileged

d. not privileged

e. privileged

f. privileged

g. not privileged

h. privileged

1.7

First it has security problem. Operating system that stores important data, any unauthorized users

can access to these data. Second if we have problem in memory, all information will be deleted.

1.8

One of them is for virtual machines that have more access than users and less than main

operating system. Another mode can be for system programs that have more access than

applications and less than virtual machines and operating system. Another possibility may be

occurs in kernel and user mode. User mode itself can has more than one mode. For example we

can group different type of user mode and applications. Also kernel mode can has different

modes.

1.9

We can determine a specific clock and for each clock, the time increase by one. Also we can use

a program to compute current time. We first set time for future and program go to sleep. After

the program called by the interrupt, it computes the number of interrupt and set current time.

1.10

Page 3: Operating system concepts ninth edition (2012), chapter 1 solution e1

3 | P a g e

Reason is that they speed up the access to data. Based on the some algorithm, they keep most

used data in cache and CPU can access them faster than memory. They solves the problem of

different access time by different component. They cause problem called data inconsistency. If

we have a global variable and it is changed in one cache, other local cache does not know this

change and it causes the problem. We do not allocate big amount of memory for cache because

of its cost. Also we want to have a hierarchy structure in which we consider both cost and

performance trade-off.

1.11

In client-server model, we have the server which provides services (e.g. memory, processor and

etc.) to its client. In peer-to-peer model every system itself can be server or client. In peer-to-peer

system when one node wants a service, it sends a message to all other nodes and if one nodes can

provides this service, it roles as server.

1.12

a. One data can be read and written simultaneously and it causes problem. Also in

simultaneously access we operating system must ensure that it does in reasonable time.

b. In time sharing machine because we have several jobs in memory we must scheduling them

with job scheduling and also we must schedule CPU allocation to job that its term is CPU

scheduling. If we do previous scheduling we have same degree of security such as dedicated

machine.

1.13

a. CPU time, memory and I/O

b. Operating system must compromise between individual usability and resource utilization

c. Mostly they are standalone units and quite often they connect each other with wireless

connection and so this type of connection should be considered in resource utilization

1.14

If we have multiple user which want to interconnect to each other and share resources and data,

we use time sharing system. But some conditions must be considered, including we must have a

good resource utilization.

1.15

Page 4: Operating system concepts ninth edition (2012), chapter 1 solution e1

4 | P a g e

In symmetric multiprocessing, each processor can interact with other processor, but in

asymmetric multiprocessing each processor has its own task and does not interact with other

processor.

Advantages:

1. We have more throughput, which means tasks will be processed faster and we also have

better response time.

2. If one process cannot do its task, the system will not fail and continue to do its work.

3. Economy of scale, they can share peripherals, mass storage and power supplies.

Disadvantages:

1. The synchronization between processor require programmer to write their program in this

type which is difficult.

1.16

In clustered system we have several system that interconnect with each other and each node can

be itself a multiprocessor system, but multiprocessor system is just one system. The system must

monitor each other and if one node is failed, other node that monitor it, restart this node and

continues its work. User just see a brief interruption of the service.

1.17

One way is asymmetric clustering in which one system is hot-standby and monitor other system

and when one system is failed, it starts to continue its work. Advantage is that implementation of

this model is easy, but disadvantage is that because hot-standby system does not always uses of

its resources, its performance is not suitable. In symmetric model every node is running

application and monitor other nodes. Disadvantage is that implementation of his model is harder

but advantage is that its performance is higher.

1.18

In network computer users can share data and hardware with each other and we have more power

computational capability in compare with traditional PCs. One thing that we must consider in

network computers is the simultaneously access to data but in traditional PCs we did not have

this problem. In network computers resource utilization must be considered but in PCs we do not

have to consider resource utilization.

1.19

Page 5: Operating system concepts ninth edition (2012), chapter 1 solution e1

5 | P a g e

The purpose of interrupts is that when we receive data from I/O devices, when its work done,

interrupts message to CPU and tell it that it does its work. A trap is software-generated interrupt.

Trap can intentionally trap from user, the purpose is that for example when it occurs with the

exception, trap message to operating system to do something.

1.20

a. CPU interface with device with interrupts, when device wants to transfer data its send the

interrupts to CPU to tell to CPU that it wants to transfer.

b. When memory operations complete, its send interrupt to CPU.

c. While DMA is transferring data, CPU is allowed to execute other program; when the DMA is

completed, it sends the interrupt to CPU to tell that it does its work.

1.21

It is not possible to have such system, because when we consider privileged instructions with

other instructions same, the instructions that are not privileged can access to hardware and causes

to hardware be damaged.

1.22

As we mentioned, one of the problem to have local cache is data inconsistency and the reason

was that when one data that is shared by several local caches is changed, other caches does not

know this change and became an issue. If we define a shared cache, when we change the shared

value, other caches can see this change.

1.23

We have global variable X and its value is 5. CPU0, CPU1 and CPU2 reads it and load it into their

cache. CPU0 change the value of X from 5 to 10 and changes its cache value, after that CPU1

reads the value of the X and read it from its local cache but its value is the previous value and

program gives the wrong answer.

1.24

a. In single-processor we don’t have such issue.

b. Each local cache of core of one processor or each local cache of single processor has their own

local value and we have data inconsistency.

Page 6: Operating system concepts ninth edition (2012), chapter 1 solution e1

6 | P a g e

c. In addition to problems of b, each system has its own value.

1.25

Each program in memory has its own size of memory and beyond that program is denied to

access memory.

1.26

a. LAN

b. WAN.

c. LAN

1.27

Mobile devices have lower capacity and screen size compare with laptops or PCs. Also their

have lower power compare to PC and laptops so they have smaller CPUs and operating system

must considers this issues.

1.28

All components share resources compare to client server systems that only server share

resources. If one node is failed other nodes do their works and system continues working but in

client-server systems if server fails, whole of the system stops working.

1.29

One challenge of such applications is to integrate nodes with each other and if one node wants

service, define a mechanism to find needed service. Such application is BitTorrent.

1.30

Advantage: every person in the world can access to operating system and we don’t have

monopoly of operating system. It can use for educational purposes.

Disadvantage: In the first releases it can has a lot of bugs.