Real-Time Embedded Systems Lab
School of Computing, Informatics, and Decision Systems Engineering
Ira A. Fulton School of Engineering, Arizona State University
Home Contact us Site Map
Faculty People


CSE 530 Embedded Operating System Internals

Course Goals:

The course provides the opportunities for students to acquire hands-on learning experience and in-depth knowledge of Linux kernel and RTOS. After completing the course, students will be able to:

1.      Understand the Linux and RTOS kernel architecture and their APIs to support embedded applications .

2.      Understand the functions and the internal structure of device model, drivers, and sysfs interface .

3.      Acquire the skill to develop Linux kernel modules and system calls, including the use of kernel threads and kernel trace facility to support concurrent operations and instrumentation in target environment.

4.      Improve software development skill, including good quality and coding style for embedded programming, and testing and debugging approaches to verify kernel operations.

Course Outline:

A significant part of course work is to examine and Investigate Linux kernel source code, including task management, kernel synchronization, device driver design, and trace/debug support. Students also need to study the implementation of RTOS (Zephyr) kernel with a focus on microkernel, task management, scheduling, and device control. In addition, Intel Galileo Gen 2 is used as the target development platform.  With its rich architectural features, students can investigate operating system internals and device operations, and to experience system design and development practices.

·       Kernel basics, system call mechanism, Linux loadable module -- building, linking and unlinking, character device driver, and device file operations. [Slide_kernel_syscall_module_driver]

·       Event and time-Driven programming models, Linux kernel thread, pthread, process and LWP, basic synchronization in user and kernel space. [Slide_thread_programming]

·       Linux kernel instrumentation mechanisms -- tracepoint, ftrace, and kprobe. [Slide_Linux_tracepoint_kprobe]

·       x86 Quark processor, PCI bus architecture and configuration, PCI device initialization, GPIO interface in Linux, Galileo GPIO interafces, and GPIO/PWM device programming. [Slide_Quark_PCI_GPIO]

·       GPIO driver structure, GPIO chip driver and pin numbering, GPIO interrupt, binding of platform devices and drivers. [Slide_tGPIO_driver_binding]

·       Linux device model, kobjects, sysfs tree and interface, and class attribute. [Slide_Device_model_sysfs]

·       Linux tasks (task struct, states, and ids), process hierarchy and pid hash, process creation, copy on write, process switching, run-queue structure and TIF_NEED_RESCHED flag for process scheduling, and Linux scheduling classes. [Slide_Linux_process_scheduling]

·       Linux kernel synchronization mechanisms, memory barrier, atomic operation, spinlock in UP and SMP, kernel semaphore and mutex, futex and pthread synchronization, and preempt-RT patch. [Slide_tLinux_synchronization]

·       Linux interrupt handling, IDT and handler table initialization, IRQ descriptor and allocation, bottom-half processing, work queue, request threaded IRQ, wait for compeletion. [Slide_Linux_interrupt_handling]

·       RTOS introdution, Zephyr RTOS architecture and services, Zephyr kernel and application building. [Slide_Zephyr_intro]

·       Zephyr nano- and micro-kernel, fiber and task, data structures for fiber and task, swap operation, Zephyr starting sequence and initialization of public objects, microkernel sever fiber. [Slide_Zephyr_kernel]

·       Zephyr device model, device API, configuration, initialization, and binding, and I2C device driver in Zephyr. [Slide_Zephyr_device_driver]

Project Assignments:

·        Assignment 1 --  Hash Table and Dynamic Probe in Linux Kernel The 1st part of the assignment is to develop a Linux kernel module which initiates a hash table in kernel space and allows the table being accessed as a character device. Hence, user-level programs can manipulate a hash table concurrently in kernel via read, write, and ioctl calls. The 2nd part of the assignment is a loadable module that uses kprobe facility to add and remove dynamic probes in any kernel functions. With the module’s device file interface, a user program can place a kprobe on a specific line of kernel module, access kernel information, and module's local variables.

·        Assignment 2 --  A Device Driver for HC-SR04 distance sensor The assignment is to implement a loadable kernel module which initiates multiple instances of HC-SR04 sensors and allows the sensors being accessed as character devices in user space. The implementation should make use of kernel threads for sampling distance measure periodically and edge interrupts for accurate measurement of pulse width. The development of a platform driver/platform device infrastructure and a sysfs interface for HC-SR04 sensors is also included in the assignment.

·        Assignment 3 --  A Barrier Mechanism in Linux Kernel The assignment is to develop a barrier synchronization mechanism in Linux kernel which can be invoked by user processes via 3 system calls, i.e., barrier_init, barrier_wait, and barrier_destroy. The barrier mechanism must work properly in SMP systems and allow multiple user processes work on multiple barriers in their corresponding address space concurrently.

·        Assignment 4 --  Task Programming and Device driver in Zephyr RTOS The assignment is to implement a Zephyr application that records distance measures from HC-SR04 sensors in a I2C-based EEPROM device. In addition to the construction of HC-SR sensor driver, the application should maximize the bandwidth of data recording and minimize sampling jitter as much as possible. (Build and setup manual for Zephyr on Galileo Gen 2)

TReference Material:


Our Research
Our Goal
We do research on  Real-time Java, Embedded Software and Systems, Smart homes, and so on...
To build reliable real-time embedded system, contribute computer engineering community and make our future better.

 Copyright [2011] [RTES, School of Computing, Informatics, and Decision Systems Engineering. Arizona State University]. All rights reserved