Linux Internals Training
5-day session

Overview
Understanding Virtual memory, Process concepts, IPC, File Systems EXT2
Understanding Shell programming
Understanding Boot process
Understanding cross compilation and installing Linux installation on
embedded hardware
Understanding developing application for embedded systems
Duration
Five days - 40 hours (8hours a day)
50% of lecture, 50% of practical labs.

Trainer
Audience
Professional Software developers
People supporting embedded and medium scale products.

Prerequisite
Knowledge of c programming
All examples are provided through c programming language.
Knowledge of c programming is required.
C training slides can browsed at
http://www.minhinc.com/training/c/advance-c-slides.php

Pdf document can be downloaded from
http://www.minhinc.com/training/advance-c-slides.pdf
Setup
Ubuntu 16.0x LTS
Raspberry Pi3
© www.minhinc.com
p1
Lecture
Lecture session will be course content presentation through the trainer.
Any source code example related to the topic will be demonstrated, it would
include executing the binaries. Complete lecture material can be downloaded from
http://www.minhinc.com/training/advance-li-slides.pdf
Labs
Lecture session will be course content presentation through the trainer.
Any source code example related to the topic will be demonstrated, it would
include executing the binaries.
Day 1 Morning

© www.MinhInc.com
p2
Day 1 Afternoon

     Lab
Day 2 Morning

Day 2 Afternoon

     Lab
Day 3 Morning

© www.MinhInc.com
p3
Day 3 Afternoon

     Lab
Day 4 Morning

© www.MinhInc.com
p4
Day 4 Afternoon

     Lab
Day 5 Morning

Day 5 Afternoon

     Lab
© www.MinhInc.com
p5
Linux Internals Essentials
Linux Internals Essenstials- Training Course
Minh, Inc.
DISCLAIMER

Text of this document is written in Bembo Std Otf(13 pt) font.

Code parts are written in Consolas (10 pts) font.

This training material is provided through Minh, Inc., B'lore, India
Pdf version of this document is available at http://www.minhinc.com/training/advance-li-slides.pdf
For suggestion(s) or complaint(s) write to us at sales@minhinc.com

Document modified on May-15-2021 

Document contains 97 pages.
 
Day 1 Morning

  1. Introduction to Linux

 
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any changes.
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
  
Day 1 Morning
  1. Introduction to Linux
  
* 1991: The Linux kernel is publicly announced on 25 August by the 21-year-old Finnish student Linus Benedict Torvalds.^[13]
* 1992: The Linux kernel is relicensed under the GNU GPL. The first Linux distributions are created.
* 1993: Over 100 developers work on the Linux kernel. With their assistance the kernel is adapted to the GNU environment, which creates a large spectrum of application types for Linux. The oldest currently (as of 2015) existing Linux distribution, Slackware, is released for the first time. Later in the same year, the Debian project is established. Today it is the largest community distribution.
* 1994: Torvalds judges all components of the kernel to be fully matured: he releases version 1.0 of Linux. The XFree86 project contributes a graphical user interface (GUI). Commercial Linux distribution makers Red Hat and SUSE publish version 1.0 of their Linux distributions.
* 1995: Linux is ported to the DEC Alpha and to the Sun SPARC.Over the following years it is ported to an ever greater number of platforms.
* 1996: Version 2.0 of the Linux kernel is released. The kernel can now serve several processors at the same time using symmetric multiprocessing (SMP), and thereby becomes a serious alternative for many companies.
* 1998: Many major companies such as IBM, Compaq and Oracle announce their support for Linux. The Cathedral and the Bazaar is first published as an essay (later as a book), resulting in Netscape publicly releasing the source code to its Netscape Communicator web browser suite. Netscape's actions and crediting of the essay^[50] brings Linux's open source development model to the attention of the popular  technical press. In addition a group of programmers begins developing the graphical user interface KDE.
* 1999: A group of developers begin work on the graphical environment GNOME, destined to become a free replacement for KDE, which at the time, depends on the, then proprietary, Qt toolkit. During the year IBM announces an extensive project for the support of Linux.
* 2000: Dell announces that it is now the No. 2 provider of Linux-based systems worldwide and the first major  manufacturer to offer Linux across its full product
* 2002: The media reports that "Microsoft killed Dell Linux"^[52]
* 2004: The XFree86 team splits up and joins with the existing X standards body to form the X.Org Foundation, which results in a substantially faster development of the X server for Linux.
* 2005: The project openSUSE begins a free distribution from Novell's community. Also the project OpenOffice.org introduces version 2.0 that then started supporting OASIS OpenDocument standards.
* 2006: Oracle releases its own distribution of Red Hat Enterprise Linux.  Novell and Microsoft announce cooperation for a better interoperability and mutual patent protection.
* 2007: Dell starts distributing laptops with Ubuntu pre-installed on them.
* 2009: RedHat's market capitalization equals Sun's, interpreted as a symbolic moment for the "Linux-based  economy".^[53]
* 2011: Version 3.0 of the Linux kernel is released.
* 2012: The aggregate Linux server market revenue exceeds that of the rest of the Unix market.^[54]
* 2013: Google's Linux-based Android claims 75% of the smartphone market share, in terms of the number of phones  shipped.^[55]
* 2014: Ubuntu claims 22,000,000 users.^[56]
* 2015: Version 4.0 of the Linux kernel is released. 
  
  
© www.minhinc.com
p6
Day 1 Morning
  1. Introduction to Linux
 
Device comes in two flavours:
- A character device represents a hardware device that reads or writes a serial stream of data bytes. Serial and parallel ports, tape drives, terminal devices, and sound cards.
 
-A block device represents a hardware device that reads or write data in fixed size blocks.unlike a character device, a block device provides random access to data stored on the device.a disk drive is an example of a block device.
 
Linux identifies devices using two numbers:the major device number and the minor device number.
 
Major device number generally identifies a driver where as minor number identifies devices controlled by the driver.so actual device is identified as major:minor combination. A device can be master and slave. master are identified with 1,2,3... and slaves as 65,66,67...
 
For each device there is a device file or device entry in the file system.cp rm mv commands works on device file as regular file.data transfer happens from actual device through device driver. use mknod to create file entry for the device.
 
$mknod ./lp0 c 6 0 
lp0 - path to the device file
c - character device, b for block device
6 - major device number, driver id
0 - minor master device number 
 
$ls -l lp0 
crw-r----- 1 root root 6, 0 Mar 7 17:03 lp0
#include <stdio.h>
int main(int argc, char *argv[]){
stat("lp0")
printf("file type
");
printf("major file number
");
printf("minor file number
");
return 0;
} 
© www.minhinc.com
p7