Difference between revisions of "IU:TestPage"

From IU
Jump to navigation Jump to search
Line 1: Line 1:
   
  +
= Advanced Linux: Understanding and programming =
= Frontend Web Development =
 
* '''Course name''': Frontend Web Development
+
* '''Course name''': Advanced Linux: Understanding and programming
* '''Code discipline''': R-01
+
* '''Code discipline''': xxxxx
 
* '''Subject area''':
 
* '''Subject area''':
   
 
== Short Description ==
 
== 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.
This course covers the following concepts: The main goal of the course is to introduce modern concepts of frontend development in the industry to the listeners and give them basic knowledge and practical skills that can be helpful at their first job as a frontend developer. We will explore such topics as pages markup with HTML and CSS, writing business logic using JavaScript and TypeScript, development of Single Page Applications with modern frameworks and libraries (Angular, React, Vue), usage of relevant technologies and approaches (CSS-in-JS, GraphQL, WebSockets, Web Components, etc.).; As a participant of the course you will develop your own SPA that will interact either with the API provided by us or with the open API of any popular service..
 
   
 
== Prerequisites ==
 
== Prerequisites ==
Line 22: Line 22:
 
! Section !! Topics within the section
 
! Section !! Topics within the section
 
|-
 
|-
  +
| X86/Arm assembler introduction ||
| Introduction. Current state of the industry. Developer roadmap and technologies overview. ||
 
  +
# Basic assembler: registers, operations
# Actual technologies in the industry
 
  +
# x86 ABI reference
  +
# Context switching
  +
# CPU security rings
 
|-
 
|-
  +
| Linux Kernel introduction ||
| Markup. HTML, CSS, DOM and styles inspector in browser. ||
 
  +
# Kernel usage
# Basics of HTML5
 
  +
# Supported HW
# Basics of CSS3
 
  +
# Building the kernel
 
|-
 
|-
  +
| Booting the Kernel ||
| JavaScript. Syntax, data types, paradigms, specifics. ||
 
  +
# Boot Sequence
# Code structure
 
  +
# Device Tree
# Variables
 
  +
# U-boot
# Control structures
 
  +
# initrd/initramfs
# Classical operators (math, comparison, logical)
 
# Functions
 
# Data types
 
 
|-
 
|-
  +
| Kernel Modules ||
| JavaScript. Engine and execution environments specifics. TypeScript. ||
 
  +
# Linux device and driver m​odel
# Synchronous and asynchronous execution
 
  +
# Virtual Filesystems
# Event loop
 
# Language features for asynchronous code
 
# Scope and closures
 
# Browser environment (DOM manipulations, events, etc.)
 
 
|-
 
|-
  +
| Memory management ||
| React. Basics, render concepts, hooks, devtools. ||
 
  +
# Physical Memory
# Pure React
 
  +
# Virtual Memory
# JSX
 
  +
# Memory Allocation
# Class components
 
# Functional components
 
# Hooks
 
# React DevTools
 
 
|-
 
|-
  +
| Threads, processes and scheduling ||
| React. Ecosystem, CSS-in-JS, routing, webpack + babel. ||
 
  +
# Thread
# React Router
 
  +
# Processes
# CSS-in-JS: Styled Components, Emotion
 
  +
# Timers
# Other useful libraries (forms, network, animations, etc.)
 
# create-react-app and other boilerplates
 
 
|-
 
|-
  +
| Concurrent access to resources ||
| React. Applications architecture, stateless and stateful components, dumb and smart components, global state management. ||
 
  +
# Mutexes
# Mono- vs multi-repository structure of enterprise projects
 
  +
# Spin locks
# Stateless and stateful components concept
 
  +
# RW-locks
# Dumb and smart components concept
 
 
|-
 
|-
  +
| Kernel debugging ||
| React. Code quality, linting, testing, optimizations. ||
 
  +
# Debugging techniques
# SonarQube for frontend projects
 
  +
# DebugFS
# ESLint, Prettier and settings presets for code linting and formatting
 
  +
# Other methods overview (J-Tag etc).
# Introduction to unit-testing of React components
 
|-
 
| NodeJS: JavaScript on backend, ExpressJS, NestJS, etc. ||
 
# NodeJS API Overview
 
 
|}
 
|}
 
== Intended Learning Outcomes (ILOs) ==
 
== Intended Learning Outcomes (ILOs) ==
   
 
=== What is the main purpose of this course? ===
 
=== 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.
After the course is completed, a student should know the basics of:
 
   
 
=== ILOs defined at three levels ===
 
