Download Quiz 1 - FSU Computer Science

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Security-focused operating system wikipedia , lookup

Copland (operating system) wikipedia , lookup

Library (computing) wikipedia , lookup

Berkeley Software Distribution wikipedia , lookup

Distributed operating system wikipedia , lookup

Plan 9 from Bell Labs wikipedia , lookup

Windows NT startup process wikipedia , lookup

Burroughs MCP wikipedia , lookup

RSTS/E wikipedia , lookup

Booting wikipedia , lookup

Acorn MOS wikipedia , lookup

DNIX wikipedia , lookup

Unix security wikipedia , lookup

Spring (operating system) wikipedia , lookup

Process management (computing) wikipedia , lookup

Paging wikipedia , lookup

VS/9 wikipedia , lookup

CP/M wikipedia , lookup

Transcript
Quiz 2
1.
__________invented the von Neumann computer architecture.
2. ___________performs Power-On Self Test (POST
3. ____________allow processes running at the user mode to access kernel
functions that run under the kernel mode
4. The type of user service that allows command line, GUI, and batch entry of data
is called the ________________
5. The user service that loads a program into memory, runs that program, ends the
execution is called _________________.
6. The user service that allows reading and writing of I/O from devices is called a
___________
7. The operating system user service that allows you to create, search, read, and
write files is called ______________.
8. The user service that allows processes to exchange information, on the same
computer or between computers over a network is called a _________________.
service
9. The user service that that makes the user aware of possible errors is called a
_______________service.
10. A system service, a service that is an operation of the operating system itself, that
allows multiple users to run jobs concurrently and share resources is called ------------------
11. A system service that keeps track of which users use how much and what kinds of
computer resources is called the _____________ service.
12. A system service that stores the owners of information in a multiuser or
networked computer system is called the _________________ service.
13. The name of the algorithm that loads the PC with the address of the first
instruction and loads the IR with the actual instruction is called the ________
algorithm.
14. __________allow processes running at the user mode to access kernel functions
that run under the kernel mode.
15. _______________prevent processes from doing bad things, such as halting and
modifying the MBR
16. The name of the Unix shell command that performs the function to copy a file is
called ______________
17. The name of the Unix shell command that performs the function to remove a file
from a directory is called ______________
18. The name of the Unix shell command that performs the function to rename a file
is called ______________
19. The name of the Unix shell command that performs the function to change a
working directory is called ______________
20. The name of the Unix shell command that performs the function to compile a
program is ______________
21. The name of the Unix shell command that performs the function to change access
permissions called ______________
22. Given the correct code below, how many context switches will occur?
Parent code
include …..
int main() {
pid_t pid;
if ((pid = fork()) == 0) {
while (1)
{ printf(“child’s return value %d: I want to play…\n”, pid); }
} else
{ while (1)
{printf(“parent’s return value %d: After the project…\n”, pid);}
}
return 0;
}
Child code
#include ……
int main() {
pid_t pid;
if ((pid = 0) == 0) {
while (1)
{ printf(“child’s return value %d: I want to play…\n”, pid); }
} else
{while (1)
{ printf(“parent’s return value %d: After the project…\n”, pid);} }
return 0;
}
There will be _____context switches (enter text)?
23. Given the code above, how many of the output lines “child’s return value 0: I
want to play” will occur before a context switch occurs(enter text).
24. Given the code above, how many of the output lines “ parent’s return value 3218:
After the project..” will occur before a context switch (enter text).
25. The first instruction of the booting sequence is which instruction.
a. A CPU jumps to a fixed address in ROM,
b. Performs POST,
c. Loads MBR from the boot device,
d. Loads the BIOS,
e. Loads an OS loader,
f. Sets the kernel mode, and
g. Loads the kernel image,
h. Jumps to the OS entry point.
26. The instruction of the booting sequence that follows the posting is called the
a. A CPU jumps to a fixed address in ROM,
b.
c.
d.
e.
f.
g.
h.
Performs POST,
Loads MBR from the boot device,
Loads the BIOS,
Loads an OS loader,
Sets the kernel mode, and
Loads the kernel image,
Jumps to the OS entry point.
27. The last instruction of the booting sequence is which instruction
a. A CPU jumps to a fixed address in ROM,
b. Performs POST,
c. Loads MBR from the boot device,
d. Loads the BIOS,
e. Loads an OS loader,
f. Sets the kernel mode, and
g. Loads the kernel image,
h. Jumps to the OS entry point.
28. What is the output of the following program?
#include <stdio.h>
int main (int argc, char const *argv[]) {
int i, j =3;
for (i = 0; i < 10; i+=2); j = j + 1;
fprintf (stdout, "i = %3d, j = %3d.\n", i, j);
return 0;
}
a.
b.
c.
d.
e.
i = 10, j = 4
i = 8, j = 4
i = 11; j = 3
i = 10; j = 3
none of the above.
29. Given the following code, what will be the output?
#include <stdio.h>
#include <ctype.h>
int main (int argc, char const *argv[]) {
char buf[10];
char const *p;
p = argv[0];
for (p = argv[0]; *p; p++) {
buf [p - argv[0]] = toupper (*p);
}
buf[p - argv[0]] = '\0';
fprintf (stdout, "buf = \"%s\".\n", buf);
return 0;
a.
b.
c.
d.
e.
buf = “HELLO”
buf = “a out”
buf = “hello”
buf = “A.OUT”
none of the above
30. Given the following code, what will be the output?
#include <stdio.h>
char *p;
int main (int argc, char const *argv[]) {
strcpy (p, "Hello there!\n");
fprintf (stderr, "%s", p);
return 0;
a.
b.
c.
d.
e.
f.
g.
h.
Hello there!
Hello there!\n
"Hello there!\n"
%s
"%s"
Segmentation fault (core dumped)
the program has syntax error(s)
none of the above
31.What is the output of the following program?
#include <stdio.h>
int equal (int x, int y) {
if (x = y) return 1;
return 0;
}
int main (int argc, char const *argv[]) {
fprintf (stderr, "%1d", equal (3, 4));
return 0;
}
f. 0
g. 1
h. syntax error
i. none of the above
32.What is the output of the following program?
#include <stdio.h>
int x[] = {3, 4, 5, 6, 0, 7};
int main (int argc, char const *argv[]) {
char *p = (char *) x;
p += sizeof (int);
*(int*) p = 8;
for (p = (char *) x; *p; p+= sizeof (int)) printf ("%2d", *(int *) p);
return 0;
}
j.
k.
l.
m.
8
32
0
None of the above
33.What is the output of the following program?
#include <stdio.h>
#define xx aa
#define aa bb
#ifdef aa
#define bb(x) "hello" x
#else
#define aa(x) "goodbye" x
#endif
n.
o.
p.
q.
r.
int main () {
printf (aa(" again"));
return 0;
}
hello
goodby
hello again
goodby again
None of the above
34 Given the following code, what is the output?
#include <stdio.h>
int main () {
int n = 2;
switch (n) {
case 1:
case 2:
printf ("first;");
case 3:
case 4:
printf ("second;");
}
return 0;
}
s.
t.
u.
v.
first
second
first, second
none of the above
35.Which of the following is an example of a systems program?
a.
b.
c.
d.
command interpreter
Web browser
text formatter
database system
36. If a program terminates abnormally, a dump of memory may be examined by a ____ to
determine the cause of the problem.
a. module
b. debugger
c. shell
d. control card
37.
a.
b.
c.
d.
A message passing model is ____.
easier to implement than a shared memory model for intercomputer communication
is faster than the shared memory model
a network protocol and does not apply to operating systems
is only useful for small simple operating systems
38.
a.
b.
c.
d.
Policy ____.
determines how to do something
determines what will be done
is not likely to change across places
is not likely to change over time
39. The major difficulty in designing a layered operating system approach is ____.
a. appropriately defining the various layers
b. making sure that each layer hides certain data structures, hardware, and operations from
higher-level layers
c. debugging a particular layer
d. making sure each layer is easily converted to modules
40. A microkernel is a kernel ____.
a. containing many components that are optimized to reduce resident memory size
b.
c.
d.
that is compressed before loading in order to reduce its resident memory size
that is compiled to produce the smallest size possible when stored to disk
that is stripped of all nonessential components
41. Which of the following pieces of information is least useful to the SYSGEN program of an
operating system?
a. the CPU being used
b. amount of memory available
c. what applications to install
d. operating-system options such as buffer sizes or CPU scheduling algorithms
42.
a.
b.
c.
d.
A boot block ____.
typically only knows the location and length of the rest of the bootstrap program
typically is sophisticated enough to load the operating system and begin its execution
is composed of multiple disk blocks
is composed of multiple disk cylinders
43.
a.
b.
c.
d.
In a virtual machine, each program believes that it has ____.
multiple processors
its own memory
another "virtual" computer to assist in its operations
more memory than is physically available on the machine
44. ____ is a popular commercial application that abstracts Intel 80XXx86 hardware into isolated
virtual machines.
a. .NET
b. JIT
c. JVM
d. VMware
45. True/False KDE and GNOME desktops are available under open-source licenses.
46. True/False A program written for the .NET Framework need not worry about the specifics of
the hardware or the operating system on which it will run.
47. True/False Many operating system merge I/O devices and files into a combined file because
of the similarity of system calls for each.
48. True/False The virtual-machine concept does not offer complete protection of the various
system resources.
49. True/False An initial bootstrap program is in the form of random-access memory (RAM).