CS449 - Introduction to Systems Software & Programming

Spring 2007

Computer Science Help Desk Hours
Pitt Student Code of Conduct for use of technology
ACM Activities (Pitt chapter of Association for Computing Machinery)

Instructor: Dr. Yasir Khalifa

TA: Mohammd Hammoud

TA: Iyad Batal

TA: Ricardo Villamarin-Salomon

Email: khalifa@cs.pitt.edu
Tel. (412) 624-8408
Office: 6203 SS- Sennott Square
Office Hours:
TH (12-12:45) &  (7:15-7:45) & MW(2:15-2:45pm)  or by appointments.
Web page: http://www.cs.pitt.edu/~khalifa
Email: mhh@cs.pitt.edu
Phone: (412) 624-8402
Office:  6805-SENSQ
Office Hours: TBA.
Web page: http://www.cs.pitt.edu/~mhh
Email: iyad@cs.pitt.edu
Phone: (412) 624-
8841
Office: 
6505-
SENSQ
Office Hours: TBA.

Web page:
http://www.cs.pitt.edu/~iyad/
Email: rvillsal@cs.pitt.edu
Phone: 412-624-7253
Office:  5506-SENSQ
Office Hours:  W/F: 6– 7:30 p.m.
Web page: http://www.cs.pitt.edu/~rvillsal
Class (CRN=12481): MW(3-4:15pm)203-LAWRN

Class (CRN=12686): TH(6-7:15pm)203-LAWRN

Recitations:
Tues [CRN= 12687] (7:25-8:15pm) 5505-SENSQ.
Recitations:
F[CRN= 12483] (2-2:50pm) 5505-SENSQ.
F [CRN=
12482] (3-3:50pm) 5505-SENSQ.

Software packages needed in the course (all freeware):

  • Install PALM  OS Developer Studio from the course ftp site (download and install- big file: ~275MB).
    Installing the developer studio (or also called developer suite) will install automatically with it the following:
                1. PalmOS SDK environment
                2. Cygwin (PRC-Tools including Pilrc)
                3. PalmOS Emulator
                4. PalmOS Simulator

  • Download instructions on how to create a project in Developer Studio, and related tools (i.e. Cygwin options and feedback on some errors).


  • pilrc -resource compiler (install only if you downloaded developer studio and had a Pilrc Error when you attempt to build the project--this means that the pilrc executable is missing from developer studio's Cygwin tool. If so, then install the pilrc tool and then look for and copy pilrc.exe into the bin/ directory inside C:\PalmOSCygwin).
  • Cygwin (no need to install this if you already installed developer studio with the install Cygwin option).

 

CD Resources for the PDA Programming in C Book
 

Weekly Activities and lectures:

I. C Programming
1. Common useful UNIX commands

2. C_Basics-2 (ppt)

Examples-Demo-in Class Use:
Example1 (using statements, relational operators, & quality operators)
Example2 (Class avg w/counter controlled repetition)
Example3 (Analysis examination results)

Data types (unsigned ints)

-A Simple C Program: Printing a Line of Text

-Adding Two Integers
-Memory Concepts
-Arithmetic in C
-Precedence in C
-Decision Making: Equality and Relational Operators

-Introduction, design flow, programming style, data types in C,  variables, and declarations, arrays, and strings in C. CopyStringsExample.c ReadStringExample.c
-Strings (practical reference)-- http://www.macdonald.egate.net/CompSci/hstrings.html
-More on strings in C, and strings/arrays

-Links to various C-Compilers and different platforms including (PC-Windows).

3.C_ProgramsControl (ppt) -C: decision and control statements (if, while & do/while, for, switch, break& continue statements)
-For loop with comma-separated lists --Example: forloop.c
-Variable scope.
-Logical Operators, 
-Equality & assignment operators.
-Example: CountLetGrade.c
4.C_Functions (ppt1)

4'-C_Functions-continue (ppt2)


-Enumeration--enum & typedef (ppt)
 Example-1, 2

 

Functions in C:
-Program Modules in C
-Math Library Functions
-Functions (Definitions, Prototypes, Header Files
-Calling Functions (Call by Value and Call by Reference) -- Example (findMax)
-Random Number Generation
-Example: (A Game of Chance)
-Storage Classes
-Scope Rules -- Examples: scoping.c, scoping2.c
-Recursion
-Example Using Recursion: (The Fibonacci Series)
-Recursion vs. Iteration
5.   C_Arrays (ppt2)--newer set Arrays in C
Example-1: preprocessor & symbolic constants with Arrays.
Example-2: histogramArrays.c  compare with histogramSwitch.c
Example-3: Arrays and strings.
Example-4: auto & static local arrays

Example-5: passing arrays to functions.

Students' in Class-Questions (set1-TH)

Students' in Class-Questions (set2-MW)

6. Pointers(ppt) [pointers, vars, and arrays] Pointers & arrays, and parameter passing. Pointers--basics sample
Call by reference (pointers) and call by value --Compilation snapshots
Pointers & Arrays -Referencing:  sample-1  code &  sample-2 (1/29)
Constant Qualifiers with Pointers:
a) Non-Constant pointer to non-constant-data sample (same as sample-1)
b) Non-constant-pointer to constant-data sample
c) Const-pointer to non-constant-data (1/29)
     Attempting to modify non-constant-pointer to constant-data sample
d) Const-pointer to const-data (1/29)
     Attempting to modify constant-pointer to constant-data sample

-Pointers Arithmetic (slides) & copying strings with Arrays-Pointers: example (1/29).

-Arrays of Pointers (example). 1/29
-Pointers to functions (example). 1/29

