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.
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.
- Login System: Username/password authentication before accessing the xv6 shell.
historyCommand: Tracks executed processes with PID, name, and memory usage.block/unblockCommands: Dynamically block or unblock system calls for processes.chmodSystem Call: Secure file permission management (read, write, execute bits).- Robust Error Handling: Invalid operations return proper error codes.
-
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.
-
chmodSystem Call (sys_chmod)- Implements Unix-like permissions as a 3-bit integer (read, write, execute).
- Integrated into
open,write,execto enforce access control. - Syscall ID 25.
- 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.
- Clone xv6-public repository and replace with modified source files.
- 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.