0% found this document useful (0 votes)
126 views

Birla Institute of Technology & Science, Pilani Course Handout Part A: Content Design

The document provides a course handout for a System Programming course covering topics like directories and files in UNIX/Linux systems, internals of the UNIX file system, VI editor, shell scripting, system calls, and assemblers, linkers and loaders. It includes the course objectives, modular content structure divided into 6 modules, learning outcomes, textbooks and reference materials. It also outlines a contact session plan describing the learning resources, class sessions, self-study tasks and homework for each module to help students achieve the learning outcomes.

Uploaded by

Aman Bhargava
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
126 views

Birla Institute of Technology & Science, Pilani Course Handout Part A: Content Design

The document provides a course handout for a System Programming course covering topics like directories and files in UNIX/Linux systems, internals of the UNIX file system, VI editor, shell scripting, system calls, and assemblers, linkers and loaders. It includes the course objectives, modular content structure divided into 6 modules, learning outcomes, textbooks and reference materials. It also outlines a contact session plan describing the learning resources, class sessions, self-study tasks and homework for each module to help students achieve the learning outcomes.

Uploaded by

Aman Bhargava
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 8

BIRLA INSTITUTE OF TECHNOLOGY & SCIENCE, PILANI

WORK INTEGRATED LEARNING PROGRAMMES

COURSE HANDOUT

Part A: Content Design

Course Title System Programming


Course No(s) SEWP  ZC332
Credit Units
Course Author
Version No
Date

Course Objectives
No Course Objective

CO1 To provide understanding of the files, directory and file systems.

CO2 To provide insight into UNIX commands and Shell scripting.

CO3 To provide understanding of the System calls and its usage with C programming.

CO4 To provide understanding of assemblers, linkers and loaders

Text Book(s)
T1 Brian. W. Kernighan and Rob Pike, “The UNIX Programming Environment”, Prentice
– Hall of India, Pvt. Ltd, 1984.
T2 Richard Blum, Christine Bresnahan, “Linux Command Line and Shell Scripting Bible”,
3rd Edition, Wiley Publication, 2015.

Reference Book(s) & other resources


R1 Muster J.C., Introduction to UNIX and LINUX, McGraw Hill, 2002.
R2 Quigley E., UNIX Shells by Example, Prentice Hall, 2001.
R3 O'Reilly, Learning the vi Editor, 6th Edition, 1998, Arnold Robbins, Linda Lamb
R4 O'Reilly, Learning the bash Shell, 2nd Edition, By Cameron Newham, Publisher:
O'Reilly Media, Released: March 2005, 3rd edition
R5 W. Richard Stevens, “Advanced Programming in the UNIX environment” 2nd edition,
Addition-Wesley, 2005.
R6 Maurice J. Bach, “The Design of the Unix Operating System”, PHI, 1993
R7 Leland L. Beck, “System Software – An Introduction to Systems Programming”, 3rd
Edition, Pearson Education Asia, 2006.

Modular Content Structure


