Systems · University · 2024
SO-SSEGADO
An operating-system simulator in C, with processes, memory, I/O and disk.
- Status
- Completed
- Context
- University project · team of three
- My role
- One of three authors, with Leandro Aguiar Mota and Otávio Augusto Teixeira.
- Stack
- C
- POSIX threads
- Semaphores
- GCC

Overview
SO-SSEGADO loads test programs and shows, in the terminal, what the operating system does with each resource.
Problem
Scheduling, semaphores and disk access are hard to grasp in theory alone. The idea was to see them running.
Approach
Each part of the system — kernel, memory, I/O and disk — runs on its own thread, like a real system. Test programs are text files with simple instructions.
How it works
Kernel
Schedules processes between ready, running and blocked.
Semaphores
Block and release processes that compete for the same resource.
Disk
C-SCAN algorithm: the head sweeps the disk in one direction and jumps back to the start.
Menu
Creates processes and shows the state of processes, semaphores, memory and disk.
pthread_t kernel; // Thread do kernel
pthread_t sim_menu; // Thread do menu
pthread_t memory_manager; // Thread da memoria
pthread_t io_manager; // Thread de io
pthread_t disk_manager; // Thread do disco
pthread_create(&sim_menu, NULL, menu, NULL);
pthread_create(&kernel, NULL, &mainLoop, NULL);
pthread_create(&memory_manager, NULL, memoryManagerThread, NULL);
pthread_create(&io_manager, NULL, ioManagerThread, NULL);
pthread_create(&disk_manager, NULL, diskManagerThread, &disk);Key decisions
One thread per resource
Concurrency was the focus of the course, and this made shared-data problems real.
C-SCAN for the disk
Sweeping in one direction keeps waiting times more even.
Result
Completed in 2024. In October 2026 I recompiled and ran it to capture the screens.