Lecture # 16 Notes:
Review (discuss) midterm topics, files and I/O in C (libc) and C++ (libstdc++) ,
serialization.
Begin discussion of User/kernel space, system calls (open,read,write,fork,exec), I/O buffering, process creation, process images (exec), etc.
- Review Midterm topics: H/W # 5 solution H/W # 7 solution
- Discuss: HW # 8 (readfile_block.cpp)
- Discuss: Project # 1 (posted): due Friday April 3rd
- Discuss Systems Programming Resources
1. USNA (Systems Programming) lectures
- User/Kernel space, System call Overview
- File I/O: read, write, open system calls
- Process creation and termination: I/O buffering
- Fork, Exec system calls, Process management
- Process Scheduling
2. Previous (Lecture 15) Notes and C/C++ Presentation Materials
- C/C++ Introduction: Mike C. notes
- C++ Survival Guide (basic syntax notes and important concepts): Dr. Fawcett
- C and C++ compilation, memory, and computation models
- Assessment of the C++
- Discussion on the elements that comprise C and C++
- Discussion on Packages and Modularity
- Important linux/system header files
- The structure and data flow in sytems is often documented with standard UML diagramming: You should be aware of it
3. Code Examples from 03/02 and 03/04
- Demo stdout/stderr file streams, write system call
- Demo Pass by value, Pass by reference, basic pointers and memory allocation (new/delete, malloc/free)
- Demo C-style strings
- Demo C++ std::strings
- Demo File I/O in C (fopen/fgetc/fprintf,read lines, memory allocation with malloc etc.) Reading/Writing Text Files: C example
- Demo File I/O in C++ (ifsteam/ofstream streams: Reading/Writing Text Files: C++ example
- Demo structs, serialization, reading/writing binary files: C++ example
- Demo reading/writing binary files in C (glibc: fopen/fread/fwrite/fseek etc) C example
- Demo reading/writing binary files in C++ (fstream library: command line args, ifstream/oftstream etc.) C example
4. Type Serialization/Deserialization example
5. C Package example for HW # 7
6. Example of a real C++ package - supports linux file and directory operations (prior to C++ 17 file system)
7. Lecture 14 Examples: Download
Note: You will need C and C++ compilers
- I will use GNU C/C++ (gcc/g++). The Linux Minit distro comes with gcc installed by default, but not g++
- Install g++ with the following command (Open terminal and type): sudo apt-get install g++
- You can install and use gcc/g++ on your Mac computer. Use this is option if you don't have a Linux distro
Code (C and C++ tutorial) Resources:
- Really Nice C tutorial
- Excellent C Programming Tutorial: Tutorialpoint
- Another Excellent C Programming Tutorial(divided in basic and advanced topics): Learn-C.org
- One of the best C++ tutorials I've seen: cpluspluss.com
- Dr. Fawcett's Page on Getting Started with C++
- A very good C++ tutorial: LearnCpp.com
- Program memory layout
- Pointers Tutorial
- Stat system call
- Stat man page
- Compiling Programs using make (chapter 23): linux command line
- Lectures from a well thought out systems programming course at USNA
- Compilation, Linking and Loading article
- A series of Systems Programming lectures from U.S. Naval Academy (USNA)
Dr. Fawcett's developed resources:
Dr. Fawcett taught graduate software design courses here at Syracuse from 1990 - Spring 2019. Most of my software training
was here at SU in Dr. Fawcett's courses from 2005-2019. In retirement he is continuing to
develop (current) software training materials, most of which is hosted in his new github website available
via the URLs below.
- The C++ story provides detailed coverage of the C++ language: specifically how to utilize
the language and its features effectively. The intent of the story is to meet people on individual level of experience. Beginning
C++ programmers can begin to get handle on using the language, while experienced programmers can get detailed insight
into the more advanced aspects.
View the C++ story here
- A series of the C++ videos corresponding to the C++ story
can be viewed here
- Previously taught (Spring 2019) graduate Object-oriented Design course using C++