Modern Operating Systems by Herbert Bos ...
Modern_Operating_Systems_by_Herbert_Bos_and_Andrew_S._Tanenbaum_4th_Ed.pdf-M ODERN O PERATING S YSTEMS
Showing 882-883 out of 1137
Modern Operating Systems by Herbert Bos and Andrew...
Modern_Operating_Systems_by_Herbert_Bos_and_Andrew_S._Tanenbaum_4th_Ed.pdf-M ODERN O PERATING S YSTEMS
Modern Operating Systems by Herbert...
Modern_Operating_Systems_by_Herbert_Bos_and_Andrew_S._Tanenbaum_4th_Ed.pdf-M ODERN O PERATING S YSTEMS
Page 882
SEC. 10.9
SUMMARY
851
PROBLEMS
1.
Explain how writing UNIX in C made it easier to port it to new machines.
2.
The POSIX interface defines a set of library procedures.
Explain why POSIX stan-
dardizes library procedures instead of the system-call interface.
3.
Linux depends on gcc compiler to be ported to new architectures. Describe one advan-
tage and one disadvantage of this dependency.
4.
A directory contains the following files:
aardvark
ferret
koala
porpoise
unicorn
bonefish
grunion
llama
quacker
vicuna
capybara
hyena
marmot
rabbit
weasel
dingo
ibex
nuthatch
seahorse
yak
emu
jellyfish
ostrich
tuna
zebu
Which files will be listed by the command
ls [abc]
*
e
*
?
5.
What does the following Linux shell pipeline do?
grep nd xyz | wc –l
6.
Write a Linux pipeline that prints the eighth line of file
z
on standard output.
7.
Why does Linux distinguish between standard output and standard error, when both
default to the terminal?
8.
A user at a terminal types the following commands:
a|b|c&
d|e|f&
After the shell has processed them, how many new processes are running?
9.
When the Linux shell starts up a process, it puts copies of its environment variables,
such as
HOME
, on the process’ stack, so the process can find out what its home direc-
tory is.
If this process should later fork, will the child automatically get these vari-
ables, too?
10.
About how long does it take a traditional UNIX system to fork off a child process
under the following conditions: text size = 100 KB, data size = 20 KB, stack size = 10
KB, task structure = 1 KB, user structure = 5 KB. The kernel trap and return takes 1
msec, and the machine can copy one 32-bit word every 50 nsec. Text segments are
shared, but data and stack segments are not.
11.
As multimegabyte programs became more common, the time spent executing the
fork
system call and copying the data and stack segments of the calling process grew
proportionally. When
fork
is executed in Linux, the parent’s address space is not cop-
ied, as traditional
fork
semantics would dictate. How does Linux prevent the child from
doing something that would completely change the
fork
semantics?


Page 883
852
CASE STUDY 1: UNIX, LINUX, AND ANDROID
CHAP. 10
12.
Why are negative arguments to
nice
reserved exclusively for the superuser?
13.
A non-real-time Linux process has priority levels from 100 to 139. What is the default
static priority and how is the nice value used to change this?
14.
Does it make sense to take away a process’ memory when it enters zombie state?
Why
or why not?
15.
To what hardware concept is a signal closely related?
Give two examples of how sig-
nals are used.
16.
Why do you think the designers of Linux made it impossible for a process to send a
signal to another process that is not in its process group?
17.
A system call is usually implemented using a software interrupt (trap) instruction.
Could an ordinary procedure call be used as well on the Pentium hardware? If so,
under what conditions and how? If not, why not?
18.
In general, do you think daemons have higher or lower priority than interactive proc-
esses? Why?
19.
When a new process is forked off, it must be assigned a unique integer as its PID.
Is it
sufficient to have a counter in the kernel that is incremented on each process creation,
with the counter used as the new PID? Discuss your answer.
20.
In every process’ entry in the task structure, the PID of the parent is stored. Why?
21.
The copy-on-write mechanism is used as an optimization in the
fork
system call, so that
a copy of a page is created only when one of the processes (parent or child) tries to
write on the page. Suppose a process
p1
forks processes
p2
and
p3
in quick succession.
Explain how a page sharing may be handled in this case.
22.
What combination of the
sharing
flags
bits used by the Linux clone command corre-
sponds to a conventional UNIX
fork
call? To creating a conventional UNIX thread?
23.
Two tasks A and B need to perform the same amount of work. However, task A has
higher priority, and needs to be given more CPU time. Expain how will this be
achieved in each of the Linux schedulers described in this chapter, the O(1) and the
CFS scheduler.
24.
Some UNIX systems are tickless, meaning they do not have periodic clock interrupts.
Why is this done? Also, does ticklessness make sense on a computer (such as an em-
bedded system) running only one process?
25.
When booting Linux (or most other operating systems for that matter), the bootstrap
loader in sector 0 of the disk first loads a boot program which then loads the operating
system. Why is this extra step necessary? Surely it would be simpler to have the boot-
strap loader in sector 0 just load the operating system directly.
26.
A certain editor has 100 KB of program text, 30 KB of initialized data, and 50 KB of
BSS. The initial stack is 10 KB.
Suppose that three copies of this editor are started si-
multaneously. How much physical memory is needed (a) if shared text is used, and (b)
if it is not?
27.
Why are open-file-descriptor tables necessary in Linux?


Ace your assessments! Get Better Grades
Browse thousands of Study Materials & Solutions from your Favorite Schools
Concordia University
Concordia_University
School:
Operating_Systems
Course:
Great resource for chem class. Had all the past labs and assignments
Leland P.
Santa Clara University
Introducing Study Plan
Using AI Tools to Help you understand and remember your course concepts better and faster than any other resource.
Find the best videos to learn every concept in that course from Youtube and Tiktok without searching.
Save All Relavent Videos & Materials and access anytime and anywhere
Prepare Smart and Guarantee better grades

Students also viewed documents