오늘, 리눅스 커널 개발과정 강의를 등록했습니다. 2개월 강의에 총 52개 강좌로 하루에 한강씩만 들을 예정입니다. 작년에 리눅스해킹보안관리과정과 운영체제론 과정을 완강했고, 컴퓨터과학 지식이였지만 개발할때도 도움이 많이 되었던것 같습니다. 최근 회사에서 C로된 서버라던가 윈도우 프로그래밍을 접하게 되면서 시스템에 대한 원론적인 이해가 필요하다는 생각이 들어, 작년까지만 해도 엄두를 못냈던 리눅스 커널 개발과정을 등록 하게 되었습니다. 커널프로그래밍이기때문에 결국 임베디드 프로그래밍하고도 연결이 되는데, 제가 SW 전공이라 실제로 임베디드 관련 개발을 해볼일은 없을것 같으나, 커널을 알아두면 개발을 할때 분명 많은 도움이 되리라 생각합니다. 개발에 있어서는 모르는것보다는 아는것이 늘 더 나은 법이라고 생각합니다.
저는 강의나 책을 보기전에 목차부터 살펴보는 습관이 있는데요. 단원단원에 매몰되기 보다는 전체를 먼저 보고 내가 배우고 있는 것이 전체에서 어떤 위치, 그리고 어떤 부분에 있는지 파악하는 것이 그 목적입니다. 그럼 해당 강의의 목차를 살펴보도록 하겠습니다.
1강좌: Introduction to Linux Operating System
- Course Description
- Outline
- References
- Homework
- History of Unix
- Portability
- Terminology
- Software Concept
- Manual
- man cat
- man bash
- script
- Multi user vs Single user
- User Interface
2강좌: Shell
- File expansion characters
- Using the shell
- Process Hierachy
- multitasking
- pipe
- meta-characters
- Shell variable
- Aliases
- Revisit
- How an editor is born
- How sh is coded
- Environment variable
- History
- if Statement
- Exit code
- condition Statement
- condition string expression
- for Statement
- And more
- Script File
- Start-up files
3강좌: Introduction to Kernel
- Kernel, Introduction
- function
- process
- Multi-user System --multiple shells
- Protection
- Main Memory
- Program execution
- OS Kernel
4강좌: Process management
- Data Structure
- Functions
- Meta-data for Process: PBC(Process Control Block)
- Observation
- To Create a new child process
- Kernel system calls for process management
- More on exec
- Booting the Kernel
- Process Hierarchy
- 6 run levels
- Thread
- Per Process Data (Revisited)
- Back to Process: Process Termination
- exit() system call
- More on swtch()
- Program execution (revisited)
- Round-Robin Scheduling
- Concept of a "Process"
- IPC(Inter Process Communication)
- Pipe Example
5강좌: File System
- Kernel Data Structure for File
- Meta-data for a File
- Contiguous allocation
- open()
- Split Metadata for File
- Sharing Files
- Device switch table
- Kernel tables after open
- Kernel data structure for file
- Kernel Data Structure
- System file table
- Inode table
- In core Inode
- Balanced tree
- Directory file
- Kernel tables before open
- C functions for file
- System call vs Library call
- File vs fd
- Functions for file handling
6강좌: File System in Disk
- superblock
- Disk Space Management : Free Space
- Free Space Management
- Occupied space
- File System 4 parts (Boot block, Superblock, Inode list, Data block)
- Hardware level Formatting
- Bad block handling
- OS level formatting
- UCB FFS(Fast File System)
7강좌: Loading File System into Memory
- Buffer
- Buffer Cache
- Delayed Write -- Pros & cons
- Crash
- fsck()
- Design Goal
- Modern systems
- Issues
- Back to buffer cache
- Allocate buffers to whom?
- Remember .. OS Kernel
- Kernel Data Structure
- mounting
- Mount Table Entry
- Relationship between Tables
- Data File System
8강좌: Internet
- Leased line
- Joining the network
- Internet Policy
9강좌: Advanced Functions for File
- Two methods of accessing files
- Memory Mapped I/O
- readv(), writev()
- Non-blocking I/O
- I/O Subsystem
- File vs I/O
- Size of device driver code
- Caution : terminology
- Terminal I/O
- tty meta-data
- Split tty meta-data
- Accessing termios
- Echoing
- When to wake up program
- raw/canonical modes
- Raw mode
- Canonical mode
- Standard code for tty
- terminfo
10강좌: Windows
- Linux Desktop Environments KDE & GNOME
- Multiple Windows
- IPC
- Root Window
- Child Window
- X-Window Protocol
- GUI involve a log of drawing
- Protocol to minimize network traffic
- X-Window Processes
- 2 kind of processes
- Window Manager a special client process
- Role of Window Manager
- Window Manager
- X-server (Hardware side)
- 2 helping processes
- Window Programming
- Widgets (Internal Window inside child window)
- Window Hierarchy Tree
- Widget classes (Internal windows)
- widget class example
- allowed events on widget classes
- Event-driven programming
- Window Libaray
- Advanced window programming
- IDE(Intergrated Development Environment)
- Curses Library
- Sample curses functions
- Starting X window
- 00 can be ...
11강좌: Developing Software on Linux
- HW technology
- Separate Compile
- C language revisited
- Reading
- Compiling
- Managing source codes
- Debugging
- Disk Speed - Exception
- SW Size
- 100 programmers, 1 year
- Compile Time
- Typical Source Codes
- Linux Kernel Example
- To compile correctly
- Type of operand is not provided?
- Address of operand not provided?
- How do we divide source files?
- You need extern
- "Defined" vs "Declare"
- Source file
- Symbol Table
- Incomplete binding
- Linking incomplete part(z)
- Format of file.o after gcc
- Three stages
- You need object module
- You need #include
- cpp & substitution
- C language
- Java language
- Program Development
12강좌: Library
- Why we need library
- Symbol table
- Static library
- Convention - Static library
- tar, tar command, tar exercise
- Two Types of Libraries
- Comparision
- Backward Compatibility
- Name of Shared library
- a.out format
- Building Shared Library
- Upgrading Shared library
13강좌: Reading Code in Modular Process
- Modular Programming
- src (include, net, vm, sys ..)
- Reading Codes
- Where is getc() function?
- Skip RE if you already know
- Regular Expression : Metacharacters
- grep -- regular expression
- Shell Escape
- To find MAX
- Where is read() function?
14강좌: The AWK Language
- While reading each line from file Pattern matching, Action
- string examples
- Built-in arithmetic functions
- Range Patterns
- AWK is
15강좌: Ctags Cscope
- src(include, net, vm, sys...)
- Reading codes... (read.c)
- Looking for identifier
- Where is read() function? index file
- ctags command
- Productivity
- More on Ctags
- Exuberant Ctags
- Linux Cross-Reference (lxr)
- cscope
- using cscope DB
- cscope & unwanted directories
- man find
16강좌: Make
- If I change a source file
- How other files should change
- Optimal compile procedure
- dependency between files
- makefile -- 2 kinds of lines
- automatic generation of makefile
- typical content of makefile
- step taken by make
- Dmmy Trget
- Multiple targets ...
- Implicit
- Macro
- special dependencies
- directory hierarcy & make
- macro & coding style
- Makefile Macro & Software Quality
- Makefile Macro Conditional Compile
17강좌: Managing Source Files_CVS
- Typical Source Codes
- Everybody makes copy of files
- Many Releases
- Many people, Many Releases
- Number of Files to Manage
- Many people, releases, branches
- Typical System
- Terminoloty
- CVS Command
- CVS Lab Exercise
- Creating master source files
- after creating master source
- files created for bookkeeping
- checkout
- Multiple Devleopers -- Status --
- Manual merge
- add/remove files
- Managing Branches
- Branches
- merge(branch & main tree)
- versions
- CVS command arguments
18강좌: Distributing Open Software RPM Command
- Standard format Object Descriptor
- Distribute Open Software?
- Challenges - Open Software Distribution
- Action at target platform...
- Install command
- Definition of "package" (3 type of files)
- Dependency between packages
- sample list of spec files
- content of spec file
- rpm
- rpm DB
- Using rpm command'
- All installed packages in the system
- file X is from which packages?
- rpm and capability
- display information of package
- provides what?
- installing package from CD
19강좌: SW development productivity
- SW development productivity
- Repeated Primitive Operations
- SW development tools
- IDE(Integrated Development Environment)
20강좌: Shell, Script Revisited (Advanced Shell)
- Shell
- Bash Shell features
- Bash Setup files
- Command Substitution
- Command Group
- How sub-shell is created
- make - revisited
- Built-in Command
- I/O redirection
- Job Control
- Conditional command execution
- In sum, sh is ...
- Many different kinds ...
- Script & specialty area
- Why Script?
22강좌: Introduction to UNIX Kernel Source Code
- Procedures (Functions)
- Back to C: Complex Declarations
- Structure type variables
- Chapter Three
- Pointers
- Back to C: Functions
- Back to C: Operator Precedence.
23강좌: Mutual Exclusion in UNIX Kernel
- multi-processor system
- Critical Section : 2 CPU's share a variable
- Interleaved execution
- Mutual Exclusion
- interrupt handler vs kernel
- disable//enable interrupt
- UNIX disk driver
- Race Condition in uni-processor
24강좌: Process Image
- CPU registers
- pdp-11 CPU has 2 SP's
- Why pdp-11 needs MMU(Memory management unit)
- 2 sets of memory mapping registers
- Kernel has PCB for each application
- Kernel's PCB in detail
- Kernel's PCB layout
- scatter ppda in physical address space
- each proc[] points to application's ppda
- 2 sets of {PAR|PDR}
- Kernel's 7th PAR -> active user's ppda
- Process Image
- CPU state 3 types of CPU registers
25강좌: Context Switching in pdp_unix savu() retu()
- savu()
- retu()
- Context Switching
26강좌: main()
- main() source
- retu(proc[j])
- retu(proc[k])
- ASM : Between kernel & User
27강좌: estabur()
- After copying patent's image...
- expand()
- extabur
- sureg
- CPU & Context Switch
- When does process switching occur?
28강좌: trap()
- Interrupt or Trap(or Exception)
- Assembler first
- HW interrupt address
- 0511
- Assembler calls kernel C function trap()
- Parameters in stack
- 2673 ( dev sp ... pc ps )
29강좌: fork()
- parent invokes fork()
- child starts form swtch/fork
- Overhead of fork()
- How does shell work
30강좌: exec()
- exec() source code
- Algorithm of exec()
- Passing arguments to child process
- Algorithm of exec()
31강좌: File System
- block device (rk disk)
- source code
- getblk()
- character device
32강좌: pipe file
- grep | who
- source code
- IPC
33강좌: Copy Semantics(Adding IO Devices)
- Which I/O devices are in System?
- devswtab[]
- PnP(Plug and Play) : Automatic detection of hardware devices
- Bug & I/O Interface
- PnP(Plug & Play)
- Linux Kernel Module
34강좌: Interactive Terminal Device Driver
- Data structure for Characters
- Device initiates (top / bottom half)
- source code
- Application Process Initiates
- Source code
35강좌: Reading Code
- Source code
- Reading Codes...
- src (include, sys, vm, net...)
- Repeated Primitive Operations
37강좌: Process(Data Structures)
- Data Structure change(1) : don't divide PCB for swapping
- Data Structure change(2) : Static -> Dynamic Allocation
- Array -> Linked List
- Data Structure change(3) : Multiple Structs for fork overhead
- Process Creation Overhead
- clone() system call - five flags -
- Linux "thread"
- PCB separates from kernel stack
38강좌: Process(Function)
- A Process running on 3 CPU's
- Multiprocessor running many Processes
- Get currently executing task
- Process Creation
- clone()
- How child is run first
- Parent's code
- Child Creation in Lion's Code
- Child Creation in Linux
- Why run child first
- PID
- Kernel thread (KT)
- Process State
- Process Termination
39강좌: Scheduling
- Priority
- Timeslice
- Ready Queue per each CPU
- Priority Arrays Diagram
- Two Priority Arrays per CPU
- Recalculating timslice
- Data Structure for Each CPU Scheduling
- Scheduling Algorithm
- Kernel mode task preemption & Critical Section problem
- Mutual Exclusion
- When can you preempt CPU from a task running in kernel mode?
- When does kernel preemption occurs?
- preemption points
- schedule()
40강좌: System Call
- Invoking a system call
- inside Wrapper Routine
- Compiling
- System Call Handling in Kernel
- Kernel system call function
- System Call Number
- Write a New System Call
- Alternative to New System Call
- System Call Implementation
41강좌: Interrupt(I)
- CPU & Interrupt
- Interrupt vs Exception
- Many I/O devices - Interrupt Controller
- Interrupt Controller
- PIC(Programmable Interrupt controller)
- Ack
- PIC History (Master/Slave PIC)
- Many IRQ lines per PIC
- Many devices per IRQ line
- Interrupt Handling in Multiprocessor
- Local & multi - APIC
- SMP (Symmetric Multiprocessing)
- IRQ distribution architecture
- IRQ distribution algorithm
- Dynamic IRQ distribution algorithm
- Asymmetric Multiprocessiong
- Data Structure for Interrupt Handling
- Information about each IRQ line
42강좌: Interrupt(II) Function for Interrupt Handling
- functions for interrupt
- do_RIQ()
- source code
- Three cases
- Case (1)
- Case (2)
- Case (3)
- State of IRQ.
43강좌: Interrupt(III) Race Condition
- Race Condition
- do-IRQ() - critical seciton
- ISR is not a ciritical section
- source code
- When & who calls do_softirq()?
- Urgent/non-urgent work in TCP/IP
- Which part is done in which module TCP/IP
- Top half & Bottom half (TCP/IP example)
44강좌: Bottom Halves
- Why Bottom Halves?
- Top half & Bottom half
- 3 Ways to Register Bottom Half Handlers
- Softirq
- Defining Softirq
- In Linux, only first few entries are used
- do_softirq()
- Invoking do_softirq()
- Concurrent Execution of Softirq
- Mutual Exclusion in Softirq Execution
- Tasklet
- Softirq vs Tasklet
- Data Structure for Tasklet
- Activating the Tasklet
- Work Queue
- Which bottom half should I use?
- Comparison 3 Bottom Half Handlers
45강좌: Kernel Synchronization
- How CPU peroforms X++
- Three Cases of Race
- (Case A) 2 CPU's sharing a variable
- SMP sharing variable
- (Case B) kernel base code vs interrupt handler
- (Case C) Process context Switch during System Call Execution
- Linux functions for Preventing Race
- Automic functions
- Lock
- Lock - several issues
- 2 kinds of lock
- Spin Lock
- Semaphores
- Which method to use : Spin vs Semaphore
- Where -- race conditions
- Advanced Issues
- Reader/Writer Spin Lock
- Seq Locks
- Comparison
- BKL : The Big Kernel Lock
- Completion Variables
- Barriers
- Timers and Time Management
- Terminology
- Hardware Clocks and Timers
- Timer Interrupt Handler
- The Time of Day
- Timers
- Delaying Execution
- Other Ways to Delay Execution
46강좌: Timers and Time Management
- Timers and Time management
- Terminology
- Hardware Clocks and Timers
- Timer Interrupt Handler
47강좌: Memory Management
- Background
- Smarter Space Management
- Heap Storage
- Heap - Variable size allocation
- malloc / free example
- Heap Storage
- External Fragmentation
- Compaction
- Performance Enhancement of Heap storage
- Smarter Space Management
- inode object, inode cahce
- emptypartial / full slab free inode list
- Terminlogy
- Slab layer -- how it works
48강좌: Virtual File System_VFS
- Many Different Implementation
- VFS Layer
- open files & mounted file systems
- Per Process Data Structures
- Linux VFS Standard Objects
- Superblock Object
- File Object
- Operations on File Object
- Inode Object
- Operations on Inode Object
- Dentry Object
- Where should we place dentry?
- Back to File object
- Dentry Object
- Operations on Dentry Object
- dentry cache lookup
- Dentry State
- Reading Linux Code
- What is in f_op?
- Superlock
- When you load (mount) superblock from disk
- Inode object
- who initializes Superblock?
- code reading & binding is dynamic
49강좌: Page Cache
- Terminology
- Buffer and Page
- Page Cache
- Objects that use pages
- Alternatively...
- address_space struct
- This page is being used for what?
- data structures for file
- read() system call
- struct page
- Page Cache
- Buffer, You still need it for metadata
- storing buffers in a page
- buffer lists
- Linux buffer cache
- bread() for metadata read
- History
50강좌: Block IO Layer
- Vectored I/O
- Reminder -- Lion's code
- readi()
- rkstrategy()
- Lion's code buffer_header
- Problems with Lion's code Buffer Head
- The bio structure
- Individual I/O Request
- Request Queue per Device
- I/O Scheduler
- 2 types of device
51강좌: Process Address Space
- Example of Address Mapping
- Memory Descriptor
- Reaching memory Areas
- VMA (Memory Area)
- Other Fields
- Kernel thread - Memory Descriptor
- Paging
- Address Space & Page Table Size
- Address Space per Process
- Paging in Linux
- Page Mapping Table
- Functions for Process Address Space
- Allocating Memory Descriptor
- Destroying Memory Descriptor
- Manipulating Memory Areas
52강좌: Swapping & Flushing
- When pages are updated
- Page Frame Reclamation
- Writing out Dirty Pages
- pdflush Daemon
- Swapping out Anonymous Pages
- Linux swapping
- Swap Area in Disk
- Swapping Subsystem
- Swap in - Race Problem
- Swap out - Race Problem
- Linux Solution - Swap Cache
- Page Fault
'서버운영 (TA, ADMIN) > 리눅스' 카테고리의 다른 글
[리눅스] IPC의 종류와 특징 (0) | 2017.10.28 |
---|---|
[리눅스] RAID란? RAID의 종류와 구성방식 (0) | 2017.10.27 |
[리눅스] 쉘을 이용한 프로그래밍 (2) | 2017.09.05 |
[리눅스] 유닉스의 발전 과정 및 리눅스 역사 (2) | 2017.08.05 |
[서버관리] CentOS에 CI(Jenkins) 구축하기 (0) | 2017.07.25 |