Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Network Operating Systems: Lecture 8: System Initialization and X Windows

Download as pdf or txt
Download as pdf or txt
You are on page 1of 34

Network Operating Systems

Lecture 8: System
Initialization and X
Windows
The Boot

01 Process

02 Boot
Loaders

03
Linux
Initialization
The X
04 Windows
System
Explain the UNIX SysV and Systemd
system initialization processes
Summarize the major
steps necessary to
boot a Linux system

Identify and explain the


purpose of the major
Configure the system to start and
Linux GUI components: X
stop daemons upon entering
Windows, window
certain runlevels and targets
manager, and desktop
environment
The Boot Process
•Power On Self Test (POST):
•Series of tests run when computer initializes,
•Boot loader: program used to load an OS:
•Locates and executes the kernel of the OS.
•MBR might contain pointer to a partition
containing a boot loader on the first sector.
•Active partition: partition pointed to by MBR
•One per hard disk.
• Secure boot: digital signature of the boot
loader within the UEFI System Partition is
checked first
• Ensures that it has not been modified by
malware
• Daemon: system process that performs
useful tasks
• Printing, scheduling, and maintenance
• Init (initialize) daemon: first process started
• Loads all other daemons
• Brings system to usable state Figure 8-1: The boot process
Boot Loaders
• Boot loader functions
•Primary function: load the Linux kernel into
memory
•Passing information to the kernel during
startup
•Booting another OS: known as dual booting
• Two most common boot loaders
•GRUB
•GRUB2
• Originally created to replace the original Linux boot loader for hard
disks that have an MBR
• Supports the booting of several different operating systems
• Stage1: first major part of GRUB
• Typically resides on MBR/GPT
• Remaining parts of the boot loader (Stage1.5 and Stage2) reside in
the /boot/grub directory
• Stage1.5: loads filesystem support and Stage2
• Stage2: performs the actual boot loader functions
• Displays graphical boot loader screen
Figure 8-2: The legacy GRUB boot screen for a Fedora system.
• GRUB Legacy configuration
• Edit the /boot/grub/grub.conf file
• Read directly by Stage2 boot loader
• GRUB root partition
• Partition containing Stage2 boot loader and grub.conf file
• GRUB normally allows manipulation of boot loader during system startup
• To prevent this, password protect GRUB modifications during boot time
• If you press any key during first five seconds after the BIOS POST, you will get a
graphical GRUB boot menu screen
• Allows you to manipulate the boot process
• Get a grub> prompt to enter commands
• Help screen provides list of all available commands
• The grub-install command: installs GRUB boot loader
• Typically for reinstallation when GRUB becomes damaged
• Grand Unified Bootloader version 2 (GRUB2)
• Most common boot loader used on modern Linux systems
• Similar structure to GRUB
• Stage2 loads a terminal-friendly boot loader screen
• Main configuration file for GRUB2 is called grub.cfg
• Stored within the /boot/grub/ (or /boot/grub2/) directory
• When a new device driver needs to be loaded by the boot loader the package often adds
a file to /etc/default/grub.d
• After modifying the file or adding scripts to the /etc/grub.d directory
• Run the grub2-mkconfig command to rebuild the /boot/grub/grub.cfg file
• GRUB2 boot loader becomes damaged
• Use the grub2-install command
Linux Initialization
• The kernel resumes control after Linux is loaded
•Executes first init daemon which then performs a system
initialization process
•Brings the system into a usable state
• Recent Linux distributions have adopted the Systemd
system initialization process
•Older Linux systems used a UNIX standard called SysV
• Systemd is completely compatible with SysV
•Implements new features for management
•Two SysV system initialization processes
• Traditional SysV
• Upstart
•In both systems the init daemon runs a series of
scripts to start other daemons to provide system
services
• The init daemon is responsible for starting and stopping
daemons after system initialization
• Runlevel: defines the number and type of daemons loaded
into memory and executed by the kernel
• Seven standard runlevels (see Table)
• The runlevel command: displays current and most recent
runlevel
• The init command: changes the runlevel on a system.
• Unless otherwise specified, the init daemon enters the
default runlevel indicated in the /etc/inittab file
•Contains a single uncommented line that configures the
default runlevel
•Syntax: id:5:initdefault:
• Runtime configuration (rc) scripts prepare the system
• Bring the system to a usable state
• The init daemon executes script for default runlevel (5)
/etc/rc.d/rc5.d script
• Executes all files that start with S or K in the /etc/rc.d/rc5.d directory
• When user specifies runlevel 5, init daemon runs default script but
executes files in the /etc/rc.d/rc5.d directory
• Each file in an /etc/rc[runlevel].d directory is a symbolic link to a
script that can be used to start or stop a daemon
• Depending on whether the symbolic link filename started with an S (start)
or K (kill/stop)
Figure 8-5: A traditional UNIX SysV system
initialization process
• Linux systems that use the upstart init system
• The /etc/rc.d directories are not used
• The init daemon identifies the default runlevel in the
/etc/inittab file
• Directly executes the rc scripts within the /etc/init.d
directory
• Each daemon has a separate configuration file within
the /etc/init directory that uses standard wildcard
notation to identify runlevels it should be started or
stopped in
Figure 8-6: An upstart system initialization process
• To manipulate daemons after system startup, you can execute
them directly from the /etc/init.d directory with the appropriate
argument (start, stop, or restart).
• The service command: start, stop, or restart daemons within
/etc/rc.d/init.d directory.
• The upstart init system also provides the stop, start, and restart
commands.
• To configure a daemon to start or stop in a particular runlevel:
• Create or modify symbolic links within /etc/rc[runlevel].d
directories
• The chkconfig command: view and modify runlevel daemons are
started in
• The chkconfig command is not available in Ubuntu Server 14.04
• Use the update-rc.d command to configure files within
/etc/rc[runlevel].d directories
• Systemd is similar to SysV
• Can also be used to start, stop, and configure many other OS components
• Each OS component is called a unit
• Daemons are called service units
• Runlevels are called target units (or targets)
• Each target maps to a UNIX SysV runlevel
• Poweroff.target = Runlevel 0
• Rescue.target = Runlevel1 (Single User Mode)
• Multi-user.target = Runlevel 2, 3, and 4
• Graphical.target = Runlevel 5
• Reboot.target = Runlevel 6
• Default target on a system with a GUI installed is the graphical.target
• To configure a different target, update /etc/systemd/system/default.target
symbolic link
Figure 8-7: A Systemd system initialization process
• The systemctl command: used to start and stop
daemons, as well as configure them to automatically
start during system initialization
•Syntax: systemctl restart crond.service
• The systemd-analyze command
•View information about Systemd units
The X Windows System
• Linux GUI components
• Many components, each of which
works separately from the video
hardware.
• Together, GUI components and
related programs use over 4GB of
storage space on a typical Linux
installation.
Figure 8-8: Components of
the Linux GUI
• X Windows: core component of Linux GUI
• Provides the ability to draw graphical images in windows that are
displayed on terminal screen
• Sometimes referred to as X server
• X clients: programs that tell X Windows how to draw the graphics and
display the results
• Need not run on same computer as X Windows
• Wayland is a new version of X Windows designed to replace X.org
• Additional security features and an architecture that makes graphical
application development easier
• Window manager: modifies look and feel of X Windows
•Can be used alone, or in conjunction with a desktop
environment
• Desktop environment: standard set of GUI tools
•Toolkits that speed up process of creating new
software
•KDE and GNOME are the most common
• K Windows Manager (kwm): window manager that works under KDE
• Qt toolkit: software toolkit included in KDE
• GNOME desktop environment: default desktop environment in most
Linux distributions
• Uses mutter window manager and the GTK+ toolkit
• KDE, GNOME, and GNOME-based desktop environments use system
resources, such as memory and CPU time, to provide their graphical
interface
•When the init daemon boots to runlevel 5 or
graphical.target, gdm starts
• Displays graphical login screen
• Allows user to choose the desktop environment
•If you use runlevel1 (or rescue.target) or runlevel 2-4, the
GNOME Display Manager is not started by default
• Type startx at a character terminal to start X Windows and the default
window manager
•X Windows interfaces with video hardware
• Requires information regarding keyboard, mouse, monitor, and
video adapter card.
• Normally detected from the associated kernel modules that are
loaded at boot time, but can also be specified within
configuration files.
• The keyboard type (e.g., English, US layout) is normally
specified manually during the installation process.
• You can manually run the system-config-keyboard command to
configure keyboard.
•Accessibility of the desktop environment
• Desktop environments configured to suit the needs
of users
•Assistive technologies
• Tools used to increase accessibility
•Universal Access utility
• Configures assistive technologies within Fedora 28
Thanks

You might also like