Quiz: Linux Basics (Solution)

User Space, Kernel Space

  • Kernel/user space: which of the following statements are true?

    Statement

    True

    False

    In kernel space there exists the concept of a process

    n

    In user space there exists the concept of a process

    y

    Interrupts are generally serviced in user space

    n

    Interrupts are generally serviced in kernel space

    y

    Scheduling of processes is done by the kernel

    y

    Address spaces are implemented in user space

    n

  • How do programs communicate with the kernel? (One answer)

    Statement

    True

    False

    System calls

    y

    Message queues

    n

    IO ports

    n

    Reverse interrupts

    n

  • File abstraction: which concepts are represented by file decriptors?

    Statement

    True

    False

    Files

    y

    Network sockets

    y

    Timers

    y

    Serial/UART devices

    y

    Memory

    n

    The process stack

    n

  • The term “blocking” describes which behavior? (One answer)

    Statement

    True

    False

    A process can block another for communication purposes

    n

    A process consumes no CPU time while it waits for an event to happen

    y

    The kernel blocks access to network resources to enhance system security

    n

Processes, Scheduling, and Virtual Memory

  • Scheduling: which of the following statements are true?

    Statement

    True

    False

    A timeslice is the amount of time that a process can run until it is suspended in favor of other processes

    y

    Fair scheduling ensures that network resources are evenly shared

    n

    On a single-CPU machine, no process may enter an infinite loop - or else, the entire machine will come to a halt

    n

    Fair scheduling ensures that every process gets its fair share of CPU resources

    y

    The scheduler gives processes the illusion that each of them owns the CPU

    y

    A context switch happens when one process enters a blocking system call

    y

  • Virtual Memory: which of the following statements are true?

    Statement

    True

    False

    A process can own all memory in the system

    n

    The kernel is the owner of all memory in the system

    y

    All processes share a single address space

    n

    Each process in the system has its own address space

    y

    An address space is three-dimensional

    n

  • Processes: which of the following statements are true?

    Statement

    True

    False

    A process is identified by its process ID

    y

    A process is identified by its pthread context number

    n

    Processes are arranged in a process hierarchy, starting at process 1

    y

    A process may have multiple parents

    n

    Every process has a parent process

    n

    Every process except process 1 has a parent process

    y

Dependencies

cluster_linux Linux cluster_linux_sysprog Linux Systems Programming cluster_linux_sysprog_fileio File I/O cluster_linux_sysprog_basics Linux Systems Programming: Basics cluster_linux_sysprog_blocking_io Blocking I/O: What Is That? cluster_linux_basics Linux Basics cluster_linux_basics_shell The Shell (Bash - “Bourne Again Shell”) cluster_linux_basics_intro Introduction: Concepts and Terminology cluster_linux_basics_permissions File System Permissions cluster_linux_toolchain Toolchain, And Cross Development linux_sysprog_fileio_basics File I/O: Basics linux_sysprog_basics_groupnode Linux Systems Programming: Basics linux_sysprog_fileio_basics->linux_sysprog_basics_groupnode linux_basics_permissions_basics Permissions: Mode, User and Group Ownership linux_sysprog_fileio_basics->linux_basics_permissions_basics linux_sysprog_basics_syscalls System Calls vs. Library Functions linux_toolchain_basics Toolchain: Basics linux_sysprog_basics_syscalls->linux_toolchain_basics linux_sysprog_basics_groupnode->linux_sysprog_basics_syscalls linux_sysprog_basics_errorhandling Error Handling linux_sysprog_basics_groupnode->linux_sysprog_basics_errorhandling linux_sysprog_basics_errorhandling->linux_sysprog_basics_syscalls linux_sysprog_blocking_io_blocking_io Blocking I/O: What is That? (“Everything is a file”) linux_sysprog_blocking_io_blocking_io->linux_sysprog_fileio_basics linux_sysprog_blocking_io_blocking_io_file Blocking I/O (On A File): What is That? linux_sysprog_blocking_io_blocking_io_file->linux_sysprog_blocking_io_blocking_io linux_basics_shell_cwd Current Working Directory linux_basics_shell_commandline Commandline linux_basics_shell_cwd->linux_basics_shell_commandline linux_basics_shell_paths Absolute and Relative Paths linux_basics_shell_cwd->linux_basics_shell_paths linux_basics_intro_process Processes, Scheduling, Address Spaces linux_basics_shell_cwd->linux_basics_intro_process linux_basics_shell_special_paths Special Paths linux_basics_shell_special_paths->linux_basics_shell_paths linux_basics_shell_ls Directory Listings: The ls Command linux_basics_shell_ls->linux_basics_shell_cwd linux_basics_shell_ls->linux_basics_shell_special_paths linux_basics_shell_ls->linux_basics_shell_paths linux_basics_intro_overview Overview linux_basics_shell_ls->linux_basics_intro_overview linux_basics_shell_file_dir_create_rm Creating And Removing Files and Directories linux_basics_shell_file_dir_create_rm->linux_basics_shell_cwd linux_basics_shell_file_dir_create_rm->linux_basics_shell_paths linux_basics_shell_commandline->linux_basics_intro_overview linux_basics_shell_paths->linux_basics_shell_commandline linux_basics_intro_fh_moodle_quiz Quiz: Linux Basics linux_basics_intro_fh_moodle_quiz->linux_sysprog_blocking_io_blocking_io_file linux_basics_intro_fh_moodle_quiz->linux_basics_intro_process linux_basics_intro_fh_moodle_quiz->linux_basics_intro_overview linux_basics_intro_demo_everything_is_a_file Everything Is A File (Live Demo) linux_basics_intro_fh_moodle_quiz->linux_basics_intro_demo_everything_is_a_file linux_basics_intro_process->linux_basics_intro_overview linux_basics_intro_demo_everything_is_a_file->linux_sysprog_blocking_io_blocking_io_file linux_basics_intro_demo_everything_is_a_file->linux_basics_intro_overview linux_basics_permissions_basics->linux_basics_shell_ls linux_toolchain_basics->linux_basics_shell_file_dir_create_rm