Abstract
This chapter covers the background information needed for systems programming. It introduces several GUI based text editors, such as vim, gedit and EMACS, to allow readers to edit files. It shows how to use the EMACS editor in both command and GUI mode to edit, compile and execute C programs. It explains program development steps. These include the compile-link steps of GCC, static and dynamic linking, format and contents of binary executable files, program execution and termination. It explains function call conventions and run-time stack usage in detail. These include parameter passing, local variables and stack frames. It also shows how to link C programs with assembly code. It covers the GNU make facility and shows how to write Makefiles by examples. It shows how to use the GDB debugger to debug C programs. It points out the common errors in C programs and suggests ways to prevent such errors during program development. Then it covers advanced programming techniques. It describes structures and pointer in C. It covers link lists and list processing by detailed examples. It covers binary trees and tree traversal algorithms. The chapter cumulates with a programming project, which is for the reader to implement a binary tree to simulate operations in the Unix/Linux file system tree. The project starts with a single root directory node. It supports mkdir, rmdir, creat, rm, cd, pwd, ls operations, saving the file system tree as a file and restoring the file system tree from saved file. The project allows the reader to apply and practice the programming techniques of tokenizing strings, parsing user commands and using function pointers to invoke functions for command processing.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Debugging with GDB, https://ftp.gnu.org/Manuals/gdb/html_node/gdb_toc.html, 2002
Linux vi and vim editor, http://www.yolinux.com/TUTORIALS/LinuxTutorialAdvanced_vi.html, 2017
GDB: The GND Project Debugger, www.gnu.org/software/gdb/, 2017
GNU Emacs, https://www.gnu.org/s/emacs, 2015
GNU make, https://www.gnu.org/software/make/manual/make.html, 2008
Wang, K. C., Design and Implementation of the MTX Operating system, Springer A.G, 2015
Youngdale, E. The ELF Object File Format: Introduction, Linux Journal, April, 1995
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2018 Springer International Publishing AG, part of Springer Nature
About this chapter
Cite this chapter
Wang, K.C. (2018). Programming Background. In: Systems Programming in Unix/Linux. Springer, Cham. https://doi.org/10.1007/978-3-319-92429-8_2
Download citation
DOI: https://doi.org/10.1007/978-3-319-92429-8_2
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-92428-1
Online ISBN: 978-3-319-92429-8
eBook Packages: Computer ScienceComputer Science (R0)