Diego Malagrida Mini Shell and Dynamic Stacks ↑ Top

AuthorDiego Malagrida

Published15 Jan 2025

Sectionsystems

Mini Shell and Dynamic Stacks

A shell built up in six levels, from running one command to chaining several through pipes, plus the library it stands on.

Overview

The three Operating Systems I practices in C: a library of string functions written from scratch, a generic dynamic stack that persists to a file, and a minimal shell taken up in six levels to multiple pipes.

The shell is the one worth describing. Level one runs a command. Level two runs it in the background, which means a process you do not wait for and have to collect later. Level three redirects input and output, level four pipes one command into another, level five pipes several, and level six handles the signals and the process groups that make a terminal behave like a terminal. Each level is a file, so the progression stays readable: what a shell is only becomes clear when you have added the next thing it cannot do yet.

Underneath it, the first practice rewrites the parts of <string.h> it needs and a generic stack that can be saved to and read back from a file: the parts of the C library that are usually taken as given.

The repository is private.

coperating-systemsshell

← All projects