=== ILOs defined at three levels ===
Line 80: Line 72:
 
==== Level 1: What concepts should a student know/remember/explain? ====
 
==== Level 1: What concepts should a student know/remember/explain? ====
 
By the end of the course, the students should be able to ...
 
By the end of the course, the students should be able to ...
  +
* Principles of Operating Systems.
* Resources that can help in furhther development of their skills
 
  +
* Principles of bootloaders (first- /second- stage).
* Resources that can help during the work as a frontend web developer
 
  +
* Linux booting principles.
* Role of frontend web-interfaces in modern systems
 
   
 
==== Level 2: What basic practical skills should a student be able to perform? ====
 
==== 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 ...
 
By the end of the course, the students should be able to ...
  +
* Memory management in Kernel and userspace.
* Key concepts that are laid into the basis of JavaScript
 
  +
* Linux kernel subsustems.
* Purpose of modern frontend frameworks
 
  +
* Concurrent access to resources.
* Key concepts that are laid into the React framework
 
  +
* HW devices interaction in Linux.
* What are the other technologies that appear in the JavaScript ecosystem
 
  +
* 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? ====
 
==== 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 ...
 
By the end of the course, the students should be able to ...
  +
* Kernel drivers design skills.
* Perform everyday tasks of frontend web developer:
 
  +
* Linux Kernel contribution and advanced GIT knowledge.
* Develop view of pages and components using HTML and CSS
 
  +
* C language low-level Kernel programming.
* Write business logic using JavaScript and/or TypeScript
 
  +
* C/C++ language system programming.
* Perform HTTP requests to an API and process responses
 
  +
* POSIX API usage.
* Configure page appearance depending on routes
 
  +
* Kernel and userspace debugging (including KGDB/GDB).
* Handle HTML forms
 
  +
* x86/ARM assembly programming.
 
== Grading ==
 
== Grading ==
   
Line 107: Line 102:
 
! Grade !! Range !! Description of performance
 
! Grade !! Range !! Description of performance
 
|-
 
|-
| A. Excellent || 80-100 || -
+
| A. Excellent || 90-100 || -
 
|-
 
|-
| B. Good || 65-79 || -
+
| B. Good || 75-89 || -
 
|-
 
|-
| C. Satisfactory || 50-64 || -
+
| C. Satisfactory || 60-74 || -
 
|-
 
|-
| D. Poor || 0-49 || -
+
| D. Poor || 0-59 || -
 
|}
 
|}
   
Line 122: Line 117:
 
! Activity Type !! Percentage of the overall course grade
 
! Activity Type !! Percentage of the overall course grade
 
|-
 
|-
| Labs/seminar classes || 10
+
| Labs/seminar classes || 40
 
|-
 
|-
| Interim performance assessment || 40
+
| Interim performance assessment || 10
 
|-
 
|-
 
| Exams || 50
 
| Exams || 50
Line 135: Line 130:
   
 
=== Open access resources ===
 
=== Open access resources ===
  +
* Linux Device Drivers by Jonathan Corbet, Alessandro Rubini, Greg Kroah-Hartman (3rd edition)
* Role of frontend web-interfaces in modern systems
 
  +
* Beginning Linux Programming by Neil Matthew (4th edition)
* What should a student be able to understand at the end of the course?
 
  +
* Linux System Programming: Talking Directly to the Kernel and C Library by Robert Love (2nd edition)
* Current state of the industry of frontend web development
 
  +
* Online resources shared by instructor
* Key concepts that are laid into the basis of JavaScript
 
* Purpose of modern frontend frameworks
 
* Key concepts that are laid into the React framework
 
* What are the other technologies that appear in the JavaScript ecosystem
 
* What should a student be able to apply at the end of the course?
 
* Setup and develop basic single page application using React
 
* Perform everyday tasks of frontend web developer:
 
* Develop view of pages and components using HTML and CSS
 
* Write business logic using JavaScript and/or TypeScript
 
* Perform HTTP requests to an API and process responses
 
* Configure page appearance depending on routes
 
* Handle HTML forms
 
   
 
=== Closed access resources ===
 
=== Closed access resources ===
Line 162: Line 146:
 
|+ Activities within each section
 
|+ Activities within each section
 
|-
 
|-
! Learning Activities !! Section 1 !! Section 2 !! Section 3 !! Section 4 !! Section 5 !! Section 6 !! Section 7 !! Section 8 !! Section 9
+
! 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 || 1
+
| 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 || 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 ==
 
== Formative Assessment and Course Activities ==
Line 178: Line 168:
 
