**** 1 - Computer Engineering Research Laboratory

Download Report

Transcript **** 1 - Computer Engineering Research Laboratory

Embedded Software
2015. 9.1
Kyu Ho Park
CORE Lab.
1. Introduction
Course Description
 The goal of this course is to understand Linux Kernel
Programming and practice it on a CPU board implementing
real device drivers. The topics will be Task management,
Memory management, File Systems, Interrupt Handling, System
call implementation, Module Programming, and Device drivers.
The development environment will be implemented on VMware
with Ubuntu Linux and a board computer.
Computer Engineering Research Laboratory
Course Description
Course Type
Elective
Course Code
EE516
Course Name
Korean
임베디드소프트웨어
Course Name
English
Embedded Software
Instructors
Kyu Ho Park
Lecture:Exp.:Credit(Homework)
1: 5: 3 (4)
Term : Fall
Descriptions
of Courses
The goal of this course is to understand Linux Kernel Programming and practice it on a
CPU board implementing real device drivers. The topics will be Task management, M
emory management, File Systems, Interrupt Handling, System call implementation, Mo
dule Programming, and Device drivers. The development environment will be impleme
nted on VMware with Ubuntu Linux and a board computer.
Course Website: http://core.kaist.ac.kr/~EE516/
Computer Engineering Research Laboratory
Topics to be covered
[Lectures will be given on every Tuesday]
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
Introduction
Development Environment based on VMware
Linux Basic Commands , Shell and Kernel Compiling
Process, Thread and Task
Synchronization
Interrupt, Trap and System calls
Module Programming and Character Device Driver
Device Driver with Interrupt Handling
File System Management
Block Device Driver
Memory Management
Timing and Timer
Computer Engineering Research Laboratory
TA
 Kim Woo Joong, PhD Student([email protected])
 Joo Kyung Ro, PhD Student([email protected])
 Shin Dong Jae, PhD Student([email protected])
 Kim Dong Jin, PhD Student([email protected])
 Choi, Jong Hun, PhD Student([email protected])
Computer Engineering Research Laboratory
Evaluation
Evaluation:
Projects ( 5 Projects will be assigned) : 50%
Homework( 4 Homeworks)
: 32%
Quiz, Presentation, etc.
: 18%
Good Luck!
Computer Engineering Research Laboratory
Projects
1.Setting Up Environment
2.Linux Fundamental
3.System Call and Synchronization
4.File System
5.Device Driver for Embedded H/W
Computer Engineering Research Laboratory
System software








System software is a type of computer program that is designed to run a computer’s hardware and
application programs. If we think of the computer system as a layered model, the system software is
the interface between the hardware and user applications.
The operating system (OS) is the best-known example of system software. The OS manages all the
other programs in a computer.
Other examples of system software and what each does:
The BIOS (basic input/output system) gets the computer system started after you turn it on and
manages the data flow between the operating system and attached devices such as the hard disk,
video adapter, keyboard, mouse, and printer.
The boot program loads the operating system into the computer's main memory or random access
memory (RAM).
An assembler takes basic computer instructions and converts them into a pattern of bits that the
computer's processor can use to perform its basic operations.
A device driver controls a particular type of device that is attached to your computer, such as a
keyboard or a mouse. The driver program converts the more general input/output instructions of the
operating system to messages that the device type can understand.
According to some definitions, system software also includes system utilities, such as the disk
defragmenter and System Restore, and development tools such as compilers and debuggers.
from WhatIS.com
Computer Engineering Research Laboratory
Computer Engineering Research Laboratory
What we will learn
Linux basic commands,
Basic shell programming,
Linux kernel programming,
Process management,
Memory management,
File systems,
Linux module programming,
System calls, interrupt and trap,
Device driver implementation.
Rerferences:
1.Understanding the Linux Kernel, 3rd,Bovet $Cesati.
2.Linux Device Drivers, 3rd, Corbet,Rubini & Kroah-Hartman.









