This project implements a simple multitasking system (MTX) in C, simulating basic process management and scheduling concepts found in operating systems. It is designed for educational purposes, demonstrating how processes can be created, scheduled, and managed in a cooperative multitasking environment.
- Process creation (fork)
- Cooperative context switching (switch)
- Process termination (exit)
- Process sleep and wakeup (sleep, wakeup)
- Waiting for child processes (wait)
- Process tree visualization
- Simple priority-based ready queue
- Interactive command-line interface for process management
t.c- Main multitasking system logic and process managementMakefile- Build instructions
This project targets 32-bit x86 Linux environments. To build the project, ensure you have gcc installed with 32-bit support:
sudo apt-get install gcc-multilib
makeThis will produce the mtx executable.
Run the multitasking system with:
./mtxYou will be greeted with an interactive shell. Available commands:
ps: Show process statusfork: Create a new processswitch: Switch to another processexit: Terminate the current processsleep: Put the process to sleep on an eventwakeup: Wake up processes sleeping on an eventwait: Wait for a child process to exitshutdown: (Only process 1) Shut down the system
The system displays the process tree and the state of all process queues after each command.
This project is licensed under the MIT License. See the LICENSE file for details.
- Copyright (c) 2025 marvelcn015