CS374-OS1
- Overview
- Assignments
- HW1: Movie Data Processing
- C Implementation
- Rust Implementation
- Features
- Movie Year Search
- Rating Analysis
- Language Search
- HW2: File Directory Processing
- C Implementation
- Rust Implementation
- File Organization System
- HW3: Small Shell
- Built-in Commands
- Process Management
- Signal Handling
- Variable Expansion
- HW4: Multi-threaded Line Processor
- Thread Pipeline
- Buffer Management
- Producer-Consumer Implementation
- HW5: One-Time Pad System
- Encryption Server/Client
- Decryption Server/Client
- Key Generation
- Network Programming
- HW1: Movie Data Processing
This repository contains 5 programming assignments (HW1-HW5) implementing various system programming concepts in C and Rust.
- C Version:
- Parses CSV files using custom string manipulation
- Implements linked list data structure for movie records
- Features menu-driven interface for searching/filtering movies
- Rust Version:
- Uses
csvcrate for file parsing - Leverages HashMap for organizing movie data
- Implements same functionality with Rust's memory safety features
- Uses
- C Version:
- Uses system calls (
mkdir,chmod,stat) - Creates directory structure by year
- Sets file permissions to rw-r----- (640)
- Handles dynamic memory for file names and paths
- Uses system calls (
- Rust Version:
- Uses
std::fsfor file operations - Implements same functionality with Rust's file system APIs
- Handles permissions using Rust's cross-platform abstractions
- Uses
- Implements built-in commands (cd, status, exit)
- Handles foreground/background processes using
fork()andexec() - Implements signal handling (SIGINT, SIGTSTP)
- Supports I/O redirection using
dup2() - Variable expansion for $$ to PID
- Uses linked list to track background processes
- Input Thread: Reads stdin until "STOP"
- Line Separator Thread: Replaces \n with spaces
- Plus Sign Thread: Converts ++ to ^
- Output Thread: Formats 80-char lines
- Uses pthread mutex and condition variables
- Implements producer-consumer pattern
- Three shared buffers between threads
- Thread-safe memory management
enc_server: Handles encryption requestsenc_client: Sends plaintext for encryptiondec_server: Handles decryption requestsdec_client: Sends ciphertext for decryptionkeygen: Generates random keys
- Socket programming for client-server communication
- One-time pad encryption algorithm
- Error handling for bad characters/connections
- Key validation and length checking
- Concurrent server design
See individual homework directories for specific compilation and usage instructions.