Skip to content

bassant001/FOS

Repository files navigation

🖥️ FOS Operating System Project 2025

📌 Project Overview

This project is a full implementation of a simplified Operating System as part of the FOS course.

It covers:

  • Low-level memory management
  • Process scheduling
  • Page fault handling
  • Synchronization mechanisms
  • System calls

The project is divided into Milestones, Group Modules, and Individual Modules to simulate real OS development stages.


👥 Group Modules (Core System)

🔸 Dynamic Allocator

  • Handles dynamic allocation inside heap

  • Uses free lists and linked lists

  • Supports:

    • alloc_block
    • free_block
  • Efficient allocation (O(1) best case)


🔸 Kernel Heap

  • Kernel-level memory management

  • Two strategies:

    • Block Allocator (small sizes)
    • Page Allocator (large sizes)
  • Uses CUSTOM FIT strategy

  • Functions:

    • kmalloc()
    • kfree()
    • Address translation

🔸 Fault Handler I (Placement)

  • Handles page faults (missing pages)
  • Loads pages from disk to memory
  • Maintains Working Set
  • Validates invalid memory access

👤 Individual Modules (Advanced Features)

🔹 Fault Handler II (Replacement)

  • Page replacement algorithms:

    • Optimal (simulation)
    • Clock
    • LRU (Aging)
    • Modified Clock

🔹 User Heap

  • User-level memory allocation

  • Lazy allocation (on page fault)

  • Uses:

    • Block allocator
    • Page allocator
  • Functions:

    • malloc()
    • free()

🔹 Shared Memory

  • Allows processes to share data

  • Functions:

    • smalloc()
    • sget()
  • Uses reference counting & frame tracking


🔹 CPU Scheduling

  • Priority-based Round Robin Scheduler

  • Features:

    • Multiple queues
    • Starvation prevention
    • Dynamic priority handling

🔹 Kernel Protection

  • Synchronization primitives:

    • Sleep Locks
    • Semaphores
  • Prevents race conditions


⚙️ System Architecture

User Programs
     ↓
System Calls
     ↓
Kernel
 ├── Memory Management
 ├── Scheduler
 ├── Synchronization
 └── Page Fault Handler

📁 Project Structure

FOS_PROJECT_2025_TEMPLATE/
│
├── boot/        # Bootloader
├── kern/        # Kernel code
├── user/        # User programs
├── lib/         # Libraries
├── inc/         # Headers
├── conf/        # Config files
├── obj/         # Build output (ignored)

🚀 How to Run

make
bochs

🧪 Testing

The project includes multiple test scenarios for:

  • Memory allocation
  • Page replacement
  • Scheduling
  • Synchronization

⚠️ Important Notes

  • Do NOT commit build files (obj/, .o, .asm)
  • Always clean before rebuild:
make clean
make

👥 Team Members

  • Bassmala Ezzat
  • Fatma Al Zahraa Ahmed
  • Bassant Mohamed
  • Nouran Mahmoud Mohamed
  • Omar Badr
  • Omar Gamal

🏁 Conclusion

This project provides hands-on experience in building core components of an operating system from scratch, including memory management, scheduling, and process synchronization.


About

A simplified operating system built in C implementing memory management, paging, scheduling, and synchronization (FOS Project 2025)

Topics

Resources

Stars

Watchers

Forks

Contributors