Advanced System Programming Lectures

(Click to  Download PPT)

Quick course-preview: intro635.ppt (PowerPoint Slides)
lesson1.ppt (PowerPoint Slides)
Demo program: hello.c illustrates a minimal application-program, written in the C language
Kernel module: kello.c modifies the 'hello.c' program, so it becomes a Linux kernel module
lesson2.ppt (PowerPoint Slides)
Demo program: mycat.c shows how you could implement your own emulation for the 'cat' command
Kernel module: cmos.c shows how to create a pseudo-file that will display some device information 
Kernel module: moreinfo.c shows how '/proc' files can be designed to display a lot more information
lesson3.ppt (PowerPoint Slides)
Kernel module: tempcdev.c shows how a kernel module can create a temporary device special file 
Kernel module: seesetfs.c to clarify the effect of the misleadingly-named 'set_fs()' macro-statement
Demo program: devtfix.cpp it clarifies what 'dev_t' parameter-value to use in a 'mknod()' system-call
lesson4.ppt (PowerPoint Slides)
Demo program: elfcheck.cpp illustrating use of standard file-I/O library functions by a user program
Kernel module: cmosram.c showing the implementation for a simple character-mode device-driver
lesson5.ppt (PowerPoint Slides)
Kernel module: tasklist.c creates a pseudo-file that will show a list of all the system's active tasks
lesson6.ppt (PowerPoint Slides)
Demo module: stash.c illustrates the use of 'sleeping' and 'waking' in a character device-driver
lesson7.ppt (PowerPoint Slides)
Demo program: concur1.cpp showing why thread-synchronization is needed in multiprogramming
Demo program: concur2.cpp revises 'concur1.cpp' so it incorporate the use of 'mutual exclusion'
Demo program: yielding.cpp demonstrates the 'nanosleep' system-call in Linux multiprogramming
Demo program: concur3.cpp revises 'concur2.cpp' so it uses 'nanosleep' to reduce 'busy-waiting'
Demo module: newstash.c uses kernel semaphores to remove 'race conditions' observed in 'stash.c'
lesson8.ppt (PowerPoint Slides) 
Demo program: showgdt.cpp shows the CPU's Global Descriptor Table (if our 'dram.ko' is installed)
Code-fragment: cmosread.asm a commented disassembly of the kernel's 'rtc_cmos_read()' function
Student-contributed tool: findFunction.sh (automates the dissassembly of a specified kernel-function)
lesson9.ppt (PowerPoint Slides)
Exercise solution: cmpxchg.cpp (to illustrate the effect of the 'cmpxchg' instruction upon the ZF-flag)
lesson10.ppt (PowerPoint Slides)
Demo program: showidt.cpp shows the CPU's Interrupt Descriptor Table (if our 'dram.ko' is installed)
Demo module: smpinfo.c shows the MP Configuration Table and Base Configuration Table's entries
Demo module: ioapic.c lets users view the current register-values in the memory-mapped I/O APIC 
lesson11.ppt (PowerPoint Slides)
Demo module: ioremap.c for illustrating effects of the kernel's 'ioremap()' and 'iounmap()' functions
Exercise solution: delaysix.cpp showing one possible way to perform the desired six-second delay
lesson12.ppt (PowerPoint Slides)
Demo module: pgdir.c for providing a visualization of the current task's 'mapped' memory regions
Demo module: cr3.c creates a pseudo-file showing current values held in registers CR3 and CR4
Demo module: mm.c creates a pseudo-file showing information from a task's 'mm_struct' object
Demo module: vma.c creates a pseudo-file that shows a task's list of 'vm_area_struct' objects
Demo program: domalloc.cpp examines the effect of 'malloc()' on a task's kernel data-structures
Demo program: dofork.cpp examines the effect of 'fork()' on the list of 'vm_area_struct' objects
lesson13.ppt (PowerPoint Slides)
Demo program: testuart.cpp uses 'loopback' mode to illustrate programming of the serial UART
Demo program: loopback.cpp showing how a UART could support interprocess communication
Demo programs: uartecho.cpp and trycable.cpp for checking that your null-modem cable works
lesson14.ppt (PowerPoint Slides)
Demo module: uartintr.c provides an example of an interrupt-handler written for the serial-UART
lesson15.ppt (PowerPoint Slides)
Demo module: vram.c this device-driver provides user-mode access to the video display memory
Demo program: rotation.cpp uses 'vram.c' to perform rotation of (red,green,blue) color-components
Demo program: inherit.cpp demonstrates inheritance of a parent's memory-map by a child-process
lesson16.ppt (PowerPoint Slides)
Demo module: baudrate.c shows the implementation of an 'ioctl()' method in a Linux device-driver
Demo program: setbaud.cpp allows users to query or modify the serial-UART's current baud-rate 
lesson17.ppt (PowerPoint Slides)
Demo module: tasklet.c illustrates use of a Linux 'tasklet' for doing bottom-half interrupt handling
Working example: myserial.c shows a possible solution to the assigned programming project #2
lesson18.ppt (PowerPoint Slides)
Demo module: foo.c a very simple device-driver that lets application programs read 'jiffies_64'
Demo program: watchfoo.cpp a program that continually displays the current 'jiffies_64' value
Demo module: timedfoo.c this driver uses a kernel timer to curtail the frequency of 'read()' calls
Demo module: trytimer.c illustrating how a kernel module might utilize a dynamic kernel timer
Demo module: trymacro.c illustrating use of 'sizeof' and 'offsetof', plus the 'container_of()' macro
Demo module: tryworkq.c illustrating the use of a 'workqueue' for scheduling some future action
Demo module: announce.c shows how a kernel module can display its messages in a window
Demo module: defermsg.c uses a workqueue to delay a message's appearance for ten seconds
lesson19.ppt (PowerPoint Slides)
Demo program: pciprobe.cpp shows how software can enumerate a system's PCI device-functions
Demo module: utsname.c shows how a module can find out the name of the node it is running on
Demo module: tigon3.c shows our network interface's MAC-address and PCI configuration space
Exercise solution: anchor.c modifies 'tigon3.c' so it performs the same function on Intel 82573L nic
lesson20.ppt (PowerPoint Slides)
Demo program: noncanon.cpp shows how applications can enable 'noncanonical' keyboard input
Demo program: mapwatch.cpp gives a dynamic visualization of current 'permanent' kernel-maps
Demo module: pkmaps.c creates the two pseudo-files required by our 'mapwatch' program above
Demo program: smpwatch.cpp shows a real-time display of dual-CPU interrupt-activity under Linux
Kernel module: smpwatch.c this driver is required when running our Linux 'smpwatch.cpp' application
lesson21.ppt (PowerPoint Slides)
Demo module: gbstatus.c it allows users to see the Intel 82573L controller's Device Status register
Developer tool: igbe.c to aid with debugging of a device-driver for Intel's GigaBit Ethernet controller
lesson22.ppt (PowerPoint Slides)
Demo module: tryreset.c performs an experiment with the 'reset' capabilities of the 82573L controller
lesson23.ppt (PowerPoint Slides)
Demo module: seereset.c shows the sequence of register state-changes during 'reset' of the 82573L
Kernel module: setupnic.c performs a system administration chore needed by a 82573L device-driver
Shell script: setupnic it will accelerate our attempts at loading the foregoing 'setupnic.ko' kernel-object
Database template: ethers for translating from Ethernet-address to Hostname on our 'anchor' cluster
Kernel module: audio.c showing one possible way of answering Question V on our Midterm Exam II
lesson24.ppt (PowerPoint Slides)
Kernel module: xmit1000.c supports writing a message to our '/dev/nic' device-file via Intel's 82573L 
lesson25.ppt (PowerPoint Slides)
Kernel module: recv1000.c receives packets sent by our 'xmit1000.c' driver via Intel's 82573L nic
lesson26.ppt (PowerPoint Slides)
Kernel module: nic.c combines 'write()' and 'read()' from previous 82573L drivers, and adds 'ioctl()'
Demo program: sendto.cpp uses 'ethers' lookup and 'ioct()' call to send packets to a specific node
lesson27.ppt (PowerPoint Slides)
Demo program: syswrite.cpp shows how applications can issue a system-call directly to the kernel
Demo module: myexport.c this module can 'export' the address of the kernel's 'sys_call_table[]' array
Shell script: myscript automates the address-lookup and module-installation steps for 'myexport.ko'
Demo module: newcall.c replaces the code for an obsolete system-call with our own kernel function
Demo program: try17.cpp this program can be used for testing our new system-call implementation
Exercise solution: unused.c creates a pseudo-file that lists all the obsolete system-call ID-numbers

No comments:

free counters