SlideShare a Scribd company logo
The Linux Kernel:
Introduction
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?
AKA: executive, system monitor.
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).
Etc…etc…
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.
Kernel Architecture
Applications
System Libraries (libc)
System Call Interface
Hardware
Architecture-Dependent Code
I/O Related Process Related
Scheduler
Memory Management
IPC
File Systems
Networking
Device Drivers
Modules
Architectural Approaches
Monolithic.
Layered.
Modularized.
Micro-kernel.
Virtual machine.
Linux Source Tree Layout
/usr/src/linux
Documentation
arch
fs
init kernel
include
ipc
drivers
net
mm
lib
scripts
alpha
arm
i386
ia64
m68k
mips
mips64
ppc
s390
sh
sparc
sparc64
acorn
atm
block
cdrom
char
dio
fc4
i2c
i2o
ide
ieee1394
isdn
macintosh
misc
net
…
adfs
affs
autofs
autofs4
bfs
code
cramfs
devfs
devpts
efs
ext2
fat
hfs
hpfs
…
asm-alpha
asm-arm
asm-generic
asm-i386
asm-ia64
asm-m68k
asm-mips
asm-mips64
linux
math-emu
net
pcmcia
scsi
video …
adfs
affs
autofs
autofs4
bfs
code
cramfs
devfs
devpts
efs
ext2
fat
hfs
hpfs …
802
appletalk
atm
ax25
bridge
core
decnet
econet
ethernet
ipv4
ipv6
ipx
irda
khttpd
lapb
…
linux/arch
Subdirectories for each current port.
Each contains kernel, lib, mm, boot and other
directories whose contents override code stubs in
architecture independent code.
lib contains highly-optimized common utility routines
such as memcpy, checksums, etc.
arch as of 2.4:
alpha, arm, i386, ia64, m68k, mips, mips64.
ppc, s390, sh, sparc, sparc64.
linux/drivers
Largest amount of code in the kernel tree (~1.5M).
device, bus, platform and general directories.
drivers/char – n_tty.c is the default line discipline.
drivers/block – elevator.c, genhd.c, linear.c, ll_rw_blk.c, raidN.c.
drivers/net –specific drivers and general routines Space.c and net_init.c.
drivers/scsi – scsi_*.c files are generic; sd.c (disk), sr.c (CD-ROM), st.c (tape),
sg.c (generic).
General:
cdrom, ide, isdn, parport, pcmcia, pnp, sound, telephony, video.
Buses – fc4, i2c, nubus, pci, sbus, tc, usb.
Platforms – acorn, macintosh, s390, sgi.
linux/fs
Contains:
virtual filesystem (VFS) framework.
subdirectories for actual filesystems.
vfs-related files:
exec.c, binfmt_*.c - files for mapping new process images.
devices.c, blk_dev.c – device registration, block device support.
super.c, filesystems.c.
inode.c, dcache.c, namei.c, buffer.c, file_table.c.
open.c, read_write.c, select.c, pipe.c, fifo.c.
fcntl.c, ioctl.c, locks.c, dquot.c, stat.c.
linux/include
include/asm-*:
Architecture-dependent include subdirectories.
include/linux:
Header info needed both by the kernel and user apps.
Usually linked to /usr/include/linux.
Kernel-only portions guarded by #ifdefs
#ifdef __KERNEL__
/* kernel stuff */
#endif
Other directories:
math-emu, net, pcmcia, scsi, video.
linux/init
Just two files: version.c, main.c.
version.c – contains the version banner that prints at boot.
main.c – architecture-independent boot code.
start_kernel is the primary entry point.
linux/ipc
System V IPC facilities.
If disabled at compile-time, util.c exports stubs that simply return –ENOSYS.
One file for each facility:
sem.c – semaphores.
shm.c – shared memory.
msg.c – message queues.
linux/kernel
The core kernel code.
sched.c – “the main kernel file”:
scheduler, wait queues, timers, alarms, task queues.
Process control:
fork.c, exec.c, signal.c, exit.c etc…
Kernel module support:
kmod.c, ksyms.c, module.c.
Other operations:
time.c, resource.c, dma.c, softirq.c, itimer.c.
printk.c, info.c, panic.c, sysctl.c, sys.c.
linux/lib
kernel code cannot call standard C library routines.
Files:
brlock.c – “Big Reader” spinlocks.
cmdline.c – kernel command line parsing routines.
errno.c – global definition of errno.
inflate.c – “gunzip” part of gzip.c used during boot.
string.c – portable string code.
Usually replaced by optimized, architecture-dependent routines.
vsprintf.c – libc replacement.
linux/mm
Paging and swapping:
swap.c, swapfile.c (paging devices), swap_state.c (cache).
vmscan.c – paging policies, kswapd.
page_io.c – low-level page transfer.
Allocation and deallocation:
slab.c – slab allocator.
page_alloc.c – page-based allocator.
vmalloc.c – kernel virtual-memory allocator.
Memory mapping:
memory.c – paging, fault-handling, page table code.
filemap.c – file mapping.
mmap.c, mremap.c, mlock.c, mprotect.c.
linux/scripts
Scripts for:
Menu-based kernel configuration.
Kernel patching.
Generating kernel documentation.
Embedded
Linux
What are embedded
systems?
• Embedded systems are self contained intelligent electronic
control systems.
• They contain a microcontroller / microprocessor and
peripherals interfaced to perform a particular series of tasks.
• Embedded systems today run almost every electronic device
imaginable from TV’s to washing machine.
• Embedded systems also can be used for self-contained
intelligent automated systems.
Simple Embedded
Example
• An AVR microcontroller. Atmega328.
• Contains all hardware necessary to perform computational tasks
onboard provided power is given to it.
• Communicates with the outside world via gpio pins.
• Can be used to read data from a sensor connected to it and analyze
that. (e.g.: IR
• Can be interfaces to motors and set to control the movement of the
motors depending on the sensor input.
• Then, the microcontroller can be put on-board a bot and be asked
to
perform line following!
Programming simple
MC’s
• Microcontrollers are defined by their architecture and bus bit
width.
• The atmega is an 8 bit AVR series microcontroller.
• To program the atmega we need
• A Compiler to compile C code for the atmega328
• A Flash/EPROM burning device
• The cross compiler convers our code from C to the hex op
code that can be placed in the atmega’s internal memory.
• The atmega executes each instruction sequentially!
Hardware
available
• Hardware manufactures keep increasing complexity and
system performance.
• The higher processing power comes with the price of too
much registers with individual internal controlling
methodology
• Hardware manufacturers needed to abstract their hardware to
be able to support easier development.
• Software developers needed a generalized framework where
they cab build their applications without worrying about their
hardware.
Hardware v/s
software
• Objective : Getting your code to sense / control external devices.
• The more complex your hardware is, the more requirements it will have
in respect to code to write control mechanism.
• If a stand-alone application is required to be developed
• Multiple (internal / external) devices have to be managed in the background
• I/O of different devices must be managed and processed as per demand.
• Interrupts / clocks / power must be managed to keep the microcontroller
running.
• This calls for increased debugging / non portability and results in
increased development time / bugs in the system.
• If hardware is as complicated and powerful as a computer (SBC) then we
need code comparable to that of an Operating System (DOS) to be able
to run it!!
Line between HW/
SW
• Very few processors can be programmed by flash burning with
ICSP. (e.g: ARM5)
• Modern communication standards are replacing “legacy”
RS- 232 with USB, I2C ,Ethernet etc.
• The software control of these protocols in the Atmega register
level way is too complex.
• Harware manufacturers release “Drivers” or libraries for
controlling their hardware to software developers which
allows for more efficient usage of the underlying hardware.
Lect 1_Embedded Linux Embedded RTOS  ppt
Embedded
Linux
Hardware
• Processor
• RAM
• GPIO
• Clocks
• UART
• I2C
Kernel
• Kernel
developers
work on
hardware
control of
the devices.
Userland
• This is
where user
level
application
programs
are written.
Embedded
Linux
• In 1990s, an underground software movement consisting of the
worlds leading developers and programmers wrote a completely
free Operating System!
• As more people used it with the FOSS philosophy, improvements,
fixes and support for multiple processors creeped in!
• This resulted in Linux (the very same kernel ) to run on many
processors and provide a similar level of functionality.
• A Global collaborative effort for improvements and upgrades
make
linux so popular with hardware developers
• Most of the time, linux gets fixes and support for new hardware as
soon as they are available!
Linux -> Embedded
Linux
• Linux for x86 and amd64 (desktop architectures) require
almost 100 - 500mb.
• Embedded Devices have more strict requirements in terms of
memory and processing power.
• Embedded Linux kernels can go as low of 11Mb when placed
in RAM.
• A non distribtion based linux – with only kernel and a minimal
filesystem for a “dos” – like usage is usually run.
• Any custom linux libraries for hardware / software can be
installed to help with application development.
Starting the
Hardware
• When the hardware is switched on, the OS is present in some
onboard memory peripheral.
• First there is code called a bootloader that initializes all the
required hardware on the board.
• Bootloaders are small programs (4 – 16K) written for and
compiled for specific hardware to be executed immediately
after start.
• The bootloader starts the board and loads the kernel from
where-ever it is into RAM.
• Once the Kernel starts executing from RAM, it takes over and
starts a linux session!
Types of
Bootloaders
• Intel Motherboard : PHOENIX BIOS :
• This bootloader is present on most intel based laptops.
• It starts the laptop hardware and loads “NTLDR” the
windows bootmanager.
• This code is hardwired into the mother board.
• Embedded Hardware
• Bootloader is usually places in a NAND Flash memory.
• Bootloaders are very small.
• They load, uncompress the linux kernel and relenquish
control..
Kerne
l• Designed as a Finnish UG (B.tech eq) student’s hobby project.
• First was made as a UNIC port for a motorola 64Kb machine that
made Linux designed for Portability.
• The groundwork and FOSS nature allowed the kernel to be ported to
(and thus support) almost every hardware platform on/off the
market.
• The base for extending the kernel through “Device Drivers” have
hardware manufactures / driver developers to release support for
any hardware available.
• Kernel is just a runtime HAL! It just has instructions for running the
hardware – something has to give it instructions -> RootFS..
Linux system Design DevelopmentLayers
Filesystem
(UserLand)
• Filesystem : Collection of directories
• These directories follow a tree heirarchy and contain
• Executable files or programs that the kernel loads into memory
• Libraries for application to link to at run-time
• User Application that can be simply installed onto it
• Setting files that control the Linux OS’s behaviour.
• Hardware devices are also linked as special file nodes in the
filesystem to connect them to the Kernel’s HAL.
• USB drives / HDDs / SD cards are mounted onto the filesystem
and can be browsed as usual.
Lect 1_Embedded Linux Embedded RTOS  ppt
Cross Compilers and Toolchains
• Different Hardware – Same Source code?
• Cross Compilers are called the translators to machine language for
different architectures.
• Hardware manufactures and developers develop a toolchain for
their architectures.
• The toolchain contain all the utilities required to compile, debug
code and link for the processor.
• There is a GNU toolchain for AVR and ARM architectures.
• The same source code when used with different cross compilers
allow for targeting different platforms.
• The changes in code required for a particular hardware is managed
with localised “patches”.
Application
s
• Headless units : Devices without the need for a graphical display
• Routers
• Set Top Box
• GUI based Applications
• Touch Smartphones
• GPS car navigation multimedia systems.
• Application developers have:
• System level functionality if required
• Shared libraries for efficient management of resources
• Linux kernel provided complete HAL
• Same code workable of various devices
• Android is a Linux Kernel and FS example!
• Android will run on any phone that linux can work in.
• Phone developers have a unified Free OS to work with.
• Cheaper and more wide variety of applications!
Driver
s
• Run time modules attached to the linux kernel to manage hardware
peripherals
• USB Wifi
• Camera
• GPS
• Unified driver API that makes it easy to write Driver Code that
integrated to the main Kernel.
• Hardware that is accepted to the main repository (upstream) means
that everybody has access to the driver for that hardware!
• Linux drivers need not be released as source – which means
hardware manufactures can release their driver in binary format.
(becomes proprietary)
Librarie
s
• C library
• Provides an interface to the kenel functions via calls from
userland.
• Stripped down minimal C libraries are there for use in
embedded devices.
• GlibC (Full Featured)
• uCibC (Minimal Variant)
• POSIX support
• Allows for communication job sceduling,
multiprocessing and IPC
in a unified framework.
• ALSA
• Advanced Linux Sound Architecture for Hardware DSP
support
Custom
Applications
• Compiled with appropriate cross-compiler as UNIX / POSIX
Compliant applications
• BusyBox
• Provides an embedded shell functionality in embedded
devices
• cd ls mkdir echo cat and all standard linux commands all work
• I/O can be managed over a serial line
• Can be thought of as a terminal equivalent
• Commands allow for direct control of the kernel
• Helps navigate the filesystem
• Qt GUI applications can also be built if LCD is present.
Run Time
Linux
• Serial Console
• Apps that can be autostarted
• Daemons or “services” that provide background
application functionality
• Kernel Threads for Real-Time interrupt management
• RTOS supprt in RT-Linux Project.
Memory
Considerations
• Linux works primarily on processors with a hardware MMU.
(memory management unit)
• MMU enforces copy and access violation protection in RAM
between kernel, hardware and user application to make sure
system can be kept stable at all times.
• Virtual Memory allows for run-time linking and delinking of un
responsive kernel modules / application to keep the system
functioning even in the event of a crash.
Try for
yourself
• devmem2
• Memory inspector
• ps
• Running processors
• cat files in /proc
• Gives you current system information
Open source
Licenses
• Basic funda
• Us at your own Risk
• No guarantee
• We’ll help if we CAN. We don’t need to.
• GPLv2
• GNU Public Licence
• Source must accompany binary
• Linkng to non GPL software not possible.
• LGPL
• Link to non GPL software possible
• To provide for non open source driver development
• LGPL source must be provided
• Modified Free-BSD
• No source delivery required
• For proprietary kernels
• Broken and non FOSS supported Forks
Ad

More Related Content

Similar to Lect 1_Embedded Linux Embedded RTOS ppt (20)

Introduction to Embedded System
Introduction to Embedded SystemIntroduction to Embedded System
Introduction to Embedded System
Zakaria Gomaa
 
esunit1.pptx
esunit1.pptxesunit1.pptx
esunit1.pptx
AmitKumar7572
 
Mces MOD 1.pptx
Mces MOD 1.pptxMces MOD 1.pptx
Mces MOD 1.pptx
RadhaC10
 
unitios-22112405585Operational 3-5fc1b7da.pptx
unitios-22112405585Operational 3-5fc1b7da.pptxunitios-22112405585Operational 3-5fc1b7da.pptx
unitios-22112405585Operational 3-5fc1b7da.pptx
RAJESH S
 
F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded SystemsF9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
National Cheng Kung University
 
Introduction to embedded linux device driver and firmware
Introduction to embedded linux device driver and firmwareIntroduction to embedded linux device driver and firmware
Introduction to embedded linux device driver and firmware
definecareer
 
CSC204PPTNOTES
CSC204PPTNOTESCSC204PPTNOTES
CSC204PPTNOTES
Gilbert NZABONITEGEKA
 
Unit I _COMPUTER ORGANISATON AND ARCHITECTURE_PPT.pptx
Unit I _COMPUTER ORGANISATON AND ARCHITECTURE_PPT.pptxUnit I _COMPUTER ORGANISATON AND ARCHITECTURE_PPT.pptx
Unit I _COMPUTER ORGANISATON AND ARCHITECTURE_PPT.pptx
snehapriya84
 
Unit I _Computer organisation andarchitecture
Unit I _Computer organisation andarchitectureUnit I _Computer organisation andarchitecture
Unit I _Computer organisation andarchitecture
figeman282
 
Linux Device Driver,LDD,
Linux Device Driver,LDD,Linux Device Driver,LDD,
Linux Device Driver,LDD,
Rahul Batra
 
linux device driver
linux device driverlinux device driver
linux device driver
Rahul Batra
 
Platform-Technology.pdf
Platform-Technology.pdfPlatform-Technology.pdf
Platform-Technology.pdf
FranzLawrenzDeTorres1
 
Os concepts
Os conceptsOs concepts
Os concepts
John Carlo Catacutan
 
Building Embedded Linux Systems Introduction
Building Embedded Linux Systems IntroductionBuilding Embedded Linux Systems Introduction
Building Embedded Linux Systems Introduction
Sherif Mousa
 
Walking around linux kernel
Walking around linux kernelWalking around linux kernel
Walking around linux kernel
Dharshana Kasun Warusavitharana
 
Organization of modern digital computers
Organization of modern digital computersOrganization of modern digital computers
Organization of modern digital computers
DrRamaPrasathAssista
 
Operating system Virtualization_NEW.pptx
Operating system Virtualization_NEW.pptxOperating system Virtualization_NEW.pptx
Operating system Virtualization_NEW.pptx
Senthil Vit
 
Chap1
Chap1Chap1
Chap1
adisi
 
fundamentals_IT_presentation computer peripherals basics
fundamentals_IT_presentation computer peripherals  basicsfundamentals_IT_presentation computer peripherals  basics
fundamentals_IT_presentation computer peripherals basics
Sachin Darekar
 
Device Drivers and Running Modules
Device Drivers and Running ModulesDevice Drivers and Running Modules
Device Drivers and Running Modules
YourHelper1
 
Introduction to Embedded System
Introduction to Embedded SystemIntroduction to Embedded System
Introduction to Embedded System
Zakaria Gomaa
 
Mces MOD 1.pptx
Mces MOD 1.pptxMces MOD 1.pptx
Mces MOD 1.pptx
RadhaC10
 
unitios-22112405585Operational 3-5fc1b7da.pptx
unitios-22112405585Operational 3-5fc1b7da.pptxunitios-22112405585Operational 3-5fc1b7da.pptx
unitios-22112405585Operational 3-5fc1b7da.pptx
RAJESH S
 
F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded SystemsF9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
National Cheng Kung University
 
Introduction to embedded linux device driver and firmware
Introduction to embedded linux device driver and firmwareIntroduction to embedded linux device driver and firmware
Introduction to embedded linux device driver and firmware
definecareer
 
Unit I _COMPUTER ORGANISATON AND ARCHITECTURE_PPT.pptx
Unit I _COMPUTER ORGANISATON AND ARCHITECTURE_PPT.pptxUnit I _COMPUTER ORGANISATON AND ARCHITECTURE_PPT.pptx
Unit I _COMPUTER ORGANISATON AND ARCHITECTURE_PPT.pptx
snehapriya84
 
Unit I _Computer organisation andarchitecture
Unit I _Computer organisation andarchitectureUnit I _Computer organisation andarchitecture
Unit I _Computer organisation andarchitecture
figeman282
 
Linux Device Driver,LDD,
Linux Device Driver,LDD,Linux Device Driver,LDD,
Linux Device Driver,LDD,
Rahul Batra
 
linux device driver
linux device driverlinux device driver
linux device driver
Rahul Batra
 
Building Embedded Linux Systems Introduction
Building Embedded Linux Systems IntroductionBuilding Embedded Linux Systems Introduction
Building Embedded Linux Systems Introduction
Sherif Mousa
 
Organization of modern digital computers
Organization of modern digital computersOrganization of modern digital computers
Organization of modern digital computers
DrRamaPrasathAssista
 
Operating system Virtualization_NEW.pptx
Operating system Virtualization_NEW.pptxOperating system Virtualization_NEW.pptx
Operating system Virtualization_NEW.pptx
Senthil Vit
 
Chap1
Chap1Chap1
Chap1
adisi
 
fundamentals_IT_presentation computer peripherals basics
fundamentals_IT_presentation computer peripherals  basicsfundamentals_IT_presentation computer peripherals  basics
fundamentals_IT_presentation computer peripherals basics
Sachin Darekar
 
Device Drivers and Running Modules
Device Drivers and Running ModulesDevice Drivers and Running Modules
Device Drivers and Running Modules
YourHelper1
 

More from Varsha506533 (20)

Controllability and observability notes for pg
Controllability and observability notes for pgControllability and observability notes for pg
Controllability and observability notes for pg
Varsha506533
 
Unit 2 Lect 2 preprocessing for sensor interfacing
Unit 2 Lect  2 preprocessing for sensor interfacingUnit 2 Lect  2 preprocessing for sensor interfacing
Unit 2 Lect 2 preprocessing for sensor interfacing
Varsha506533
 
Lect 2 Design approaches in Operating System.pptx
Lect 2 Design approaches in  Operating System.pptxLect 2 Design approaches in  Operating System.pptx
Lect 2 Design approaches in Operating System.pptx
Varsha506533
 
design metrics for embedded systems and rtos
design metrics for embedded systems and rtosdesign metrics for embedded systems and rtos
design metrics for embedded systems and rtos
Varsha506533
 
L1 and L3 _uCOS Task and scheduler concepts
L1 and L3 _uCOS Task and scheduler conceptsL1 and L3 _uCOS Task and scheduler concepts
L1 and L3 _uCOS Task and scheduler concepts
Varsha506533
 
ucos-2 introduction and characteristics
ucos-2   introduction and characteristicsucos-2   introduction and characteristics
ucos-2 introduction and characteristics
Varsha506533
 
Processor Design Flow architecture design
Processor Design Flow architecture designProcessor Design Flow architecture design
Processor Design Flow architecture design
Varsha506533
 
Processor Design Flow for architecture design
Processor Design Flow for architecture designProcessor Design Flow for architecture design
Processor Design Flow for architecture design
Varsha506533
 
Processor Design Flow for architecture design
Processor Design Flow for architecture designProcessor Design Flow for architecture design
Processor Design Flow for architecture design
Varsha506533
 
Lecture Notes in Design for Testability _Test Economics.ppt
Lecture Notes in Design for Testability _Test Economics.pptLecture Notes in Design for Testability _Test Economics.ppt
Lecture Notes in Design for Testability _Test Economics.ppt
Varsha506533
 
Memory organization in processor architecture
Memory organization in processor architectureMemory organization in processor architecture
Memory organization in processor architecture
Varsha506533
 
VLSI Testing : Logic Simulation Part 1.pptx
VLSI Testing : Logic Simulation Part 1.pptxVLSI Testing : Logic Simulation Part 1.pptx
VLSI Testing : Logic Simulation Part 1.pptx
Varsha506533
 
Lect3_ customizable.pptx
Lect3_ customizable.pptxLect3_ customizable.pptx
Lect3_ customizable.pptx
Varsha506533
 
Lect3.pptx
Lect3.pptxLect3.pptx
Lect3.pptx
Varsha506533
 
Lect1_ DSP.pptx
Lect1_ DSP.pptxLect1_ DSP.pptx
Lect1_ DSP.pptx
Varsha506533
 
Lect1a_ basics of DSP.pptx
Lect1a_ basics of DSP.pptxLect1a_ basics of DSP.pptx
Lect1a_ basics of DSP.pptx
Varsha506533
 
Lect4_ customizable.pptx
Lect4_ customizable.pptxLect4_ customizable.pptx
Lect4_ customizable.pptx
Varsha506533
 
IO.ppt
IO.pptIO.ppt
IO.ppt
Varsha506533
 
Lect 2a Direct Current Motor Drives.pptx
Lect 2a Direct Current Motor Drives.pptxLect 2a Direct Current Motor Drives.pptx
Lect 2a Direct Current Motor Drives.pptx
Varsha506533
 
Lecture 1b Selection of Motor Rating.pptx
Lecture 1b Selection of Motor Rating.pptxLecture 1b Selection of Motor Rating.pptx
Lecture 1b Selection of Motor Rating.pptx
Varsha506533
 
Controllability and observability notes for pg
Controllability and observability notes for pgControllability and observability notes for pg
Controllability and observability notes for pg
Varsha506533
 
Unit 2 Lect 2 preprocessing for sensor interfacing
Unit 2 Lect  2 preprocessing for sensor interfacingUnit 2 Lect  2 preprocessing for sensor interfacing
Unit 2 Lect 2 preprocessing for sensor interfacing
Varsha506533
 
Lect 2 Design approaches in Operating System.pptx
Lect 2 Design approaches in  Operating System.pptxLect 2 Design approaches in  Operating System.pptx
Lect 2 Design approaches in Operating System.pptx
Varsha506533
 
design metrics for embedded systems and rtos
design metrics for embedded systems and rtosdesign metrics for embedded systems and rtos
design metrics for embedded systems and rtos
Varsha506533
 
L1 and L3 _uCOS Task and scheduler concepts
L1 and L3 _uCOS Task and scheduler conceptsL1 and L3 _uCOS Task and scheduler concepts
L1 and L3 _uCOS Task and scheduler concepts
Varsha506533
 
ucos-2 introduction and characteristics
ucos-2   introduction and characteristicsucos-2   introduction and characteristics
ucos-2 introduction and characteristics
Varsha506533
 
Processor Design Flow architecture design
Processor Design Flow architecture designProcessor Design Flow architecture design
Processor Design Flow architecture design
Varsha506533
 
Processor Design Flow for architecture design
Processor Design Flow for architecture designProcessor Design Flow for architecture design
Processor Design Flow for architecture design
Varsha506533
 
Processor Design Flow for architecture design
Processor Design Flow for architecture designProcessor Design Flow for architecture design
Processor Design Flow for architecture design
Varsha506533
 
Lecture Notes in Design for Testability _Test Economics.ppt
Lecture Notes in Design for Testability _Test Economics.pptLecture Notes in Design for Testability _Test Economics.ppt
Lecture Notes in Design for Testability _Test Economics.ppt
Varsha506533
 
Memory organization in processor architecture
Memory organization in processor architectureMemory organization in processor architecture
Memory organization in processor architecture
Varsha506533
 
VLSI Testing : Logic Simulation Part 1.pptx
VLSI Testing : Logic Simulation Part 1.pptxVLSI Testing : Logic Simulation Part 1.pptx
VLSI Testing : Logic Simulation Part 1.pptx
Varsha506533
 
Lect3_ customizable.pptx
Lect3_ customizable.pptxLect3_ customizable.pptx
Lect3_ customizable.pptx
Varsha506533
 
Lect1a_ basics of DSP.pptx
Lect1a_ basics of DSP.pptxLect1a_ basics of DSP.pptx
Lect1a_ basics of DSP.pptx
Varsha506533
 
Lect4_ customizable.pptx
Lect4_ customizable.pptxLect4_ customizable.pptx
Lect4_ customizable.pptx
Varsha506533
 
Lect 2a Direct Current Motor Drives.pptx
Lect 2a Direct Current Motor Drives.pptxLect 2a Direct Current Motor Drives.pptx
Lect 2a Direct Current Motor Drives.pptx
Varsha506533
 
Lecture 1b Selection of Motor Rating.pptx
Lecture 1b Selection of Motor Rating.pptxLecture 1b Selection of Motor Rating.pptx
Lecture 1b Selection of Motor Rating.pptx
Varsha506533
 
Ad

Recently uploaded (20)

Introduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptxIntroduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptx
AS1920
 
Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
Smart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptxSmart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptx
rushikeshnavghare94
 
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design ThinkingDT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DhruvChotaliya2
 
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdfRICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
MohamedAbdelkader115
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
DSP and MV the Color image processing.ppt
DSP and MV the  Color image processing.pptDSP and MV the  Color image processing.ppt
DSP and MV the Color image processing.ppt
HafizAhamed8
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptxExplainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
MahaveerVPandit
 
Compiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptxCompiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptx
RushaliDeshmukh2
 
π0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalizationπ0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalization
NABLAS株式会社
 
Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 
The Gaussian Process Modeling Module in UQLab
The Gaussian Process Modeling Module in UQLabThe Gaussian Process Modeling Module in UQLab
The Gaussian Process Modeling Module in UQLab
Journal of Soft Computing in Civil Engineering
 
theory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptxtheory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptx
sanchezvanessa7896
 
15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...
IJCSES Journal
 
Compiler Design Unit1 PPT Phases of Compiler.pptx
Compiler Design Unit1 PPT Phases of Compiler.pptxCompiler Design Unit1 PPT Phases of Compiler.pptx
Compiler Design Unit1 PPT Phases of Compiler.pptx
RushaliDeshmukh2
 
Oil-gas_Unconventional oil and gass_reseviours.pdf
Oil-gas_Unconventional oil and gass_reseviours.pdfOil-gas_Unconventional oil and gass_reseviours.pdf
Oil-gas_Unconventional oil and gass_reseviours.pdf
M7md3li2
 
Reagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptxReagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptx
AlejandroOdio
 
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
inmishra17121973
 
Introduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptxIntroduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptx
AS1920
 
Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
Smart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptxSmart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptx
rushikeshnavghare94
 
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design ThinkingDT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DhruvChotaliya2
 
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdfRICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
MohamedAbdelkader115
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
DSP and MV the Color image processing.ppt
DSP and MV the  Color image processing.pptDSP and MV the  Color image processing.ppt
DSP and MV the Color image processing.ppt
HafizAhamed8
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptxExplainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
MahaveerVPandit
 
Compiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptxCompiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptx
RushaliDeshmukh2
 
π0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalizationπ0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalization
NABLAS株式会社
 
Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 
theory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptxtheory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptx
sanchezvanessa7896
 
15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...
IJCSES Journal
 
Compiler Design Unit1 PPT Phases of Compiler.pptx
Compiler Design Unit1 PPT Phases of Compiler.pptxCompiler Design Unit1 PPT Phases of Compiler.pptx
Compiler Design Unit1 PPT Phases of Compiler.pptx
RushaliDeshmukh2
 
Oil-gas_Unconventional oil and gass_reseviours.pdf
Oil-gas_Unconventional oil and gass_reseviours.pdfOil-gas_Unconventional oil and gass_reseviours.pdf
Oil-gas_Unconventional oil and gass_reseviours.pdf
M7md3li2
 
Reagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptxReagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptx
AlejandroOdio
 
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
inmishra17121973
 
Ad

Lect 1_Embedded Linux Embedded RTOS ppt

  • 2. 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.
  • 3. What’s a Kernel? AKA: executive, system monitor. 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). Etc…etc…
  • 4. 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.
  • 5. Kernel Architecture Applications System Libraries (libc) System Call Interface Hardware Architecture-Dependent Code I/O Related Process Related Scheduler Memory Management IPC File Systems Networking Device Drivers Modules
  • 7. Linux Source Tree Layout /usr/src/linux Documentation arch fs init kernel include ipc drivers net mm lib scripts alpha arm i386 ia64 m68k mips mips64 ppc s390 sh sparc sparc64 acorn atm block cdrom char dio fc4 i2c i2o ide ieee1394 isdn macintosh misc net … adfs affs autofs autofs4 bfs code cramfs devfs devpts efs ext2 fat hfs hpfs … asm-alpha asm-arm asm-generic asm-i386 asm-ia64 asm-m68k asm-mips asm-mips64 linux math-emu net pcmcia scsi video … adfs affs autofs autofs4 bfs code cramfs devfs devpts efs ext2 fat hfs hpfs … 802 appletalk atm ax25 bridge core decnet econet ethernet ipv4 ipv6 ipx irda khttpd lapb …
  • 8. linux/arch Subdirectories for each current port. Each contains kernel, lib, mm, boot and other directories whose contents override code stubs in architecture independent code. lib contains highly-optimized common utility routines such as memcpy, checksums, etc. arch as of 2.4: alpha, arm, i386, ia64, m68k, mips, mips64. ppc, s390, sh, sparc, sparc64.
  • 9. linux/drivers Largest amount of code in the kernel tree (~1.5M). device, bus, platform and general directories. drivers/char – n_tty.c is the default line discipline. drivers/block – elevator.c, genhd.c, linear.c, ll_rw_blk.c, raidN.c. drivers/net –specific drivers and general routines Space.c and net_init.c. drivers/scsi – scsi_*.c files are generic; sd.c (disk), sr.c (CD-ROM), st.c (tape), sg.c (generic). General: cdrom, ide, isdn, parport, pcmcia, pnp, sound, telephony, video. Buses – fc4, i2c, nubus, pci, sbus, tc, usb. Platforms – acorn, macintosh, s390, sgi.
  • 10. linux/fs Contains: virtual filesystem (VFS) framework. subdirectories for actual filesystems. vfs-related files: exec.c, binfmt_*.c - files for mapping new process images. devices.c, blk_dev.c – device registration, block device support. super.c, filesystems.c. inode.c, dcache.c, namei.c, buffer.c, file_table.c. open.c, read_write.c, select.c, pipe.c, fifo.c. fcntl.c, ioctl.c, locks.c, dquot.c, stat.c.
  • 11. linux/include include/asm-*: Architecture-dependent include subdirectories. include/linux: Header info needed both by the kernel and user apps. Usually linked to /usr/include/linux. Kernel-only portions guarded by #ifdefs #ifdef __KERNEL__ /* kernel stuff */ #endif Other directories: math-emu, net, pcmcia, scsi, video.
  • 12. linux/init Just two files: version.c, main.c. version.c – contains the version banner that prints at boot. main.c – architecture-independent boot code. start_kernel is the primary entry point.
  • 13. linux/ipc System V IPC facilities. If disabled at compile-time, util.c exports stubs that simply return –ENOSYS. One file for each facility: sem.c – semaphores. shm.c – shared memory. msg.c – message queues.
  • 14. linux/kernel The core kernel code. sched.c – “the main kernel file”: scheduler, wait queues, timers, alarms, task queues. Process control: fork.c, exec.c, signal.c, exit.c etc… Kernel module support: kmod.c, ksyms.c, module.c. Other operations: time.c, resource.c, dma.c, softirq.c, itimer.c. printk.c, info.c, panic.c, sysctl.c, sys.c.
  • 15. linux/lib kernel code cannot call standard C library routines. Files: brlock.c – “Big Reader” spinlocks. cmdline.c – kernel command line parsing routines. errno.c – global definition of errno. inflate.c – “gunzip” part of gzip.c used during boot. string.c – portable string code. Usually replaced by optimized, architecture-dependent routines. vsprintf.c – libc replacement.
  • 16. linux/mm Paging and swapping: swap.c, swapfile.c (paging devices), swap_state.c (cache). vmscan.c – paging policies, kswapd. page_io.c – low-level page transfer. Allocation and deallocation: slab.c – slab allocator. page_alloc.c – page-based allocator. vmalloc.c – kernel virtual-memory allocator. Memory mapping: memory.c – paging, fault-handling, page table code. filemap.c – file mapping. mmap.c, mremap.c, mlock.c, mprotect.c.
  • 17. linux/scripts Scripts for: Menu-based kernel configuration. Kernel patching. Generating kernel documentation.
  • 19. What are embedded systems? • Embedded systems are self contained intelligent electronic control systems. • They contain a microcontroller / microprocessor and peripherals interfaced to perform a particular series of tasks. • Embedded systems today run almost every electronic device imaginable from TV’s to washing machine. • Embedded systems also can be used for self-contained intelligent automated systems.
  • 20. Simple Embedded Example • An AVR microcontroller. Atmega328. • Contains all hardware necessary to perform computational tasks onboard provided power is given to it. • Communicates with the outside world via gpio pins. • Can be used to read data from a sensor connected to it and analyze that. (e.g.: IR • Can be interfaces to motors and set to control the movement of the motors depending on the sensor input. • Then, the microcontroller can be put on-board a bot and be asked to perform line following!
  • 21. Programming simple MC’s • Microcontrollers are defined by their architecture and bus bit width. • The atmega is an 8 bit AVR series microcontroller. • To program the atmega we need • A Compiler to compile C code for the atmega328 • A Flash/EPROM burning device • The cross compiler convers our code from C to the hex op code that can be placed in the atmega’s internal memory. • The atmega executes each instruction sequentially!
  • 22. Hardware available • Hardware manufactures keep increasing complexity and system performance. • The higher processing power comes with the price of too much registers with individual internal controlling methodology • Hardware manufacturers needed to abstract their hardware to be able to support easier development. • Software developers needed a generalized framework where they cab build their applications without worrying about their hardware.
  • 23. Hardware v/s software • Objective : Getting your code to sense / control external devices. • The more complex your hardware is, the more requirements it will have in respect to code to write control mechanism. • If a stand-alone application is required to be developed • Multiple (internal / external) devices have to be managed in the background • I/O of different devices must be managed and processed as per demand. • Interrupts / clocks / power must be managed to keep the microcontroller running. • This calls for increased debugging / non portability and results in increased development time / bugs in the system. • If hardware is as complicated and powerful as a computer (SBC) then we need code comparable to that of an Operating System (DOS) to be able to run it!!
  • 24. Line between HW/ SW • Very few processors can be programmed by flash burning with ICSP. (e.g: ARM5) • Modern communication standards are replacing “legacy” RS- 232 with USB, I2C ,Ethernet etc. • The software control of these protocols in the Atmega register level way is too complex. • Harware manufacturers release “Drivers” or libraries for controlling their hardware to software developers which allows for more efficient usage of the underlying hardware.
  • 26. Embedded Linux Hardware • Processor • RAM • GPIO • Clocks • UART • I2C Kernel • Kernel developers work on hardware control of the devices. Userland • This is where user level application programs are written.
  • 27. Embedded Linux • In 1990s, an underground software movement consisting of the worlds leading developers and programmers wrote a completely free Operating System! • As more people used it with the FOSS philosophy, improvements, fixes and support for multiple processors creeped in! • This resulted in Linux (the very same kernel ) to run on many processors and provide a similar level of functionality. • A Global collaborative effort for improvements and upgrades make linux so popular with hardware developers • Most of the time, linux gets fixes and support for new hardware as soon as they are available!
  • 28. Linux -> Embedded Linux • Linux for x86 and amd64 (desktop architectures) require almost 100 - 500mb. • Embedded Devices have more strict requirements in terms of memory and processing power. • Embedded Linux kernels can go as low of 11Mb when placed in RAM. • A non distribtion based linux – with only kernel and a minimal filesystem for a “dos” – like usage is usually run. • Any custom linux libraries for hardware / software can be installed to help with application development.
  • 29. Starting the Hardware • When the hardware is switched on, the OS is present in some onboard memory peripheral. • First there is code called a bootloader that initializes all the required hardware on the board. • Bootloaders are small programs (4 – 16K) written for and compiled for specific hardware to be executed immediately after start. • The bootloader starts the board and loads the kernel from where-ever it is into RAM. • Once the Kernel starts executing from RAM, it takes over and starts a linux session!
  • 30. Types of Bootloaders • Intel Motherboard : PHOENIX BIOS : • This bootloader is present on most intel based laptops. • It starts the laptop hardware and loads “NTLDR” the windows bootmanager. • This code is hardwired into the mother board. • Embedded Hardware • Bootloader is usually places in a NAND Flash memory. • Bootloaders are very small. • They load, uncompress the linux kernel and relenquish control..
  • 31. Kerne l• Designed as a Finnish UG (B.tech eq) student’s hobby project. • First was made as a UNIC port for a motorola 64Kb machine that made Linux designed for Portability. • The groundwork and FOSS nature allowed the kernel to be ported to (and thus support) almost every hardware platform on/off the market. • The base for extending the kernel through “Device Drivers” have hardware manufactures / driver developers to release support for any hardware available. • Kernel is just a runtime HAL! It just has instructions for running the hardware – something has to give it instructions -> RootFS..
  • 32. Linux system Design DevelopmentLayers
  • 33. Filesystem (UserLand) • Filesystem : Collection of directories • These directories follow a tree heirarchy and contain • Executable files or programs that the kernel loads into memory • Libraries for application to link to at run-time • User Application that can be simply installed onto it • Setting files that control the Linux OS’s behaviour. • Hardware devices are also linked as special file nodes in the filesystem to connect them to the Kernel’s HAL. • USB drives / HDDs / SD cards are mounted onto the filesystem and can be browsed as usual.
  • 35. Cross Compilers and Toolchains • Different Hardware – Same Source code? • Cross Compilers are called the translators to machine language for different architectures. • Hardware manufactures and developers develop a toolchain for their architectures. • The toolchain contain all the utilities required to compile, debug code and link for the processor. • There is a GNU toolchain for AVR and ARM architectures. • The same source code when used with different cross compilers allow for targeting different platforms. • The changes in code required for a particular hardware is managed with localised “patches”.
  • 36. Application s • Headless units : Devices without the need for a graphical display • Routers • Set Top Box • GUI based Applications • Touch Smartphones • GPS car navigation multimedia systems. • Application developers have: • System level functionality if required • Shared libraries for efficient management of resources • Linux kernel provided complete HAL • Same code workable of various devices • Android is a Linux Kernel and FS example! • Android will run on any phone that linux can work in. • Phone developers have a unified Free OS to work with. • Cheaper and more wide variety of applications!
  • 37. Driver s • Run time modules attached to the linux kernel to manage hardware peripherals • USB Wifi • Camera • GPS • Unified driver API that makes it easy to write Driver Code that integrated to the main Kernel. • Hardware that is accepted to the main repository (upstream) means that everybody has access to the driver for that hardware! • Linux drivers need not be released as source – which means hardware manufactures can release their driver in binary format. (becomes proprietary)
  • 38. Librarie s • C library • Provides an interface to the kenel functions via calls from userland. • Stripped down minimal C libraries are there for use in embedded devices. • GlibC (Full Featured) • uCibC (Minimal Variant) • POSIX support • Allows for communication job sceduling, multiprocessing and IPC in a unified framework. • ALSA • Advanced Linux Sound Architecture for Hardware DSP support
  • 39. Custom Applications • Compiled with appropriate cross-compiler as UNIX / POSIX Compliant applications • BusyBox • Provides an embedded shell functionality in embedded devices • cd ls mkdir echo cat and all standard linux commands all work • I/O can be managed over a serial line • Can be thought of as a terminal equivalent • Commands allow for direct control of the kernel • Helps navigate the filesystem • Qt GUI applications can also be built if LCD is present.
  • 40. Run Time Linux • Serial Console • Apps that can be autostarted • Daemons or “services” that provide background application functionality • Kernel Threads for Real-Time interrupt management • RTOS supprt in RT-Linux Project.
  • 41. Memory Considerations • Linux works primarily on processors with a hardware MMU. (memory management unit) • MMU enforces copy and access violation protection in RAM between kernel, hardware and user application to make sure system can be kept stable at all times. • Virtual Memory allows for run-time linking and delinking of un responsive kernel modules / application to keep the system functioning even in the event of a crash.
  • 42. Try for yourself • devmem2 • Memory inspector • ps • Running processors • cat files in /proc • Gives you current system information
  • 43. Open source Licenses • Basic funda • Us at your own Risk • No guarantee • We’ll help if we CAN. We don’t need to. • GPLv2 • GNU Public Licence • Source must accompany binary • Linkng to non GPL software not possible. • LGPL • Link to non GPL software possible • To provide for non open source driver development • LGPL source must be provided • Modified Free-BSD • No source delivery required • For proprietary kernels • Broken and non FOSS supported Forks

Editor's Notes

  • #5: Stephen Tweedie claims “All kernel code executes in a process context (except during startup)”. He also says that it is possible for an interrupt to occur during a context switch. So it is uncommon for there to be no user process mapped. The real problem is not knowing what process is mapped. Kernel mode, system context activities occurs asynchronously and may be entirely unrelated to the current process.