Professional Documents
Culture Documents
101 - System Architecture
101 - System Architecture
System Architecture
Why Linux?
Open Source
Many people have been able to adapt Linux in
different ways
This caused wide range of new features and
system.
Each user can run multiple tasks at the same time,
jobs
Why Linux?
Portability
Linux Operating system is programmed to be
information
Tools and utilities to manipulate USB devices
Conceptual understanding of sysfs, udev, hald, dbus
8
101: system Architecuture
1. Determine and configure Hardware settings
Interrupt Requests
IO addresses are regions of memory mapped to devices where the
lines to devices.
Now with Intel’s Advanced Programmable Interrupt Controller
system
to export information about the running kernel user processes,
& hardware devices that have been configured
Exist only in memory & doesnot represent any true physical
files
10
101: system Architecuture
1. Determine and configure Hardware settings ...
Input / Output Addresses.
CPU and peripheral devices, communications make use of IO
addresses
Two types of methods 1)Memory Mapped IO
2) Port Mapped IO
MMIO – regions of memory reserved for communication
PMIO – CPU has separate set of instructions for performing IO
use,
lspci, setpci } utilities that use information from /proc
in ring 0
User space applications – run in less privileged mode ring 3, and
partitioned computer
Boot sector – is region of hard disk that contains machine code to
devices
Linux kernels’ device-mapper framework allows for creation of virtual
http://wiki.osdev.org/MBR_(x86)#Building_a_Custom_MB
R_Bootstrap_program
18
101: system Architecuture
1. Determine and configure Hardware settings ...
USB Support
Hot plug interface
USB support is present from Linux kernel 2.2.7
#lsusb – command to list the USB devices
Device Drivers
Kernel uses drivers to export device info to /sys file system
In most Linux distributions, drivers are provided as part of the kernel, can
parameters
e.g. init – overrides the process that is run by the kernel after
it has finished loading,
“init=/bin/bash” – is used to by pass login prompt in
case password is forgotten.
24
101: system Architecture
1. Boot the System … contd
Init Process overview
After loading the kernel, init process is started,
Init is responsible for checking and mounting file systems,
initdefault=action
25
101: system Architecture
1. Boot the System … contd
Actions
wait – init will wait till process starting is completed
respawn – init restarts even when process terminates, usual used
limited this to two characters, so you will often see only two characters
used.
runlevels lists the runlevels for which the action for this id should be
anything else.
30
101: system Architecture
1. Boot the System … contd
Troubleshooting Boot Process
dmesg
Contents of ring buffer (memory location) can be read with dmesg tool
It can also tell us screen outputs during bootup
/var/log/syslog or /var/log/messages
These two files are additional locations where we have to look at to
device
Maintain through Live CD, with out mounting Root file system
31
101: system Architecture
3. Runlevels, Rebooting, Shutting Down System
Introduction
Linux has 7 run-levels [0 – 6]
Run-levels are assigned to the following configurations
1) single user mode
2) multi-user, text mode, no servers
3) multi-user, text mode, servers
4) multi-user, GUI mode, no servers
5) multi-user, GUI mode, servers.
32
101: system Architecture
3. Runlevels, Rebooting, Shutting Down System
Introduction … contd
Run levels on Red hat server
# Default runlevel. The runlevels used by RHS are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have
networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
33
101: system Architecture
3. Runlevels, Rebooting, Shutting Down System
Introduction … contd
Run levels specific scripts are stored in /etc/init.d/rc?.d
/etc/rc.d/init.d
Symbolic links: must have S – for start at run level entry
some systems, you must authenticate by logging in, but on others you go
straight into a shell prompt as root.
Single-user mode can be a lifesaver, but you can also destroy your system, so
always be careful whenever you are running with root authority. Reboot to
normal multiuser mode as soon as you are done.
36
101: system Architecture
3. Runlevels, Rebooting, Shutting Down System
Changing run levels
Single-user mode
As with switching to regular multiuser runlevels, you can also switch to
can be rather abrupt and cause users to lose work and processes to
terminate abnormally.
The preferred method to shut down or reboot the system is to use the
shutdown command,
Shutdown first sends a warning message to all logged-in users and blocks
You may specify the -h option to halt the system, or the -r option to
reboot.
A standard message is issued in addition to any message you specify.
RPM based
#service httpd start|stop|reload