Lecture # 9 - Systems and Network Programming

Introduction to C/C++ Programming

House keeping items:

Agenda for Today (02/12/20):

Lecture # 9 Notes:

Most operating systems are written in the C programming Language. Unix (and Linux) are both almost entirely developed in C. The C++ language is based on a C language core, but adds powerful and expressive support for object-oriented and generic programming (templates) programming paradigms. Most C programs will compile as C++ programs. This semester we will use both C and C++ (where appropriate) in order to expose the students to the best of both.

  1. C/C++ Presentation
  2. Download class code examples: here
  3. A series of Systems Programming lectures from U.S. Naval Academy (USNA)
  4. 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

Other Resources:

  1. Really Nice C tutorial
  2. Excellent C Programming Tutorial: Tutorialpoint
  3. Another Excellent C Programming Tutorial(divided in basic and advanced topics): Learn-C.org
  4. One of the best C++ tutorials I've seen: cpluspluss.com
  5. Dr. Fawcett's Page on Getting Started with C++
  6. A very good C++ tutorial: LearnCpp.com
  7. Program memory layout
  8. Pointers Tutorial
  9. Stat system call
  10. Stat man page
  11. Compiling Programs using make (chapter 23): linux command line
  12. Lectures from a well thought out systems programming course at USNA
  13. Compilation, Linking and Loading article

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.

  1. 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

  2. A series of the C++ videos corresponding to the C++ story
    can be viewed here

  3. Previously taught (Spring 2019) graduate Object-oriented Design course using C++

Environment Setup Notes:

  1. Install VirtualBox
  2. Install Linux Mint (based on Ubuntu -- I prefer MATE desktop, but many people like Cinnamon)
    • Desktop Comparisons: MATE versus Cinnamon
    • Install Guest Additions - device drivers and system applications that optimize the guest operating system for better performance and usability.
  3. Enable "Shared Clipboard and Drag'nDrop": Settings -> Advanced
  4. Configure shared folders, then run the following commands..
    1. run: sudo usermod -a -G vboxsf `whoami`
    2. run: sudo chown -R `whoami`:users name-of-mount-point
    3. log out, and log back in
  5. Update Mint (run): "sudo apt update && sudo apt upgrade -y"

Interesting Technologies related to Linux:

  1. Kernel-based Virtual Machine (KVM) - turn Linux into a Hypervisor
  2. Docker (Container Technology)
  3. TCPDump & LIBPCAP
  4. Extended Berkeley Packet Filter (eBPF)
*** Action Items for Next Class ***
  • H/W # 5 posted: due Weds: 02/19
  • C/C++ programming