Welcome Contributors!
Thank you for your interest in contributing to Portix OS! This is an open-source bare-metal operating system project, and contributions are always welcome. Whether you’re fixing a bug, adding a feature, improving documentation, or optimizing performance, your help is valuable.Prerequisites
Before contributing, ensure you have:Development Environment
- Rust Nightly toolchain
- NASM assembler
- QEMU emulator
- LLVM binutils
Knowledge
- Rust programming (especially
no_std) - x86-64 assembly basics
- Operating system concepts
- Git workflow
Getting Started
Code Standards
Rust Code
No Standard Library (no_std)
All kernel code must work without the Rust standard library:
Minimize unsafe
While unsafe is necessary for hardware access, minimize its use:
unsafe is safe:
Code Formatting
Follow Rust conventions:- Use 4 spaces for indentation
- Keep lines under 100 characters
- Use snake_case for functions and variables
- Use CamelCase for types and enums
Assembly Code
For assembly files inboot/ and interrupt handlers:
- Use Intel syntax
- Add comments explaining each section
- Keep code readable with proper spacing
- Document any magic numbers or hardware-specific values
Commit Message Guidelines
Portix OS follows conventional commit message format:Commit Types
| Type | Description | Example |
|---|---|---|
feat | New feature | feat(drivers): add ps/2 mouse support |
fix | Bug fix | fix(mem): correct buddy allocator coalescing |
docs | Documentation only | docs(readme): update build instructions |
style | Code style/formatting | style(kernel): run cargo fmt |
refactor | Code restructuring | refactor(ata): extract drive detection logic |
perf | Performance improvement | perf(graphics): use rep stosd for fills |
test | Adding tests | test(allocator): add coalescing test |
arch | Architecture/boot changes | arch(boot): implement A20 fast gate |
chore | Maintenance tasks | chore: update rust toolchain |
Commit Scope
Use the module or component affected:mem- Memory managementdrivers- Device driversgraphics- Graphics subsystemfs- Filesystemboot- Bootloaderarch- Architecture-specific codeui- User interfaceconsole- Terminal/console
Examples
Commit Best Practices
- One change per commit: Don’t mix unrelated changes
- Keep commits atomic: Each commit should be a complete, working change
- Write in imperative mood: “add feature” not “added feature”
- Explain why, not what: The diff shows what changed, explain why
Pull Request Process
Ensure code quality
Before submitting:Verify:
- Code compiles without warnings
- Boots successfully in QEMU
- No regressions in existing functionality
Create pull request
Go to GitHub and create a pull request with:
- Clear title describing the change
- Description of what and why
- Screenshots/videos if UI changes
- Reference any related issues
PR Checklist
- Code follows project style guidelines
- All commits have meaningful messages
- No compiler warnings
- Boots successfully in QEMU and VirtualBox
- Documentation updated if needed
- No breaking changes (or clearly documented)
- Serial output shows no errors
Areas to Contribute
Not sure where to start? Here are some ideas:Terminal Commands
Add new commands in
kernel/src/console/terminal/commands/- File system operations
- System information utilities
- Debugging tools
Driver Support
Expand hardware support:
- USB controller
- Network card (E1000)
- Sound card (AC97)
- Additional filesystems
Graphics Optimizations
Improve rendering performance:
- Hardware acceleration
- Better font rendering
- Window manager primitives
Documentation
Improve or add documentation:
- Code comments
- API documentation
- Architecture diagrams
- Tutorials
Code Review Guidelines
When reviewing PRs:- Be constructive and respectful
- Focus on code quality and maintainability
- Check for:
- Correctness and safety
- Performance implications
- Code clarity and documentation
- Adherence to project standards
Architecture Guidelines
Module Organization
Keep the existing module structure:Adding New Drivers
- Create module in appropriate
drivers/subdirectory - Implement initialization function
- Call from
main.rsduring boot - Add documentation
- Export necessary types in
mod.rs
Adding Terminal Commands
- Create new file in
console/terminal/commands/ - Implement command handler:
- Register in
commands/mod.rs - Add help text
Testing Requirements
All significant changes should be tested:- Manual testing: Boot in QEMU and VirtualBox
- Functionality: Verify feature works as expected
- Regression: Ensure existing features still work
- Edge cases: Test boundary conditions
- Check allocator statistics
- Test under low memory
- Verify no leaks
Documentation
Good documentation is crucial:-
Add doc comments to public APIs:
- Update README if adding major features
- Add architecture docs for complex subsystems
- Include examples in doc comments
Communication
- Questions: Open a GitHub issue with the
questionlabel - Bugs: Open an issue with the
buglabel and reproduction steps - Feature requests: Open an issue with the
enhancementlabel - Discussions: Use GitHub Discussions for broader topics
License
By contributing to Portix OS, you agree that your contributions will be licensed under the same license as the project.Recognition
All contributors are valued! Your name will be added to the contributors list in recognition of your work.Thank you for contributing to Portix OS! Every contribution, no matter how small, helps make this project better.
Ready to Start?
Head to the building guide to set up your development environment