pyOS (pronounced "pious") is a Python implementation of a pseudo unix-like operating system.
- Python 3.10+
- Unix terminal interface with command interpreter
- Common utilities (cat, cd, cp, echo, find, grep, head, ls, mkdir, mv, pwd, rm, sed, tail, tee, touch, tree, which, etc)
- Piping and stdio redirection
- Virtual filesystem with persistent storage
- File/directory metadata including timestamps and permissions
- Dynamic manipulation of files and directories
- System call interface for program access to OS functions
- File/directory permissions with owner/group/other access controls
- Basic user system with authentication
- Environment variables and command aliases
- Command history
- DRY code principles with utility modules for common operations
The system is composed of several key components:
-
Kernel: Core system services and protocols
- System management (startup, shutdown, process management)
- Shell implementation with environment and variable support
- Stream system for pipes and I/O redirection
- Filesystem abstraction layer
- Metadata and user data management
- Permission checking system
- Common utility modules for file, I/O, and path operations
-
Programs: Individual command implementations in the
programs/
directory- Standard Unix utilities (ls, cat, cp, etc)
- System management commands (login, logout, shutdown, restart)
- Utility commands (echo, find, grep, etc)
kernel.base_command
- Base class for implementing commandskernel.common
- Common utility functions for file operations and error handlingkernel.constants
- System constants and enumerationskernel.exceptions
- Custom exception classeskernel.file_utils
- File operation utilities for reading, writing, and processing fileskernel.filesystem
- Filesystem abstraction layerkernel.interfaces
- Interface definitions for system componentskernel.io_utils
- Standard input/output utilities for consistent I/O operationskernel.logging
- Logging utilitieskernel.metadata
- Enhanced database operations for file metadatakernel.models
- Data models for system objectskernel.path_utils
- Path manipulation utilities for handling file pathskernel.permissions
- Permission checking decorators and utilitieskernel.protocols
- Protocol definitions for system componentskernel.services
- Service layer implementationskernel.shell
- Shell implementation with environment and variable supportkernel.stream
- Stream system for pipes and I/O redirectionkernel.system
- Core system services and SysCall interfacekernel.userdata
- Enhanced database operations for user datakernel.utils
- Additional utility functions
alias
- Manage command aliasescat
- Concatenate and print filescd
- Change directorycp
- Copy files and directoriesecho
- Display a line of textedit
- Simple text editorfind
- Search for files in a directory hierarchygrep
- Print lines matching a patternhead
- Output the first part of fileshelp
- Display help informationhistory
- Command historyinterpreter
- Command interpreterlogin
- User authenticationlogout
- End user sessionls
- List directory contentsmkdir
- Make directoriesmv
- Move/rename filespwd
- Print working directoryrestart
- Restart the systemrm
- Remove files or directoriessed
- Stream editor for filtering and transforming textshutdown
- Shutdown the systemtac
- Print files in reversetail
- Output the last part of filestee
- Read from standard input and write to standard output and filestouch
- Change file timestamps or create empty filestree
- List contents of directories in a tree-like formatwhich
- Locate a commandwrite
- Write input to a file
- stderr redirection
- Additional utilities (xargs, awk, etc)
- Polish existing utilities
- Formalize the directory structure
- Thread(multiprocess?) processes
- Exit codes
- Tests
- Documentation
- Formalize syscalls
- Networking
- `command` execution
- User management commands (add, delete, change permissions, etc)
- cd into the pyOS directory
- Run
python pyOS.py
to start the system - Use
--login
and--password
arguments for automatic login during development