IU:TestPage

From IU
Revision as of 00:26, 9 September 2022 by R.sirgalina (talk | contribs)
Jump to navigation Jump to search

Advanced Linux: Understanding and programming

  • Course name: Advanced Linux: Understanding and programming
  • Code discipline: xxxxx
  • Subject area:

Short Description

This course covers the following concepts: The fundamental principles for `booting`; Linux Kernel: understanding, programming, debugging, contributing; Device drivers; Power management; Graphical stack overview; Userspace: understating and interaction with Kernel.

Prerequisites

Prerequisite subjects

Prerequisite topics

Course Topics

Course Sections and Topics
Section Topics within the section
X86/Arm assembler introduction
  1. Basic assembler: registers, operations
  2. x86 ABI reference
  3. Context switching
  4. CPU security rings
Linux Kernel introduction
  1. Kernel usage
  2. Supported HW
  3. Building the kernel
Booting the Kernel
  1. Boot Sequence
  2. Device Tree
  3. U-boot
  4. initrd/initramfs
Kernel Modules
  1. Linux device and driver m​odel
  2. Virtual Filesystems
Memory management
  1. Physical Memory
  2. Virtual Memory
  3. Memory Allocation
Threads, processes and scheduling
  1. Thread
  2. Processes
  3. Timers
Concurrent access to resources
  1. Mutexes
  2. Spin locks
  3. RW-locks
Kernel debugging
  1. Debugging techniques
  2. DebugFS
  3. Other methods overview (J-Tag etc).

Intended Learning Outcomes (ILOs)

What is the main purpose of this course?

The main purpose of this course is to give the students advanced knowledge of how Linux operation system boots, works and what parts it is consists of.

ILOs defined at three levels

Level 1: What concepts should a student know/remember/explain?

By the end of the course, the students should be able to ...

  • Principles of Operating Systems.
  • Principles of bootloaders (first- /second- stage).
  • Linux booting principles.

Level 2: What basic practical skills should a student be able to perform?

By the end of the course, the students should be able to ...

  • Memory management in Kernel and userspace.
  • Linux kernel subsustems.
  • Concurrent access to resources.
  • HW devices interaction in Linux.
  • Interrupt and multithreading execution.
  • Real- and virtual- filesystems interaction.

Level 3: What complex comprehensive skills should a student be able to apply in real-life scenarios?

By the end of the course, the students should be able to ...

  • Kernel drivers design skills.
  • Linux Kernel contribution and advanced GIT knowledge.
  • C language low-level Kernel programming.
  • C/C++ language system programming.
  • POSIX API usage.
  • Kernel and userspace debugging (including KGDB/GDB).
  • x86/ARM assembly programming.

Grading

Course grading range

Grade Range Description of performance
A. Excellent 90-100 -
B. Good 75-89 -
C. Satisfactory 60-74 -
D. Poor 0-59 -

Course activities and grading breakdown

Activity Type Percentage of the overall course grade
Labs/seminar classes 40
Interim performance assessment 10
Exams 50

Recommendations for students on how to succeed in the course

Resources, literature and reference materials

Open access resources

  • Linux Device Drivers by Jonathan Corbet, Alessandro Rubini, Greg Kroah-Hartman (3rd edition)
  • Beginning Linux Programming by Neil Matthew (4th edition)
  • Linux System Programming: Talking Directly to the Kernel and C Library by Robert Love (2nd edition)
  • Online resources shared by instructor

Closed access resources

Software and tools used within the course

Teaching Methodology: Methods, techniques, & activities

Activities and Teaching Methods

Activities within each section
Learning Activities Section 1 Section 2 Section 3 Section 4 Section 5 Section 6 Section 7 Section 8
Development of individual parts of software product code 1 1 1 1 1 1 1 1
Homework and group projects 1 1 1 1 1 1 1 1
Midterm evaluation 1 1 1 1 1 1 1 1
Testing (written or computer based) 1 1 1 1 1 1 1 1
Discussions 1 1 1 1 1 1 1 1

Formative Assessment and Course Activities

Ongoing performance assessment

Section 1

Activity Type Content Is Graded?
Question ARM architecture is faster than x86, itn’s it? 1
Question Why does antivirus software works in RING0? 1
Question What is the main purpose of having interrupts? 1
Question How-to debug anything inside interrupt context? 1
Question Show the difference in x86 and ARM CPU registers. 0
Question Create `basic` atomic operations for ARM in x86 (and vice versa). 0
Question Implement simple context switching without threads. 0

Section 2