1. Directories and Files in UNIX / Linux system. Basic UNIX commands
1.1. Getting Introduction to UNIX / Linux
1.2. Logging in to Linux system
1.3. UNIX files and directories
1.4. Basic UNIX commands
2. Internals of Unix file system, I/O in UNIX
2.1. Basics of files, UNIX file system, Inode structure in UFS, Links in UNIX
2.2. Directories in UNIX, Conversion of a path name to an inode, open files and
descriptor management
2.3. File system layout, Superblock, I/O in UNIX – Kernel I/O structure, I/O devices –
Block and Character devices, Device drivers, I/O queuing and interrupt handling
2.4. Inspect the hard disks and sectors: lsblk, fdisk, df, hwinfo, parted, cfdisk, sfdisk, etc.
smartctl command line tool to check the health of a disk drive on linux system
3. VI editor, File and directory commands, I/O indirection and Filters
3.1. Working with VI editor: Basic operating modes
3.2. Commands for copying & pasting text and pattern searching & substitution of text in
command mode, Recovering files in vi editor
3.3. File and directory commands – cat, cp, mv, rm, chmod, cmp, diff and top
3.4. I/O indirection, Filters – wc, sort, head, tail, grep, pipe and tee
4. Shell Scripting
4.1. Pattern matching and Shell Meta characters
4.2. Shell Scripting: simple programs, interactive shell scripting, arithmetic in shell,
variables in shell with more example programs
4.3. Decision making constructs in Shell with more example programs
4.4. Loop constructs in Shell with more example programs
4.5. Files using Shell scripting with more example programs
5. System calls
5.1. Need for protection, System call – User mode and Kernel mode communication,
execution of a system call, system call example program in C, difference between
system call and function call, system call examples
5.2. System calls for low level file I/Os – open, creat, close, read, write, lseek, mkdir,
rmdir, rename, link, symlink, unlink
5.3. System calls related to process – fork, wait, waitpid, exec, signal, kill and raise
6. Assemblers, Linkers and Loaders
6.1. Assemblers – assembler’s functions, assembler directives, object code structure,
object code, two pass assembler, data structures for two pass assembler – operation
code table, symbol table and location counter
6.2. Linker and Loader – Absolute loader, absolute loader implementation. Relocation
loader using modification record, Relocation loader using relocation bit mask
6.3. Linker and Loader – Program linking, implementation of linking loader, data
structures, external symbol table, program load address and control section address,
algorithm. Dynamic linking – dynamic linking applications, dynamic linking
implementation
Learning Outcomes:
No Learning Outcomes
Students will be able to

LO1 Explain how the Unix command shell processes commands

LO2 Write simple shell scripts

LO3 Discuss how the Unix file system stores information

LO4 Analyze how concurrent processes are used in Unix

LO5 Outline the working of assemblers, linkers and loaders

Part B: Contact Session Plan

Academic Term
Course Title System programming
Course No SEWP  ZC332
Lead Instructor

Course Modular Structure


Module 1: Directories and Files in UNIX / Linux system. Basic UNIX commands
Type Description/Plan/Reference Text Book
RL1.1 Getting Introduction to UNIX / Linux T1 and T2
Logging in to Linux system
UNIX files and directories
Basic UNIX commands – passwd, date, who, who am i, mail, write, man,
pwd and ls
RL1.2 Basic UNIX commands – mkdir, cd [using relative and absolute path],
creating a new file using editor ed and command cat, displaying the
content of a file using cat and pr commands
CS1.1 A live demonstration on how to start working with Linux operating
system and the command line interpreter (CLI)
How to execute commands in CLI
Show the complete explanation of all the basic commands discussed in
RL1.1 and RL1.2
LE1.1 Execute all the Basic UNIX commands with different options in server
and observe the result
SS1.1 In RL1.1 and RL1.2, we discussed only a few very useful options of all
basic commands. Remaining options of these commands will be a topic
for self-study
[R5: UNIX man pages]
HW1.1 Unsolved exercise problems are given in the end of learning material for
Module 1

Module 2: Internals of Unix file system, I/O in UNIX


Type Description/Plan/Reference Text Book
RL2.1 Basics of files, UNIX file system, Inode structure in UFS, Links in UNIX T1
RL2.2 Directories in UNIX, Conversion of a path name to an inode, open files
and descriptor management
RL2.3 File system layout, Superblock, I/O in UNIX – Kernel I/O structure, I/O
devices – Block and Character devices, Device drivers, I/O queuing and
interrupt handling
CS2.1 What is files and directories in UNIX
What is a file system? Basics of UNIX File System (UFS).
What is inode in UFS? Discussion about inode structure in UNIX
Discussion about various types of links [hard, symbolic] in UFS.
Different between these links. Discussion on choosing hard link Vs
Symbolic link
CS2.2 Conversion of given path name to inode in UFS with more examples.
UFS layout and superblock.
I/O in UNIX – Block and Character devices, device drivers
I/O queuing and interrupt handling
SS2.1 Explore all the options in link.
Learn more about how data blocks and inodes are assigned / freed in UFS
Learn more about the complete data structure for inode in UFS
[R5: UNIX man pages]
[R1: Maurice J. Bach, “The Design of the Unix Operating System”, PHI,
1993]
HW2.1 Exercises of R1, Chapter 4

