Architecture Language Platform Type License
Developed for Teaching OS Concepts at FCIS - Ain Shams University
Based on MIT Exokernel Architecture with Extensive Modifications
GitHub stars GitHub forks GitHub issues GitHub license
๐ Quick Start โข ๐ Documentation โข ๐ฅ Team โข ๐งช Testing
๐ Click to expand full table of contents
- ๐ Introduction
- โจ Features
- ๐๏ธ System Architecture
- ๐ Project Structure
- ๐พ Memory Management
- ๐ Process Management
- โฐ CPU Scheduling
- ๐ Page Replacement
- ๐ System Calls
- ๐ Quick Start
- ๐ป Commands Reference
- ๐งช Testing Framework
- ๐ Debugging
- ๐จโ๐ซ Course Instructor
- ๐ฅ Development Team
- ๐ License
- ๐ Acknowledgments
FOS (FCIS Operating System) is a state-of-the-art educational operating system kernel that bridges the gap between theoretical OS concepts and practical implementation. Born from the legendary MIT Exokernel project, FOS has evolved into a comprehensive learning platform that empowers students with hands-on experience in systems programming.
๐ก Fun Fact: FOS contains over 15,000+ lines of C code and 100+ user programs for testing and learning!
Learn virtual memory, paging, heap allocation, and page replacement strategies
Master multiple scheduling algorithms with real-time process management
Understand kernel/user mode separation, trap handling, and interrupts
Get hands-on with low-level C and x86 Assembly programming
| Advantage | Description |
|---|---|
| ๐ Educational Focus | Designed specifically for learning, not just running |
| ๐ Well Documented | Extensive comments and documentation throughout |
| ๐ง Modular Design | Easy to understand and modify individual components |
| ๐งช Comprehensive Tests | 50+ test cases covering all major features |
| ๐ Real-World Concepts | Implements actual OS algorithms used in production systems |
๐พ Memory Management
| Feature | Description | Status |
|---|---|---|
| Virtual Memory | Full paging support with 4KB pages | โ |
| Two-Level Page Tables | Efficient address translation | โ |
| Memory Protection | Kernel/User space separation | โ |
| Frame Allocator | Physical frame management | โ |
| Page Table Management | Dynamic creation and manipulation | โ |
โก Process Management
| Feature | Description | Status |
|---|---|---|
| Multi-tasking | Pre-emptive multitasking | โ |
| Context Switching | Fast assembly-based switching | โ |
| Process Isolation | Separate address spaces | โ |
| ELF Loading | Load executable programs | โ |
| Process Priority | Priority-based scheduling | โ |
๐ Page Replacement
| Algorithm | Type | Status |
|---|---|---|
| FIFO | Simple | โ |
| Clock | Second Chance | โ |
| Modified Clock | Dirty Bit Aware | โ |
| LRU (Time) | Timestamp Based | โ |
| LRU (Lists) | Active/Second Lists | โ |
| N-Chance | Configurable | โ |
| Optimal | For Testing | โ |
โฐ CPU Scheduling
| Algorithm | Description | Status |
|---|---|---|
| Round Robin | Equal time quantum | โ |
| MLFQ | Multi-level feedback | โ |
| BSD | FreeBSD-based | โ |
| Priority RR | Priority with RR | โ |
๐ Inter-Process Communication
| Feature | Description | Status |
|---|---|---|
| Shared Memory | Share memory regions | โ |
| Kernel Semaphores | Synchronization | โ |
| User Semaphores | User-level sync | โ |
| Sleep/Wakeup | Process blocking | โ |
| Category | Count |
|---|---|
| ๐ Scheduling Algorithms | 4 |
| ๐ Page Replacement Algorithms | 7 |
| ๐พ Memory Allocation Strategies | 6 |
| ๐ System Calls | 30+ |
| ๐ค User Programs | 100+ |
| ๐งช Test Cases | 50+ |
| ๐ป Kernel Commands | 40+ |
The FOS kernel uses a well-defined memory layout that separates kernel and user space:
| Region | Start Address | End Address | Permissions | Description |
|---|---|---|---|---|
| Invalid Memory | 0xFFFFF000 |
0xFFFFFFFF |
--/-- |
Guard page at top |
| Kernel Heap | 0xF6000000 |
0xFFFFF000 |
RW/-- |
Dynamic kernel memory |
| Remapped Physical | 0xF0000000 |
0xF6000000 |
RW/-- |
Physical memory access |
| Kernel Base | 0xF0000000 |
- | - | Kernel/User boundary |
| Virtual Page Table | 0xEFC00000 |
0xF0000000 |
RW/-- |
Kernel page table access |
| Scheduler Stack | Below VPT | - | RW/-- |
Per-CPU kernel stacks |
| User Limit | 0xEF800000 |
- | - | Top of user memory |
| User Page Table | 0xEF400000 |
0xEF800000 |
R-/R- |
User-readable page table |
| Read-Only ENVs | 0xEEC00000 |
0xEF000000 |
R-/R- |
Process info |
| User Exception Stack | 0xEEBFF000 |
0xEEC00000 |
RW/RW |
Exception handling |
| User Stack | Below USTACKTOP | - | RW/RW |
Normal stack (grows up) |
| User Heap | 0x80000000 |
0xA0000000 |
RW/RW |
Dynamic user memory |
| Program Code | 0x00800000 |
- | R-/R- |
.text and .data |
// Kernel Memory #define KERNEL_BASE 0xF0000000 // Kernel virtual address start #define KERNEL_HEAP_START 0xF6000000 // Kernel heap begins here #define KERNEL_HEAP_MAX 0xFFFFF000 // Kernel heap maximum #define KERNEL_STACK_SIZE (8*PAGE_SIZE) // 32 KB per kernel stack // User Memory #define USER_HEAP_START 0x80000000 // User heap begins here #define USER_HEAP_MAX 0xA0000000 // User heap maximum (512 MB heap) #define USER_TOP 0xEEC00000 // Top of user-accessible memory #define USTACKTOP 0xEEBFE000 // Top of user stack // Common #define PAGE_SIZE 4096 // 4 KB pages #define PTSIZE (1024*PAGE_SIZE) // 4 MB per page table
๐ boot/ - Boot Loader
The boot loader is the first code to execute when the system starts.
| File | Description |
|---|---|
boot.S |
Assembly boot sector (512 bytes), enables A20, switches to protected mode |
main.c |
Loads kernel ELF from disk, validates headers, jumps to kernel |
sign.pl |
Perl script to add boot sector signature |
Makefrag |
Build configuration for boot loader |
๐ง kern/ - Kernel Source Code
The heart of the operating system.
| Directory | Files | Description |
|---|---|---|
kern/ |
init.c, entry.S |
Kernel entry and initialization |
kern/cmd/ |
commands.c, command_prompt.c |
40+ kernel commands |
kern/cons/ |
console.c |
VGA text mode console driver |
kern/cpu/ |
sched.c, context_switch.S, kclock.c |
CPU and scheduling |
kern/mem/ |
memory_manager.c, kheap.c, working_set_manager.c |
Memory management |
kern/proc/ |
user_environment.c, user_programs.c |
Process management |
kern/trap/ |
trap.c, fault_handler.c, syscall.c |
Trap and interrupt handling |
kern/disk/ |
pagefile_manager.c |
Page file operations |
kern/tests/ |
Various test files | Kernel test suite |
๐ inc/ - Header Files
Shared definitions used by kernel and user programs.
| File | Description |
|---|---|
memlayout.h |
Memory layout constants and definitions |
mmu.h |
MMU and paging definitions |
environment_definitions.h |
Process (Env) structure |
trap.h |
Trap frame definitions |
queue.h |
List/Queue macros |
syscall.h |
System call numbers |
types.h |
Basic type definitions |
dynamic_allocator.h |
Heap allocator interface |
๐ lib/ - User Library
Runtime library for user programs.
| File | Description |
|---|---|
libmain.c |
User program entry point |
syscall.c |
System call wrappers |
uheap.c |
User heap (malloc/free) |
dynamic_allocator.c |
Block-based allocator |
string.c |
String manipulation |
printf.c |
Formatted output |
๐ค user/ - User Programs (100+)
Sample user programs for testing and learning.
| Category | Examples |
|---|---|
| Basic | fos_helloWorld.c, fos_factorial.c, fos_fibonacci.c |
| Sorting | quicksort_*.c, mergesort_*.c |
| Memory Tests | tst_malloc_*.c, tst_free_*.c, heap_program.c |
| Page Replacement | tst_page_replacement_*.c |
| Shared Memory | tst_sharing_*.c |
| Semaphores | tst_semaphore_*.c, tst_ksemaphore_*.c |
| Scheduling | priRR_*.c |
FOS uses a frame allocator to manage physical memory pages.
// Allocate a physical frame int allocate_frame(struct FrameInfo **ptr_frame_info); // Free a physical frame void free_frame(struct FrameInfo *ptr_frame_info); // Decrement reference count void decrement_references(struct FrameInfo* ptr_frame_info);
๐ Frame Info Structure
struct FrameInfo { Page_LIST_entry_t prev_next_info; // Free list links uint16 references; // Reference count (for sharing) struct Env *proc; // Owning process unsigned char isBuffered; // In modified buffer? };
FOS implements two-level paging with 4KB pages.
// Get page table for a virtual address int get_page_table(uint32 *ptr_page_directory, const uint32 virtual_address, uint32 **ptr_page_table); // Create a new page table void create_page_table(uint32 *ptr_directory, const uint32 virtual_address); // Map a frame to a virtual address int map_frame(uint32 *ptr_page_directory, struct FrameInfo *ptr_frame_info, uint32 virtual_address, int perm); // Unmap a virtual address void unmap_frame(uint32 *ptr_page_directory, uint32 virtual_address); // Invalidate TLB entry void tlb_invalidate(uint32 *ptr_page_directory, void *virtual_address);
Dynamic memory allocation within the kernel.
// Allocate kernel memory void* kmalloc(unsigned int size); // Free kernel memory void kfree(void* virtual_address); // Reallocate kernel memory void* krealloc(void* virtual_address, uint32 new_size); // Address conversion unsigned int kheap_virtual_address(unsigned int physical_address); unsigned int kheap_physical_address(unsigned int virtual_address);
Allocation Strategies:
| Strategy | Command | Description | Best For |
|---|---|---|---|
| ๐ฏ First Fit | khfirstfit |
First block that fits | General purpose |
| ๐ Best Fit | khbestfit |
Smallest fitting block | Minimize fragmentation |
| โก๏ธ Next Fit | khnextfit |
Continue from last | Faster allocation |
| ๐ Worst Fit | khworstfit |
Largest block | Large allocations |
| โ๏ธ Custom Fit | khcustomfit |
Optimized hybrid | Best performance |
Each process has its own heap for dynamic memory.
// User-level allocator (in lib/) void* malloc(uint32 size); void free(void* virtual_address); void* realloc(void* virtual_address, uint32 new_size); // System calls for heap management void* sys_sbrk(int increment); void allocate_user_mem(uint32 va, uint32 size); void free_user_mem(uint32 va, uint32 size);
Each process is represented by an Env structure:
View Complete Env Structure
struct Env { // โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ // MAIN INFORMATION // โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ struct Trapframe *env_tf; // Saved registers during trap struct Context *context; // Context switch registers LIST_ENTRY(Env) prev_next_info; // Queue links int32 env_id; // Unique process identifier int32 env_parent_id; // Parent process ID unsigned env_status; // Current state int priority; // Scheduling priority char prog_name[PROGNAMELEN]; // Program name (64 chars) void* channel; // Sleep channel (blocking) // โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ // ADDRESS SPACE // โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ uint32 *env_page_directory; // Page directory (virtual) uint32 env_cr3; // Page directory (physical) uint32 initNumStackPages; // Initial stack pages char* kstack; // Kernel stack bottom // Page file management uint32* disk_env_pgdir; unsigned int disk_env_pgdir_PA; uint32* disk_env_tabledir; unsigned int disk_env_tabledir_PA; // โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ // WORKING SET // โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ unsigned int page_WS_max_size; // Maximum working set size struct WS_List page_WS_list; // Working set elements struct WorkingSetElement* page_last_WS_element; // LRU Lists struct WS_List ActiveList; // Hot pages struct WS_List SecondList; // Cold pages int ActiveListSize; // Max active list size int SecondListSize; // Max second list size // โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ // STATISTICS // โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ uint32 pageFaultsCounter; uint32 tableFaultsCounter; uint32 freeingFullWSCounter; uint32 freeingScarceMemCounter; uint32 nModifiedPages; uint32 nNotModifiedPages; uint32 env_runs; // Times this env has run uint32 nPageIn, nPageOut, nNewPageAdded; uint32 nClocks; };
| State | Value | Description | Next States |
|---|---|---|---|
๐ ENV_FREE |
0 | Available in free list | NEW |
๐ ENV_NEW |
4 | Newly created | READY |
โ
ENV_READY |
1 | Ready to run | RUNNING |
ENV_RUNNING |
2 | Currently executing | READY, BLOCKED, EXIT |
โธ๏ธ ENV_BLOCKED |
3 | Waiting for resource | READY |
๐ช ENV_EXIT |
5 | Terminated normally | FREE |
โ ๏ธ ENV_KILLED |
6 | Killed externally | FREE |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PROCESS LIFECYCLE โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ FREE โโcreateโโโบ NEW โโscheduleโโโบ READY โโโโโโโโโ โ
โ โฒใใใใ โ โ โ
โ โ dispatch โ โ
โ โ โผ โ โ
โ โ RUNNING โโโโโโโโโค โ
โ โ โ โ โ
โ free โโโโโโโโโโโผโโโโโโโโโโ โ โ
โ โ โ โ โ โ โ
โ โ โผ โผ โผ โ โ
โ โโโโโโโโโโโโโโโโโโโโโ BLOCKED EXIT preempt โ
โ โ โ
โ wakeup โโโบ READY โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
// Create a new process struct Env* env_create(char* user_program_name, unsigned int page_WS_size, unsigned int LRU_second_list_size, unsigned int percent_WS_pages_to_remove); // Free a process and its resources void env_free(struct Env *e); // Exit current process void env_exit(void); // Get current running process struct Env* get_cpu_proc(void); // Convert env ID to env pointer int envid2env(int32 envid, struct Env **env_store, bool checkperm);
FOS implements four different scheduling algorithms, each with unique characteristics.
The simplest fair scheduling algorithm.
| Property | Value |
|---|---|
| Fairness | โญโญโญโญโญ Equal time for all |
| Complexity | โญ Very simple |
| Responsiveness | โญโญโญ Depends on quantum |
| Overhead | โญโญ Context switches |
Command: schedRR <quantum>
How it works:
- All processes are in a single FIFO queue
- Each process runs for exactly
quantumtime units - After quantum expires, process moves to end of queue
- Next process in queue starts executing
Adaptive scheduling that learns process behavior.
| Property | Value |
|---|---|
| Fairness | โญโญโญ Based on behavior |
| Complexity | โญโญโญโญ Multiple queues |
| Responsiveness | โญโญโญโญโญ Interactive friendly |
| Overhead | โญโญโญ Queue management |
Command: schedMLFQ <num_levels> <q1> <q2> ...
How it works:
- Multiple priority queues with different time quantums
- New processes start at highest priority (shortest quantum)
- If process uses full quantum โ move to lower priority
- If process blocks for I/O โ stay at current or move up
- Periodic priority boost to prevent starvation
Based on the FreeBSD scheduler with dynamic priority calculation.
| Property | Value |
|---|---|
| Fairness | โญโญโญโญ Dynamic adjustment |
| Complexity | โญโญโญโญ Priority calculation |
| Responsiveness | โญโญโญโญ Good for mixed workloads |
| Overhead | โญโญโญ Recalculation |
Command: schedBSD <num_levels> <quantum>
Priority Formula:
priority = PRI_BASE + (recent_cpu / 4) + (nice รใฐใค 2)
Combines priority scheduling with round-robin within each level.
| Property | Value |
|---|---|
| Fairness | โญโญโญ Within priority levels |
| Complexity | โญโญโญ Multiple queues + RR |
| Responsiveness | โญโญโญโญ High priority = fast |
| Overhead | โญโญโญ Anti-starvation |
Command: schedPRIRR <num_priorities> <quantum> <starvation_threshold>
Priority Levels:
| Level | Name | Value |
|---|---|---|
| 5 | HIGH | Highest priority |
| 4 | ABOVENORMAL | Above average |
| 3 | NORMAL | Default |
| 2 | BELOWNORMAL | Below average |
| 1 | LOW | Lowest priority |
Anti-Starvation:
After starvation_threshold ticks without running, low-priority processes get a priority boost.
FOS implements 7 page replacement algorithms for virtual memory management.
| Algorithm | Command | Complexity | Accuracy | Best For |
|---|---|---|---|---|
| ๐ข FIFO | fifo |
O(1) | Low | Simple systems |
| โฐ Clock | clock |
O(n) | Medium | General purpose |
| โฐ Modified Clock | modclock |
O(n) | Good | Write-heavy |
| ๐ LRU (Time) | lru 1 |
O(n) | High | Accuracy needed |
| ๐ LRU (Lists) | lru 2 |
O(1) | Good | Fast approximation |
| ๐ N-Chance | nthclk <n> |
O(n) | Configurable | Flexible |
| โญ Optimal | optimal |
O(nรใฐใคm) | Perfect | Testing only |
๐ข FIFO - First In First Out
The simplest replacement algorithm.
- Idea: Replace the oldest page in memory
- Pros: Very simple to implement
- Cons: Doesn't consider page usage (Belady's anomaly possible)
โฐ Clock (Second Chance)
An approximation of LRU using a reference bit.
- Idea: Give pages a "second chance" if recently used
- Implementation: Circular buffer with clock hand
- Reference bit: Set to 1 when page accessed, cleared by clock hand
โฐ Modified Clock
Clock algorithm that also considers the dirty bit.
- Idea: Prefer replacing clean pages (no write-back needed)
- Priority: (R=0, M=0) > (R=0, M=1) > (R=1, M=0) > (R=1, M=1)
๐ LRU - Least Recently Used
Replace the page that hasn't been used for the longest time.
Two implementations:
- Time-based: Each page has a timestamp of last access
- Lists-based: Active list (hot) and Second list (cold)
โญ Optimal (Belady's)
The theoretically optimal algorithm - replace the page that won't be used for the longest time.
- Uses: Future knowledge (reference string)
- Purpose: Benchmarking other algorithms
- Reality: Cannot be implemented in real systems
FOS provides 30+ system calls for user programs.
๐ Process Management
int32 sys_getenvid(void); // Get current process ID void sys_exit(void); // Terminate process int sys_create_env(char* prog_name, unsigned int page_WS_size, unsigned int lru_second_size, unsigned int percent_WS_remove); void sys_run_env(int32 envid); // Start process execution void sys_destroy_env(int envid); // Destroy a process void sys_yield(void); // Give up CPU
๐พ Memory Management
int sys_allocate_page(void *va, int perm); int sys_map_frame(int32 srcenvid, void *srcva, int32 dstenvid, void *dstva, int perm); int sys_unmap_frame(int32 envid, void *va); void* sys_sbrk(int increment); uint32 sys_get_brk(); void sys_free_user_mem(uint32 va, uint32 size); uint32 sys_calculate_free_frames(); uint32 sys_calculate_modified_frames();
๐ Shared Memory
int sys_createSharedObject(char* shareName, uint32 size, uint8 isWritable, void** returned_shared_address); int sys_getSharedObject(int32 ownerEnvID, char* shareName, void** returned_shared_address); int sys_freeSharedObject(int32 sharedObjectID, void* startVA);
๐ Semaphores
// Kernel semaphores int sys_createSemaphore(char* name, int value); void sys_waitSemaphore(int id); void sys_signalSemaphore(int id); // User semaphores void sys_acquire_lock(struct uspinlock* lock); void sys_release_lock(struct uspinlock* lock);
๐ฅ๏ธ Console I/O
void sys_cputs(const char *s, uint32 len); int sys_cgetc(void); void sys_cputc(int c);
| Tool | Version | Purpose |
|---|---|---|
i386-elf-gcc |
Latest | Cross-compiler for x86-32 |
i386-elf-as |
Latest | Assembler |
i386-elf-ld |
Latest | Linker |
i386-elf-objcopy |
Latest | Binary manipulation |
bochs |
2.6+ | x86 Emulator |
make |
GNU Make | Build system |
perl |
5.x | Build scripts |
# Build the entire project make all # Clean build artifacts make clean # Full clean (including logs) make realclean # Build and run in Bochs (no GUI) make bochs
# Start Bochs with GUI bochs # Start Bochs without GUI (console mode) bochs 'display_library: nogui' # Windows users bochscon.bat
- Boot FOS - Watch the initialization messages
- Type
help- See all available commands - Run Hello World:
run fos_helloWorld 10 - Check memory:
meminfo - Run more programs:
run fos_factorial 15 - Kill all processes:
killall
| Command | Arguments | Description |
|---|---|---|
run |
<program> <ws_size> |
Run a program with working set size |
kill |
<env_id> |
Kill a specific process |
killall |
- | Kill all running processes |
runall |
- | Run all loaded programs |
printall |
- | Print info about all processes |
| Command | Arguments | Description |
|---|---|---|
meminfo |
- | Display memory statistics |
allocuserpage |
<va> |
Allocate a user page |
remove_table |
<va> |
Remove a page table |
readmem_k |
<va> |
Read kernel memory |
writemem_k |
<va> <val> |
Write to kernel memory |
| Command | Description |
|---|---|
fifo |
Set FIFO replacement |
clock |
Set Clock (second chance) |
modclock |
Set Modified Clock |
lru 1 |
Set LRU with timestamps |
lru 2 |
Set LRU with lists |
nthclk <n> |
Set N-Chance Clock |
optimal |
Set Optimal (for testing) |
pagerep |
Print current algorithm |
| Command | Arguments | Description |
|---|---|---|
schedRR |
<quantum> |
Set Round Robin |
schedMLFQ |
<levels> <q1> <q2>... |
Set MLFQ |
schedBSD |
<levels> <quantum> |
Set BSD |
schedPRIRR |
<pri> <quantum> <thresh> |
Set Priority RR |
schedmethod |
- | Print current scheduler |
setpriority |
<env_id> <priority> |
Set process priority |
| Command | Description |
|---|---|
khfirstfit |
Kernel heap: First Fit |
khbestfit |
Kernel heap: Best Fit |
khnextfit |
Kernel heap: Next Fit |
khworstfit |
Kernel heap: Worst Fit |
khcustomfit |
Kernel heap: Custom Fit |
uhfirstfit |
User heap: First Fit |
uhbestfit |
User heap: Best Fit |
uhcustomfit |
User heap: Custom Fit |
FOS includes a comprehensive testing framework with 50+ test cases.
| Category | Command Prefix | Description |
|---|---|---|
| Dynamic Allocator | tst dynalloc |
Block allocation and freeing |
| Kernel Heap | tst kheap |
kmalloc, kfree, krealloc |
| Page Replacement | run tpr*, run tclock* |
All replacement algorithms |
| User Heap | run tm*, run tf* |
malloc and free tests |
| Custom Fit | run tcf* |
Custom allocation tests |
| Shared Memory | run tshr* |
Shared memory operations |
| Semaphores | run tst_ksem* |
Synchronization tests |
| Scheduler | tst priorityRR |
Priority scheduling |
| Environment Free | run tef* |
Process cleanup tests |
# Dynamic allocator tests FOS> tst dynalloc init FOS> tst dynalloc alloc FOS> tst dynalloc free FOS> tst dynalloc realloc # Kernel heap tests FOS> tst kheap CF kmalloc blk FOS> tst kheap CF kfree both # User program tests FOS> run tm1 3000 FOS> run tm2 3000 FOS> run tshr1 3000 # Page replacement tests FOS> clock FOS> run tclock1 11 FOS> run tclock2 11 # Scheduler tests FOS> schedPRIRR 10 40 1000 FOS> tst priorityRR 0
# Start Bochs in debug mode bochs -f .bochsrc-debug # In another terminal, connect with GDB gdb obj/kern/kernel (gdb) target remote localhost:1234 (gdb) break FOS_initialize (gdb) continue (gdb) info registers (gdb) x/10x $esp
// Print debug information void debug_printinfo(void); // Print stack backtrace void debug_backtrace(void); // Kernel panic - halt system void _panic(const char *file, int line, const char *fmt, ...); // Panic and exit all environments void _panic_all(const char *file, int line, const char *fmt, ...); // Warning - continue execution void _warn(const char *file, int line, const char *fmt, ...);
// Assert condition assert(condition); // Panic with message panic("Something went wrong: %d", error_code); // Warning message warn("Unexpected value: %x", value);
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
| Permissions | Conditions | Limitations |
|---|---|---|
| โ Commercial use | ๐ License and copyright notice | โ Liability |
| โ Modification | ๐ State changes | โ Warranty |
| โ Distribution | ๐ Disclose source | |
| โ Patent use | ๐ Same license | |
| โ Private use |
FOS is derived from multiple open-source projects:
| Component | Source | Original License |
|---|---|---|
| Core Kernel | MIT Exokernel | MIT License |
| Console Driver | NetBSD pccons | BSD License |
| Clock/Scheduler | Exotec, Inc. | Exotec License |
| Printf | UC Berkeley | BSD License |
| Process Management | xv6 (MIT) | MIT License |
| Contributor | Contribution |
|---|---|
| Dr. Ahmed Salah | Course instructor and guidance |
| MIT PDOS Group | Exokernel foundation |
| UC Berkeley | Console and printf code |
| xv6 Developers | Inspiration and reference |
Faculty of Computers and Information Science
Ain Shams University
Cairo, Egypt
Fady Gerges
๐ง Email: fadygerges2023@gmail.com
๐ GitHub: @Fady2024
๐ Repository: OS_Project_2025
Made with Love For Education Team
Copyright ยฉ 2025 Fady Gerges and contributors
Last Updated: January 2026