sp with linux-page2

Lec11 Design and Code of UNIX more utility


This session deals with the design and development of UNIX more utility. It starts with the discussion of “What more do?”, then “How more do it?”, and finally different versions of more utility are designed and coded.

Email: arif@pucit.edu.pk Example Codes: https://bitbucket.org/arifpucit/spvl-repo/src

Lec12 UNIX File System Architecture


In this session will start with a quick recap of hard disk partitioning, formatting and mounting. The internal structure of UNIX file system (Disk, partitions, boot block, super block, inode block) are described in detail. Connection to an open file via PPFDT is discussed. The session will close with the concept of UNIX Universal I/O model (open-read-write-close paradigm).

Email: arif@pucit.edu.pk Example Codes: https://bitbucket.org/arifpucit/spvl-repo/src

Lec13 UNIX File Management


This session will deal with various file related system calls. It starts with repositioning the current file offset using lseek(). Creating soft link to a file, changing permissions, and ownership of a file from within a C program. Different techniques of I/O redirection are discussed using dup() and dup2() system calls. Finally, the use of fcntl() system call is discussed to duplicate a file descriptor, get/set file descriptor flags in PPFDT, get/set file status flags in SWFT, and achieving advisory locks on files

Email: arif@pucit.edu.pk Example Codes: https://bitbucket.org/arifpucit/spvl-repo/src

Lec14 Design and Code of UNIX ls Utility


This session deals with the designing the ls program. First we will see what actually ls do? by digging in the details of its various options. Then we will try to understand how ls actually do it? Finally we will start writing different versions of the ls utility. We sill start from the very basic program that displays the listing of present working directory and finally we will write an ls program that shows the long listing of files of the directories passed as command line arguments.

Email: arif@pucit.edu.pk Example Codes: https://bitbucket.org/arifpucit/spvl-repo/src

Lec15 Design and Code Of UNIX who Utility


This session deals with the different categories of OS configuration files as well as of different programs that we install on our Linux machine. Their importance in correct execution of different programs and services is discussed. Then we will start with the design of UNIX who utility. First we will see what who do? Then we will try to understand how who actually do it? Finally we will start writing different versions of the who utility. I will also discuss the concept off buffering done by our application programs and the OS kernel as well.

Email: arif@pucit.edu.pk Example Codes: https://bitbucket.org/arifpucit/spvl-repo/src

Lec16 Programming Terminal Devices (Arif Butt @ PUCIT)


This session starts with character and block special files and their attributes. The terminal devices are discussed in detail by reading and writing the terminal devices. The attributes of terminal driver (Input, output, control, and local processing) are discussed in detail. Modifying terminal attributes on the shell using stty command is shown. The two main modes of terminal driver Canonical and non-canonical are discussed. Finally accessing and modifying the terminal attributes from within a C program using system(), tcgetattr(), tcsetattr() and ioctl() system call are discussed in details with example codes.

Email: arif@pucit.edu.pk Example Codes: https://bitbucket.org/arifpucit/spvl-repo/src

Lec17 Process Management-I


This session starts with a quick recap of processes in Linux by giving an overview of the data structures maintained by Linux kernel to manage processes. We will discuss different identifications related to processes and their usage. The famous fork() system call is discussed in detail with example codes. Finally we will discuss the concept of process trees, chains and fans.

Email: arif@pucit.edu.pk Example Codes: https://bitbucket.org/arifpucit/spvl-repo/src

Lec18 Process Management-II


This session starts with a comparison between the fork() and the vfork() system call. We will discuss how the newer versions of fork() use the copy on write semantics. The concept of zombie and orphan processes are discussed. Then we will discuss different system calls that are used for monitoring the status of child processes like wait(), waitpid(), waitid(), wait3(), and wait4()

Email: arif@pucit.edu.pk Example Codes: https://bitbucket.org/arifpucit/spvl-repo/src

Lec19 Process Management-III


This is a continuation of previous two sessions on process management. Today we will discuss the exec() family of functions that are used to overwrite the calling process address space with a new program. We will discuss the impact of fork() and exec() on different process attributes. We will write down our own system() function and use it to create a shell utility. The session will terminate with a discussion on process groups, process sessions, and controlling terminals.

Email: arif@pucit.edu.pk Example Codes: https://bitbucket.org/arifpucit/spvl-repo/src

Lec20 Design and Code Of Daemon Processes


This session gives an overview of daemon processes in Linux. Writing your own daemon process programatically. Introduction to systemd (replacement of SysV init daemon). Controlling daemons using systemctl utility. Writing long lived process and managing it using systemctl

Email: arif@pucit.edu.pk Example Codes: https://bitbucket.org/arifpucit/spvl-repo/src