! Activity Type !! Content !! Is Graded?
 
! Activity Type !! Content !! Is Graded?
 
|-
 
|-
| Question || What are the most used frameworks in frontend development? || 1
+
| 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 || What frameworks do best suit particular types of projects? || 1
+
| Question || Create `basic` atomic operations for ARM in x86 (and vice versa). || 0
 
|-
 
|-
| Question || How can you understand which skills you need to master next? || 1
+
| Question || Implement simple context switching without threads. || 0
 
|}
 
|}
 
==== Section 2 ====
 
==== Section 2 ====
Line 190: Line 188:
 
! Activity Type !! Content !! Is Graded?
 
! Activity Type !! Content !! Is Graded?
 
|-
 
|-
| Question || What is the purpose of tags head, body? || 1
+
| Question || Monolithic kernel vs Micro-kernel. What is faster and why? || 1
 
|-
 
|-
| Question || What is the difference between inline and block elements? || 1
+
| Question || How Linux works on HW without IOMMU? || 1
 
|-
 
|-
| Question || Where you can find styles applied to pseudo-classes in the devtools? || 1
+
| Question || Tools required for building Linux Kernel. || 1
 
|-
 
|-
| Question || How do you add a new element to a page in the devtools? || 0
+
| Question || Name few operations systems bases on Linux and name the difference. || 1
 
|-
 
|-
| Question || What is the purpose of DOCTYPE tag? || 0
+
| Question || Contributing to Open Source software and Kernel. What is the difference? || 0
 
|-
 
|-
| Question || What is semantic markup? What is accessibility in contect of HTML? || 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 ====
 
==== Section 3 ====
Line 208: Line 214:
 
! Activity Type !! Content !! Is Graded?
 
! Activity Type !! Content !! Is Graded?
 
|-
 
|-
| Question || Which datatypes do exist in JavaScript? || 1
+
| 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 || What is the object in JavaScript? || 1
+
| Question || Why in x86 we do not have device tree? And why is it required for ARM platforms? || 1
 
|-
 
|-
| Question || Which control structures in JavaScript do you know? || 1
+
| Question || What is the purpose of having initramfs? Can we skip that stage? || 1
 
|-
 
|-
| Question || What is the difference between arrow and classical functions? || 0
+
| Question || Build U-boot || 0
 
|-
 
|-
| Question || What is the difference between var, let and const? || 0
+
| Question || Rebuilding initramfs || 0
 
|-
 
|-
| Question || What is JSON? Which instruments do we have in JavaScript for work with JSON? || 0
+
| Question || Changing boot order of your PC. Creating simple systemd service. || 0
 
|}
 
|}
 
==== Section 4 ====
 
==== Section 4 ====
Line 226: Line 234:
 
! Activity Type !! Content !! Is Graded?
 
! Activity Type !! Content !! Is Graded?
 
|-
 
|-
| Question || Do we have any possibility to run multiple threads in JavaScript? || 1
+
| Question || How kernel module can be compiled and used inside or outside Linux Kernel Image? || 1
 
|-
 
|-
| Question || What is the Promise? Why do we need async and await keywords? || 1
+
| Question || What is the purpose of System.map file for correct Linux Kernel functionality? || 1
 
|-
 
|-
| Question || What is TypeScript and which problems it solves? || 1
+
| Question || What is the real requirement to have virtual filesystems in Linux Kernel? || 1
 
|-
 
|-
| Question || How do we set a callback for any event? || 0
+
| Question || Name few real and virtual filesystems. Briefly describe usage in real life. || 1
 
|-
 
|-
| Question || What is the difference between Promise.all() and Promice.race()? || 0
+
| Question || Develop and deploy simple Kernel Module outside kernel image. Dynamic Loading. || 0
 
|-
 
|-
| Question || How does the event loop wokr? || 0
+
| Question || Develop and deploy simple Kernel Module inside kernel image. || 0
  +
|-
  +
| Question || SysFS/ DebugFS / ProcFS/ TmpFS usage || 0
 
|}
 
|}
 
==== Section 5 ====
 
==== Section 5 ====
Line 244: Line 254:
 
! Activity Type !! Content !! Is Graded?
 
! Activity Type !! Content !! Is Graded?
 
|-
 
|-
| Question || What is the main difference between class components and functional components? || 1
+
| Question || Why do we need virtual memory? || 1
 
|-
 
|-
| Question || How to use React without JSX? || 1
+
| Question || Why does Linux Kernel maps itself to every process address space? || 1
 