C Formatted I/O (ppt) Formatting output with printf( ).
Note-1: printf("%p", var);  //p-outputs memory location as hexadecimal integer on most platforms.
7. Pointers & Structures, Unions (ppt)

-Brief set of slides for above #7 (ppt)

8. Strings and chars (ppt)

Structures & Unions, Bit Manipulations and Enumerations.
Advanced data types in C: structures, unions, typedef, enum, casting. Pointers in C.
Pointers & Structures (Basics--sample)

Arrays of Pointers and Structures and using structures with functions (example)

Revisit - data types (unsigned ints)

8.Preprocessing, Makefile, FileIO (ppt)

 

9. More on File I/O (ppt)

C preprocessor. Header files. Sample program.

Useful C-Programming link--others below:

Links about C programming

  • Online reference for the Standard C programming language Link
  • Tutorial on C Pointers: Link
  • Another C Tutorial Link
  • C Tutorial at About.com Link
  • Programming in C under UNIX & Makefiles Link
  • C Programming tips Link

-Makefiles. Introduction to Palm OS and event driven GUI programming.
-Basic Makefile  -- Useful link about Makefile -- Palm generic Makefile

-Another Makefile Example (all progs together)

Other makefile resources (1, 2, 3)

Qs from class.

Build your own 100-word computer (Simpletron)

Look under Projects/Assignments link.

 

  • Requirements
    A) Part-1 Machine Language
    1)
         Use a sentinel-controlled loop to read 10 positive integers and compute and print their sum
    2)
         Use a counter-controlled loop to read seven numbers, some positive and some negative, and compute and print their average.
    3)
         Read a series of numbers and determine and print the largest number. The first number read indicates how many numbers should be processed.

     B) Part-2: C-Programming
     Write the code to interpret/compile the SML programs.
      Your
    C-program should give the user two options to enter the SML code (1 & 2 as follows):
          1. Interactively by entering each instruction at the command-line, one instruction at a time.
          2. By reading the SML instructions-code from a file. Your program should read all the instructions from the file and proceeds execution.            

    C) Simpletron Specs with SML (machine language) sample programs.

  • Midterm (study guide) Wed. Feb. 28 (for M.W. class)
    Thurs. March 1 (for T.H. class).

    II. OS Concepts

     

    Shell Programming (class-notes)

    UNIX Commands help -- OS examples   &  UNIX Signals, UNIX Errors Codes, & UNIX Shells1,  Shells2

    Shell Programming:
    1. UNIX Shell Scripts (overview)
    2. Examples (csh-1) (csh-2) (csh-3 deleteFiles)

    3. Verify User LoggedOn (csh), KornShell (date), bourneShell example(date), readstdin example, displayColors(csh), deletePermission(csh), readFiles(csh)

    Processes:
    Examples on Processes: example.1(Comm)  example.2 (fork)

    Example-Create a Simple Shell & tutorial  including (exec( ) ) w/return values

    Processes & Threads  Processes, threads, interprocess communication, IPC problems (Dining Philosophers, Readers-Writers, & Sleeping Barber problems, & Scheduling.
    POSIX Threads: example.1(no mytex)  example.2 (mutex) Processes Implementation Issues - Tutorial
    III. PalmOS
    • Install PALM  OS Developer Studio  from the course ftp site (download and install- big file: ~275MB).
      Installing the developer studio (or also called developer suite) will install automatically with it the following:
                  1. PalmOS SDK environment
                  2. Cygwin (PRC-Tools including Pilrc)
                  3. PalmOS Emulator
                  4. PalmOS Simulator

    • Download instructions on how to create a project in Developer Studio, and related tools (i.e. Cygwin options and feedback on some errors).


    • pilrc -resource compiler (install only if you downloaded developer studio and had a Pilrc Error when you attempt to build the project--this means that the pilrc executable is missing from developer studio's Cygwin tool. If so, then install the pilrc tool and then look for and copy pilrc.exe into the bin/ directory inside C:\PalmOSCygwin).
    • Cygwin (no need to install this if you already installed developer studio with the install Cygwin option)
     

    Palm OS Overview

    Palm Application Development Tutorial

    Overview of the Palm OS-PDA programming (develop a Palm application, tools used, generate a Palm executable, and run a Palm application).

    HelloWorld Example (hello.c, hello.rcp, hello.h, hello.prc --executable), and Makefile

    Instructions on how to create a project in PalmOS Developer Studio

    Reading: chapters 1-3 (PDA programming in C-book)

    PalmOSHandlingEvents (ppt) Event Structure in Palm and Handling Events.

    Reference: chapter 6 (PDA Programming in C- book)

    DataTypes-(ppt) Common data types in PalmOS

    Reference: chapter 8 (PDA Programming in C- book)

    PalmOSMemoryMgnt (ppt)

    Memory Management in Palm OS.
    Memory Manager APIs:

    Reference: chapter 7 (PDA Programming in C- book)

    User Interface Elements
    (Resource Programming) (ppt)
    Palm OS resources, building forms. Programming user interface elements: buttons and alerts.
    String Resources in PalmOS

    Reference: Chapter 4 (PDA Programming in C- book)

    PalmOS-Practices Exercise-1 (simple editor) and Exercise-2 (hello2.zip)

    Reference: Chapter 5 (PDA Programming in C- book)

    Final Exam -

    Week of April 23-28

    The final exam is scheduled as the following: (final study guide)

    For the M.W. Class --> the Final Exam is on Tues, Apr 24 (8-9:50am).

    For the T.H. Class --> the Final Exam is on Tues, Apr 24 (6- 7:50pm).