0% found this document useful (0 votes)
131 views

Linux System Architecture

System calls provide a standardized interface for user processes to request services from the kernel like hardware access, allowing easier programming while also enabling the kernel to check requests for security and maintain portability by changing lower-level implementations.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
131 views

Linux System Architecture

System calls provide a standardized interface for user processes to request services from the kernel like hardware access, allowing easier programming while also enabling the kernel to check requests for security and maintain portability by changing lower-level implementations.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Linux Features

• UNIX-like operating system.


• Features:
– Preemptive multitasking.
– Virtual memory (protected memory, paging).
– Shared libraries.
– Demand loading, dynamic kernel modules.
– Shared copy-on-write executables.
– TCP/IP networking.
– SMP support.
– Open source.
What’s a Kernel?
• Controls and mediates access to hardware.
• Implements and supports fundamental
abstractions:
– Processes, files, devices etc.
• Schedules / allocates system resources:
– Memory, CPU, disk, descriptors, etc.
• Enforces security and protection.
• Responds to user requests for service (system
calls).
Kernel Design Goals
• Performance: efficiency, speed.
– Utilize resources to capacity with low overhead.
• Stability: robustness, resilience.
– Uptime, graceful degradation.
• Capability: features, flexibility, compatibility.
• Security, protection.
– Protect users from each other & system from bad
users.
• Portability.
• Extensibility.
Example “Core” Kernel
Applications

System Libraries (libc)

System Call Interface

I/O Related Process Related


Modules

File Systems Scheduler


Networking Memory Management
Device Drivers IPC

Architecture-Dependent Code

Hardware
Architectural Approaches
• Monolithic.
• Layered.
• Modularized.
• Micro-kernel.
• Virtual machine.
Summary
• Linux is a modular, UNIX-like monolithic kernel.
• Kernel is the heart of the OS that executes with
special hardware permission (kernel mode).
• “Core kernel” provides framework, data
structures, support for drivers, modules,
subsystems.
• Architecture dependent source sub-trees live
in /arch.
Booting and Kernel
Initialization
System Lifecycle: Ups & Downs

Power Power
on off
Boot Kernel OS RUN! Shut
Init Init down
Boot Terminology
• Loader:
– Program that moves bits from disk (usually)
to memory and then transfers CPU control to the newly
“loaded” bits (executable).

• Bootloader / Bootstrap:
– Program that loads the “first program” (the kernel).

• Boot PROM / PROM Monitor / BIOS:


– Persistent code that is “already loaded” on power-up.

• Boot Manager:
– Program that lets you choose the “first program” to load.
LILO: LInux LOader
• A versatile boot manager that supports:
– Choice of Linux kernels.
– Boot time kernel parameters.
– Booting non-Linux kernels.
– A variety of configurations.
• Characteristics:
– Lives in MBR or partition boot sector.
– Has no knowledge of filesystem structure so…
– Builds a sector “map file” (block map) to find kernel.
• /sbin/lilo – “map installer”.
– /etc/lilo.conf is lilo configuration file.
/sbin/init
• Ancestor of all processes (except idle/swapper
process).
• Controls transitions between “runlevels”:
– 0: shutdown
– 1: single-user
– 2: multi-user (no NFS)
– 3: full multi-user
– 5: X11
– 6: reboot
• Executes startup/shutdown scripts for each runlevel.
Advanced Boot Concepts
• Initial ramdisk (initrd) – two-stage boot for flexibility:
– First mount “initial” ramdisk as root.
– Execute linuxrc to perform additional setup, configuration.
– Finally mount “real” root and continue.
– See Documentation/initrd.txt for details.
– Also see “man initrd”.

• Net booting:
– Remote root (Diskless-root-HOWTO).
– Diskless boot (Diskless-HOWTO).
Summary
• Bootstrapping a system is a complex, device-dependent process that
involves transition from hardware, to firmware, to software.
• Booting within the constraints of the Intel architecture is especially
complex and usually involves firmware support (BIOS) and a boot manager
(LILO).
• /sbin/lilo is a “map installer” that reads configuration information and
writes a boot sector and block map files used during boot.
• start_kernel is Linux “main” and sets up process context before spawning
process 0 (idle) and process 1 (init).
• The init() function performs high-level initialization before exec’ing the
user-level init process.
System Calls
System Calls
• Interface between user-level processes and
hardware devices.
– CPU, memory, disks etc.
• Make programming easier:
– Let kernel take care of hardware-specific issues.
• Increase system security:
– Let kernel check requested service via syscall.
• Provide portability:
– Maintain interface but change functional
implementation.

You might also like