|-
 
|-
| Question || What is Virtual DOM? || 1
+
| Question || How does page fault handler work? || 1
 
|-
 
|-
| Question || What is the difference between useCallback and useMemo? || 0
+
| Question || What is segmentation fault and how it handles in Linux Kernel? || 1
 
|-
 
|-
| Question || What is a controlled component? What is an uncontrolled component? || 0
+
| Question || Create simple allocator (myalloc/myfree). || 0
 
|-
 
|-
| Question || Which lifecycle methods do exist in React? || 0
+
| Question || Create benchmark for simple allocator. || 0
 
|}
 
|}
 
==== Section 6 ====
 
==== Section 6 ====
Line 262: Line 272:
 
! Activity Type !! Content !! Is Graded?
 
! Activity Type !! Content !! Is Graded?
 
|-
 
|-
| Question || What is the boilerplate? || 1
+
| Question || What is the difference between thread and process? || 1
 
|-
 
|-
| Question || What technologies of styling do we have? || 1
+
| Question || Can process exist without any threads? || 1
 
|-
 
|-
| Question || What is the difference between Link and NavLink in React Router? || 1
+
| Question || What scheduling methods does Linux Kernel has? || 1
 
|-
 
|-
| Question || How to setup a React project without a boilerplate? || 0
+
| Question || What make `realtime` OS really realtime? || 1
 
|-
 
|-
| Question || What is the difference between BrowserRouter and HashRouter? || 0
+
| Question || What is the difference between cooperative and preemptive multitasking? || 1
|}
 
==== Section 7 ====
 
{| class="wikitable"
 
|+
 
 
|-
 
|-
  +
| Question || Implement your own threads inside app. || 0
! Activity Type !! Content !! Is Graded?
 
 
|-
 
|-
| Question || What are the pros and cons of a mono-repository? || 1
+
| Question || Implement simple scheduler for your threading app. || 0
 
|-
 
|-
| Question || What are the pros and cons of multi-repository? || 1
+
| Question || Implement timer for your app without using `real` timers. || 0
|-
 
| Question || Which patterns are most wiedly used in React applications? || 1
 
|-
 
| Question || What is Flux architecture? || 0
 
|-
 
| Question || Why do we need any external solution for state menegement? Why can't we use the Context API or useDispatch hook? || 0
 
 
|}
 
|}
==== Section 8 ====
+
==== Section 7 ====
 
{| class="wikitable"
 
{| class="wikitable"
 
|+
 
|+
Line 294: Line 294:
 
! Activity Type !! Content !! Is Graded?
 
! Activity Type !! Content !! Is Graded?
 
|-
 
|-
| Question || How to track rerenders in React? || 1
+
| Question || Why do we need locking structures? || 1
 
|-
 
|-
| Question || How to avoid unnecessary rerenders in React? || 1
+
| Question || Where is mutex preferred on spinlock? || 1
 
|-
 
|-
| Question || What is SonarQube? Why do we need it? || 1
+
| Question || Where is spinlock preferred on mutex? || 1
 
|-
 
|-
| Question || Why do we need to use code linters? || 0
+
| Question || Can we just write locking-free code? || 1
 
|-
 
|-
| Question || What is the difference between test runner and testing framework? || 0
+
| Question || What is deadlock and how it could be handled? || 1
 
|-
 
|-
| Question || Why do we need react-testing-library? || 0
+
| Question || Implement simple locking structures. || 0
  +
|-
  +
| Question || Implement Wait-die lock. || 0
 
|}
 
|}
==== Section 9 ====
+
==== Section 8 ====
 
{| class="wikitable"
 
{| class="wikitable"
 
|+
 
|+
Line 312: Line 314:
 
! Activity Type !! Content !! Is Graded?
 
! Activity Type !! Content !! Is Graded?
 
|-
 
|-
| Question || What is npm in Node? || 1
+
| Question || Name and briefly describe kernel-debugging techniques. || 1
 
|-
 
|-
| Question || How does Node prevent blocking code? || 1
+
| Question || What debug levels for printk do you know and what is their usage? || 1
 
|-
 
|-
| Question || What is the NodeJS Process Model? || 1
+
| Question || What other methods of Kernel debugging techniques do you know? || 1
 
|-
 
|-
| Question || Why should you separate Express 'app' and 'server'? || 0
+
| Question || Why can’t we use regular GDB to debug Linux Kernel? || 1
 
|-
 
|-
| Question || What is a module in NestJS? What is an interceptor? || 0
+
| Question || Usage of DebugFS for basic debugging || 0
 
|-
 
|-
| Question || What is a middleware in ExpressJS? || 0
+
| Question || Usage of printk and debug levels. || 0
  +
|-
  +
| Question || KGDB usage for Kernel debugging. || 0
 
|}
 
|}
 
