Next:
List of Tables
Up:
Ceng 425 System Programming
Previous:
Ceng 425 System Programming
Contents
List of Tables
List of Figures
Getting Started
Compiling with GCC
Compiling a Single Source File
Optimization Options
Linking Object Files
Common Command-line Options
Error Checking and Warnings
Automating the Process with GNU Make
Debugging with GNU Debugger (GDB)
Compiling with Debugging Information
Running GDB
Finding More Information
Man Pages
Header Files
SYSTEMS PROGRAMMING LABORATORY I - Getting Started
Writing Good GNU/Linux Software
Interaction With the Execution Environment
GNU/Linux Command-Line Conventions
Using getopt_long
Standard I/O
Program Exit Codes
The Environment
Using Temporary Files
Coding Defensively
Errors and Resource Allocation
Writing and Using Libraries
Archives
Shared Libraries
Library Dependencies
Pros and Cons
SYSTEMS PROGRAMMING LABORATORY II - Writing Good GNU/Linux Software
Introduction to Shell Programming
What is Linux Shell?
What is Shell Script ?
Getting started with Shell Programming
Shells (bash) structured Language Constructs
Decision making
Loops
Advanced Shell Scripting Commands
User Interface and dialog utility
getopts command
SYSTEMS PROGRAMMING LABORATORY III - Introduction to Shell Programming
Processes
Looking at Processes
Process IDs
Viewing Active Processes
Killing a Process
Process Control
Attributes
Creating Processes
Using system and popen
Using fork and exec
Using clone
Process Scheduling
Signals
Process Termination
Waiting for Process Termination
The wait System Calls
Zombie Processes
Cleaning Up Children Asynchronously
SYSTEMS PROGRAMMING LABORATORY IV - Processes
Threads
Thread Creation
Passing Data to Threads
Joining Threads
Thread Return Values
Thread Attributes
Thread Cancellation
Synchronous and Asynchronous Threads
Uncancelable Critical Sections
Thread-Specific Data
Synchronization and Critical Sections
Race Conditions
Mutexes
Mutex Deadlocks
SYSTEMS PROGRAMMING LABORATORY V - Threads I
Semaphores for Threads
Linux Thread Implementation
Processes Vs. Threads
Interprocess Communication
Shared Memory
Fast Local Communication
The Memory Model
Allocation
Attachment and Detachment
Controlling and Deallocating Shared Memory
Processes Semaphores
Allocation and Deallocation
Initializing Semaphores
Wait and Post Operations
Mapped Memory
Mapping an Ordinary File
Pipes
Communication Between Parent and Child Processes
Redirecting the Standard Input, Output, and Error Streams
FIFOs
SYSTEMS PROGRAMMING LABORATORY VI - Threads II & IPC
Sockets
Socket Concepts
System Calls
Servers
Local Sockets
An Example Using Local Namespace Sockets
Internet-Domain Sockets
Devices
Device Types
Device Numbers
Device Entries
The /dev Directory
Accessing Devices by Opening Files
Hardware Devices
Special Devices
ioctl
SYSTEMS PROGRAMMING LABORATORY VI - IPC II & Devices
Device Drivers
The Role of the Device Driver
Splitting the Kernel
Loadable Modules
Classes of Devices and Modules
Building and Running Modules
The Hello World Module
Kernel Modules Versus Applications
Concurrency in the Kernel
A Few Other Details
Compiling and Loading
Loading and Unloading Modules
The Kernel Symbol Table
SYSTEMS PROGRAMMING LABORATORY VIII - Device Drivers
Linux System Calls
Using strace
access: Testing File Permissions
fcntl: Locks and Other File Operations
fsync: Flushing Disk Buffers
getrlimit and setrlimit: Resource Limits
getrusage: Process Statistics
The mlock Family: Locking Physical Memory
mprotect: Setting Memory Permissions
readlink: Reading Symbolic Links
sysinfo: Obtaining System Statistics
uname
Inline Assembly Code
When to Use Assembly Code
Simple Inline Assembly
Converting an asm to Assembly Instructions
Example
SYSTEMS PROGRAMMING LABORATORY IX - Linux System Calls & Inline Assembly Code
The /proc File System
Extracting Information from /proc
Process Information
/proc/self
Process Argument List
Process Environment
Process Executable
Process File Descriptors
Process Memory Statistics
Hardware Information
Kernel Information
Drives, Mounts, and File Systems
System Statistics
Secure Programming
Types of Applications
Users and Groups
Process User IDs and Process Group IDs
File System Permissions
Security Hole: Programs Without Execute Permissions
Sticky Bits
Real and Effective IDs
Setuid Programs
More Security Holes
Buffer Overruns
Race Conditions in /tmp
Using system or popen
SYSTEMS PROGRAMMING LABORATORY X - The /proc File System & Secure Programming
Programming the User Interface
Terminal Control the Hard Way
Controlling Terminals
Using the Terminal Interface
Changing Terminal Modes
Using terminfo
Screen Manipulation with ncurses
About Windows
Illustrating ncurses Initialization and Termination
Input and Output
X Window Programming
The Xlib API
A Sample Xlib Program
The X Toolkit API
Creating Graphical Interfaces
KDE and Qt
Creating and Displaying a Window
vita
Cem Ozdogan 2007-05-16