Skip to content

Latest commit

 

History

27 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

low-level-c-projects

C Assembly License: MIT

A collection of systems-level C projects examining operating system fundamentals, including process scheduling, memory management, shell construction, and custom data structures.


Overview

This repository contains six independent systems programming projects, each targeting a different aspect of low-level computing. Together they cover:

  1. Shell Construction — Unix-style interactive task management
  2. Bioinformatics Algorithms — DNA motif discovery with mismatch tolerance
  3. Linked Data Structures — Custom shell with node-based command management
  4. Floating-Point Emulation — Software FP library for hardware without FPU support
  5. Process Scheduling — Multi-level feedback queue CPU scheduler
  6. Operating System Kernel — System call extensions on OS/161 (MIPS)

Project Structure

low-level-c-projects/
├── HIY_TaskManger/              # Unix-style task management shell
│   ├── inc/                     # Header files (hiy.h, logging.h, parse.h, util.h)
│   ├── src/                     # Core shell logic and utilities
│   ├── Makefile
│   └── README.md
├── MotifFinder/                 # DNA motif search tool
│   ├── source.c                 # Main program
│   ├── Makefile
│   └── README.md
├── NodeManager/                 # Linked-list-based command shell
│   ├── inc/                     # Header files (listnode.h, exec.h)
│   ├── src/                     # Shell source
│   ├── inputs/                  # Sample input files
│   ├── outputs/                 # Expected outputs for testing
│   ├── driver.py                # Automated test runner
│   └── README.md
├── SmallFP/                     # Software floating-point library
│   ├── inc/                     # Struct/constant definitions
│   ├── src/                     # smallfp.c implementation + tester
│   ├── scripts/                 # Sample MUAN scripts
│   └── README.md
├── Wlf_Scheduler/               # Multi-level feedback queue CPU scheduler
│   ├── inc/                     # wlf_sched.h (structs + macros)
│   ├── src/                     # wlf_sched.c implementation
│   └── README.md
└── os161/                       # OS/161 kernel system call extensions
    ├── kern/                    # Kernel source
    ├── include/                 # Kernel headers
    ├── testbin/                 # Test programs
    ├── asst1-part2/
    ├── asst2-part2/
    └── README.md

Projects

HIY Task Manager

A fully interactive Unix-style task management shell written in C. Simulates core features of traditional Unix shells such as Bash or Zsh, providing hands-on experience with process forking, IPC, I/O redirection, and signal handling.

Key Features:

  • Foreground and background task execution (start / startbg)
  • Unix pipe support connecting task stdout to task stdin (pipe)
  • I/O redirection from/to files (< infile, > outfile)
  • Signal handling for SIGINT, SIGTSTP, SIGCHLD, and SIGQUIT
  • Full task lifecycle: creation, suspension, resumption, termination, deletion

Build & Run:

make
./hiy

MotifFinder

A command-line C program for analyzing DNA sequences and identifying common motifs with a configurable mismatch tolerance. Implements Hamming distance-based motif search using dynamic memory allocation.

Key Features:

  • Dynamic generation of all possible motif candidates (4^m)
  • Substring extraction and Hamming distance matching
  • Configurable sequence count, length, motif length, and mismatch threshold
  • Identifies motifs common to all input sequences
  • Valgrind-verified memory management

Build & Run:

gcc -o motif_finder source.c -lm
./motif_finder

NodeManager

A custom C shell that mimics basic Unix shell behavior while managing a user-defined linked list of command nodes. Each node can be associated with a command, arguments, and loaded file contents.

Key Features:

  • Command history with re-execution by index (history, history [n])
  • Dynamic linked list management (new, list, open, execute)
  • Multi-file modular design with full strerror(errno) error handling
  • Automated test suite via driver.py

Build & Run:

make clean && make
python3 driver.py

SmallFP

A software floating-point library implementing a custom 11-bit FP format for embedded systems that lack native float or double support. Used as the numeric backend for the MUAN (Micro-Ubiquitous Accounting Notary) interpreter.

Format: S:1 | EXP:4 | FRAC:6 — all operations performed via bitwise manipulation on 16-bit integers.

Key Features:

  • Encode/decode integers and fractions to/from smallfp format
  • Arithmetic: addition, subtraction, multiplication, negation
  • Round-to-nearest-even rounding
  • Special values: NaN, Infinity, Zero, overflow/underflow

Build & Run:

make
./muan

Wlf Scheduler

A multi-level feedback queue CPU scheduler used by the StrawHat task manager shell. Manages processes across high-priority, normal, and terminated queues using singly linked lists and bitwise state encoding.

Process State (16-bit):

Bits 13–15: R (Ready) | U (Running) | T (Terminated)
Bit 12:     Critical
Bit 11:     High Priority
Bits 0–7:   Exit Code

Key Features:

  • Critical-first, exclusive execution
  • Aging and starvation prevention via promotion to high-priority queue
  • Full scheduler lifecycle: create, enqueue, select, promote, reap, cleanup

Build & Run:

make
./strawhat

os161 — Kernel System Call Extensions

Kernel-level extensions to the OS/161 operating system implementing additional system calls across the complete syscall execution path: user-space invocation → trap into kernel → dispatch → handler → return via trapframe.

Key Features:

  • Extended syscall dispatch table and kernel headers
  • Kernel-space handler implementation with register convention compliance
  • Trapframe manipulation and user–kernel privilege separation
  • Error code and return-value semantics
  • Memory safety in kernel-space C

Environment: C · OS/161 kernel · MIPS (simulated) · OS/161 toolchain


Languages

Language Share Usage
C 77.2% All core project implementations
HTML 13.4% Documentation / output reports
Makefile 4.2% Build automation across all projects
Assembly 2.2% OS/161 low-level system interfaces
Shell 1.7% Helper and test scripts
Yacc 0.8% Grammar definitions

About

A collection of systems-level C projects examining operating system fundamentals, including process scheduling, memory management, shell construction, and custom data structures.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages