You are on page 1of 16

Linux Architecture

Agenda
• • • • Monolithic and Micro Kernel Architectures Linux Architecture Features of Linux Sample user space and kernel space programs • Files and File Types • File Permissions, Users and Attributes • File System Layout

Monolithic OS

Micro Kernel OS

Layered Architecture of Linux

USER APPLICATIONS

STANDARD LIBRARY

SYSTEM CALL LIBRARY
USER MODE KERNEL MODE

KERNEL DEVICE DRIVERS

HARDWARE Layered Architecture of Linux

Linux Architecture

Invoking a System Call

Split View
KERNEL
S O F T W A R E

KERNEL I/O SUBSYSTEM
Mouse Device Driver Keyboard Device Driver PCI Bus Device Driver

……

Floppy Device Driver

H A R D W A R E

Mouse Device Controller

Keyboard Device Controller

PCI Bus Device Controller

Floppy Device Controller

Mouse

Keyboard

PCI Bus

Floppy

Split View of Kernel I/O SubSystem with Device Drivers

Features of Linux
• • • • • • • • • • Unix like Operating System Monolithic Dynamic Kernel modules Preemptive multitasking Virtual Memory Shared Libraries Shared Copy-on-write executables SMP support TCP/IP support Open Source

Application using Standard Library Interface
#include <stdio.h> int main() { printf(“Hello World\n”); return(0); }

Application using System Call Library Interface
#include <unistd.h> int main() { write(1,”Hello World\n”, 12); return(0); }

Kernel Module
#include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h>

// Initialization Function int init_module(void) { printk(“Hello World Init\n”); return(0); } //Cleanup Function void cleanup_module(void) { printk(“Hello World cleanup\n”); }

Files
• • • • Everything is a file or a process A file is a linear stream of bytes Unification of File I/O and Device I/O File Types
 Regular  Directory  Link  Character Device  Block Device Socket Named Pipe d l c b s p

Files
• File Permissions
– Read (r ) – Write (w ) – Execute (x)

• User Categories
-user -group -other

• File Attributes
-rw-rw-r-- 1 raju sec 31744 Feb 21 17:56 intro.txt

File System Layout
• • • • • • • • • • / /home /bin /usr /usr/lib /dev /etc /var /root /sbin Begins file system structure, called the root Users home directories Standard commands and utility programs Files and commands used by system Host libraries for programming languages Holds file interfaces for devices Holds system configuration files Storage for all variable files and temporary files The administrative user's home directory Programs for use by the system and the system administrator.

Thank You