=== Final assessment ===
 
=== Final assessment ===
 
'''Section 1'''
 
'''Section 1'''
  +
# Describe basic CPU registers and their purpose.
 
  +
# Describe x86 ABI.
  +
# What is context switching and how does it work?
  +
# Name all CPU security rings and describe security levels.
  +
# Interrupts. Interrupt handler.
 
'''Section 2'''
 
'''Section 2'''
  +
# Briefly describe modern OS architecture. (for ex. Linux)
# How can you center an element inside of a div container with predefined width and height?
 
  +
# Describe supported HW by Linux Kernel.
# What properties of flex elements do you know?
 
  +
# Describe contribution process to Linux Kernel.
# How does a browser understand which CSS rule to apply in case of conflict?
 
 
'''Section 3'''
 
'''Section 3'''
  +
# Name popular bootloaders and briefly describe the difference.
# How does prototypical inheritance work?
 
  +
# Describe all boot sequence starting from pushing START button.
# What is the difference between Map and WeakMap?
 
  +
# Describe in details the role of initrd/initramfs in booting process.
# Why can “this” be lost in JavaScript?
 
  +
# First userspace process. Describe how it works and why do we need SystemV/system?
 
'''Section 4'''
 
'''Section 4'''
  +
# Describe Linux device and driver model
# What are micro-tasks and macro-tasks?
 
  +
# Real- and Virtual- filesystems. Describe in details.
# What is the difference between bubbling and capturing?
 
  +
# Name other Linux Kernel subsystems and their usage.
# What is the Event delegation?
 
 
'''Section 5'''
 
'''Section 5'''
  +
# Describe how virtual memory maps on physical memory.
# How does React check if a component needs to be rerendered?
 
  +
# Describe in details how TLB works. How TLB increases memory operations?
# What is the difference between Component and PureComponent?
 
  +
# Describe structure of page table, its location and management from OS.
# How to emulate lifecycle methods in functional components?
 
  +
# Describe memory allocation techniques. Describe one of them in details.
 
'''Section 6'''
 
'''Section 6'''
  +
# Describe how threading works.
# What is babel? Why do we need it?
 
  +
# Describe pthread API usage.
# What is better: axios or Fetch API?
 
  +
# Describe difference between monotomic and realtime clocks.
  +
# Describe scheduling strategies. Make a suggestion which one is preferred for different situations.
  +
# Question 5
 
'''Section 7'''
 
'''Section 7'''
  +
# Describe mutex internals.
# Describe the concept of stateless and stateful components
 
# Describe the concept of dumb and smart components
+
# Describe spin lock internals.
  +
# Describe deadlock problem and how it could be handled.
  +
# Compare different locking methods and make conclusion of which is faster and why.
  +
# Question 5
 
'''Section 8'''
 
'''Section 8'''
  +
# Explain usage of debugFS in modern kernels.
# How to emulate browser features (cookies, events, etc.) in unit tests?
 
  +
# Describe main kernel debugging techniques.
# Which main optimization problems in React do you know?
 
# How do you test asynchronous functions?
 
'''Section 9'''
 
# How to make a post request in Node.js?
 
# How to create a simple server in Node.js that returns Hello World?
 
# What is the difference between NodeJS Environment and browser environment?
 
# P.1.2.10 Section 10
 
# Section title: Technologies overview: workers, WebSockets, GraphQL, Web Components, Progressive Web Apps, etc.
 
# Topics covered in this section:
 
# Service Workers, Web Workers
 
# WebSockets
 
# GraphQL
 
# Web Components
 
# Progressive Web Apps
 
# What forms of evaluation were used to test students’ performance in this section?
 
# Typical questions for ongoing performance evaluation within this section
 
# What are the concepts lying behind Web Components?
 
# What are the concepts lying behind PWA?
 
# What is the difference between Service Workers and Web Workers
 
# Typical questions for seminar classes (labs) within this section
 
# What is the difference between query and mutation in GraphQL
 
# Why do we need Web Sockets?
 
# Test questions for final assessment in this section
 
   
 
=== The retake exam ===
 
=== The retake exam ===
Line 391: Line 385:
   
 
'''Section 8'''
 
'''Section 8'''
 
'''Section 9'''
 

Revision as of 00:26, 9 September 2022

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