Module 3: VI editor, File and directory commands, I/O indirection and Filters
Type Description/Plan/Reference Text Book
RL3.1 Working with VI editor: Basic operating modes – insert mode, command T1 and T2
mode and command line mode. Commands for editing text, Cursor
movement commands and deletion of file contents in command mode,
Commands to save, quit, save & quit and quit without saving in command
line mode
RL3.2 Commands for copying & pasting text and pattern searching &
substitution of text in command mode, Recovering files in vi editor
RL3.3 File and directory commands – cat, cp, mv, rm, chmod, cmp, diff and top
RL3.4 I/O indirection, Filters – wc, sort, head, tail, grep, pipe and tee
CS3.1 VI Editor – various modes, commands to edit text, move cursor, delete
file contents, save and quit
VI Editor – commands for copy, paste, pattern search and substitution
Recovering files in VI Editor
CS3.2 File and commands like cat, cp, mv, rm, chmod, cmp, diff and top with
some of the most important options
I/O Indirection
Filters like wc, sort, head, tail, grep, pipe and tee with some of the most
important options
LE3.1 Explore VI Editor and execute all the UNIX commands discussed in this
module with different options in server and observe the result
SS3.1 In RL3.3 and RL3.4, we discussed only a few very useful options of all
file and directory commands and filters. Remaining options of these
commands will be a topic for self-study
[R5: UNIX man pages]
HW3.1 Unsolved exercise problems are given in the end of learning material for
Module 3

Module 4: Shell Scripting


