- Names:: Aagam Dalal, Lakshman Swaminathan, Kavin Sarvanan, Arnav Chopra
- Penn Key: [Your Penn Key Here]
├── Makefile
├── Makefile2
├── README.md
├── bin
│ ├── pennfat
│ └── standalone-pennfat
├── doc
│ ├── README.md
│ └── companion.md
├── lib
│ ├── exiting_alloc.o
│ └── linked_list.h
├── llvm.sh.1
├── pennosfat
├── scheduler-test
├── scheduler.mk
├── src
│ ├── Makefile
│ ├── nonewline
│ ├── nonewline2
│ ├── pennfat
│ │ ├── fat.c
│ │ ├── fat.h
│ │ ├── fat.o
│ │ ├── fat_constants.h
│ │ ├── fat_utils.c
│ │ ├── fat_utils.h
│ │ ├── fat_utils.o
│ │ ├── mkfs.c
│ │ ├── mkfs.h
│ │ ├── mkfs.o
│ │ └── pennfat.c
│ ├── pennosfat
│ ├── scheduler
│ │ ├── README.md
│ │ ├── fat_syscalls.c
│ │ ├── fat_syscalls.h
│ │ ├── fat_syscalls.o
│ │ ├── kernel.c
│ │ ├── kernel.h
│ │ ├── kernel.o
│ │ ├── logger.c
│ │ ├── logger.h
│ │ ├── logger.o
│ │ ├── pennos.c
│ │ ├── sched-test.o
│ │ ├── scheduler.c
│ │ ├── scheduler.h
│ │ ├── scheduler.o
│ │ ├── spthread.c
│ │ ├── spthread.h
│ │ ├── spthread.o
│ │ ├── spthread_demo.c
│ │ ├── sys.c
│ │ ├── sys.h
│ │ └── sys.o
│ ├── scheduler.log
│ ├── shell
│ │ ├── Job.c
│ │ ├── Job.h
│ │ ├── Job.o
│ │ ├── Makefile
│ │ ├── README.md
│ │ ├── command_execution.c
│ │ ├── command_execution.h
│ │ ├── command_execution.o
│ │ ├── commands.c
│ │ ├── commands.h
│ │ ├── commands.o
│ │ ├── exiting_signal.c
│ │ ├── exiting_signal.h
│ │ ├── exiting_signal.o
│ │ ├── inp.txt
│ │ ├── jobs.c
│ │ ├── jobs.h
│ │ ├── jobs.o
│ │ ├── out.txt
│ │ ├── parser.c
│ │ ├── parser.h
│ │ ├── parser.o
│ │ ├── penn-shell
│ │ ├── penn-shell.c
│ │ ├── penn-shell.o
│ │ ├── print.o
│ │ ├── shell_porcelain.c
│ │ ├── shell_porcelain.h
│ │ ├── shell_porcelain.o
│ │ ├── signals.c
│ │ ├── signals.h
│ │ ├── signals.o
│ │ ├── stress.c
│ │ ├── stress.h
│ │ ├── stress.o
│ │ ├── valid_input.c
│ │ ├── valid_input.h
│ │ └── valid_input.o
│ └── utils
│ ├── errno.c
│ ├── errno.h
│ ├── errno.o
│ ├── error_codes.h
│ ├── spthread.c
│ └── spthread.h
├── test
│ └── sched-demo.c
├── test_scheduler
└── tests
├── pennfat
│ ├── acutest.h
│ ├── cram-tests
│ │ └── mount_unmount.t
│ ├── test_pennfat
│ └── test_pennfat.c
├── sched-demo.c
├── test_linked_list.c
├── test_scheduler.c
└── test_scheduler.o
- Navigate to the
srcdirectory:cd src - Run
maketo compile the project:make - The executable(s) (e.g.,
pennosfat) will be created in thesrcdirectory.
This project implements a basic operating system with a filesystem that lives on top (and runs as a process in) the host operating system. Users can interact with it via a shell interface that is also implemented. Here is a breakdown of the different components we have implemented -
We have implemented a priority based scheduler for our operating system that keeps maintains queues for each of these states -
- High Priority
- Medium Priority
- Low Priority
- Blocked
- Stopped
- Zombied
Within each queue, we use round robin scheduling to schedule processes. Two processes are always running in the lifetime of the OS (while the user is interacting with the shell) - the INIT process and the SHELL process. These are both scheduled with the highest priority.
- INIT is responsible for reaping zombies and for spawning the shell process. It is only scheduled when there are zombies to reap, as to ensure that it does not busy wait and consume CPU time.
- SHELL is responsible for parsing commands and executing them. It also spawns new processes when necessary.
We maintain three levels of abstraction for our processes -
- Kernel Level Functions (
k_): These functions are used to interface directly with the scheduler - System Calls (
s_): These functions implement higher level functionality built on top of the kernel level functions - User Level Functions: These functions are used to interface with the shell and use the system calls to interact with the kernel
The shell is implemented as a high priority process. It is responsible for parsing commands and executing them. It also spawns new processes when necessary.
At a high level, the shell provides jobs, foreground and background processes, and a way to interact with the filesystem and is built on top of the system functions exposed by the kernel. For more details on the commands and functionality implemented, please refer to the companion document.
The project is structured as follows:
/(Root Directory): Contains the main Makefile, test infrastructure, and documentation.src/: Contains the core source code for PennOS.Makefile: Specific makefile for compiling the source withinsrc.shell/: Source code for the PennOS shell implementation.utils/: Utility functions used across different components.scheduler/: Source code for the process scheduler.kernel.c: Kernel level functions for the scheduler.logger.c: Logger for the scheduler.pennos.c: PennOS specific functions for the scheduler.scheduler.c: Scheduler implementation.spthread.c: Thread library.sys.c: System call implementation.
pennfat/: Source code for the PennFAT file system implementation.pennosfat: Likely the main executable or related file.
lib/: Contains any supporting libraries.tests/(and potentiallytest/): Contains testing scripts and code.doc/: Contains documentation, including the Companion Document.bin/: May contain compiled binaries or scripts.