JCAC MOD 8 UNIX Flashcards
101 Questions
100 Views

JCAC MOD 8 UNIX Flashcards

Created by
@CorrectSaxhorn

Questions and Answers

What is a Shell?

  • Runs under user control
  • A program that provides user environment and CLI (correct)
  • A command line interface only
  • Part of the kernel
  • What is a Process?

    A running program.

    What is a Daemon?

    A program that runs in the background, waiting for specific events.

    What is a Lightweight Process?

    <p>Similar to threads in Windows.</p> Signup and view all the answers

    What does the System Call Interface do?

    <p>Enables function calls from user space to the kernel.</p> Signup and view all the answers

    What is a Library Function Call?

    <p>A wrapper function for a system call.</p> Signup and view all the answers

    Linux can run on a processor without a Memory Management Unit.

    <p>True</p> Signup and view all the answers

    Linux is the ___ of the OS.

    <p>kernel</p> Signup and view all the answers

    UNIX features what two rings of protection?

    <p>User Mode and Kernel Mode</p> Signup and view all the answers

    In a 32-bit system, how much memory is reserved for Kernel Mode?

    <p>1GB</p> Signup and view all the answers

    In a 32-bit system, how much memory is reserved for User Mode?

    <p>3GB</p> Signup and view all the answers

    Code running in user mode relies on ___ to access hardware.

    <p>APIs or System Calls</p> Signup and view all the answers

    Crashes in user mode are nearly always ___ .

    <p>recoverable</p> Signup and view all the answers

    In kernel mode, the executing code has ___ and ___ access to the hardware.

    <p>full and unrestricted</p> Signup and view all the answers

    Kernel crashes are ___ and will ___ the entire PC.

    <p>catastrophic and halt</p> Signup and view all the answers

    Processes and their threads start at ___ mode and hardware requests are handled via the ___.

    <p>User mode and Kernel</p> Signup and view all the answers

    Access to kernel routines is only possible through the ___ ___ ___.

    <p>System Call Interface</p> Signup and view all the answers

    What is Multithreading?

    <p>Many user threads adhere to one or many lightweight processes.</p> Signup and view all the answers

    Linux does not distinguish between ___ and ___.

    <p>Threads and Processes</p> Signup and view all the answers

    What are user threads mapped into?

    <p>Kernel processes</p> Signup and view all the answers

    Each shell has its own specific set of ___ and choice of ___.

    <p>functions and distributions</p> Signup and view all the answers

    The main difference in a ___ and a ___ is that the latter supports using the computer.

    <p>command and utility</p> Signup and view all the answers

    What is the primary function of Kernel Mode?

    <p>Managing system resources and performing services.</p> Signup and view all the answers

    What is a Trap?

    <p>Transfers kernel control for system call preparation.</p> Signup and view all the answers

    Describe the 5 steps in the System Call Flow.

    <p>User invokes system call, vectored through glibc library, expands to assembly, transfers to kernel, executed.</p> Signup and view all the answers

    What is Process Management?

    <p>Kernel responsibility for executing processes.</p> Signup and view all the answers

    Process management uses a ___ to share CPU time.

    <p>Scheduler</p> Signup and view all the answers

    What is Memory Management?

    <p>Kernel responsibility for managing memory pages.</p> Signup and view all the answers

    What is Swapping?

    <p>Moving pages out onto disk when memory is exhausted.</p> Signup and view all the answers

    What is the Virtual File System (VFS)?

    <p>A kernel component that implements file interfaces.</p> Signup and view all the answers

    What is the Network Stack?

    <p>Component of the kernel that provides network resource interfaces.</p> Signup and view all the answers

    Describe the 3 steps of the network stack data flow.

    <p>Presents send socket by descriptor, data copied from user mode to kernel memory, device driver communicates with NIC.</p> Signup and view all the answers

    What are Board Support Packages (BSPs)?

    <p>Essential elements for architecture operation and efficiency.</p> Signup and view all the answers

    What is the GNU C Library?

    <p>Implementation of the standard C library.</p> Signup and view all the answers

    What are the steps of the Linux System Boot Process?

    <p>Big BIOS, Mike MBR, Getting GRUB, Kicked KERNEL, In INIT, Russia RUNLEVEL.</p> Signup and view all the answers

    What are the 3 steps that the BIOS completes during the Linux boot process?

    <p>Performs system integrity checks, builds a device tree, executes MBR.</p> Signup and view all the answers

    What is the step that the MBR completes during the Linux boot process?

    <p>Executes GRUB.</p> Signup and view all the answers

    What is GRUB?

    <p>The single most important piece of software on the system.</p> Signup and view all the answers

    What is initrd?

    <p>Initial root file system with essential executables.</p> Signup and view all the answers

    What is insmod?

    <p>Tool used to install kernel modules.</p> Signup and view all the answers

    What are the 2 steps that the GRUB completes during the Linux boot process?

    <p>OS selection screen, loads and executes kernel and initrd images.</p> Signup and view all the answers

    What is the path of the GRUB configuration file?

    <p>/boot/grub/grub.conf.</p> Signup and view all the answers

    During the Kernel phase, what does the kernel execute?

    <p>/sbin/init.</p> Signup and view all the answers

    What 2 steps does the kernel phase complete during the Linux boot process?

    <p>Mounts the root file system, executes /sbin/init daemon.</p> Signup and view all the answers

    What is the /sbin/init Daemon?

    <p>The very first process started with a PID of 1.</p> Signup and view all the answers

    What is a Run Level?

    <p>Software configuration for a select group of processes.</p> Signup and view all the answers

    What is the default run level in Linux?

    <p>5</p> Signup and view all the answers

    What is the default run level in Solaris?

    <p>3</p> Signup and view all the answers

    In Linux, what does init search for in the inittab file?

    <p>initdefault entry.</p> Signup and view all the answers

    What does the 0 Run Level in Linux signify?

    <p>All processes terminated; orderly halt.</p> Signup and view all the answers

    What does the 1 Run Level represent in Linux?

    <p>Single-User Mode.</p> Signup and view all the answers

    What does the 2 Run Level indicate in Linux?

    <p>Multi-User Mode.</p> Signup and view all the answers

    What is the 3 Run Level in Linux?

    <p>Full Multi-User Mode.</p> Signup and view all the answers

    What does the 4 Run Level in Linux represent?

    <p>User-Defined Mode.</p> Signup and view all the answers

    What does the 5 Run Level signify?

    <p>X11.</p> Signup and view all the answers

    What does the 6 Run Level indicate?

    <p>Reboot Mode.</p> Signup and view all the answers

    What file describes default run levels?

    <p>/etc/inittab.</p> Signup and view all the answers

    A directory for each run level is located in _______ directory.

    <p>/etc/rc*.d.</p> Signup and view all the answers

    What is the init command used for?

    <p>To change the current run level.</p> Signup and view all the answers

    What does the who -r command do?

    <p>Determines the current and previous run level.</p> Signup and view all the answers

    The inittab file describes what processes start at bootup and what does the init daemon get?

    <p>Its instructions.</p> Signup and view all the answers

    What does a # symbol at the beginning of a line in inittab mean?

    <p>A comment field.</p> Signup and view all the answers

    What line in /etc/inittab can be altered to change the system's default run level?

    <p>Id:*:initdefault:</p> Signup and view all the answers

    In Linux, the ______ monitors the tty for a user login request.

    <p>getty or mingetty.</p> Signup and view all the answers

    In Solaris, what monitors the tty for user login requests?

    <p>ttymon.</p> Signup and view all the answers

    How many fields are there in the inittab file?

    <p>4</p> Signup and view all the answers

    Field 1 in inittab is an ID which is a _______.

    <p>Unique entry identifier.</p> Signup and view all the answers

    Field 2 in inittab lists the run levels that apply to the entry; if no run level is defined, it runs for all run levels. What is this field called?

    <p>rstate.</p> Signup and view all the answers

    What does Field 3 in inittab describe?

    <p>How the process in the process field is to be run.</p> Signup and view all the answers

    What are the 6 sub-fields in the Action Field of inittab?

    <p>sysinit, respawn, boot, off, wait, initdefault.</p> Signup and view all the answers

    What does the sysinit sub-field in Field 4 do?

    <p>Used for initializing the system.</p> Signup and view all the answers

    What does the respawn sub-field in inittab ensure?

    <p>The process restarts on termination.</p> Signup and view all the answers

    What does the boot sub-field in inittab do?

    <p>Only runs the first time the inittab is read.</p> Signup and view all the answers

    What does the off sub-field do?

    <p>Kills a running process.</p> Signup and view all the answers

    What does the wait sub-field represent?

    <p>Termination status.</p> Signup and view all the answers

    The initdefault sub-field runs the default run level for the system; what field is this?

    <p>Field 4.</p> Signup and view all the answers

    What directory contains master copies of all rc scripts?

    <p>/etc/init.d.</p> Signup and view all the answers

    What does a script that begins with a 'K' do?

    <p>Kills the processes or services.</p> Signup and view all the answers

    What does a script that begins with an 'S' do?

    <p>Spawns associated processes or services.</p> Signup and view all the answers

    How can you stop a file in a script from spawning at boot?

    <p>Rename file to make the 'S' an 's'.</p> Signup and view all the answers

    What is the chkconfig command used for?

    <p>Listing and changing startup information for services.</p> Signup and view all the answers

    Updates made with chkconfig take effect immediately.

    <p>False</p> Signup and view all the answers

    What does chkconfig --list do?

    <p>Lists current services and startup status.</p> Signup and view all the answers

    What does the command chkconfig sshd off do?

    <p>Changes SSH service status in xinetd.d.</p> Signup and view all the answers

    What is the service command used for?

    <p>Stopping, starting, or restarting services.</p> Signup and view all the answers

    Describe four ways that a service can be started/stopped on a Linux system.

    <p>mv, chkconfig, /etc/init.d, service.</p> Signup and view all the answers

    Describe two ways that a service can be stopped/started on a Solaris system.

    <p>mv, /etc/init.d.</p> Signup and view all the answers

    What is the strace command used for in Linux?

    <p>Examining system calls during command execution.</p> Signup and view all the answers

    What is the truss command used for in Solaris?

    <p>Examining system calls during command execution.</p> Signup and view all the answers

    What are the options for the Linux strace command?

    <p>-c, -e, -o.</p> Signup and view all the answers

    What are the options for the Solaris truss command?

    <p>-c, -t, -o.</p> Signup and view all the answers

    List the System Calls for Low-Level File I/O.

    <p>creat(), open(), close(), unlink(), read(), write().</p> Signup and view all the answers

    List the System Calls for Process Control.

    <p>fork(), wait(), execve(), exit(), kill(sig, PID).</p> Signup and view all the answers

    List the Common System Calls.

    <p>mmap(), munmap(), fstat(), memcntl(), access(), brk(), mprotect(), uname(), socket().</p> Signup and view all the answers

    Child processes that have not been 'wait()ed' for are called ___ processes.

    <p>zombie.</p> Signup and view all the answers

    The ___ process is in charge of clearing a process table.

    <p>Parent</p> Signup and view all the answers

    If the parent does not clear the table, ___ takes over.

    <p>init</p> Signup and view all the answers

    What are Loadable Kernel Modules (LKM)?

    <p>Allows linking and removal of drivers in the kernel.</p> Signup and view all the answers

    What does the lsmod command do?

    <p>Shows the status of currently loaded LKMs.</p> Signup and view all the answers

    Where are tunable kernel module parameters located?

    <p>/proc/sys.</p> Signup and view all the answers

    What does the sysctl command provide?

    <p>Interface for viewing and changing kernel parameters.</p> Signup and view all the answers

    Study Notes

    Shell

    • A program providing a user-customizable environment and command-line interface (CLI) to the kernel.
    • Not part of the kernel itself.

    Process

    • Defined as a running program within the system.

    Daemon

    • A background program operating without direct user control.
    • Activated by specific events or conditions.

    Lightweight Process

    • Shares logical address space and system resources with other processes, similar to threads in Windows.

    System Call Interface

    • Acts as the primary interface between applications and the Linux kernel.
    • Facilitates function calls from user space to kernel space, transitioning user mode to kernel mode.

    Library Function Call

    • A wrapper function that facilitates system calls to the Linux kernel.

    MMU and Linux

    • Linux is capable of running on processors with or without a Memory Management Unit (MMU).

    Kernel

    • The central component of the operating system, managing operations and resources.

    User Mode and Kernel Mode

    • UNIX systems feature two protection modes: unprivileged (User Mode) and privileged (Kernel Mode).

    Memory Allocation in 32-bit Systems

    • In a 32-bit system, 1GB of memory is allocated to Kernel Mode, and 3GB to User Mode.

    Access to Hardware

    • Code in user mode must rely on APIs or system calls to interact with hardware.

    User Mode Crashes

    • Crashes occurring in User Mode are generally recoverable.

    Kernel Mode Access

    • Code in Kernel Mode has full and unrestricted access to hardware resources.

    Kernel Crashes

    • Crashes in Kernel Mode can lead to catastrophic failures, halting the entire PC.

    Process and Threads Initialization

    • Processes and threads commence in User Mode, transitioning to Kernel for hardware requests.

    Access to Kernel Routines

    • Access to kernel routines is exclusively through the System Call Interface.

    Multithreading

    • User threads can correspond to one or more lightweight processes.

    Threads and Processes Relationship

    • Linux does not differentiate significantly between threads and processes.

    User Threads Categories

    • User threads are mapped into kernel processes categorized as Shells, UNIX Commands, Utility Programs, User Application Programs, and Libraries (e.g., GNU C Library glibc).

    Shell Functions

    • Each shell provides its specific set of functions and distributions.

    Command vs Utility

    • The key distinction between a command and a utility is that the latter supports computer functionality.

    Kernel Mode Functions

    • Kernel Mode's primary role is to manage system resources and provide system services.

    Trap Function

    • Transfers control to the kernel for executing the required system call.

    System Call Flow

    • The system call flow consists of user-initiated calls, through glibc library and assembly, conveyed to the kernel where execution occurs.

    Process Management

    • A kernel responsibility dedicated to ensuring timely execution of processes.

    Scheduler

    • The process management utilizes a scheduler to distribute CPU time among multiple lightweight processes.

    Memory Management

    • Involves tracking memory page statuses to allow dynamic adjustments according to system requirements.

    Swapping

    • A mechanism to move pages to disk when memory is under pressure.

    Virtual File System (VFS)

    • Kernel component that implements file-related interfaces for user programs and supports multiple file systems.

    Network Stack

    • Kernel component that provides network resource interfaces.

    Network Stack Data Flow

    • Involves sending socket buffers to user apps, transferring data to kernel memory, and device drivers communicating with NIC protocols.

    Board Support Packages (BSPs)

    • Necessary elements for specific architecture functionality and efficiency within the Linux kernel.

    GNU C Library

    • The standard C library implementation used by numerous operating systems and applications.

    Linux Boot Process Acronym

    • Stages include Big BIOS, Mike MBR, Getting GRUB, Kicked KERNEL, In INIT, Russia RUNLEVEL.

    BIOS Boot Process Steps

    • Performs POST (Power-On Self Test), constructs a device tree, and executes the MBR (Master Boot Record).

    MBR Role

    • Executes GRUB or LILO for boot management.

    GRUB Characteristics

    • Flexibly configurable and critically important for system operation.

    Initial Root File System

    • The initrd contains core directories and executables needed before the main root file system loads.

    Kernel Execution Steps

    • Mounts the root filesystem and executes the /sbin/init daemon.

    Init Daemon

    • The first process started by the system with Process ID 1 (PID 1).

    Run Level Concept

    • Defined configurations outlining active processes in the system.

    Default Run Levels in Linux

    • Run Level 5 is set as the default, while Run Level 3 is default in Solaris.

    inittab Configuration

    • Init consults the inittab file for the run level entry during startup.

    Run Levels Characteristics

    • Denote specific operational states, such as halting processes (0), single-user tasks (1), multi-user without network support (2), full multi-user with services (3), user-defined tasks (4), multi-user with X-windows (5), and rebooting (6).

    Service Management Commands

    • chkconfig and service commands manipulate service states in real-time.

    inittab Fields

    • Define ID, run state, action, process to execute, and more.

    Script Execution Order

    • Scripts prefixed with 'K' kill processes, while 'S' spawns services.

    Kernel Module Management

    • Loadable Kernel Modules allow in-kernel operations for device drivers and functionalities.

    Kernel Parameters

    • Managed via /proc/sys and adjustable in real-time with the sysctl command.

    System Calls for File I/O and Process Control

    • List includes functions like open(), close(), fork(), and wait() among others.

    Zombie Processes

    • Child processes not waited on become zombie processes, necessitating cleanup by parent processes or init if they remain unclaimed.

    Overall Linux Boot and Service Lifecycle

    • Involves security and functionality checks at multiple stages to ensure an operating system is fully operational and configurable.

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Description

    Test your knowledge of key UNIX concepts with these flashcards. This quiz covers essential terms like shell, process, and daemon, providing a solid foundation for understanding UNIX environments. Perfect for students in the JCAC program!

    More Quizzes Like This

    Operating System Lab Journal 7
    10 questions

    Operating System Lab Journal 7

    DurableChalcedony2267 avatar
    DurableChalcedony2267
    Linux Operating System Concepts
    18 questions
    Linux Study Prep
    3 questions

    Linux Study Prep

    ExtraordinaryDubnium avatar
    ExtraordinaryDubnium
    Use Quizgecko on...
    Browser
    Browser