CPS 444/544 Lecture notes: Introduction to Systems Programming
Coverage: [OSC8] Chapter 1 (pp. 3-47) and [UPE] Preface
Introduction to CPS 444/544
- logistics, evaluation, and policies
- this is a class on UNIX and C
What is systems programming?
- generally, developing programs which support
the development of other programs
- the process of developing systems software
What is systems software?
- software which supports software development,
or a computer system in general
- software which allocates and manages
computer resources (e.g., CPU, memory, devices)
Examples of systems software
- compilers (e.g., gcc)
- command interpreters (i.e., shells, e.g., bash)
- system libraries (e.g., libc)
- device drivers
- debuggers (e.g., gdb)
- system utilities (e.g., env)
- configuration managers (e.g., git)
- compilation managers (e.g., make)
One dichotomy of programming
- application programming: targeted toward developing systems
to support the end-user
- systems programming:
targeted toward developing systems
to support the programmer
Recently, this boundary has become fuzzy. Building a web browser,
such as Google Chrome might once have been considered
application programming. However, nowadays developing such
applications requires attention to system details such as
resources and efficiency (e.g., Google Chrome
Historically, systems programming meant programming the system
(i.e., building compilers, shells, loaders, and so on). However, nowadays,
systems programming has come to mean programming with the system (i.e.,
making system calls, managing threads, and so on).
We could also say that computer science students study programming software
while computer engineering students study programming the interface between
hardware and software (historically, they studied programming hardware).
Another viewpoint (course themes)
Review of operating system nomenclature
- program vs. (heavyweight) process
- thread (lightweight process):
- an ADT within a process
- has its own stack, program counter value, register set, and state
- share process resources (e.g., open files)
- (heavyweight) process vs. (lightweight) thread
- process control block
- batch process
- resident monitor
- timesharing (or preemptive multi-tasking)
- non-preemptive multi-tasking = multiprogramming without timesharing
- job scheduling
- ready queue
- process scheduling (or CPU scheduling)
- context switch
- context switch time
- quantum (or time slice)
- system call
- interrupt (hardware)
- interrupt service routine
- (asynchronous or synchronous) signal (software)
- asynchronous event
- synchronous event
- device driver
- paged segmentation
UNIX is a multiprogramming, timeshared OS.
Why study this stuff anyway?
- an improved understanding/appreciation of the internals of
your system and systems software
will make you a better application programmer
- UNIX and C are an enabling environment/language for wide
- since UNIX and C are ubiquitous in our field, in general,
to be a well-rounded computer scientist
- communication and concurrency are everything in today's software
- ability to write reliable and secure code is indispensable
- gateway to studies in distributed computing and networking
- Develop a proficiency in UNIX and C as a systems programming
- Survey various system-oriented software tools,
including debuggers, and compilation and configuration managers.
- Establish an understanding of the design and
development of systems software, such as command interpreters and compilers,
through the study of pattern matching and filters, interprocess communication,
system libraries, signals, and automatic program generation.
- Explore UNIX internals and
establish an understanding of UNIX system calls.
- Introduce the client/server model of computation.
Overview of CPS 444/544 course outline
||A. Silberschatz, P.B. Galvin, and G. Gagne.
Operating Systems Concepts.
John Wiley and Sons, Inc., Eighth edition, 2009.
||B.W. Kernighan and R. Pike. The UNIX Programming Environment.
Prentice Hall, Upper Saddle River, NJ, Second edition, 1984.