Computer Engineering Research Laboratory
Linux history
 1991.8.26 Linux 0.0.1 Linus Benedict Torvalds
 1991.10.5 The first official version Linux 0.0.2
 1996.6.9 Linux-2.0.tar.gz
 Mr. Torvalds developed based on the experience of using
Minix( developed by Andrew Tanenbaum).
Computer Engineering Research Laboratory
Linux
(System Call Interface)
Process Managenent Module
File system
Initialization
Module
Memory Management Module
Network Management Module
Device Driver
Computer Engineering Research Laboratory
Linux File System
(Buffer Cache)
(Device Driver)
13
Computer Engineering Research Laboratory
Linux components
H/W dependent kernel codes
Header files to build kernel
Kernel initialization routines
Memory management codes
File system codes
Main kernel codes
Socket interface, TCP/IP
Computer Engineering Research Laboratory
Linux Distribution Tree
http://futurist.se/gldt
*Debian---Ubuntu Linux
*Slackware
*Redhat
Ubuntu (/ʊˈbuːntʊ/ uu-BOON-tuu; Zulu pronunciation:
[ùɓúntʼú])[1][2] is a Nguni Bantu term roughly translating to
"human kindness."[dubious – discuss] It is an idea from the Southern
African region which means literally "human-ness," and is
often translated as "humanity toward others," but is often
used in a more philosophical sense to mean "the belief in a
universal bond of sharing that connects all humanity".[3]
Computer Engineering Research Laboratory
http://futurist.se/gldt
Computer Engineering Research Laboratory
debian
Computer Engineering Research Laboratory
ubuntu
Computer Engineering Research Laboratory
slackware
Computer Engineering Research Laboratory
redhat
Computer Engineering Research Laboratory
Ubuntu Linux
 Ubuntu13.04 was released in April,2013.
 Ubuntu13.10 was released in October,2013.
 Generally Ubuntu is released in April and Oct.
Computer Engineering Research Laboratory
System Calls and Shell
 Operating system is the code that executes the system
calls.
 System Calls: The interface between the OS and its
application programs
 How are the commands executed?
-shell: command interpreter
22
Computer Engineering Research Laboratory
System Call
Users’ Programs
System Call
System Call Interface
(Kernel Functions)
Kernel
Hardware
Computer Engineering Research Laboratory
Shell
Other
programs
csh
Kernel
bash
The X
Window
System
1.shell: command interpreter
2. #date ; The shell creates a child process and runs the ‘date’ program as
the child.
When the child process is running, the shell waits for it to terminate. When the
child finishes , the shell types the prompt again and tries
to read the next input line.
Process Management Module
 fork( ), exec( )
 kill( ), exit( )
 signal( )
( ./linux/kernel and ./linux/arch/x86/kernel)
Computer Engineering Research Laboratory
File systems
 open( ), read( ), write( ),close( )
 create( )
 lseek( )
 chmod( ),rename( )
Computer Engineering Research Laboratory
files
 files:
 regular file
 directory
 symbolic link
 device file
Computer Engineering Research Laboratory
Basic Operations of a Computer
OS
CPU
Disk
Memory
Basic Operations of a Computer
Basic Operations of a Computer
vi testWelcom.c
inode
Disk
69 6e
74 20
…
Basic Operations of a Computer
testWelcom.c
testWelcom
Basic Operations of a Computer
vi testWelcom.c
testWelcom
Disk
inode
69 6e
74 20
…
Basic Operations of a Computer
vi testWelcom.c
testWelcom
$./testWelcom
4GB
3GB
Kernel Space
16EB
128TB
Stack
SP
Disk
inode
Heap
69 6e
74 20
…
BSS
Data
0B
CPU
Text
Memory
running
p5
readyQueue
p1
p2
p3
p4
PC
0B
testWelcom process
Programming Environment
Computer Engineering Research Laboratory