Activity Type Content Is Graded?
Question Monolithic kernel vs Micro-kernel. What is faster and why? 1
Question How Linux works on HW without IOMMU? 1
Question Tools required for building Linux Kernel. 1
Question Name few operations systems bases on Linux and name the difference. 1
Question Contributing to Open Source software and Kernel. What is the difference? 0
Question Git usage: commits, email-patches. 0
Question Git usage: rewriting history. 0
Question Building Linux Kernel for your own PC. 0
Question Running new Kernel on your machine. 0
Question Kernel config file location and editing. 0

Section 3

Activity Type Content Is Graded?
Question What is the difference between BIOS and UEFI? What we prefer in nowadays? 1
Question What is the usage for secure boot? What requirements should be met for this? 1
Question Why in x86 we do not have device tree? And why is it required for ARM platforms? 1
Question What is the purpose of having initramfs? Can we skip that stage? 1
Question Build U-boot 0
Question Rebuilding initramfs 0
Question Changing boot order of your PC. Creating simple systemd service. 0

Section 4

Activity Type Content Is Graded?
Question How kernel module can be compiled and used inside or outside Linux Kernel Image? 1
Question What is the purpose of System.map file for correct Linux Kernel functionality? 1
Question What is the real requirement to have virtual filesystems in Linux Kernel? 1
Question Name few real and virtual filesystems. Briefly describe usage in real life. 1
Question Develop and deploy simple Kernel Module outside kernel image. Dynamic Loading. 0
Question Develop and deploy simple Kernel Module inside kernel image. 0
Question SysFS/ DebugFS / ProcFS/ TmpFS usage 0

Section 5

Activity Type Content Is Graded?
Question Why do we need virtual memory? 1
Question Why does Linux Kernel maps itself to every process address space? 1
Question How does page fault handler work? 1
Question What is segmentation fault and how it handles in Linux Kernel? 1
Question Create simple allocator (myalloc/myfree). 0
Question Create benchmark for simple allocator. 0

Section 6

Activity Type Content Is Graded?
Question What is the difference between thread and process? 1
Question Can process exist without any threads? 1
Question What scheduling methods does Linux Kernel has? 1
Question What make `realtime` OS really realtime? 1
Question What is the difference between cooperative and preemptive multitasking? 1
Question Implement your own threads inside app. 0
Question Implement simple scheduler for your threading app. 0
Question Implement timer for your app without using `real` timers. 0

Section 7

Activity Type Content Is Graded?
Question Why do we need locking structures? 1
Question Where is mutex preferred on spinlock? 1
Question Where is spinlock preferred on mutex? 1
Question Can we just write locking-free code? 1
Question What is deadlock and how it could be handled? 1
Question Implement simple locking structures. 0
Question Implement Wait-die lock. 0

Section 8

Activity Type Content Is Graded?
Question Name and briefly describe kernel-debugging techniques. 1
Question What debug levels for printk do you know and what is their usage? 1
Question What other methods of Kernel debugging techniques do you know? 1
Question Why can’t we use regular GDB to debug Linux Kernel? 1
Question Usage of DebugFS for basic debugging 0
Question Usage of printk and debug levels. 0
Question KGDB usage for Kernel debugging. 0

Final assessment

Section 1

  1. Describe basic CPU registers and their purpose.
  2. Describe x86 ABI.
  3. What is context switching and how does it work?
  4. Name all CPU security rings and describe security levels.
  5. Interrupts. Interrupt handler.

Section 2

  1. Briefly describe modern OS architecture. (for ex. Linux)
  2. Describe supported HW by Linux Kernel.
  3. Describe contribution process to Linux Kernel.

Section 3

  1. Name popular bootloaders and briefly describe the difference.
  2. Describe all boot sequence starting from pushing START button.
  3. Describe in details the role of initrd/initramfs in booting process.
  4. First userspace process. Describe how it works and why do we need SystemV/system?

Section 4

  1. Describe Linux device and driver model
  2. Real- and Virtual- filesystems. Describe in details.
  3. Name other Linux Kernel subsystems and their usage.

Section 5

  1. Describe how virtual memory maps on physical memory.
  2. Describe in details how TLB works. How TLB increases memory operations?
  3. Describe structure of page table, its location and management from OS.
  4. Describe memory allocation techniques. Describe one of them in details.

Section 6

  1. Describe how threading works.
  2. Describe pthread API usage.
  3. Describe difference between monotomic and realtime clocks.
  4. Describe scheduling strategies. Make a suggestion which one is preferred for different situations.
  5. Question 5

Section 7

  1. Describe mutex internals.
  2. Describe spin lock internals.
  3. Describe deadlock problem and how it could be handled.
  4. Compare different locking methods and make conclusion of which is faster and why.
  5. Question 5

Section 8

  1. Explain usage of debugFS in modern kernels.
  2. Describe main kernel debugging techniques.

The retake exam

Section 1

Section 2

Section 3

Section 4

Section 5

Section 6

Section 7

Section 8