ABSTRACT

This problem set focuses on the interaction between a user-space program and the Operating System kernel. You will practice the “Fork-Exec-Wait” pattern, manage file I/O, and implement the string parsing logic required to build a functional command-line interface.

1. Process Management & System Calls

The core mechanics of how a shell launches and manages programs.

  • Fork and Wait: Mastering the creation of child processes and parent synchronization.
  • Running ls Command: Using the exec family to replace a process image with an external binary.
  • Run CD: Implementing “Built-in” commands that modify the shell’s own state (like the current directory).
  • Run Exit: Handling clean termination of a session.
  • Test Perror: Using perror to translate system error codes into human-readable strings.

2. Command Line Parsing

Turning raw user input into actionable data for system calls.


3. File I/O and String Utilities

Interacting with the file system and cleaning up data for display.


4. Advanced Formatting


Implementation Mapping: The Shell Architecture

Shell TaskRelevant Problem Set File
Read InputGet Line, Trim Trailing Spaces...
TokenizeTokenize Args, Split Space, Count Occurrences...
Identify CommandParse Flags, Run CD (Built-ins)
ExecuteFork and Wait, Running ls Command
Error HandleTest Perror
Folder Contents

20 items under this folder.