This repository contains a collection of C programs, assignments, and lab exercises focused on Linux system programming. It includes code examples and materials from the book "Hands-on System Programming with Linux" by Kaiwan N Billimoria, as well as personal assignments and lab work exploring various system-level concepts.
This repository serves as a personal workspace and a collection of learning materials for Linux system programming in C. It is structured to include:
- Code examples, assignments, and solutions from the "Hands-on System Programming with Linux" book.
- A series of personal assignments (
assign1
throughassign9
) covering various topics. - Lab exercises (
lab01
throughlab07
) for hands-on practice. - A
playground
directory for experimental code.
The primary language used is C, and compilation is generally managed via Makefiles.
To work with the code in this repository, you'll generally need:
- A Linux Environment: Or a Unix-like system with strong POSIX compatibility (e.g., macOS with developer tools, WSL on Windows).
- C Compiler: GCC (GNU Compiler Collection) is primarily used in the Makefiles. Clang may also work.
- Make Utility: For building projects using the provided Makefiles.
- Standard Development Tools:
gdb
(GNU Debugger),objdump
,ltrace
,strace
,valgrind
(often mentioned or useful for system programming). - Shell: A POSIX-compliant shell like
bash
. - (For specific labs/assignments):
libcmocka-dev
(forlab04
if using CMocka for testing).
- Clone this repository to your local machine:
git clone [https://github.com/borvux/linux-programming.git](https://github.com/borvux/linux-programming.git) cd linux-programming
- Navigate to the book's code directory:
cd Hands-on-System-Programming-with-Linux-master
- Choose a chapter you're interested in, for example,
ch10
(Process Creation):cd ch10
- Compile the examples using the Makefile:
This will typically build normal and debug (
make
_dbg
) versions of the programs. - Run an example, e.g.:
./fork1 ./fork4_dbg 3 5
- Explore the
assignments_ch10.txt
and check thesolutions_to_assgn/ch10/
directory for solutions.
- Navigate to the specific assignment or lab directory, for example:
cd assign9
- Look for a
Makefile
. If present, use it to compile:make
- If no
Makefile
is present, you may need to compile C files manually usinggcc
. For example:gcc -Wall my_program.c -o my_program
- Run the compiled executable:
Refer to any
./request_server # (Example for assign9)
README.txt
or notes within the assignment/lab directory for specific instructions.