Type Description/Plan/Reference Text Book
RL4.1 Introduction to UNIX shell and pattern matching with shell T1, T2 and R3
metacharacters. Shell scripting – simple programs, programs with
positional parameters, interactive shell scripting using read, arithmetic
operation in shell using expr
RL4.2 Variables in Shell – System variables and User defined variables. Rules
for naming variables, Decision making constructs in shell – if …. fi
construct, if ….. else ….. fi construct. Example programs using variables
and decision making constructs
RL4.3 Decision making constructs in shell – nested if …. else ….. fi construct,
multilevel if ….. else construct and case construct. Example programs
using decision making constructs. Looping constructs in shell – for loop
construct. Example programs using loop construct
RL4.4 Looping constructs in Shell – for loop constructs and while loop
construct, Example programs using for loop and while loop constructs
RL4.5 Nested loops in Shell – using for loops only, using while loops only and
combination of for loop and while loop. Files using shell scripting –
programs to take data from file, manipulate the data and store it in file
CS4.1 Pattern matching and Shell Meta characters
Shell Scripting: simple programs, interactive shell scripting, arithmetic in
shell, variables in shell with more example programs
CS4.2 Decision making constructs in Shell with more example programs
CS4.3 Loop constructs in Shell with more example programs
Files using Shell scripting with more example programs
LE4.1 Execute shell script programs in server
SS4.1 In RL4.1 to 4.5, we discussed only a few sample problems of Shell
script. You can try exploring Shell script for various other real time
problems
[R3: O'Reilly, Learning the bash Shell, 2nd Edition, By Cameron
Newham, Publisher: O'Reilly Media, Released: March 2005, 3rd edition]
HW4.1 Unsolved exercise problems are given in the end of learning material for
Module 4
Module 5: System calls
Type Description/Plan/Reference Text Book
RL5.1 Need for protection, System call – User mode and Kernel mode T1 and R1
communication, execution of a system call, system call example program
in C, difference between system call and function call, system call
examples
RL5.2 System calls for low level file I/Os – open, creat, close, read, write, lseek,
mkdir, rmdir, rename, link, symlink, unlink
RL5.3 System calls related to process – fork, wait, waitpid, exec, signal, kill and
raise
CS5.1 Need of protection – both for applications and OS
System calls – User mode to kernel mode, execution of system call with
example
Difference between System call and function call
CS5.2 I/O related system calls and process related system calls
LE5.1 Write C programs which uses all the system calls directly
SS5.1 In RL5.2 and RL5.3, we discussed only few very useful system calls of
file and I/O and process. Remaining system calls of file I/O and
processes will be the topic for self-study
[R1: Maurice J. Bach, “The Design of the Unix Operating System”, PHI,
1993]
HW5.1 Exercises of R1, Chapter 5

Module 6: Assemblers, Linkers and Loaders


Type Description/Plan/Reference Text Book
RL6.1 Assemblers – assembler’s functions, assembler directives, object code R2
structure, object code, two pass assembler, data structures for two pass
assembler – operation code table, symbol table and location counter
RL6.2 Linker and Loader – Absolute loader, absolute loader implementation.
Relocation loader using modification record, Relocation loader using
relocation bit mask
RL6.3 Linker and Loader – Program linking, implementation of linking loader,
data structures, external symbol table, program load address and control
section address, algorithm. Dynamic linking – dynamic linking
applications, dynamic linking implementation
CS6.1 Assemblers – function, directives
2 pass assembler
CS6.2 Linker and Loader
Absolute loader, Relocation loader
Program linking, Dynamic linking
SS6.1 Platform dependent and platform independent assembler, linker and
loader
[R2:Leland L. Beck, “System Software – An Introduction to Systems
Programming”, 3rd Edition, Pearson Education Asia, 2006]
HW6.1 Exercises of R2, Chapter 2 and 3
Session Plan:
Modular sections to be covered in each sessions (CS) is presented in this session plan
This plan is to use in conjunction with the modularized course structure

Instruct Recorded Contact Session Self-study Home-work Lab


ion Lecture Exercise
Block
No.
1 As in CS 1.1 As in Modular As in Modular As in
Modular plan M1 plan M1 Modular
plan M1 plan M1
2 As in CS 2.1 CS 2.2 As in Modular As in Modular As in
Modular plan M2 plan M2 Modular
plan M2 plan M2
3 As in CS 3.1 As in Modular As in Modular As in
Modular plan M3.1 plan M3.1 Modular
plan M3.1 plan M3.1
4 As in CS 3.2 As in Modular As in Modular As in
Modular plan M3.2 plan M3.2 Modular
plan M3.2 plan M3.2
5 Revision and
review
Mid semester Examination ( module 1 to Module 3)
6 As in CS 4.1 As in Modular As in Modular As in
Modular plan 4.1 plan 4.1 Modular
plan 4.2 plan 4.1
7 As in CS4.2 As in Modular As in Modular As in
Modular plan 4.2 plan 4.2 Modular
plan 4.2 plan 4.2
8 As in CS 4.3 As in Modular As in Modular As in
Modular plan M4.3 plan M4.3 Modular
plan M4.3 plan M4.3
9 As in CS 5.1 CS 5.2 As in Modular As in Modular As in
Modular plan M5 plan M5 Modular
plan M5 plan M5
10 As in CS 6.1 CS 6.2 As in Modular As in Modular As in
Modular Revision and plan M6 plan M6 Modular
plan M6 review plan M6
Comprehensive examination ( six modules )

Detailed Plan for Lab work/Design work


Lab Lab Objective Lab Sheet Access URL Content
No Reference

1 Execute all the Basic UNIX commands with TBD Module 1


different options in server and observe the result
Basic UNIX commands – passwd, date, who, who
am i, mail, write, man, pwd and ls
Basic UNIX commands – mkdir, cd [using relative
and absolute path], creating a new file using editor
ed and command cat, displaying the content of a file
using cat and pr commands
2 Discussion about various types of links [hard, TBD Module 2
symbolic] in UFS. Different between these links.
Discussion on choosing hard link Vs Symbolic link

3 Explore VI Editor and execute all the UNIX TBD Module 3


commands discussed in this module with different
options in server and observe the result

4 Execute shell script programs in server TBD Module 4


Example programs using variables and decision
making constructs
Example programs using decision making
constructs.
Example programs using loop construct
Files using shell scripting – programs to take data
from file, manipulate the data and store it in file

5 Write C programs which uses all the system calls TBD Module 5
directly

6 System calls for low level file I/Os – open, creat, TBD Module 5
close, read, write, lseek, mkdir, rmdir, rename, link,
symlink, unlink

7 System calls related to process – fork, wait, waitpid, TBD Module 5


exec, signal, kill and raise

8 Demo of Assembler, linker and loader (8086) TBD Module 6


TASM, TLINK

You might also like