General Knowledge Quiz
10 Questions
19 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which of the following statements are correct?

  • a. Parallel execution is possible on a single processor.
  • b. Concurrency is about dealing with lots of things at once. Parallelism is about doing lots of things at once. (correct)
  • c. Concurrent execution and parallel execution can be combined. (correct)
  • d. Concurrent execution is possible on a single processor. (correct)

Which of the following statements are true?

  • a. A kernel has to exploit concurrency in order to be efficient.
  • b. A hardware trap caused by dereferencing an invalid pointer is synchronous to a running process. (correct)
  • c. A software interrupt generated by a terminal program on user request is asynchronous to a running process. A system call is asynchronous to a running process.
  • e. The kernel handles asynchronous interrupts that may not be visible by any running processes. A system call is asynchronous to a running process. (correct)

How is a C programmer expected to handle runtime error situations?

  • The function strerror() converts an error code into a string describing the error code. (correct)
  • b. Unhandled runtime errors lead to exceptions that are handled by the main() function if not caught elsewhere.
  • c. The function void perror(const char *s) defined in stdio.h can be used to write a message s to the standard error stream followed by a message describing the last error encountered during a call to a system or library function. e. The file descriptor of the standard output is 0 and the file descriptor of the standard error is 1. (correct)
  • d. Error messages do not belong on the standard output and should be written to the standard error.

Which statements are true for libraries and dynamic linking?

<p>Dynamic libraries may be shared between multiple programs that use the same dynamic libraries. (A), A dynamically linked executable executes the dynamic linker before the main() function is called. (B), Deploying an updated dynamic library requires the restart of all affected programs but no explicit call of the linker. (D)</p> Signup and view all the answers

Which of the following statements about operating system architectures are correct?

<p>A modular architecture simplifies the development of new kernel modules such as driverrs or filesystems. (B), A virtual machine kernel architecture benefits from having three or more privilege levels. (C), A microkernel architecture is essentially a layered architecture with just two layers. (D)</p> Signup and view all the answers

How do system calls and programs report runtime error conditions?

<p>a. The global symbol errno declared in errno.h resolves to an int value indicating the error code of the last error that has occurred. (A), d. A program exiting with a non-zero exit code is indicating an error. (D), b. System calls often return the int status code -1 to indicate that an error occurred. (B)</p> Signup and view all the answers

Which of the following statements are correct?

<p>c. The separation ensures that systems can be used in a wide range of different situations. (C), d. An operating system should support mechanisms to enforce access control but leave the access control policies to be configured flexibly. (D)</p> Signup and view all the answers

Which statements are correct for standard input, output, error streams?

<p>b. In a terminal session, the standard output and the standard error are by default both printed to the terminal. (B), d. The C library’s stream interface to the standard output is buffered and hence write failures may be detected late (for example, when the stream is flushed or closed). (C), f. The standard input can be redirected to read the content of a file or the output produced by other programs. (D)</p> Signup and view all the answers

Which of the following functions are direct system calls?

<p>int pause(void); (A), c. int open(const char *pathname, int flags, mode_t mode); (C), f. ssize_t write(int fd, const void *buf, size_t count); (D)</p> Signup and view all the answers

Which of the following statements are correct?

<p>a. A loaded kernel module executes in system mode. (A), b. Transition from user mode into system can be caused by an interrupt or a system call. (B), d. Regular programs execute in user mode. (D)</p> Signup and view all the answers

Flashcards

Concurrency vs. Parallelism

Concurrency deals with managing multiple tasks seemingly at once, while parallelism actually performs multiple tasks simultaneously.

Hardware trap - invalid pointer

A hardware trap caused by a bad pointer reference directly impacts the running process's execution synchronously.

Error handling - C programmer

The function strerror() changes an error code into a readable error message string.

Dynamic linking - libraries

Dynamic libraries can be shared between various programs that use them.

Signup and view all the flashcards

Modular OS architecture

Kernel modules (drivers, filesystems) are easier to develop and maintain with modular architecture.

Signup and view all the flashcards

Error code - system calls

The global variable errno holds the error code of the most recent error.

Signup and view all the flashcards

OS architecture advantage

Modular OS design lets different systems be deployed and configured differently, for various situations.

Signup and view all the flashcards

Standard input/output/error - terminal

On terminals, standard output and standard error are normally displayed together on the terminal.

Signup and view all the flashcards

Direct system calls - example

pause() is a direct system call.

Signup and view all the flashcards

Kernel modules execution

Loaded kernel modules execute in system mode.

Signup and view all the flashcards

More Like This

Use Quizgecko on...
Browser
Browser