Systems Programming - Purdue University :: Computer Science
Download
Report
Transcript Systems Programming - Purdue University :: Computer Science
Systems
Programming Course
Gustavo Rodriguez-Rivera
CS Common Core Courses
Problem Solving and Object Oriented
Programming
Programming in C
Foundations of Computer Science
Data Structures and Algorithms
Computer Architecture
Systems
Programming
Objective
Consolidate the programming skills from
the previous core courses.
The System Programming course
concentrates on how programs run in user
space and how the interact with the OS.
It does not cover OS internals. That will be
covered in the Operating Systems Course.
Objective (cont.)
It solidifies the programming skills by
having the students write large programs
(>1000 lines).
The students will use tools like IDEs,
debuggers, profilers, and source control to
help them write good and maintainable
code.
The students will learn how to work on
teams.
Objective (cont.)
Use of Scripting Languages.
The students will learn to write multiprocess and multi-threaded programs.
Topics
Address space. Structure of a Program. Text,
Data, BSS, Stack Segments.
Review of Pointers, double pointers, pointers to
functions
Use of an IDE and debugger to program in C
and C++.
Executable File Formats. ELF, COFF, a.out.
Development Cycle, Compiling, Assembling,
Linking. Static Libraries
Loading a program, Runtime Linker, Shared
Libraries.
Topics (cont.)
Scripting Languages. sh, bash, basic UNIX
commands.
File creation, read, write, close, file mode.
IO redirection, pipes
Fork, wait, waitpid, signals.
Directories, creating, directory list.
Project: Writing your own shell.
Source Control Systems (CVS, SVN) and
distributed (GIT, Mercurial)
Topics (cont.)
Programming with Threads, thread creation.
Race Conditions, Mutex locks.
Socket Programming.
Iterative and concurrent servers.
Project: Implementing your own web server with
threads and process concurrency.
Memory allocation. Problems with memory
allocation. Memory Leaks, Premature Frees,
Memory Smashing, Double Frees.
Execution Profiling.
Textbook
No official Textbook.
Class
Notes
Selected Documents and Tutorials available
in the Internet
Recommended Textbook.
Advanced
Programming in the UNIX
Environment, Addison-Wesley, 1992.
Credits
Dr. Douglas Comer wrote the initial
proposal for the Systems Programming
Course.
The proposal was reviewed by Tim Korb,
Gustavo Rodriguez-Rivera and the
Systems Faculty.
Hardware Lab in the
Computer Architecture
Course
By Gustavo Rodriguez-Rivera
Introduction
We want to teach the students that computer
programs are everywhere and not only in
Windows, Linux, and Macintosh computers.
The students also program in
Robots
Phones
Embedded
Processors
The students get hands on experience with both
hardware and software.
The Hardware Kit
The students buy a kit from the department at cost.
The kit contains, breadboard, wires, gates, PIC18
processor, LED display, speaker, and everything they
need to do projects with the PIC18 processor.
PIC 18 processor:
8 bit architecture
2K RAM, 64KB Flash Memory for Programs
USB communication
Digital Input/Outputs, Analog inputs
Timers, interrupts
Assembly and C programming with Microchip’s MPLAB IDE
The Hardware Kit
Programming the PIC18
The students write the Assembly or C
program in a PC running Windows and the
the MPLAB IDE environment.
The program is assembled/compile and
downloaded to the PIC18 using a
programmer called PICKit2.
The MPLAB IDE
Projects
Implementing a 7-Segment display
decoder using AND, OR, NOT gates.
Ambient light using an RGB Full Color
LED, Pulse Wide Modulation (PWM),
push buttons, and the segment display.
Configurable Alarm Clock with selectable
ring tones and interrupts.
Interfacing the PC and a servo motor
using the USB port.
You
are invited to see some of the student’s
projects here in the room.
The
URL of the course is
http://www.cs.purdue.edu/homes/cs250
Thanks!