Computer Science, Prifysgol Cymru Aberystwyth University of Wales


CS23710 - C and UNIX Systems Programming


Brief Description

The main objectives of this course are to teach the basic features of the C programming language, the structure of the Unix operating system and the Unix interface to the programmer.

The facilities of C will be introduced by comparison with those of Ada, the emphasis being on the rationale behind the language design decisions for the two programming languages. Emphasis will also be placed on C programming incorporating good modular design, readability, portability, and use of appropriate tools.

The second part of the course will address the structure of the Unix operating system and the interface presented by functions and system calls for use from C.

The unit will also consider the relevance of standards, both in C and in Unix.

Aims, Objectives, Syllabus, Booklist


Further Details

Number of lectures
24
Number of seminars/tutorials
4
Number of practicals
0
Coordinator
Dr. Fred Long
Other staff involved
Not yet known
Pre-requisites
CS22210
Co-requisites
CS21020
Incompatibilities
None
Assessment
Assessed coursework - 100%
Timing
This module is offered only in Semester 2

Aims

The aim of this course is to teach the student the fundamentals of the C language. In order to compare the facilities and underlying philosophy of C with that of Ada, the first part of the course will draw closely on the material that is covered in CS21020 .

The UNIX operating system is studied as an example of the operating systems material covered in CS22210 and also as an application of the C language.

Objectives

The detailed objectives of this module are:

Syllabus

Basic Concepts - 1 Lecture
History of the C language, philosophical differences between C language design and Ada. Basic form of a C program compared with that of an Ada program. Using the compiler.
Control Structures - 2 Lectures
Sequence, branching and iteration in C compared with that of Ada.
Basic Data Structures - 1 Lecture
Review of basic data types and operators in C.
Subprograms - 1 Lecture
Discussion of ways in which functions are implemented, and used in C, including parameter passing mechanisms.
Composite Data Structures - 1 Lecture
A first discussion of Arrays in C. Input/Output.
Software Support Tools - 1 Lecture
Make, Lint, Debuggers (UPS). Libraries and library utilities.
C Programming Style and Portability - 1 Lecture
Language standards. Portability. Programming standards.
Arrays, Pointers and Functions - 2 Lectures
A discussion of pointer data types, how they relate to arrays, and how they contrast with the Ada Access type.
Dynamic Data Structures - 2 Lectures
Implementation of various record structures and dynamic structures. Pointers. Malloc. Examples in C. Parallels will be drawn with similar constructs in Ada.
Pitfalls - 1 Lecture
Major problem areas. Design rationale of C and of Ada in problem areas.
Further Features - 1 Lecture
C preprocessor, header files, conditional inclusion, macro substitution, bitwise operators, casts, enumeration, scope, static and external declarations, separate compilation
The Structure of UNIX - 2 Lectures
An overview of the structure of the UNIX operating system and a description of the major components, including: the kernel, device drivers, the filesystem, the process, the terminal. An introduction to the programming interface to Unix.
The Filesystem and Files - 2 Lectures
The structure of the filesystem and associated operations. The types of file and the operations on files.
The Process and Interprocess Communication - 2 Lectures
The concept of the process and associated operations.
The Terminal - 1 Lecture
A study of the general interface.
Network Programming - 1 Lecture
A study of network programming using remote procedure calls and the Transport Level Interface.
Standards - 1 Lecture
ANSI 'C'; IEEE POSIX; UNIX International SVID; XOPEN XPG; COSE
Window systems and Event-Driven Programming - 1 Lecture
An appreciation of some of the problems involved in the programming of applications which interact with the X window system. Includes studying event-driven programming techniques.

Booklist

Students are likely to need ready access to the following

L. Ameraal. C for Programmers. Wiley, 1991.

K. Haviland and H. Salama. UNIX Systems Programming. Addison Wesley, 1987.

The following should be consulted for different approaches or for further information

B.W. Kernighan and D. Ritchie. The C Programming Language - 2nd Edition. Prentice Hall, 1988.

M.J. Bach. The Design of the UNIX Operating System. Prentice Hall, 1986. Of value to students interested in the design of the UNIX Operating System.

Andrew Koenig. C - Traps and Pitfalls. Addison Wesley, 1988.

L.W. Cannon et.al. Indian Hill C Style and Coding Standards. Technical report, University of Toronto, 1990. This highly recommended document is available in the home directory of user cmk as misc/c/docs/ihstyle.ps.

Version 2.2

Syllabus Syllabus

Nigel Hardy Departmental Advisor

nwh@aber.ac.uk

Dept of Computer Science, UW Aberystwyth (disclaimer)