Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xv6-operating-systems-shell-system-calls

Enhanced xv6 kernel with an authenticated shell, new system calls (history, block, unblock, chmod), and process tracking. Demonstrates systems programming, OS internals, and secure file permission management.

xv6 Operating Systems Project – Enhanced Shell & System Calls

📌 Overview

This project extends the xv6 operating system by implementing new shell features and system calls.
It demonstrates process management, system-level programming, and OS security concepts.
The modifications include authentication, command history, system call blocking, and file permission management.

🚀 Features Implemented

  • Login System: Username/password authentication before accessing the xv6 shell.
  • history Command: Tracks executed processes with PID, name, and memory usage.
  • block / unblock Commands: Dynamically block or unblock system calls for processes.
  • chmod System Call: Secure file permission management (read, write, execute bits).
  • Robust Error Handling: Invalid operations return proper error codes.

🛠 Implementation Details

  • Shell Authentication
    Implemented using macros (USERNAME, PASSWORD) in the Makefile with 3 login attempts.

  • History Command (sys_gethistory)

    • Tracks executed processes.
    • Displays: PID | Process Name | Memory Utilization.
    • Implemented as a new system call with syscall ID 22.
  • Blocking/Unblocking System Calls

    • sys_block(int syscall_id) → Blocks a syscall for processes in the current shell.
    • sys_unblock(int syscall_id) → Unblocks it.
    • Critical calls (fork, exit) are protected.
  • chmod System Call (sys_chmod)

    • Implements Unix-like permissions as a 3-bit integer (read, write, execute).
    • Integrated into open, write, exec to enforce access control.
    • Syscall ID 25.

🧪 Testing

  • Verified login system with valid/invalid attempts.
  • Validated history tracking across multiple processes.
  • Tested blocking/unblocking of exec system calls.
  • Checked chmod enforcement by denying unauthorized read/write/execute attempts.

⚙️ How to Run

  1. Clone xv6-public repository and replace with modified source files.
  2. Build xv6:
    make clean
    make qemu

Use the following commands inside xv6:

bash Copy Edit $ history $ block <syscall_id> $ unblock <syscall_id> $ chmod 📊 Results Secure shell login successfully restricts unauthorized access.

Process history accurately tracks PID, name, and memory.

Blocking/unblocking system calls dynamically controls execution.

File permissions enforced with robust error messages.

About

Enhanced xv6 kernel with an authenticated shell, new system calls (history, block, unblock, chmod), and process tracking. Demonstrates systems programming, OS internals, and secure file permission management.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages