Compare commits

..

No commits in common. "master" and "0.0.6" have entirely different histories.

200 changed files with 5494 additions and 5192 deletions

6
.cargo/config Normal file
View File

@ -0,0 +1,6 @@
[target.x86_64-unknown-redox]
linker = "libc-artifacts/gcc.sh"
rustflags = [
"--verbose",
"-Z", "print-link-args"
]

15
.github/ISSUE_TEMPLATE vendored Normal file
View File

@ -0,0 +1,15 @@
**Reproduction**: [describe how you are able to reproduce ("trigger") this bug/issue.]
**Expected behavior**: [describe the behavior you would expect the repro to yield.]
**Actual behavior**: [describe the actual behavior, which is presented through the repro.].
**Build information**: [output of `rustc -V`, `git rev-parse HEAD`, `qemu-i386 -version`, `uname -a`, etc.]
**Blocking/related**: [issues or PRs blocking or being related to this issue.]
**Misc**: [optional: for other relevant information that should be known or cannot be described in the other fields.]
------
_If the above does not fit the nature of the issue feel free to modify it._

11
.gitignore vendored
View File

@ -1,4 +1,7 @@
/build/
/prefix/
.config
**/my_*
Cargo.lock
build
target
initfs/bin
filesystem/bin
filesystem/ref
filesystem/sbin

View File

@ -1,41 +0,0 @@
image: "ubuntu:22.04"
variables:
GIT_STRATEGY: "clone"
GIT_SUBMODULE_STRATEGY: "recursive"
before_script:
# Disable the wget progress bar
- echo 'show-progress = off' >> ~/.wgetrc
- |
export DEBIAN_FRONTEND=noninteractive
apt-get update -qq &&
apt-get install -qq \
bison \
build-essential \
curl \
flex \
fuse3 \
git \
libfuse-dev \
nasm \
pkg-config \
texinfo \
wget \
zstd &&
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
img:
script:
- |
source "$HOME/.cargo/env" &&
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash &&
cargo binstall --no-confirm --version 0.1.1 cargo-config &&
cargo binstall --no-confirm --version 1.16.0 just &&
cargo binstall --no-confirm --version 0.26.0 cbindgen &&
cargo build --manifest-path installer/Cargo.toml --release &&
make ci-img IMG_TAG=$CI_COMMIT_REF_NAME REPO_BINARY=1
artifacts:
paths:
- build/img/
expire_in: 1 week

View File

@ -1,92 +0,0 @@
<!-- Thank you for taking the time to submit an issue! By following these comments and filling out the sections below, you can help the developers get the necessary information to fix your issue. Please provide a single issue per report. You can also preview this report before submitting it. Feel free to modify/remove sections to fit the nature of your issue. -->
<!-- Please search to check that your issue has not been created already. By preventing duplicate issues, you can help keep the repository organized. If your current issue has already been created and is still unresolved, you can contribute by commenting there. -->
<!-- Replace the empty checkbox [ ] below with a checked one [x] if you have already searched for your issue. -->
- [ ] I agree that I have searched opened and closed issues to prevent duplicates.
--------------------
## Description
<!-- Briefly summarize/describe the issue that you are experiencing below. -->
Replace me
## Environment info
<!-- To understand where your issue originates, please include some relevant information about your environment. -->
<!-- If you are using a pre-built release of Redox, please specify the release version below. -->
- Redox OS Release:
0.0.0 Remove me
<!-- If you have built Redox OS yourself, please provide the following information: -->
- Operating system:
Replace me
- `uname -a`:
`Replace me`
- `rustc -V`:
`Replace me`
- `git rev-parse HEAD`:
`Replace me`
<!-- Depending on your issue, additional information about your environment (network config, package versions, dependencies, etc.) can also help. You can list that below. -->
- Replace me:
Replace me
## Steps to reproduce
<!-- If possible, please list the steps to reproduce ("trigger") your issue below. Being detailed definitely helps speed up bug fixes. -->
1. Replace me
2. Replace me
3. ...
## Behavior
<!-- It may seem obvious to know what to expect, but isolating the behavior from everything else simplifies the development process. Remember to provide a single issue in this report. You can use the References section below to link your issues together. -->
<!-- Describe the behavior you expect your steps should yield (i.e., correct behavior). -->
- **Expected behavior**:
Replace me
<!-- Describe the behavior you observed when running your steps (i.e., buggy behavior). -->
- **Actual behavior**:
Replace me
<!-- **Logs?** Posting a log can help developers find your particular issue more easily. Please wrap your code in code blocks using triple back-ticks ``` to increase readability. -->
```
Replace me
```
<!-- **Solution?** Have a solution in mind? Propose your solution below. -->
- **Proposed solution**:
Replace me
<!-- **Screenshots?** Make it easier to get your point across with screenshots. You can drag & drop or paste your images below. -->
## Optional references
<!-- If you have found issues or pull requests that are related to or blocking this issue, please link them below. See https://help.github.com/articles/autolinked-references-and-urls/ for more options. You can also link related code snippets by providing the permalink. See https://help.github.com/articles/creating-a-permanent-link-to-a-code-snippet/ for more information. -->
Related to:
- #0000 Remove me
- Replace me
- ...
Blocked by:
- #0000 Remove me
- ...
## Optional extras
<!-- If you have other relevant information not found in other sections, you can include it below. -->
Replace me
<!-- **Code?** Awesome! You can also create a pull request with a reference to this issue. -->
<!-- **Files?** Attach your relevant files by dragging & dropping or pasting them below. -->
<!-- You also can preview your report before submitting it. Thanks for contributing to Redox! -->

89
.gitmodules vendored
View File

@ -1,21 +1,72 @@
[submodule "cookbook"]
path = cookbook
url = https://gitlab.redox-os.org/redox-os/cookbook.git
branch = master
[submodule "installer"]
path = installer
url = https://gitlab.redox-os.org/redox-os/installer.git
branch = master
[submodule "rust"]
path = rust
url = https://gitlab.redox-os.org/redox-os/rust.git
branch = redox-2023-09-07
update = none
[submodule "redoxfs"]
path = redoxfs
url = https://gitlab.redox-os.org/redox-os/redoxfs.git
branch = master
[submodule "relibc"]
path = relibc
url = https://gitlab.redox-os.org/redox-os/relibc.git
branch = master
url = https://github.com/redox-os/rust.git
[submodule "ion"]
path = programs/ion
url = https://github.com/redox-os/ion.git
[submodule "programs/coreutils"]
path = programs/coreutils
url = https://github.com/redox-os/coreutils.git
[submodule "schemes/redoxfs"]
path = schemes/redoxfs
url = https://github.com/redox-os/redoxfs
[submodule "programs/extrautils"]
path = programs/extrautils
url = https://github.com/redox-os/extrautils.git
[submodule "programs/smith"]
path = programs/smith
url = https://github.com/IGI-111/Smith.git
[submodule "programs/userutils"]
path = programs/userutils
url = https://github.com/redox-os/userutils.git
[submodule "programs/netutils"]
path = programs/netutils
url = https://github.com/redox-os/netutils.git
[submodule "schemes/orbital"]
path = schemes/orbital
url = https://github.com/redox-os/orbital.git
[submodule "programs/orbutils"]
path = programs/orbutils
url = https://github.com/redox-os/orbutils.git
[submodule "filesystem/ui"]
path = filesystem/ui
url = https://github.com/redox-os/orbdata.git
[submodule "programs/acid"]
path = programs/acid
url = https://github.com/redox-os/acid.git
[submodule "programs/tar"]
path = programs/tar
url = https://github.com/redox-os/tar-rs.git
[submodule "programs/pkgutils"]
path = programs/pkgutils
url = https://github.com/redox-os/pkgutils.git
[submodule "installer"]
path = installer
url = https://github.com/redox-os/installer.git
[submodule "syscall"]
path = syscall
url = https://github.com/redox-os/syscall.git
[submodule "crates/docgen"]
path = crates/docgen
url = https://github.com/redox-os/docgen.git
[submodule "programs/binutils"]
path = programs/binutils
url = https://github.com/redox-os/binutils.git
[submodule "libc-artifacts"]
path = libc-artifacts
url = https://github.com/redox-os/libc-artifacts.git
[submodule "programs/games"]
path = programs/games
url = https://github.com/redox-os/games.git
[submodule "kernel"]
path = kernel
url = https://github.com/redox-os/kernel.git
[submodule "drivers"]
path = drivers
url = https://github.com/redox-os/drivers.git
[submodule "bootloader"]
path = bootloader
url = https://github.com/redox-os/bootloader.git
[submodule "isolinux"]
path = isolinux
url = https://github.com/redox-os/isolinux.git

45
.travis.yml Normal file
View File

@ -0,0 +1,45 @@
sudo: required
language: rust
rust:
- nightly
cache: cargo
os:
- linux
#- osx
#matrix:
# allow_failures:
# - os: osx
dist: trusty
before_install:
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
sudo apt-get update -qq &&
sudo apt-get install -qq nasm pkg-config fuse libfuse-dev genisoimage syslinux &&
sudo modprobe fuse &&
sudo chmod 666 /dev/fuse &&
sudo chown root:$USER /etc/fuse.conf;
fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
brew update &&
brew install nasm pkg-config Caskroom/cask/osxfuse &&
travis_wait 30 brew install redox-os/gcc_cross_compilers/x86_64-elf-gcc;
fi
script:
- make clean &&
make update &&
make build/harddrive.bin.gz build/livedisk.bin.gz build/livedisk.iso
notifications:
email: false
webhooks: http://37.139.9.28:54863/travis
deploy:
provider: releases
api_key:
secure: E5w3mgFbW4fAFNJn0FGcvwGKK33d+StC4izDX7dsGPxX/gwAsMnZqabDWpsrj8n/jFI5NdPzuyz4Ojkip4AXrEs0DWfX96d9CSWvJmWIirwwKhALnxZ5cqnHnBXY3wpk9k8MKpdODzKs3ZjM3pPug2jjjp2EHdrEV6iyc8LlnLAJutbtPpNJv0rJrx/TfCZRx70YWKQyx2Lfx5P6Vj+5yoYsKk+SHmKZlIQfj2E1cfC8+/w+fzc9CRTNhM9XFBisKnu9qql3nNhEW8VUNQ9FnltGpunmcTnCmsKzHPfs8Zv6kM/6y3wuoqxwPnIwRu+zsntkjM/eT7Zy3DtTBqJDjq+L5jov50QWOxzjUuFYMv0lAMeMC0PIGn0ECpFs546M+Wqvd7HKgabac0UhilEBPbinOdW+6aOOhbo+Fe2I2ec0XIGxlQpccQeWQUsjjOQ+6QuvnpPE+CbvQaVyrx27rVAkqD44cOP8xqOq2Es651J+Dt0O1OIhLdPB3FxOLCDpEIHU5Ojci1QbUxZgGKjShpo44nNqcTv7v71JrfzFSVG2pF9a35Mpo6bFEkzyQprOyrwH2fcnN+4jyxdJXzdNsgraXsQopWAB5cL/8i7SXMwHy9ivpFaX/zgoHQqpc1a4VjrmTtPA08rLORIllw9CplfvJNsmNmCi2aSeTXR06Xk=
file:
- build/harddrive.bin.gz
- build/livedisk.bin.gz
- build/livedisk.iso
on:
repo: redox-os/redox
tags: true
condition: $TRAVIS_OS_NAME = linux
skip_cleanup: true

View File

@ -1,141 +1,163 @@
# Contributing to Redox
**Thank you for your interest in contributing to Redox!**
Thank you for your interest in contributing to Redox! This document is a guide to help newcomers contribute!
There are many ways to help us out and we appreciate all of them.
This document will outline the basics of where to start if you wish to contribute to the project. There are many ways to help us out and and we appreciate all of them. We look forward to **your contribution!**
## Index
## Code Of Conduct
* [Communication](#communication)
* [Chat](#chat)
* [Reddit](#reddit)
* [Direct Contributing](#direct-contributing)
* [Low-Hanging Fruit - Easy Targets for Newbies](#easy-targets)
* [GitHub Issues](#gh-issues)
* [Pull Requests](#prs)
* [Creating a Pull Request](#creating-a-pr)
* [Best Practices/Guidelines](#best-practices)
* [General](#general)
* [Kernel](#kernel)
* [Testing Practices](#testing-practices)
* [Style Guidelines](#style-guidelines)
* [Rust](#rust-style-guidelines)
* [Git](#git-style-guidelines)
* [Other Ways to Contribute](#other)
* [Graphic Design](#graphic-design)
We follow the [Rust Code Of Conduct](https://www.rust-lang.org/policies/code-of-conduct).
## <a name="extern-links"> Other External Links </a>
## License
* [redox-os.org](http://redox-os.org)
* [rust-os-comparison](https://github.com/flosse/rust-os-comparison)
* [rust-lang.org](http://rust-lang.org)
In general, your contributions to Redox are governed by the [MIT License](https://en.wikipedia.org/wiki/MIT_License). Each project repository has a `LICENSE` file that provides the license terms for that project.
## <a name="communication"> Communication </a>
Please review the LICENSE for the project you are contributing to.
### <a name="chat"> Chat </a>
On [this](https://doc.redox-os.org/book/ch01-02-philosophy.html) page we explain why we use the MIT license.
The quickest and most open way to communicate with the Redox team is on our chat server. Currently, the only way to join it is by sending an email to [info@redox-os.org](mailto:info@redox-os.org), which might take a little while, since it's not automated. We're currently working on an easier way to do this, but this is the most convenient way right now.
## Chat
### <a name="reddit"> Reddit </a>
Join us on [Matrix Chat](https://doc.redox-os.org/book/ch13-01-chat.html) to discuss issues or ask questions.
You can find Redox on Reddit in [/r/rust/](https://www.reddit.com/r/rust) and [/r/redox/](https://www.reddit.com/r/redox). The weekly update news is posted on the former.
## Important Places to Contribute
## <a name="direct-contributing"> Direct Contributing </a>
(Before starting to contribute you **must** read the [FAQ](https://www.redox-os.org/faq/) and the [Redox Book](https://doc.redox-os.org/book/))
### <a name="easy-targets"> Low-Hanging Fruit - Easy Targets for Newbies </a>
You can contribute to the Redox documentation and code on these repositories:
* If you're not fluent in Rust:
(The order is based on difficulty, easy things first)
* Writing documentation
* Using/testing Redox, filing issues for bugs and needed features
* Web development ([Redox website, separate repo](https://github.com/redox-os/website))
* Writing unit tests (may require minimal knowledge of rust)
- [Website](https://gitlab.redox-os.org/redox-os/website)
- [Book](https://gitlab.redox-os.org/redox-os/book) - High-level documentation
- [Build System Configuration](https://gitlab.redox-os.org/redox-os/redox) - Our main repository
- [Cookbook](https://gitlab.redox-os.org/redox-os/cookbook) - Ports system
- [Orbital](https://gitlab.redox-os.org/redox-os/orbital) - Display server and window manager
- [Package Manager](https://gitlab.redox-os.org/redox-os/pkgutils)
- [relibc](https://gitlab.redox-os.org/redox-os/relibc) - Redox C Library
- [Drivers](https://gitlab.redox-os.org/redox-os/drivers) - Device daemons
- [Kernel](https://gitlab.redox-os.org/redox-os/kernel)
* If you are fluent in Rust, but not OS Development:
### Skill Levels
* Apps development
* Shell ([Ion](https://github.com/redox-os/ion)) development
* Package manager ([Magnet](https://github.com/redox-os/magnet)) development
* Other high-level code tasks
If you aren't fluent in Rust:
* If you are fluent in Rust, and have experience with OS Dev:
- Write documentation
- Use and test Redox, fill issues for bugs or needed features (please verify the repository issues before)
- Web development on the website (we don't accept JavaScript code)
- Write unit tests (may require minimal knowledge of Rust)
* Familiarize yourself with the repository and codebase
* Grep for `TODO`, `FIXME`, `BUG`, `UNOPTIMIZED`, `REWRITEME`, `DOCME`, and `PRETTYFYME` and fix the code you find.
* Improve and optimize code, especially in the kernel
If you are fluent in Rust, but not operating system Development:
### <a name="gh-issues"> GitHub Issues </a>
- Improve the Orbital display server and window manager.
- Port programs written in Rust to Redox (in most cases you need to port crates, be aware of missing functions on relibc, porting without these functions will make patches dirty)
- Improve the program compatibility in relibc
- Improve the package manager
- Improve the [Ion](https://gitlab.redox-os.org/redox-os/ion) shell
A bit more formal way of communication with fellow Redox devs, but a little less quick and convenient like the chat (unless of course you aren't in it yet, which if you're going to be involved in this project really at all, it is recommended that you request to join). These are for more specific topics.
If you are fluent in Rust, and have experience with operating system development:
### <a name="prs"> Pull Requests </a>
- Familiarize yourself with the repository and code
- Grep for `TODO`, `FIXME`, `BUG`, `UNOPTIMIZED`, `REWRITEME`, `DOCME`, and `PRETTYFYME` and fix the code you find
- Update old code to remove warnings
- Improve and optimize code, especially in the kernel
- Write device drivers
It's completely okay to just submit a small pull request without first making an issue or something, but if it's a significant change that will require a lot of planning and reviewing, it's best you start with writing an issue first. Also see [git guidelines](#git-style-guidelines)
For those who want to contribute to the Redox GUI, our GUI strategy has recently changed.
### <a name="creating-a-pr"> Creating a Pull Request </a>
- We are improving the [Orbital](https://gitlab.redox-os.org/redox-os/orbital) display server and window manager, you can read more about it on [this](https://gitlab.redox-os.org/redox-os/redox/-/issues/1430) tracking issue.
- Redox is in the process of adopting other Rust-written GUI toolkits, such as [Iced](https://iced.rs) and [Slint](https://slint-ui.com/). Please check out those projects if this is your area of interest.
- OrbTk is in maintenance mode, and its developers have moved to other projects such as the ones below. There is currently no Redox-specific GUI development underway.
1. Fork the repository
2. Clone the original repository to your local PC using one of the following commands based on the protocol you are using:
* HTTPS:`git clone https://github.com/redox-os/redox.git --origin upstream --recursive`
* SSH:`git clone git@github.com:redox-os/redox.git --origin upstream --recursive`
* Then rebase: `git rebase upstream master`
Use HTTPS if you don't know which one to use. (Recommended: learn about SSH if you don't want to have to log in every time you push/pull!)
3. Add your fork with
* HTTPS:`git remote add origin https://github.com/your-username/redox.git`
* SSH:`git remote add origin git@github.com:your-username/redox.git`
4. Alternatively, if you already have a fork and copy of the repo, you can simply check to make sure you're up-to-date
* Fetch the upstream:`git fetch upstream master`
* Rebase with local commits:`git rebase upstream/master`
* Update the submodules:`git submodule update --init`
5. Optionally create a separate branch (recommended if you're making multiple changes simultaneously) (`git checkout -b my-branch`)
6. Make changes
7. Commit (`git add . --all; git commit -m "my commit"`)
8. Optionally run [rustfmt](https://github.com/rust-lang-nursery/rustfmt) on the files you changed and commit again if it did anything (check with `git diff` first)
9. Test your changes with `make qemu` or `make virtualbox` (you might have to use `make qemu kvm=no`, formerly `make qemu_no_kvm`)
(see [Best Practices and Guidelines](#best-practices))
10. Pull from upstream (`git fetch upstream; git rebase upstream/master`) (Note: try not to use `git pull`, it is equivalent to doing `git fetch upstream; git merge master upstream/master`, which is not usually preferred for local/fork repositories, although it is fine in some cases.)
11. Repeat step 9 to make sure the rebase still builds and starts
12. Push to your fork (`git push origin my-branch`)
13. Create a pull request
14. Describe your changes
15. Submit!
## Tracking Issues Index
## <a name="best-practices"> Best Practices and Guidelines </a>
We use an index to track the development priorities, you can find them on [this](https://gitlab.redox-os.org/redox-os/redox/-/issues/1384) page.
### <a name="general"> General </a>
## Build System
* **Remember to do a `git rebase -i upstream/master` before you send your patch!**
* **Make sure your code is readable, commented, and well-documented.**
* **Don't hesitate to ask for help!**
* **Before implementing something, discuss it! Open an issue, or join the chat.**
You can find the Redox build system organization and commands on [this](https://doc.redox-os.org/book/ch08-06-build-system-reference.html) page.
##### On the more technical side:
* Test, test, and test!
* Follow the style conventions
* Use `std::mem::replace` and `std::mem::swap` when you can.
* `libredox` should be 1-to-1 with the official `libstd`.
* Use `.into()` and `.to_owned()` over `.to_string()`.
* Prefer passing references to the data over owned data. (Don't take `String`, take `&str`. Don't take `Vec<T>` take `&[T]`).
* Use generics, traits, and other abstractions Rust provides.
* Avoid using lossy conversions (for example: don't do `my_u32 as u16 == my_u16`, prefer `my_u32 == my_u16 as my_u32`).
* Prefer in place (`box` keyword) when doing heap allocations.
* Prefer platform independently sized integer over pointer sized integer (`u32` over `usize`, for example).
* Follow the usual idioms of programming, such as "composition over inheritance", "let your program be divided in smaller pieces", and "resource acquisition is initialization".
* When `unsafe` is unnecessary, don't use it. 10 lines longer safe code is better than more compact unsafe code!
* Be sure to mark parts that need work with `TODO`, `FIXME`, `BUG`, `UNOPTIMIZED`, `REWRITEME`, `DOCME`, and `PRETTYFYME`.
* Use the compiler hint attributes, such as `#[inline]`, `#[cold]`, etc. when it makes sense to do so.
* Check the [chat](#chat), [the Website](http://redox-os.org), and [the Rust subreddit](https://www.reddit.com/r/rust) frequently.
## Developer FAQ
### <a name="kernel"> Kernel </a>
You can see the most common questions and problems on [this](https://doc.redox-os.org/book/ch09-07-developer-faq.html) page.
* When trying to access a slice, **always** use the `common::GetSlice` trait and the `.get_slice()` method to get a slice without causing the kernel to panic.
The problem with slicing in regular Rust, e.g. `foo[a..b]`, is that if someone tries to access with a range that is out of bounds of an array/string/slice, it will cause a panic at runtime, as a safety measure. Same thing when accessing an element.
Always use `foo.get(n)` instead of `foo[n]` and try to cover for the possibility of `Option::None`. Doing the regular way may work fine for applications, but never in the kernel. No possible panics should ever exist in kernel space, because then the whole OS would just stop working.
## Porting Software
### <a name="testing-practices"> Testing Practices </a>
You can read how to use the Cookbook recipe system to port applications on [this](https://doc.redox-os.org/book/ch09-03-porting-applications.html) page.
* It's always better to test boot (`make qemu` or `make virtualbox`) every time you make a change, because it is important to see how the OS boots and works after it compiles.
Even though Rust is a safety-oriented language, something as unstable as an in-dev operating system will have problems in many cases and may completely break on even the slightest critical change.
Also, make sure you check how the unmodified version runs on your machine before making any changes. Else, you won't have anything to compare to, and it will generally just lead to confusion. TLDR: Rebuild and test boot often.
## Libraries and APIs
* To run the ZFS tests:
* Create the zfs.img only once. If one has not been created, run `make filesystem/apps/zfs/zfs.img` before booting into Redox.
* Run `open zfs.img` to open the created ZFS image.
* Run `file /home/LICENSE.md` twice to ensure ARC isn't broken.
You can read [this](https://doc.redox-os.org/book/ch09-06-libraries-apis.html) page to learn about the libraries and APIs used in Redox.
## <a name="style-guidelines"> Style Guidelines </a>
## Development Tips
### <a name="rust-style-guidelines"> Rust </a>
You can find important tips on [this](https://doc.redox-os.org/book/ch09-02-coding-and-building.html#development-tips) section.
Since Rust is a relatively small and new language compared to others like C, there's really only one standard. Just follow the official Rust standards for formatting, and maybe run `rustfmt` on your changes, until we setup the CI system to do it automatically.
## References
### <a name="git-style-guidelines"> Git </a>
We maintain a list of wikis, articles and videos to learn Rust, OS development and computer science on [this](https://doc.redox-os.org/book/ch09-08-references.html) page.
* Commit messages should describe their changes in present tense, e.g. "`Add stuff to file.ext`" instead of "`added stuff to file.ext`".
* Try to remove useless duplicate/merge commits from PRs as these clutter up history, and may make it hard to read.
* Usually, when syncing your local copy with the master branch, you will want to rebase instead of merge. This is because it will create duplicate commits that don't actually do anything when merged into the master branch.
* When you start to make changes, you will want to create a separate branch, and keep the `master` branch of your fork identical to the main repository, so that you can compare your changes with the main branch and test out a more stable build if you need to.
* You should have a fork of the repository on GitHub and a local copy on your computer. The local copy should have two remotes; `upstream` and `origin`, `upstream` should be set to the main repository and `origin` should be your fork.
If you are skilled there's a possibility that they could improve your knowledge in some way.
## <a name="other"> Other Ways to Contribute </a>
## Best Practices and Guidelines
### <a name="graphic-design"> Graphic Design </a>
You can read the best practices and guidelines on [this](https://doc.redox-os.org/book/ch11-00-best-practices.html) chapter.
## Style Guidelines
### Rust
Since **Rust** is a relatively small and new language compared to others like C and C++, there's really only one standard. Just follow the official Rust standards for formatting, and maybe run `rustfmt` on your changes, until we setup the CI system to do it automatically.
### Git
Please follow our [Git style](https://doc.redox-os.org/book/ch12-04-creating-proper-pull-requests.html) for pull requests.
## GitLab
### Issues
To know how to create issues on the Redox GitLab, read [this](https://doc.redox-os.org/book/ch12-05-filing-issues.html) page.
### Pull Requests
Please follow [our process](https://doc.redox-os.org/book/ch12-04-creating-proper-pull-requests.html) for creating proper pull requests.
## Other Ways to Contribute
If you aren't good on coding, but you still want to help keep the project going, you can contribute and support in a variety of ways! We'll try to find a way to use anything you have to offer.
### Design
If you're a good designer, whether it's 2D graphics, 3D graphics, interfaces, web design, you can help. We need logos, UI design, UI skins, app icons, desktop backgrounds, etc.
- [Redox backgrounds](https://gitlab.redox-os.org/redox-os/backgrounds) - You can send your wallpapers on this repository.
- [Redox assets](https://gitlab.redox-os.org/redox-os/assets) - You can send your logos, icons and themes on this repository.
If you have questions about the graphic design, ask us on the [Chat](https://doc.redox-os.org/book/ch13-01-chat.html).
### Donate to Redox
If you are interested in donating to the Redox OS Nonprofit, you can find instructions [here](https://www.redox-os.org/donate/).
If you're a good designer, you can help with logos, UI design, app icons, other graphics (e.g. stock desktop backgrounds), etc. More information to come on this, for now just join [the chat](#chat) and ask about graphic design.

35
Cargo.toml Normal file
View File

@ -0,0 +1,35 @@
[workspace]
members = [
"crates/docgen",
"drivers/ahcid",
"drivers/bgad",
"drivers/e1000d",
"drivers/pcid",
"drivers/ps2d",
"drivers/rtl8168d",
"drivers/vesad",
"kernel",
"programs/acid",
"programs/binutils",
"programs/contain",
"programs/coreutils",
"programs/extrautils",
"programs/games",
"programs/init",
"programs/ion",
"programs/netutils",
"programs/orbutils",
"programs/pkgutils",
"programs/smith",
"programs/tar",
"programs/userutils",
"schemes/ethernetd",
"schemes/example",
"schemes/ipd",
"schemes/orbital",
"schemes/ptyd",
"schemes/randd",
"schemes/redoxfs",
"schemes/tcpd",
"schemes/udpd"
]

View File

@ -1,327 +0,0 @@
# Hardware Compatibility
This document tracks the current hardware compatibility of Redox.
- [Status](#status)
- [General](#general)
- [Template](#template)
- [x86-64](#x86-64)
- [System76](#system76)
- [Dell](#dell)
- [HP](#hp)
- [ASUS](#asus)
- [Lenovo](#lenovo)
- [Toshiba](#toshiba)
- [Custom](#custom)
- [i686](#i686)
- [Dell](#dell-1)
- [ASUS](#asus-1)
- [Lenovo](#lenovo-1)
- [Toshiba](#toshiba-1)
- [Panasonic](#panasonic)
- [Custom](#custom-1)
- [ARM64](#arm64)
- [Custom](#custom-2)
## Status
- Broken - The system can't boot.
- Booting - The system boots with some issues.
- Recommended - The system start with all features working.
## General
This section cover things to consider.
- ACPI support is incomplete (some things are hardcoded on the kernel)
- USB support is incomplete (desktops are generally not recommended)
- Wi-Fi is not supported
- GPU drivers aren't supported (only VESA and GOP)
- Automatic operating system discovery on boot loader is not implemented (remember this before installing Redox)
## Template
You will use this template to insert your computer.
- **Computer model**
```
Status - (Broken, Booting or Recommended)
Redox version - 0.0.0
Variant - (server-minimal, desktop-minimal, server, desktop, demo, dev or customized)
Image date - day-month-year
- Additional details goes here as items
```
## x86-64
Computers using a 64 bits Intel/AMD CPU.
### System76
- **System76 Galago Pro (galp5)**
```
Status - Recommended
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using UEFI
- Boots to desktop
```
- **System76 Lemur Pro (lemp9)**
```
Status - Recommended
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using UEFI
- Boots to desktop
```
- **System76 Oryx Pro (oryp10)**
```
Status - Booting
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using UEFI
- Boots to desktop
- No touchpad support, though it should be working
```
- **System76 Pangolin (pang12)**
```
Status - Booting
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using UEFI
- Boots to desktop
- No touchpad support, requires I2C HID
```
### Dell
- **Dell XPS 13 (9350)**
```
Status - Booting
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using both BIOS and UEFI
- Boots to desktop
- NVMe driver livelocks
```
### HP
- **HP Dev One**
```
Status - Booting
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using UEFI
- Boots to desktop
- No touchpad support, requires I2C HID
```
### ASUS
- **ASUS X554L**
```
Status - Booting
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using BIOS
- Boots to desktop
- No audio, HDA driver cannot find output pins
```
- **ASUS ROG g55vw**
```
Satus - Booting
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2023
- Booted using BIOS
- Boots to desktop
- UEFI panic in SETUP
```
### Lenovo
- **Lenovo IdeaPad Y510P**
```
Status - Recommended
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using both BIOS and UEFI
- Boots to desktop
```
- **Lenovo G570**
```
Status - Broken
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using BIOS
- Correct video mode not offered, this is a firmware issue
- Bootloader panics in alloc_zeroed_page_aligned
```
### Toshiba
- **Toshiba Satellite L500**
```
Status - Booting
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using BIOS
- Correct video mode not offered, this is a firmware issue
- Boots to desktop
- No ethernet driver
```
### Custom
If you have a customized computer, put it here.
## i686
Computers with a 32 bits Intel/AMD CPU.
### Dell
- **Dell XPS 13 (9350)**
```
Status - Booting
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using BIOS
- Boots to desktop
- NVMe driver livelocks
```
### ASUS
- **ASUS Eee PC 900**
```
Status - Booting
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using BIOS
- Correct video mode not offered, this is a firmware issue
- Boots to desktop
- No ethernet driver
```
### Lenovo
- **Lenovo IdeaPad Y510P**
```
Status - Broken
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using BIOS
- Panics on phys_to_virt overflow, probably having invalid mappings for 32-bit
```
### Toshiba
- **Toshiba Satellite L500**
```
Status - Broken
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using BIOS
- Correct video mode not offered, this is a firmware issue
- Panics on phys_to_virt overflow, probably having invalid mappings for 32-bit
```
### Panasonic
- **Panasonic Toughbook CF-18**
```
Status - Broken
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using BIOS
- Hangs after PIT initialization
```
### Custom
If you have a customized computer, put it here.
## ARM64
Computers using a 64 bits ARM CPU.
### Raspberry Pi
- **Raspberry Pi 3 Model B+**
```
Status - Booting
Redox version - 0.8.0
Variant - server
Image date - None
- Booted using Uboot
- Boots to UART serial console
- a bcm2835-sdhci/mmc driver
- pl011 UART
```
### Custom
If you have a customized ARM board, put it here.

113
Makefile
View File

@ -1,100 +1,53 @@
# Configuration and variables
include mk/config.mk
# Dependencies
include mk/depends.mk
all: build/harddrive.bin
all: $(BUILD)/harddrive.img
live: build/livedisk.bin
live:
-$(FUMOUNT) $(BUILD)/filesystem/ || true
-$(FUMOUNT) /tmp/redox_installer/ || true
rm -f $(BUILD)/livedisk.iso
$(MAKE) $(BUILD)/livedisk.iso
iso: build/livedisk.iso
popsicle: $(BUILD)/livedisk.iso
popsicle-gtk $(BUILD)/livedisk.iso
clean:
cargo clean
cargo clean --manifest-path rust/src/libcollections/Cargo.toml
cargo clean --manifest-path rust/src/libstd/Cargo.toml
-$(FUMOUNT) build/filesystem/ || true
rm -rf initfs/bin
rm -rf filesystem/bin filesystem/sbin filesystem/ui/bin
rm -rf build
image:
-$(FUMOUNT) $(BUILD)/filesystem/ || true
-$(FUMOUNT) /tmp/redox_installer/ || true
rm -f $(BUILD)/harddrive.img $(BUILD)/livedisk.iso
$(MAKE) all
rebuild:
-$(FUMOUNT) $(BUILD)/filesystem/ || true
-$(FUMOUNT) /tmp/redox_installer/ || true
rm -rf $(BUILD)
$(MAKE) all
clean: $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
cd cookbook && ./clean.sh
-rm -rf cookbook/repo
cargo clean --manifest-path cookbook/pkgutils/Cargo.toml
cargo clean --manifest-path installer/Cargo.toml
cargo clean --manifest-path redoxfs/Cargo.toml
cargo clean --manifest-path relibc/Cargo.toml
endif
-$(FUMOUNT) $(BUILD)/filesystem/ || true
-$(FUMOUNT) /tmp/redox_installer/ || true
rm -rf $(BUILD)
distclean: $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
$(MAKE) clean
cd cookbook && ./unfetch.sh
endif
update:
cargo update
pull:
git pull
git submodule sync --recursive
git pull --rebase --recurse-submodules
git submodule sync
git submodule update --recursive --init
git clean -X -f -d
make clean
make update
fetch: $(BUILD)/fetch.tag
# Emulation recipes
include mk/qemu.mk
include mk/bochs.mk
include mk/virtualbox.mk
repo: $(BUILD)/repo.tag
# Kernel recipes
include mk/kernel.mk
# Podman build recipes and vars
include mk/podman.mk
# Userspace recipes
include mk/userspace/mod.mk
# Disk Imaging and Cookbook tools
include mk/fstools.mk
# Documentation
include mk/doc.mk
# Cross compiler recipes
include mk/prefix.mk
# Repository maintenance
include mk/repo.mk
# Filesystem recipes
include mk/initfs.mk
include mk/filesystem.mk
# Disk images
include mk/disk.mk
# Emulation recipes
include mk/qemu.mk
include mk/virtualbox.mk
# CI
include mk/ci.mk
env: prefix FORCE $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
export PATH="$(PREFIX_PATH):$$PATH" && \
bash
endif
gdb: FORCE
gdb cookbook/recipes/core/kernel/target/$(TARGET)/build/kernel.sym --eval-command="target remote localhost:1234"
# An empty target
FORCE:
# Wireshark
# Misc
wireshark: FORCE
wireshark $(BUILD)/network.pcap
wireshark build/network.pcap

192
README.md
View File

@ -1,73 +1,151 @@
<p align="center">
<img alt="Redox" width="346" src="https://gitlab.redox-os.org/redox-os/assets/raw/master/logos/redox/logo.png">
<img alt="Redox" height="120" src="https://github.com/redox-os/assets/raw/master/logo.png">
</p>
[Redox](https://www.redox-os.org) is an operating system written in Rust, a language with focus on safety, efficiency and high performance. Redox, following the microkernel design, aims to be reliable, secure, usable, correct and free. Redox is inspired by previous operating systems, such as seL4, MINIX, Plan 9, Linux and BSD.
**Redox** is an operating system written in Rust, a language with focus on safety and high performance. Redox, following the microkernel design, aims to be secure, usable, and free. Redox is inspired by previous kernels and operating systems, such as SeL4, Minix, Plan 9, and BSD.
Redox _is not_ just a kernel, it's a **full-featured operating system**, providing components (memory allocator, file system, display manager, core utilities, etc.) that together make up a functional and convenient operating system. You can loosely think of it as the GNU or BSD ecosystem, but in a memory safe language and with modern technology.
Redox _is not_ just a kernel, it's a full-featured Operating System, providing packages (memory allocator, file system, display manager, core utilities, etc.) that together makes up a functional and convenient operating system. You can loosly think of it as the GNU or BSD ecosystem, but in a memory safe language and with modern technology. See [this list](#ecosystem) for overview of the ecosystem.
[![Downloads](https://img.shields.io/github/downloads/redox-os/redox/total.svg)](https://gitlab.redox-os.org/redox-os/redox/tags)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
The website can be found at https://www.redox-os.org.
## Guide
Please make sure you use the **latest nightly** of `rustc` before building (for more troubleshooting, see ["Help! Redox won't compile!"](#compile-help)).
This is the main repository of the Redox GitLab where the build system files are stored, this README is used to guide new developers.
[![Travis Build Status](https://travis-ci.org/redox-os/redox.svg?branch=master)](https://travis-ci.org/redox-os/redox)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.md)
![Rust Version](https://img.shields.io/badge/rust-1.16.0--nightly%20(4ecc85beb%202016--12--28)-lightgrey.svg)
You can find the most important pages below:
## Contents
- [Book](https://doc.redox-os.org/book/)
- [Contribute](CONTRIBUTING.md)
- [Hardware Compatibility](HARDWARE.md)
- [Trying Out Redox](https://doc.redox-os.org/book/ch02-04-trying-out-redox.html)
- [Building Redox](https://doc.redox-os.org/book/ch02-05-building-redox.html)
- [Build System Documentation](https://doc.redox-os.org/book/ch08-06-build-system-reference.html)
- [Developer FAQ](https://doc.redox-os.org/book/ch09-07-developer-faq.html)
- [Chat/Discussions/Help](https://doc.redox-os.org/book/ch13-01-chat.html)
* [What it looks like](#what-it-looks-like)
* [Ecosystem](#ecosystem)
* [Help! Redox won't compile](#compile-help)
* [Contributing to Redox](#contributing)
* [Cloning, Building and running](#cloning-building-running)
* [Quick Setup](#quick-setup)
* [Manual Setup](#manual-setup)
## Ecosystem
## <a name="what-it-looks-like"> What it looks like </a>
These are the most important repositories available on the Redox GitLab:
<img alt="Redox" height="150" src="https://github.com/redox-os/assets/raw/master/screenshots/Desktop.png">
<img alt="Redox" height="150" src="https://github.com/redox-os/assets/raw/master/screenshots/Fancy_opacity.png">
<img alt="Redox" height="150" src="https://github.com/redox-os/assets/raw/master/screenshots/File_manager.png">
| Name (lexicographic order) | Maintainer
|--------------------------------------------------------------------------------------|---------------------------
| [acid (kernel integration tests)](https://gitlab.redox-os.org/redox-os/acid) | **@jackpot51**
| [binutils](https://gitlab.redox-os.org/redox-os/binutils) | **@jackpot51**
| [cookbook](https://gitlab.redox-os.org/redox-os/cookbook) | **@jackpot51** **@hatred_45** **@ids1024**
| [coreutils](https://gitlab.redox-os.org/redox-os/coreutils) | **@jackpot51**
| [extrautils](https://gitlab.redox-os.org/redox-os/extrautils) | **@jackpot51**
| [games](https://gitlab.redox-os.org/redox-os/games) | **@fabiao**
| [Ion (shell)](https://gitlab.redox-os.org/redox-os/ion) | **@jackpot51**
| [ipcd](https://gitlab.redox-os.org/redox-os/ipcd) | **@jackpot51**
| [kernel](https://gitlab.redox-os.org/redox-os/kernel) | **@jackpot51**
| [libextra](https://gitlab.redox-os.org/redox-os/libextra) | **@jackpot51**
| [libpager](https://gitlab.redox-os.org/redox-os/libpager) | **@jackpot51**
| [netstack](https://gitlab.redox-os.org/redox-os/netstack) | **@jackpot51**
| [netutils](https://gitlab.redox-os.org/redox-os/netutils) | **@jackpot51**
| [orbclient (Orbital client)](https://gitlab.redox-os.org/redox-os/orbclient) | **@jackpot51** **@FloVanGH**
| [orbdata](https://gitlab.redox-os.org/redox-os/orbdata) | **@jackpot51**
| [orbgame (Orbital 2D game engine)](https://gitlab.redox-os.org/redox-os/orbgame) | **@FloVanGH**
| [Orbital (windowing and compositing system)](https://gitlab.redox-os.org/redox-os/orbital) | **@jackpot51**
| [orbtk (Orbital toolkit)](https://gitlab.redox-os.org/redox-os/orbtk) | **@FloVanGH**
| [orbutils (Orbital utilities)](https://gitlab.redox-os.org/redox-os/orbutils) | **@jackpot51**
| [pkgutils (current package manager)](https://gitlab.redox-os.org/redox-os/pkgutils) | **@jackpot51**
| [ralloc](https://gitlab.redox-os.org/redox-os/ralloc) | **@jackpot51**
| [RANSID (Rust ANSI driver)](https://gitlab.redox-os.org/redox-os/ransid) | **@jackpot51**
| [redoxfs (default filesystem)](https://gitlab.redox-os.org/redox-os/redoxfs) | **@jackpot51**
| [relibc (C Library in Rust)](https://gitlab.redox-os.org/redox-os/relibc) | **@jackpot51**
| [small (stack String and other collections)](https://gitlab.redox-os.org/redox-os/small) | **@jackpot51**
| [syscall](https://gitlab.redox-os.org/redox-os/syscall) | **@jackpot51**
| [Sodium (Vim-inspired text editor)](https://gitlab.redox-os.org/redox-os/sodium) | **@jackpot51**
| [The Redox book](https://gitlab.redox-os.org/redox-os/book) | **@hatred_45**
| [userutils](https://gitlab.redox-os.org/redox-os/userutils) | **@jackpot51**
<img alt="Redox" height="150" src="https://github.com/redox-os/assets/raw/master/screenshots/Sodium_v1.png">
<img alt="Redox" height="150" src="https://github.com/redox-os/assets/raw/master/screenshots/Boot.png">
<img alt="Redox" height="150" src="https://github.com/redox-os/assets/raw/master/screenshots/start.png">
## What it looks like
## <a name="ecosystem"> Ecosystem </a>
<img alt="Redox" height="150" src="https://gitlab.redox-os.org/redox-os/assets/raw/master/screenshots/Senza%20titolo.jpeg">
<img alt="Redox" height="150" src="https://gitlab.redox-os.org/redox-os/assets/raw/master/screenshots/redox running.jpeg">
<img alt="Redox" height="150" src="https://gitlab.redox-os.org/redox-os/assets/raw/master/screenshots/IMG_1460.PNG">
The ecosystem and software Redox OS provides is listed below.
<img alt="Redox" height="150" src="https://gitlab.redox-os.org/redox-os/assets/raw/master/screenshots/Sodium_v2.PNG">
<img alt="Redox" height="150" src="https://gitlab.redox-os.org/redox-os/assets/raw/master/screenshots/Boot.png">
<img alt="Redox" height="150" src="https://gitlab.redox-os.org/redox-os/assets/raw/master/screenshots/IMG_1459.PNG">
| Name (lexicographic order) | Maintainer
|-----------------------------------------------------------------------------|---------------------------
| [acid tests](https://github.com/redox-os/acid) | [**@jackpot51**](https://github.com/jackpot51) (co.: [**@ticki**](https://github.com/ticki), [**@nilset](https://github.com/nilset))
| [binutils](https://github.com/redox-os/binutils) | [**@ticki**](https://github.com/ticki)
| [bots (other internal bots)](https://github.com/redox-os/bots) | [**@ticki**](https://github.com/ticki)
| [cookbook](https://github.com/redox-os/cookbook) | [**@jackpot51**](https://github.com/jackpot51)
| [coreutils](https://github.com/redox-os/coreutils) | [**@ticki**](https://github.com/ticki) (co.: [**@stratact**](https://github.com/stratact))
| [extrautils](https://github.com/redox-os/extrautils) | [**@ticki**](https://github.com/ticki)
| [games](https://github.com/redox-os/games) | [**@ticki**](https://github.com/ticki)
| [Ion (shell)](https://github.com/redox-os/ion) | [**@skylerberg**](https://github.com/skylerberg) & [**@jackpot51**](https://github.com/jackpot51)
| [kernel](https://github.com/redox-os/kernel) | [**@jackpot51**](https://github.com/jackpot51)
| [libextra](https://github.com/redox-os/libextra) | [**@ticki**](https://github.com/ticki)
| [libpager](https://github.com/redox-os/libpager) | [**@ticki**](https://github.com/ticki)
| [magnet (future package manager)](https://github.com/redox-os/magnet) | [**@ticki**](https://github.com/ticki)
| [netutils](https://github.com/redox-os/netutils) | [**@jackpot51**](https://github.com/jackpot51)
| [orbclient](https://github.com/redox-os/orbclient) | [**@jackpot51**](https://github.com/jackpot51)
| [orbdata](https://github.com/redox-os/orbdata) | [**@jackpot51**](https://github.com/jackpot51)
| [orbital](https://github.com/redox-os/orbital) | [**@jackpot51**](https://github.com/jackpot51)
| [orbtk](https://github.com/redox-os/orbtk) | [**@stratact**](https://github.com/stratact)
| [orbutils](https://github.com/redox-os/orbutils) | [**@jackpot51**](https://github.com/jackpot51)
| [pkgutils (current package manager)](https://github.com/redox-os/pkgutils) | [**@jackpot51**](https://github.com/jackpot51)
| [playbot (internal REPL bot)](https://github.com/redox-os/playbot) | [**@ticki**](https://github.com/ticki)
| [ralloc](https://github.com/redox-os/ralloc) | [**@ticki**](https://github.com/ticki)
| [RANSID](https://github.com/redox-os/ransid) | [**@jackpot51**](https://github.com/jackpot51)
| [redoxfs (old filesystem)](https://github.com/redox-os/redoxfs) | [**@jackpot51**](https://github.com/jackpot51)
| [syscall](https://github.com/redox-os/syscall) | [**@jackpot51**](https://github.com/jackpot51)
| [Sodium (editor)](https://github.com/redox-os/sodium) | [**@ticki**](https://github.com/ticki)
| [Standard library](https://github.com/redox-os/libstd) | [**@jackpot51**](https://github.com/jackpot51)
| [userutils](https://github.com/redox-os/userutils) | [**@jackpot51**](https://github.com/jackpot51)
| [TFS (filesystem)](https://github.com/ticki/tfs) | [**@ticki**](https://github.com/ticki)
| [The Redox book](https://github.com/redox-os/book) | [**@ticki**](https://github.com/ticki)
| [The old kernel](https://github.com/redox-os/old) | **abandoned**
| [ZFS](https://github.com/redox-os/zfs) | **abandoned, superseded by TFS**
See [Redox in Action](https://www.redox-os.org/screens/) for photos and videos.
## <a name="compile-help"> Help! Redox won't compile! </a>
Sometimes things go wrong when compiling. Try the following before opening an issue:
1. Run `make clean`.
2. Run `git clean -X -f -d`.
3. Make sure you have **the latest version of Rust nightly!** ([rustup.rs](https://www.rustup.rs) is recommended for managing Rust versions).
4. Update **GNU Make**, **NASM** and **QEMU/VirtualBox**.
5. Pull the upstream master branch (`git remote add upstream git@github.com:redox-os/redox.git; git pull upstream master`).
6. Update submodules (`git submodule update --recursive --init`).
and then rebuild!
## <a name="contributing"> Contributing to Redox </a>
If you're interested in this project, and you'd like to help us out, [here](CONTRIBUTING.md) is a list of ways you can do just that.
## <a name="cloning-building-running"> Cloning, Building, and Running </a>
Redox is big (even compressed)! So cloning Redox takes a lot of bandwidth, and (depending on your data plan) can be costly, so clone at your own risk!
### <a name="quick-setup" /> Quick Setup </a>
```bash
$ cd path/to/your/projects/folder/
# Run bootstrap setup
$ curl -sf https://raw.githubusercontent.com/redox-os/redox/master/bootstrap.sh -o bootstrap.sh && bash -e bootstrap.sh
# Build Redox
$ make all
# Launch using QEMU
$ make qemu
# Launch using QEMU without using KVM (Kernel Virtual Machine). Try if QEMU gives an error.
$ make qemu kvm=no
```
#### QEMU with KVM
To use QEMU with KVM (kernel-based virtual Machine), which is faster than without KVM, you need a CPU with Intel® Virtualization Technology (Intel® VT) or AMD Virtualization™ (AMD-V™) support. Most systems have this disabled in the BIOS by default, so you may need to reboot and enable the feature in the BIOS.
### <a name="manual-setup"> Manual Setup </a>
To manually clone, build and run Redox using a Linux host, run the following commands (with exceptions, be sure to read the comments):
```bash
$ cd path/to/your/projects/folder/
# HTTPS
$ git clone https://github.com/redox-os/redox.git --origin upstream --recursive
# SSH
$ git clone git@github.com:redox-os/redox.git --origin upstream --recursive
$ cd redox/
# Install/update dependencies
$ bash bootstrap.sh -d
# Install rustup.rs
$ curl https://sh.rustup.rs -sSf | sh
# Set override toolchain to nightly build
$ rustup override set nightly
# For successive builds start here. If this is your first build, just continue
# Update git submodules
$ git submodule update --recursive --init
# Build Redox
$ make all
# Launch using QEMU
$ make qemu
# Launch using QEMU without using KVM (Kernel Virtual Machine). Try if QEMU gives an error.
$ make qemu kvm=no
```

14
bochs.x86_64 Normal file
View File

@ -0,0 +1,14 @@
ata0-master: type=disk, path="build/harddrive.bin", mode=flat
boot: disk
com1: enabled=1, mode=file, dev=build/serial.log
megs: 1024
magic_break: enabled=1
display_library: x, options="gui_debug"
log: -
debug: action=ignore
info: action=report
error: action=report
panic: action=ask
debugger_log: -

1
bootloader Submodule

@ -0,0 +1 @@
Subproject commit 7639aef32ed5ffd272701d955147b8b50aad53e0

900
bootstrap.sh Executable file → Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,98 +0,0 @@
#!/usr/bin/env bash
###########################################################################
# #
# Build the system, with a specified processor type and filesystem config #
# #
###########################################################################
usage()
{
echo "build.sh: Invoke make for a particular architecture and configuration."
echo "Usage:"
echo "./build.sh [-X | -A | -6 | -a ARCH] [-c CONFIG] [-f FILESYSTEM_CONFIG] TARGET..."
echo " -X Equivalent to -a x86_64."
echo " -A Equivalent to -a aarch64."
echo " -6 Equivalent to -a i686."
echo " -a ARCH: Processor Architecture. Normally one of x86_64, aarch64 or"
echo " i686. ARCH is not checked, so you can add a new architecture."
echo " Defaults to the directory containing the FILESYSTEM_CONFIG file,"
echo " or x86_64 if no FILESYSTEM_CONFIG is specified."
echo " -c CONFIG: The name of the config, e.g. desktop, server or demo."
echo " Determines the name of the image, build/ARCH/CONFIG/harddrive.img"
echo " e.g. build/x86_64/desktop/harddrive.img"
echo " Determines the name of FILESYSTEM_CONFIG if none is specified."
echo " Defaults to the basename of FILESYSTEM_CONFIG, or 'desktop'"
echo " if FILESYSTEM_CONFIG is not specified."
echo " -f FILESYSTEM_CONFIG:"
echo " The config file to use. It can be in any location."
echo " However, if the file is not in a directory named x86_64, aarch64"
echo " or i686, you must specify the architecture."
echo " If -f is not specified, FILESYSTEM_CONFIG is set to"
echo " config/ARCH/CONFIG.toml"
echo " If you specify both CONFIG and FILESYSTEM_CONFIG, it is not"
echo " necessary that they match, but it is recommended."
echo " Examples: ./build.sh -c demo live - make build/x86_64/demo/livedisk.iso"
echo " ./build.sh -6 qemu - make build/i686/desktop/harddrive.img and"
echo " and run it in qemu"
echo " NOTE: If you do not change ARCH or CONFIG very often, edit mk/config.mk"
echo " and set ARCH and FILESYSTEM_CONFIG. You only need to use this"
echo " script when you want to override them."
}
if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
usage
exit
fi
defaultarch="x86_64"
defaultname="desktop"
ARCH=""
CONFIG_NAME=""
FILESYSTEM_CONFIG=""
while getopts ":c:f:a:dhXA6" opt
do
case "$opt" in
a) ARCH="$OPTARG";;
c) CONFIG_NAME="$OPTARG";;
f) FILESYSTEM_CONFIG="$OPTARG";;
X) ARCH="x86_64";;
A) ARCH="aarch64";;
6) ARCH="i686";;
h) usage;;
\?) echo "Unknown option -$OPTARG, try -h for help"; exit;;
:) echo "-$OPTARG requires a value"; exit;;
esac
done
shift $((OPTIND -1))
if [ -z "$ARCH" ] && [ -n "$FILESYSTEM_CONFIG" ]; then
dirname=`dirname "$FILESYSTEM_CONFIG"`
ARCH=`basename $dirname`
case "$ARCH" in
x86_64) : ;;
aarch64) : ;;
i686) : ;;
\?) ARCH=""; echo "Unknown Architecture, please specify x86_64, aarch64 or i686";;
esac
fi
if [ -z "$config_name" ] && [ -n "$FILESYSTEM_CONFIG" ]; then
CONFIG_NAME=`basename "$FILESYSTEM_CONFIG" .toml`
fi
if [ -z "$ARCH" ]; then
ARCH="$defaultarch"
fi
if [ -z "$CONFIG_NAME" ]; then
CONFIG_NAME="$defaultname"
fi
if [ -z "$FILESYSTEM_CONFIG" ]; then
FILESYSTEM_CONFIG="config/$ARCH/$CONFIG_NAME.toml"
fi
export ARCH CONFIG_NAME FILESYSTEM_CONFIG
make $@

View File

@ -1,3 +0,0 @@
# Configuration for using acid
include = ["../acid.toml"]

View File

@ -1,213 +0,0 @@
# This is the CI configuration file
# General settings
[general]
# Do not prompt if settings are not defined
prompt = false
# Package settings
[packages]
acid = {}
atk = {}
audiod = {}
autoconf = {}
automake = {}
bash = {}
binutils = {}
bootloader = {}
bootstrap = {}
ca-certificates = {}
cairo = {}
cairodemo = {}
#calculator = {}
cargo = {}
cleye = {}
#cmatrix = {} # needs ncursesw now
contain = {}
coreutils = {}
cosmic-edit = {}
cosmic-icons = {}
cosmic-text = {}
cpal = {}
curl = {}
dash = {}
diffutils = {}
dosbox = {}
drivers = {}
drivers-initfs = {}
duktape = {}
eduke32 = {}
escalated = {}
exampled = {}
expat = {}
extrautils = {}
#fal
#fd = {} # ctrlc-3.1.1
#ffmpeg6 = {} # undefined references
findutils = {}
fontconfig = {}
#freeciv = {}
freedoom = {}
#freeglut = {}
freepats = {}
freetype2 = {}
#friar = {} # mio patch
fribidi = {}
#game-2048 = {} # rustc-serialize
#gawk = {} # langinfo.h
gcc13 = {}
gdbserver = {}
#gdk-pixbuf = {} # shared-mime-info
gears = {}
generaluser-gs = {}
gettext = {}
gigalomania = {}
git = {}
glib = {}
glium = {}
glutin = {}
gnu-binutils = {}
gnu-grep = {}
gnu-make = {}
#gstreamer = {} # conflict with thread local errno
harfbuzz = {}
#hematite = {} # needs crate patches for redox-unix
init = {}
initfs = {}
installer = {}
installer-gui = {}
intel-one-mono = {}
ion = {}
ipcd = {}
jansson = {}
kernel = {}
keyboard-sfx = {}
lci = {}
libc-bench = {}
libffi = {}
libgmp = {}
libiconv = {}
libjpeg = {}
libogg = {}
liborbital = {}
libpng = {}
libsodium = {}
libvorbis = {}
libxml2 = {}
llvm = {}
logd = {}
lua54 = {}
#mdp = {} # ncursesw
mesa = {}
mesa-glu = {}
mgba = {}
#miniserve = {} # actix
nano = {}
nasm = {}
#ncdu = {} # fails to link with ncurses
ncurses = {}
#ncursesw = {} # mkstemp configure hang
netdb = {}
netstack = {}
netsurf = {}
netutils = {}
neverball = {}
#newlib = {} # obsolete
#newlibtest = {} # obsolete
nghttp2 = {}
openjazz = {}
openssl1 = {}
openttd = {}
openttd-opengfx = {}
openttd-openmsx = {}
openttd-opensfx = {}
orbclient = {}
orbdata = {}
orbital = {}
orbterm = {}
orbutils = {}
#orbutils-background = {} # needs recipe update
#orbutils-launcher = {} # needs recipe update
#orbutils-orblogin = {} # needs recipe update
osdemo = {}
#pango = {} # undefined references to std::__throw_system_error(int)
#pastel = {} # needs crate patches for redox-unix
patch = {}
#pathfinder = {} # servo-fontconfig
#pciids = {}
pcre = {}
perg = {}
periodictable = {}
#perl = {} # ctermid, tempnam, ttyname
pixelcannon = {}
pixman = {}
#pkgar = {} # uses virtual Cargo.toml, needs recipe update
pkg-config = {}
pkgutils = {}
pop-icon-theme = {}
#powerline = {} # dirs
prboom = {}
procedural-wallpapers-rs = {}
ptyd = {}
#python = {} # getaddrinfo
#qemu = {}
ramfs = {}
randd = {}
readline = {}
redoxerd = {}
redox-fatfs = {}
redoxfs = {}
redox-games = {}
redox-ssh = {}
relibc = {}
#relibc-tests = {} # madvise link error
resist = {}
#retroarch = {} # OS_TLSIndex not declared
ripgrep = {}
rodioplay = {}
rs-nes = {}
rust = {}
rust64 = {}
rust-cairo = {}
rust-cairo-demo = {}
rustual-boy = {}
schismtracker = {}
scummvm = {}
sdl-gfx = {}
#sdl-player = {} # wctype_t
sdl1 = {}
sdl1-image = {}
sdl1-mixer = {}
sdl1-ttf = {}
sdl2 = {}
sdl2-gears = {}
sdl2-image = {}
sdl2-mixer = {}
sdl2-ttf = {}
sed = {}
#servo = {} # some more crates to port
#shared-mime-info = {} # intltool-update out of date
shellharden = {}
shellstorm = {}
smith = {}
sodium = {}
sopwith = {}
#ssh = {}
strace = {}
syobonaction = {}
terminfo = {}
#termplay = {} # backtrace cannot find link.h
timidity = {}
ttf-hack = {}
userutils = {}
uutils = {}
vice = {}
vim = {}
vttest = {}
vvvvvv = {}
#webrender = {} # unwind
#wesnoth = {}
#winit = {} # tzset
xz = {}
zerod = {}
zlib = {}

View File

@ -1,14 +0,0 @@
# Default desktop configuration
include = ["../desktop-minimal.toml"]
# Override the default settings here
# General settings
[general]
# Filesystem size in MiB
# filesystem_size = 1024
# Package settings
[packages]
# example = {}

View File

@ -1,10 +0,0 @@
# Minimal configuration
include = ["../../server-minimal.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 256
# EFI partition size in MiB
efi_partition_size = 128

View File

@ -1,3 +0,0 @@
# Configuration for using resist
include = ["../resist.toml"]

View File

@ -1,14 +0,0 @@
# Minimal configuration
include = ["../server-minimal.toml"]
# Override the default settings here
# General settings
[general]
# Filesystem size in MiB
# filesystem_size = 1024
# Package settings
[packages]
# example = {}

View File

@ -1,26 +0,0 @@
# Configuration for using acid
include = ["base.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 256
# Package settings
[packages]
acid = {}
coreutils = {}
ion = {}
[[files]]
path = "/usr/lib/init.d/10_acid"
data = """
export RUST_BACKTRACE full
acid
acid create_test
acid switch
acid tls
acid thread
shutdown
"""

View File

@ -1,168 +0,0 @@
# Base configuration: This configuration is meant to be included by
# other configurations rather than use directly. It is the greatest
# common divisor of all other configurations and misses several
# parts necessary to create a bootable system.
# General settings
[general]
# Do not prompt if settings are not defined
prompt = false
[packages]
bootloader = {}
bootstrap = {}
escalated = {}
initfs = {}
ipcd = {}
kernel = {}
ptyd = {}
uutils = {}
## Configuration files
[[files]]
path = "/usr/lib/init.d/00_base"
data = """
# clear and recreate tmpdir with 0o1777 permission
rm -r /tmp
mkdir -m a=rwxt /tmp
ipcd
ptyd
escalated
"""
[[files]]
path = "/etc/hostname"
data = """
redox
"""
# https://www.freedesktop.org/software/systemd/man/latest/os-release.html
[[files]]
path = "/usr/lib/os-release"
data = """
PRETTY_NAME="Redox OS 0.8.0"
NAME="Redox OS"
VERSION_ID="0.8.0"
VERSION="0.8.0"
ID="redox-os"
HOME_URL="https://redox-os.org/"
DOCUMENTATION_URL="https://redox-os.org/docs/"
SUPPORT_URL="https://redox-os.org/community/"
"""
# FIXME maybe add VARIANT= and VARIANT_ID= keys depending on the chosen configuration?
[[files]]
path = "/etc/os-release"
data = "../usr/lib/os-release"
symlink = true
## Symlinks for usrmerge
[[files]]
path = "/usr"
data = ""
directory = true
mode = 0o755
[[files]]
path = "/usr/bin"
data = ""
directory = true
mode = 0o755
[[files]]
path = "/bin"
data = "usr/bin"
symlink = true
[[files]]
path = "/usr/include"
data = ""
directory = true
mode = 0o755
[[files]]
path = "/include"
data = "usr/include"
symlink = true
[[files]]
path = "/usr/lib"
data = ""
directory = true
mode = 0o755
[[files]]
path = "/lib"
data = "usr/lib"
symlink = true
[[files]]
path = "/usr/share"
data = ""
directory = true
mode = 0o755
[[files]]
path = "/share"
data = "usr/share"
symlink = true
## Device file symlinks
[[files]]
path = "/dev/null"
data = "null:"
symlink = true
[[files]]
path = "/dev/random"
data = "rand:"
symlink = true
[[files]]
path = "/dev/urandom"
data = "rand:"
symlink = true
[[files]]
path = "/dev/zero"
data = "zero:"
symlink = true
[[files]]
path = "/dev/tty"
data = "libc:tty"
symlink = true
[[files]]
path = "/dev/stdin"
data = "libc:stdin"
symlink = true
[[files]]
path = "/dev/stdout"
data = "libc:stdout"
symlink = true
[[files]]
path = "/dev/stderr"
data = "libc:stderr"
symlink = true
# User settings
[users.root]
password = "password"
uid = 0
gid = 0
name = "root"
home = "/root"
[users.user]
# Password is unset
password = ""
# Group settings
[groups.sudo]
gid = 1
members = ["user"]

View File

@ -1,30 +0,0 @@
# Default desktop configuration
include = ["server-minimal.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 128
# Package settings
[packages]
drivers = {}
orbdata = {}
orbital = {}
orbterm = {}
orbutils-background = {}
orbutils-launcher = {}
orbutils-orblogin = {}
[[files]]
path = "/usr/lib/init.d/00_drivers"
data = """
pcid /etc/pcid.d/
"""
[[files]]
path = "/usr/lib/init.d/20_orbital"
data = """
orbital orblogin launcher
"""

View File

@ -1,33 +0,0 @@
# Default desktop configuration
include = ["server.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 512
# Package settings
[packages]
audiod = {}
installer-gui = {}
netsurf = {}
orbdata = {}
orbital = {}
orbterm = {}
orbutils = {}
[[files]]
path = "/usr/lib/init.d/20_orbital"
data = """
audiod
orbital orblogin launcher
"""
# Override console config to not switch to VT 2
[[files]]
path = "/usr/lib/init.d/30_console"
data = """
getty 2
getty debug: -J
"""

View File

@ -1,27 +0,0 @@
# Configuration for development, includes cargo and rustc
include = ["desktop.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 2048
# Do not prompt if settings are not defined
prompt = false
# Package settings
[packages]
cargo = {}
crates-io-index = {}
gcc13 = {}
gnu-binutils = {}
gnu-make = {}
rust = {}
[[files]]
path = "/home/user/example.rs"
data = """
fn main() {
println!("Hello, Redox!");
}
"""

View File

@ -1,3 +0,0 @@
# Configuration for using acid
include = ["../acid.toml"]

View File

@ -1,47 +0,0 @@
# This is the CI configuration file
# General settings
[general]
# Do not prompt if settings are not defined
prompt = false
# Package settings
[packages]
audiod = {}
bootloader = {}
bootstrap = {}
ca-certificates = {}
contain = {}
coreutils = {}
dash = {}
diffutils = {}
drivers = {}
escalated = {}
extrautils = {}
findutils = {}
initfs = {}
installer = {}
installer-gui = {}
ion = {}
ipcd = {}
kernel = {}
nano = {}
netdb = {}
netstack = {}
netsurf = {}
netutils = {}
orbdata = {}
orbital = {}
orbterm = {}
orbutils = {}
pkgutils = {}
ptyd = {}
redoxfs = {}
relibc = {}
resist = {}
smith = {}
userutils = {}
uutils = {}
vim = {}
#TODO: Add more packages

View File

@ -1,70 +0,0 @@
##############################################################################
# Redox Demo Configuration #
# #
# This file defines the setup of the Redox Demo system. #
# #
# The "[packages]" section specifies what packages are installed in the #
# filesystem prior to booting the system. During build, these packages must #
# have a recipe defined in the config folder (see the Redox Book, #
# Chapter 5.1). The first group of packages is mandatory for the system to #
# function, although some items can be removed for special builds, #
# e.g. The Orbital GUI is not required for a headless server. #
# #
# Items in the "Developer Tools" and "Games" section are optional. You can #
# add your own programs here. #
# #
# The "[users]" section creates user id's and passwords. Each user will have #
# a home directory at boot. #
# #
# The "[[files]]" section contains files needed by the system. If you need #
# create a file, e.g. a config file for a program you are adding, you can do #
# it here. #
# #
##############################################################################
include = ["../desktop.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 512
# Package settings
[packages]
# Games
dosbox = {}
freedoom = {}
prboom = {}
redox-games = {}
# Demos
pixelcannon = {}
# MIDI
freepats = {}
[[files]]
path = "/home/user/Welcome.txt"
data = """
##############################################################################
# #
# Welcome to Redox! #
# #
# Redox is an operating system written in Rust, a language with focus #
# on safety and high performance. Redox, following the microkernel design, #
# aims to be secure, usable, and free. Redox is inspired by previous kernels #
# and operating systems, such as SeL4, MINIX, Plan 9, and BSD. #
# #
# Redox _is not_ just a kernel, it's a full-featured Operating System, #
# providing packages (memory allocator, file system, display manager, core #
# utilities, etc.) that together make up a functional and convenient #
# operating system. You can loosely think of it as the GNU or BSD ecosystem, #
# but in a memory safe language and with modern technology. #
# #
# The website can be found at https://www.redox-os.org. #
# #
# For things to try on Redox, please see #
# https://doc.redox-os.org/book/ch02-06-trying-out-redox.html #
# #
##############################################################################
"""

View File

@ -1,14 +0,0 @@
# Default desktop configuration
include = ["../desktop-minimal.toml"]
# Override the default settings here
# General settings
[general]
# Filesystem size in MiB
# filesystem_size = 1024
# Package settings
[packages]
# example = {}

View File

@ -1,14 +0,0 @@
# Default desktop configuration
include = ["../desktop.toml"]
# Override the default settings here
# General settings
[general]
# Filesystem size in MiB
# filesystem_size = 1024
# Package settings
[packages]
# example = {}

View File

@ -1,14 +0,0 @@
# Configuration for development, includes cargo and rustc
include = ["../dev.toml"]
# Override the default settings here
# General settings
[general]
# Filesystem size in MiB
# filesystem_size = 1024
# Package settings
[packages]
# example = {}

View File

@ -1,40 +0,0 @@
# Jeremy's configuration
include = ["../desktop.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 4000
# Package settings
[packages]
# apps
cosmic-text = {}
pixelcannon = {}
sodium = {}
# cli
acid = {}
cleye = {}
ripgrep = {}
# demos
cpal = {}
orbclient = {}
rodioplay = {}
winit = {}
# games
dosbox = {}
eduke32 = {}
freedoom = {}
prboom = {}
redox-games = {}
# stuff
freepats = {}
generaluser-gs = {}
jeremy = {}
keyboard-sfx = {}
ttf-hack = {}

View File

@ -1,3 +0,0 @@
# Configuration for using resist
include = ["../resist.toml"]

View File

@ -1,14 +0,0 @@
# Minimal configuration
include = ["../server-minimal.toml"]
# Override the default settings here
# General settings
[general]
# Filesystem size in MiB
# filesystem_size = 1024
# Package settings
[packages]
# example = {}

View File

@ -1,14 +0,0 @@
# Default server configuration
include = ["../server.toml"]
# Override the default settings here
# General settings
[general]
# Filesystem size in MiB
# filesystem_size = 1024
# Package settings
[packages]
# example = {}

View File

@ -1,51 +0,0 @@
# Net configuration: includes the base configuration and adds files required
# for networking
include = ["base.toml"]
# Package settings
[packages]
drivers = {}
netstack = {}
netutils = {}
## Driver init
[[files]]
path = "/usr/lib/init.d/00_drivers"
data = """
pcid /etc/pcid.d/
"""
## Network init
[[files]]
path = "/usr/lib/init.d/10_net"
data = """
smolnetd
dnsd
dhcpd -b
"""
## Default net configuration (optimized for QEMU)
[[files]]
path = "/etc/net/dns"
data = """
208.67.222.222
"""
[[files]]
path = "/etc/net/ip"
data = """
10.0.2.15
"""
[[files]]
path = "/etc/net/ip_router"
data = """
10.0.2.2
"""
[[files]]
path = "/etc/net/ip_subnet"
data = """
255.255.255.0
"""

View File

@ -1,17 +0,0 @@
# Configuration for redoxer GUI image
include = ["redoxer.toml"]
# Package settings
[packages]
orbdata = {}
orbital = {}
# Override to run inside of orbital
[[files]]
path = "/usr/lib/init.d/30_redoxer"
data = """
echo
echo ## running redoxer in orbital ##
orbital redoxerd
"""

View File

@ -1,53 +0,0 @@
# Configuration for redoxer image
include = ["net.toml"]
# Package settings
[packages]
bash = {}
ca-certificates = {}
coreutils = {}
extrautils = {}
findutils = {}
gcc13 = {}
gnu-binutils = {}
netdb = {}
pkgutils = {}
redoxerd = {}
relibc = {}
# Override to not background dhcpd
[[files]]
path = "/usr/lib/init.d/10_net"
data = """
smolnetd
dnsd
dhcpd
"""
[[files]]
path = "/usr/lib/init.d/20_env"
data = """
echo
echo ## preparing environment ##
export GROUPS 0
export HOME /root
export HOST redox
export SHELL /bin/sh
export UID 0
export USER root
cd /root
env
"""
[[files]]
path = "/usr/lib/init.d/30_redoxer"
data = """
echo
echo ## running redoxer ##
redoxerd
"""
[[files]]
path = "/etc/pkg.d/50_redox"
data = "https://static.redox-os.org/pkg"

View File

@ -1,45 +0,0 @@
# Configuration for using resist
include = ["net.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 256
# Package settings
[packages]
bash = {}
coreutils = {}
diffutils = {}
extrautils = {}
findutils = {}
gcc13 = {}
gnu-binutils = {}
gnu-make = {}
netdb = {}
resist = {}
userutils = {}
# Override to not background dhcpd
[[files]]
path = "/usr/lib/init.d/10_net"
data = """
smolnetd
dnsd
dhcpd
"""
[[files]]
path = "/usr/lib/init.d/20_resist"
data = """
export RUST_BACKTRACE full
resist /share/resist/redox/spec.toml
resist /share/resist/posix/base.toml
resist /share/resist/posix/shell.toml
shutdown
"""
[[files]]
path = "/etc/pkg.d/50_redox"
data = "https://static.redox-os.org/pkg"

View File

@ -1,23 +0,0 @@
# Minimal configuration
include = ["base.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 128
# Package settings
[packages]
coreutils = {}
extrautils = {}
ion = {}
smith = {}
userutils = {}
[[files]]
path = "/usr/lib/init.d/30_console"
data = """
getty 2
getty debug: -J
"""

View File

@ -1,44 +0,0 @@
# Default server configuration
include = ["net.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 512
# Package settings
[packages]
bash = {}
ca-certificates = {}
contain = {}
coreutils = {}
curl = {}
diffutils = {}
extrautils = {}
findutils = {}
git = {}
installer = {}
ion = {}
nano = {}
netdb = {}
pkgutils = {}
redoxfs = {}
relibc = {}
resist = {}
smith = {}
terminfo = {}
userutils = {}
vim = {}
[[files]]
path = "/usr/lib/init.d/30_console"
data = """
inputd -A 2
getty 2
getty debug: -J
"""
[[files]]
path = "/etc/pkg.d/50_redox"
data = "https://static.redox-os.org/pkg"

View File

@ -1,3 +0,0 @@
# Configuration for using acid
include = ["../acid.toml"]

View File

@ -1,215 +0,0 @@
# This is the CI configuration file
# General settings
[general]
# Do not prompt if settings are not defined
prompt = false
# Package settings
[packages]
acid = {}
atk = {}
audiod = {}
autoconf = {}
automake = {}
bash = {}
binutils = {}
bootloader = {}
bootstrap = {}
ca-certificates = {}
cairo = {}
cairodemo = {}
#calculator = {}
cargo = {}
cleye = {}
#cmatrix = {} # needs ncursesw now
contain = {}
coreutils = {}
cosmic-edit = {}
cosmic-icons = {}
cosmic-text = {}
cpal = {}
curl = {}
dash = {}
diffutils = {}
dosbox = {}
drivers = {}
drivers-initfs = {}
duktape = {}
eduke32 = {}
escalated = {}
exampled = {}
expat = {}
extrautils = {}
#fal
#fd = {} # ctrlc-3.1.1
ffmpeg6 = {}
findutils = {}
fontconfig = {}
#freeciv = {}
freedoom = {}
#freeglut = {}
freepats = {}
freetype2 = {}
#friar = {} # mio patch
fribidi = {}
#game-2048 = {} # rustc-serialize
#gawk = {} # langinfo.h
gcc13 = {}
gdbserver = {}
#gdk-pixbuf = {} # shared-mime-info
gears = {}
generaluser-gs = {}
gettext = {}
gigalomania = {}
git = {}
glib = {}
glium = {}
glutin = {}
gnu-binutils = {}
gnu-grep = {}
gnu-make = {}
#gstreamer = {} # conflict with thread local errno
harfbuzz = {}
#hematite = {} # needs crate patches for redox-unix
init = {}
initfs = {}
installer = {}
installer-gui = {}
intel-one-mono = {}
ion = {}
ipcd = {}
#jansson = {} # needs config.sub update
kernel = {}
keyboard-sfx = {}
lci = {}
libc-bench = {}
libffi = {}
libgmp = {}
libiconv = {}
libjpeg = {}
libogg = {}
liborbital = {}
libpng = {}
libsodium = {}
libvorbis = {}
libxml2 = {}
llvm = {}
logd = {}
lua54 = {}
#mdp = {} # ncursesw
mednafen = {}
mesa = {}
mesa-glu = {}
mgba = {}
#miniserve = {} # actix
nano = {}
nasm = {}
#ncdu = {} # fails to link with ncurses
ncurses = {}
#ncursesw = {} # mkstemp configure hang
netdb = {}
netstack = {}
netsurf = {}
netutils = {}
neverball = {}
#newlib = {} # obsolete
#newlibtest = {} # obsolete
nghttp2 = {}
nushell = {}
openjazz = {}
openssl1 = {}
openttd = {}
openttd-opengfx = {}
openttd-openmsx = {}
openttd-opensfx = {}
orbclient = {}
orbdata = {}
orbital = {}
orbterm = {}
orbutils = {}
#orbutils-background = {} # needs recipe update
#orbutils-launcher = {} # needs recipe update
#orbutils-orblogin = {} # needs recipe update
osdemo = {}
#pango = {} # undefined references to std::__throw_system_error(int)
#pastel = {} # needs crate patches for redox-unix
patch = {}
#pathfinder = {} # servo-fontconfig
#pciids = {}
pcre = {}
perg = {}
periodictable = {}
#perl = {} # ctermid, tempnam, ttyname
pixelcannon = {}
pixman = {}
#pkgar = {} # uses virtual Cargo.toml, needs recipe update
pkg-config = {}
pkgutils = {}
pop-icon-theme = {}
#powerline = {} # dirs
prboom = {}
procedural-wallpapers-rs = {}
ptyd = {}
#python = {} # getaddrinfo
#qemu = {}
ramfs = {}
randd = {}
readline = {}
redoxerd = {}
redox-fatfs = {}
redoxfs = {}
redox-games = {}
redox-ssh = {}
relibc = {}
#relibc-tests = {} # madvise link error
resist = {}
#retroarch = {} # OS_TLSIndex not declared
ripgrep = {}
rodioplay = {}
rs-nes = {}
rust = {}
rust64 = {}
rust-cairo = {}
rust-cairo-demo = {}
rustual-boy = {}
schismtracker = {}
scummvm = {}
sdl-gfx = {}
#sdl-player = {} # wctype_t
sdl1 = {}
sdl1-image = {}
sdl1-mixer = {}
sdl1-ttf = {}
sdl2 = {}
sdl2-gears = {}
sdl2-image = {}
sdl2-mixer = {}
sdl2-ttf = {}
sed = {}
#servo = {} # some more crates to port
shared-mime-info = {}
shellharden = {}
shellstorm = {}
smith = {}
sodium = {}
sopwith = {}
#ssh = {}
strace = {}
syobonaction = {}
terminfo = {}
#termplay = {} # backtrace cannot find link.h
timidity = {}
ttf-hack = {}
userutils = {}
uutils = {}
#vice = {} # linker errors
vim = {}
vttest = {}
vvvvvv = {}
#webrender = {} # unwind
#wesnoth = {}
#winit = {} # tzset
xz = {}
zerod = {}
zlib = {}

View File

@ -1,97 +0,0 @@
##############################################################################
# Redox Demo Configuration #
# #
# This file defines the setup of the Redox Demo system. #
# #
# The "[packages]" section specifies what packages are installed in the #
# filesystem prior to booting the system. During build, these packages must #
# have a recipe defined in the config folder (see the Redox Book, #
# Chapter 5.1). The first group of packages is mandatory for the system to #
# function, although some items can be removed for special builds, #
# e.g. The Orbital GUI is not required for a headless server. #
# #
# Items in the "Developer Tools" and "Games" section are optional. You can #
# add your own programs here. #
# #
# The "[users]" section creates user id's and passwords. Each user will have #
# a home directory at boot. #
# #
# The "[[files]]" section contains files needed by the system. If you need #
# create a file, e.g. a config file for a program you are adding, you can do #
# it here. #
# #
##############################################################################
include = ["../desktop.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 1536
# Package settings
[packages]
# GUI Apps
cosmic-edit = {}
cosmic-files = {}
periodictable = {}
# GUI Data
cosmic-icons = {}
intel-one-mono = {}
pop-icon-theme = {}
shared-mime-info = {}
# Shell Apps
curl = {}
git = {}
gnu-grep = {}
ripgrep = {}
sodium = {}
vim = {}
# Games
dosbox = {}
freedoom = {}
neverball = {}
prboom = {}
redox-games = {}
sopwith = {}
syobonaction = {}
# Demos
acid = {}
nushell = {}
orbclient = {}
pixelcannon = {}
rodioplay = {}
gears = {}
# MIDI
freepats = {}
[[files]]
path = "/home/user/Welcome.txt"
data = """
##############################################################################
# #
# Welcome to Redox! #
# #
# Redox is an operating system written in Rust, a language with focus #
# on safety and high performance. Redox, following the microkernel design, #
# aims to be secure, usable, and free. Redox is inspired by previous kernels #
# and operating systems, such as SeL4, MINIX, Plan 9, and BSD. #
# #
# Redox _is not_ just a kernel, it's a full-featured Operating System, #
# providing packages (memory allocator, file system, display manager, core #
# utilities, etc.) that together make up a functional and convenient #
# operating system. You can loosely think of it as the GNU or BSD ecosystem, #
# but in a memory safe language and with modern technology. #
# #
# The website can be found at https://www.redox-os.org. #
# #
# For things to try on Redox, please see #
# https://doc.redox-os.org/book/ch02-06-trying-out-redox.html #
# #
##############################################################################
"""

View File

@ -1,41 +0,0 @@
# Default desktop configuration using contain
include = ["../desktop.toml"]
# Override the default settings here
# General settings
[general]
# Filesystem size in MiB
# filesystem_size = 1024
# Package settings
[packages]
# example = {}
# Override orbital init to use contain_orblogin
[[files]]
path = "/usr/lib/init.d/20_orbital"
data = """
audiod
orbital contain_orblogin launcher
"""
# Override console init to use contain
[[files]]
path = "/usr/lib/init.d/30_console"
data = """
getty --contain 2
getty --contain debug: -J
"""
[[files]]
path = "/etc/contain.toml"
data = """
pass_schemes = ["rand", "null", "tcp", "udp", "thisproc", "pty", "orbital", "display.vesa"]
sandbox_schemes = ["file"]
files = ["file:/dev/null"]
rofiles = ["file:/etc/passwd", "file:/etc/hostname", "file:/etc/localtime"]
dirs = ["file:/tmp"]
rodirs = ["file:/bin", "file:/ui"]
"""

View File

@ -1,14 +0,0 @@
# Default desktop configuration
include = ["../desktop-minimal.toml"]
# Override the default settings here
# General settings
[general]
# Filesystem size in MiB
# filesystem_size = 1024
# Package settings
[packages]
# example = {}

View File

@ -1,14 +0,0 @@
# Default desktop configuration
include = ["../desktop.toml"]
# Override the default settings here
# General settings
[general]
# Filesystem size in MiB
# filesystem_size = 1024
# Package settings
[packages]
# example = {}

View File

@ -1,14 +0,0 @@
# Configuration for development, includes cargo and rustc
include = ["../dev.toml"]
# Override the default settings here
# General settings
[general]
# Filesystem size in MiB
# filesystem_size = 1024
# Package settings
[packages]
# example = {}

View File

@ -1,115 +0,0 @@
# Jeremy's configuration
include = ["../desktop.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 8192
# Package settings
[packages]
# apps
boxedwine = {}
cosmic-edit = {}
cosmic-files = {}
cosmic-term = {}
cosmic-text = {}
periodictable = {}
pixelcannon = {}
schismtracker = {}
sodium = {}
# cli
acid = {}
cleye = {}
ffmpeg6 = {}
gnu-grep = {}
lua54 = {}
nano = {}
nushell = {}
perg = {}
relibc-tests = {}
ripgrep = {}
sed = {}
shellharden = {}
xz = {}
# demos
cairodemo = {}
#cmatrix = {} # addwstr
cpal = {}
gears = {}
glium = {} # does not show anything
glutin = {}
hematite = {}
iced = {}
libcosmic = {}
orbclient = {}
osdemo = {} # does not show anything
pathfinder = {}
procedural-wallpapers-rs = {}
rodioplay = {}
rust-cairo = {}
rust-cairo-demo = {}
sdl2-gears = {}
vttest = {}
webrender = {}
winit = {}
# dev
autoconf = {}
automake = {}
#cargo = {} # openssl issues
#gcc13 = {} # libiberty errors
gnu-binutils = {}
gnu-make = {}
nasm = {}
patch = {}
pkg-config = {}
#rust = {} # takes too long to compile
rustpython = {}
# games
devilutionx = {}
dosbox = {}
eduke32 = {}
flycast = {}
freedoom = {}
gigalomania = {}
mednafen = {}
mgba = {}
neverball = {}
openjazz = {}
openjk = {}
openttd = {}
openttd-opengfx = {}
openttd-openmsx = {}
openttd-opensfx = {}
prboom = {}
redox-games = {}
#retroarch = {} # need to package cores
rs-nes = {} # need game for testing
rust64 = {} # need roms
rustual-boy = {} # need game for testing
scummvm = {} # need game for testing
sm64ex = {}
sopwith = {}
spacecadetpinball = {}
syobonaction = {}
#vice = {} # broken on new toolchain
vvvvvv = {}
# stuff
cosmic-icons = {}
freepats = {}
generaluser-gs = {}
intel-one-mono = {}
jeremy = {}
keyboard-sfx = {}
libc-bench = {}
noto-color-emoji = {}
pop-icon-theme = {}
shared-mime-info = {}
timidity = {}
ttf-hack = {}

View File

@ -1,3 +0,0 @@
# Configuration for using resist
include = ["../resist.toml"]

View File

@ -1,14 +0,0 @@
# Minimal configuration
include = ["../server-minimal.toml"]
# Override the default settings here
# General settings
[general]
# Filesystem size in MiB
# filesystem_size = 1024
# Package settings
[packages]
# example = {}

View File

@ -1,14 +0,0 @@
# Default server configuration
include = ["../server.toml"]
# Override the default settings here
# General settings
[general]
# Filesystem size in MiB
# filesystem_size = 1024
# Package settings
[packages]
# example = {}

@ -1 +0,0 @@
Subproject commit d0378b5c485ef7943e744ebeda4ecc453c7cd7b7

6
crates/dma/Cargo.toml Normal file
View File

@ -0,0 +1,6 @@
[package]
name = "dma"
version = "0.1.0"
[dependencies]
redox_syscall = { path = "../../syscall/" }

78
crates/dma/src/lib.rs Normal file
View File

@ -0,0 +1,78 @@
extern crate syscall;
use std::{mem, ptr};
use std::ops::{Deref, DerefMut};
use syscall::Result;
struct PhysBox {
address: usize,
size: usize
}
impl PhysBox {
fn new(size: usize) -> Result<PhysBox> {
let address = unsafe { syscall::physalloc(size)? };
Ok(PhysBox {
address: address,
size: size
})
}
}
impl Drop for PhysBox {
fn drop(&mut self) {
let _ = unsafe { syscall::physfree(self.address, self.size) };
}
}
pub struct Dma<T> {
phys: PhysBox,
virt: *mut T
}
impl<T> Dma<T> {
pub fn new(value: T) -> Result<Dma<T>> {
let phys = PhysBox::new(mem::size_of::<T>())?;
let virt = unsafe { syscall::physmap(phys.address, phys.size, syscall::MAP_WRITE)? } as *mut T;
unsafe { ptr::write(virt, value); }
Ok(Dma {
phys: phys,
virt: virt
})
}
pub fn zeroed() -> Result<Dma<T>> {
let phys = PhysBox::new(mem::size_of::<T>())?;
let virt = unsafe { syscall::physmap(phys.address, phys.size, syscall::MAP_WRITE)? } as *mut T;
unsafe { ptr::write_bytes(virt as *mut u8, 0, phys.size); }
Ok(Dma {
phys: phys,
virt: virt
})
}
pub fn physical(&self) -> usize {
self.phys.address
}
}
impl<T> Deref for Dma<T> {
type Target = T;
fn deref(&self) -> &T {
unsafe { &*self.virt }
}
}
impl<T> DerefMut for Dma<T> {
fn deref_mut(&mut self) -> &mut T {
unsafe { &mut *self.virt }
}
}
impl<T> Drop for Dma<T> {
fn drop(&mut self) {
unsafe { drop(ptr::read(self.virt)); }
let _ = unsafe { syscall::physunmap(self.virt as usize) };
}
}

1
crates/docgen Submodule

@ -0,0 +1 @@
Subproject commit d2e0e0d24006628609fb5d77b60f0a83299f4937

6
crates/event/Cargo.toml Normal file
View File

@ -0,0 +1,6 @@
[package]
name = "event"
version = "0.1.0"
[dependencies]
redox_syscall = { path = "../../syscall/" }

83
crates/event/src/lib.rs Normal file
View File

@ -0,0 +1,83 @@
extern crate syscall;
use std::collections::BTreeMap;
use std::fs::File;
use std::io::{Read, Error, Result};
use std::os::unix::io::RawFd;
pub struct EventQueue<R> {
/// The file to read events from
file: File,
/// A map of registered file descriptors to their handler callbacks
callbacks: BTreeMap<RawFd, Box<FnMut(usize) -> Result<Option<R>>>>
}
impl<R> EventQueue<R> {
/// Create a new event queue
pub fn new() -> Result<EventQueue<R>> {
Ok(EventQueue {
file: File::open("event:")?,
callbacks: BTreeMap::new()
})
}
/// Add a file to the event queue, calling a callback when an event occurs
///
/// The callback is given a mutable reference to the file and the event data
/// (typically the length of data available for read)
///
/// The callback returns Ok(None) if it wishes to continue the event loop,
/// or Ok(Some(R)) to break the event loop and return the value.
/// Err can be used to allow the callback to return an I/O error, and break the
/// event loop
pub fn add<F: FnMut(usize) -> Result<Option<R>> + 'static>(&mut self, fd: RawFd, callback: F) -> Result<()> {
syscall::fevent(fd, syscall::EVENT_READ).map_err(|x| Error::from_raw_os_error(x.errno))?;
self.callbacks.insert(fd, Box::new(callback));
Ok(())
}
/// Remove a file from the event queue, returning its callback if found
pub fn remove(&mut self, fd: RawFd) -> Result<Option<Box<FnMut(usize) -> Result<Option<R>>>>> {
if let Some(callback) = self.callbacks.remove(&fd) {
syscall::fevent(fd, 0).map_err(|x| Error::from_raw_os_error(x.errno))?;
Ok(Some(callback))
} else {
Ok(None)
}
}
/// Send an event to a descriptor callback
pub fn trigger(&mut self, fd: RawFd, count: usize) -> Result<Option<R>> {
if let Some(callback) = self.callbacks.get_mut(&fd) {
callback(count)
} else {
Ok(None)
}
}
/// Send an event to all descriptor callbacks, useful for cleaning out buffers after init
pub fn trigger_all(&mut self, count: usize) -> Result<Vec<R>> {
let mut rets = Vec::new();
for (_fd, callback) in self.callbacks.iter_mut() {
if let Some(ret) = callback(count)? {
rets.push(ret);
}
}
Ok(rets)
}
/// Process the event queue until a callback returns Some(R)
pub fn run(&mut self) -> Result<R> {
loop {
let mut event = syscall::Event::default();
if self.file.read(&mut event)? > 0 {
if let Some(ret) = self.trigger(event.id, event.data)? {
return Ok(ret);
}
}
}
}
}

View File

@ -0,0 +1,8 @@
[package]
authors = ["Philipp Oppermann <dev@phil-opp.com>"]
name = "hole_list_allocator"
version = "0.1.0"
[dependencies]
linked_list_allocator = { git = "https://github.com/phil-opp/linked-list-allocator.git" }
spin = "*"

View File

@ -0,0 +1,62 @@
#![feature(allocator)]
#![feature(const_fn)]
#![allocator]
#![no_std]
use spin::Mutex;
use linked_list_allocator::Heap;
extern crate spin;
extern crate linked_list_allocator;
static HEAP: Mutex<Option<Heap>> = Mutex::new(None);
pub unsafe fn init(offset: usize, size: usize) {
*HEAP.lock() = Some(Heap::new(offset, size));
}
#[no_mangle]
pub extern fn __rust_allocate(size: usize, align: usize) -> *mut u8 {
if let Some(ref mut heap) = *HEAP.lock() {
heap.allocate_first_fit(size, align).expect("out of memory")
} else {
panic!("__rust_allocate: heap not initialized");
}
}
#[no_mangle]
pub extern fn __rust_deallocate(ptr: *mut u8, size: usize, align: usize) {
if let Some(ref mut heap) = *HEAP.lock() {
unsafe { heap.deallocate(ptr, size, align) };
} else {
panic!("__rust_deallocate: heap not initialized");
}
}
#[no_mangle]
pub extern fn __rust_usable_size(size: usize, _align: usize) -> usize {
size
}
#[no_mangle]
pub extern fn __rust_reallocate_inplace(_ptr: *mut u8, size: usize,
_new_size: usize, _align: usize) -> usize
{
size
}
#[no_mangle]
pub extern fn __rust_reallocate(ptr: *mut u8, size: usize, new_size: usize,
align: usize) -> *mut u8 {
use core::{ptr, cmp};
// from: https://github.com/rust-lang/rust/blob/
// c66d2380a810c9a2b3dbb4f93a830b101ee49cc2/
// src/liballoc_system/lib.rs#L98-L101
let new_ptr = __rust_allocate(new_size, align);
unsafe { ptr::copy(ptr, new_ptr, cmp::min(size, new_size)) };
__rust_deallocate(ptr, size, align);
new_ptr
}

3
crates/io/Cargo.toml Normal file
View File

@ -0,0 +1,3 @@
[package]
name = "io"
version = "0.1.0"

67
crates/io/src/io.rs Normal file
View File

@ -0,0 +1,67 @@
use core::cmp::PartialEq;
use core::ops::{BitAnd, BitOr, Not};
pub trait Io {
type Value: Copy + PartialEq + BitAnd<Output = Self::Value> + BitOr<Output = Self::Value> + Not<Output = Self::Value>;
fn read(&self) -> Self::Value;
fn write(&mut self, value: Self::Value);
#[inline(always)]
fn readf(&self, flags: Self::Value) -> bool {
(self.read() & flags) as Self::Value == flags
}
#[inline(always)]
fn writef(&mut self, flags: Self::Value, value: bool) {
let tmp: Self::Value = match value {
true => self.read() | flags,
false => self.read() & !flags,
};
self.write(tmp);
}
}
pub struct ReadOnly<I: Io> {
inner: I
}
impl<I: Io> ReadOnly<I> {
pub const fn new(inner: I) -> ReadOnly<I> {
ReadOnly {
inner: inner
}
}
#[inline(always)]
pub fn read(&self) -> I::Value {
self.inner.read()
}
#[inline(always)]
pub fn readf(&self, flags: I::Value) -> bool {
self.inner.readf(flags)
}
}
pub struct WriteOnly<I: Io> {
inner: I
}
impl<I: Io> WriteOnly<I> {
pub const fn new(inner: I) -> WriteOnly<I> {
WriteOnly {
inner: inner
}
}
#[inline(always)]
pub fn write(&mut self, value: I::Value) {
self.inner.write(value)
}
#[inline(always)]
pub fn writef(&mut self, flags: I::Value, value: bool) {
self.inner.writef(flags, value)
}
}

14
crates/io/src/lib.rs Normal file
View File

@ -0,0 +1,14 @@
//! I/O functions
#![feature(asm)]
#![feature(const_fn)]
#![feature(core_intrinsics)]
#![no_std]
pub use self::io::*;
pub use self::mmio::*;
pub use self::pio::*;
mod io;
mod mmio;
mod pio;

31
crates/io/src/mmio.rs Normal file
View File

@ -0,0 +1,31 @@
use core::intrinsics::{volatile_load, volatile_store};
use core::mem::uninitialized;
use core::ops::{BitAnd, BitOr, Not};
use super::io::Io;
#[repr(packed)]
pub struct Mmio<T> {
value: T,
}
impl<T> Mmio<T> {
/// Create a new Mmio without initializing
pub fn new() -> Self {
Mmio {
value: unsafe { uninitialized() }
}
}
}
impl<T> Io for Mmio<T> where T: Copy + PartialEq + BitAnd<Output = T> + BitOr<Output = T> + Not<Output = T> {
type Value = T;
fn read(&self) -> T {
unsafe { volatile_load(&self.value) }
}
fn write(&mut self, value: T) {
unsafe { volatile_store(&mut self.value, value) };
}
}

89
crates/io/src/pio.rs Normal file
View File

@ -0,0 +1,89 @@
use core::marker::PhantomData;
use super::io::Io;
/// Generic PIO
#[derive(Copy, Clone)]
pub struct Pio<T> {
port: u16,
value: PhantomData<T>,
}
impl<T> Pio<T> {
/// Create a PIO from a given port
pub const fn new(port: u16) -> Self {
Pio::<T> {
port: port,
value: PhantomData,
}
}
}
/// Read/Write for byte PIO
impl Io for Pio<u8> {
type Value = u8;
/// Read
#[inline(always)]
fn read(&self) -> u8 {
let value: u8;
unsafe {
asm!("in $0, $1" : "={al}"(value) : "{dx}"(self.port) : "memory" : "intel", "volatile");
}
value
}
/// Write
#[inline(always)]
fn write(&mut self, value: u8) {
unsafe {
asm!("out $1, $0" : : "{al}"(value), "{dx}"(self.port) : "memory" : "intel", "volatile");
}
}
}
/// Read/Write for word PIO
impl Io for Pio<u16> {
type Value = u16;
/// Read
#[inline(always)]
fn read(&self) -> u16 {
let value: u16;
unsafe {
asm!("in $0, $1" : "={ax}"(value) : "{dx}"(self.port) : "memory" : "intel", "volatile");
}
value
}
/// Write
#[inline(always)]
fn write(&mut self, value: u16) {
unsafe {
asm!("out $1, $0" : : "{ax}"(value), "{dx}"(self.port) : "memory" : "intel", "volatile");
}
}
}
/// Read/Write for doubleword PIO
impl Io for Pio<u32> {
type Value = u32;
/// Read
#[inline(always)]
fn read(&self) -> u32 {
let value: u32;
unsafe {
asm!("in $0, $1" : "={eax}"(value) : "{dx}"(self.port) : "memory" : "intel", "volatile");
}
value
}
/// Write
#[inline(always)]
fn write(&mut self, value: u32) {
unsafe {
asm!("out $1, $0" : : "{eax}"(value), "{dx}"(self.port) : "memory" : "intel", "volatile");
}
}
}

View File

@ -1,3 +0,0 @@
# Hijack this file to set this PS1, visually indicating to the user that we are running the docker container
PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[1;35m\]<$IMAGE_NAME>\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ "

View File

@ -1,43 +0,0 @@
FROM rustlang/rust:nightly
ENV IMAGE_NAME=redox-os-docker
RUN set -ex; \
apt-get update; \
apt-get install -q -y --no-install-recommends \
apt-transport-https \
bison \
flex \
fuse \
gosu \
libfuse-dev \
nasm \
qemu-utils \
sudo \
texinfo \
autopoint \
git \
cmake \
gperf \
libhtml-parser-perl \
; \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AA12E97F0881517F; \
echo "deb https://static.redox-os.org/toolchain/apt/ /" >> \
/etc/apt/sources.list.d/redox.list; \
apt-get update -o Dir::Etc::sourcelist="redox.list"; \
apt-get install -q -y --no-install-recommends \
x86-64-unknown-redox-newlib \
x86-64-unknown-redox-binutils \
x86-64-unknown-redox-gcc \
; \
cargo install cargo-config; \
cargo install just@1.16.0; \
apt-get autoremove -q -y; \
apt-get clean -q -y; \
rm -rf /var/lib/apt/lists/*
COPY entrypoint.sh /usr/local/bin/
COPY .bash_aliases /etc/skel/
ENTRYPOINT ["bash", "/usr/local/bin/entrypoint.sh"]
CMD ["/bin/bash"]

View File

@ -1,85 +0,0 @@
## Building Redox using a Docker image with the pre-built toolchain
*All you need is `git`, `make`, `qemu`, `fuse` and `docker`. The method requires
a non-privileged user able to run the `docker` command, which is usually achieved
by adding the user to the `docker` group.*
It's a three-steps process with variations depending on the platform.
On the first execution of one of the following docker commands, the
official container image will be pulled from dockerhub and stored
locally.
The image includes the required dependencies and the pre-built
toolchain. As long as you rely on this particular dependencies and
toolchain versions, you don't need to update the container.
### <a name='get_the_sources'></a>Get the sources
```
git clone https://gitlab.redox-os.org/redox-os/redox.git ; cd redox
```
### Update the source tree
Note: if you use the container on a different host or
with a different user, [get the sources first](#get_the_sources).
```shell
git pull --rebase --recurse-submodules && git submodule sync \
&& git submodule update --recursive --init
```
### Run the container to build Redox
```shell
docker run --privileged --cap-add MKNOD --cap-add SYS_ADMIN --device /dev/fuse \
-e LOCAL_UID="$(id -u)" -e LOCAL_GID="$(id -g)" \
-v redox-"$(id -u)-$(id -g)"-cargo:/usr/local/cargo \
-v redox-"$(id -u)-$(id -g)"-rustup:/usr/local/rustup \
-v "$(pwd):$(pwd)" -w "$(pwd)" --rm redoxos/redox make fetch all
```
#### Linux with security modules
Add the following options depending on the security modules activated on your system:
```shell
--security-opt label=disable // disable SELinux
--security-opt seccomp=unconfined // disable seccomp
--security-opt apparmor=unconfined // disable AppArmor
```
Ex.: for a SELinux only system such as Fedora or CentOS
```shell
docker run --privileged --cap-add MKNOD --cap-add SYS_ADMIN --device /dev/fuse \
-e LOCAL_UID="$(id -u)" -e LOCAL_GID="$(id -g)" \
--security-opt label=disable \
-v redox-"$(id -u)-$(id -g)"-cargo:/usr/local/cargo \
-v redox-"$(id -u)-$(id -g)"-rustup:/usr/local/rustup \
-v "$(pwd):$(pwd)" -w "$(pwd)" --rm redoxos/redox make fetch all
```
### Run the container interactively
```shell
docker run --privileged --cap-add MKNOD --cap-add SYS_ADMIN --device /dev/fuse \
-e LOCAL_UID="$(id -u)" -e LOCAL_GID="$(id -g)" \
-v redox-"$(id -u)-$(id -g)"-cargo:/usr/local/cargo \
-v redox-"$(id -u)-$(id -g)"-rustup:/usr/local/rustup \
-v "$(pwd):$(pwd)" -w "$(pwd)" --rm -it redoxos/redox
```
#### Demo
![Image of Usage](demo.gif)
### Clear the named volumes containing the toolchain caches
```shell
docker volume rm redox-"$(id -u)-$(id -g)"-cargo \
redox-"$(id -u)-$(id -g)"-rustup
```
### Build the container manually
If you cannot access dockerhub for whatever reason, you can also build
the container image manually.
```shell
docker build -t redoxos/redox docker/
```
### Troubleshooting / updating
Sometimes, builds may fail because the nightly toolchain of rust inside the container got out of sync with dependencies of redox, or there are issues with cargo. In this case, it might help to update your current container image and delete the rust and cargo caches. This way, you can start over from a clean state and rule out your local setup as the origin of errors.
```shell
docker pull redoxos/redox
docker volume rm redox-"$(id -u)-$(id -g)"-cargo \
redox-"$(id -u)-$(id -g)"-rustup
```

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 MiB

View File

@ -1,5 +0,0 @@
docker run --privileged --cap-add MKNOD --cap-add SYS_ADMIN --device /dev/fuse \
-e LOCAL_UID="$(id -u)" -e LOCAL_GID="$(id -g)" \
-v redox-"$(id -u)-$(id -g)"-cargo:/usr/local/cargo \
-v redox-"$(id -u)-$(id -g)"-rustup:/usr/local/rustup \
-v "$(pwd):$(pwd)" -w "$(pwd)" --rm -it redoxos/redox "$@"

View File

@ -1,34 +0,0 @@
#!/usr/bin/env bash
# Add local user
# Either use LOCAL_UID and LOCAL_GID if passed in at runtime via
# -e LOCAL_UID="$(id -u)" -e LOCAL_GID="$(id -g)" or fallback
USER_NAME=redox
RUN_UID=${LOCAL_UID:-9001}
RUN_GID=${LOCAL_GID:-9001}
groupadd --non-unique --gid $RUN_GID $USER_NAME
useradd --non-unique --create-home --uid $RUN_UID --gid $USER_NAME --groups sudo $USER_NAME
echo "$USER_NAME ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/user-no-sudo-password
export HOME=/home/$USER_NAME
# Check current UID and GID of files in the named volume caches for
# cargo and rustup. Test only one of the top level folders to speed
# things up.
TESTFILE=$RUSTUP_HOME/settings.toml
CACHED_UID=$(stat -c "%u" $TESTFILE)
CACHED_GID=$(stat -c "%g" $TESTFILE)
if [ $CACHED_UID != $RUN_UID ] || [ $RUN_GID != $CACHED_GID ]; then
echo -e "\033[01;38;5;155mChanging user id:group to ${RUN_UID}:${RUN_GID}. Please wait...\033[0m"
chown $RUN_UID:$RUN_GID -R $CARGO_HOME $RUSTUP_HOME
fi
# fixes issue in docker for mac where fuse permissions are restricted to root:root
# https://github.com/theferrit32/data-commons-workspace/issues/5
# https://github.com/heliumdatacommons/data-commons-workspace/commit/f96624c8a55f5ded5ac60f4f54182a59be92e66d
if [ -f /dev/fuse ]; then chmod 666 /dev/fuse; fi
exec gosu $USER_NAME "$@"

1
drivers Submodule

@ -0,0 +1 @@
Subproject commit 9eeade88606095a03ee3c285972b45d1c499a971

1
filesystem/etc/group Normal file
View File

@ -0,0 +1 @@
sudo;1;user

View File

@ -0,0 +1,3 @@
/sbin/randd
/sbin/ptyd
/sbin/pcid /etc/pcid.toml

View File

@ -0,0 +1,5 @@
/sbin/ethernetd
/sbin/ipd
/sbin/tcpd
/sbin/udpd
dhcpd -b

View File

@ -0,0 +1,2 @@
getty display:2
getty display:3

View File

@ -0,0 +1 @@
/sbin/orbital display:4/activate /ui/bin/orblogin /ui/bin/launcher

View File

@ -0,0 +1 @@
getty debug: -J

6
filesystem/etc/issue Normal file
View File

@ -0,0 +1,6 @@
########## Redox OS ##########
# Login with the following: #
# `user` #
# `root`:`password` #
##############################

2
filesystem/etc/motd Normal file
View File

@ -0,0 +1,2 @@
Welcome to Redox OS!

1
filesystem/etc/net/dns Normal file
View File

@ -0,0 +1 @@
208.67.222.222

1
filesystem/etc/net/ip Normal file
View File

@ -0,0 +1 @@
10.0.2.15

View File

@ -0,0 +1 @@
10.0.2.2

View File

@ -0,0 +1 @@
255.255.255.0

1
filesystem/etc/net/mac Normal file
View File

@ -0,0 +1 @@
00.00.00.00.00.00

View File

@ -0,0 +1,2 @@
background=/ui/background.png
cursor=/ui/cursor.png

2
filesystem/etc/passwd Normal file
View File

@ -0,0 +1,2 @@
root;$argon2i$m=4096,t=10,p=1$Tnc4UVV0N00$ML9LIOujd3nmAfkAwEcSTMPqakWUF0OUiLWrIy0nGLk;0;0;root;/root;/bin/ion
user;;1000;1000;user;/home/user;/bin/ion

13
filesystem/etc/pcid.toml Normal file
View File

@ -0,0 +1,13 @@
[[drivers]]
name = "E1000 NIC"
class = 2
vendor = 32902
device = 4110
command = ["/sbin/e1000d", "$NAME", "$BAR0", "$IRQ"]
[[drivers]]
name = "RTL8168 NIC"
class = 2
vendor = 4332
device = 33128
command = ["/sbin/rtl8168d", "$NAME", "$BAR2", "$IRQ"]

View File

@ -0,0 +1 @@
../../../LICENSE

View File

@ -0,0 +1 @@
../../../README.md

1
filesystem/root/LICENSE Symbolic link
View File

@ -0,0 +1 @@
../../LICENSE

1
filesystem/root/README.md Symbolic link
View File

@ -0,0 +1 @@
../../README.md

1
filesystem/ui Submodule

@ -0,0 +1 @@
Subproject commit e8c057a343c2f55c38a134ac9db65f3c7f5c8eb2

9
initfs/etc/init.rc Normal file
View File

@ -0,0 +1,9 @@
export PATH initfs:/bin
vesad T T T G
stdio display:1
ps2d
pcid /etc/pcid.toml
redoxfs disk:0 file
cd file:
export PATH file:/bin
run.d /etc/init.d

19
initfs/etc/pcid.toml Normal file
View File

@ -0,0 +1,19 @@
[[drivers]]
name = "AHCI storage"
class = 1
subclass = 6
command = ["ahcid", "$NAME", "$BAR5", "$IRQ"]
[[drivers]]
name = "Bochs Graphics Array"
class = 3
vendor = 4660
device = 4369
command = ["bgad", "$NAME", "$BAR0"]
[[drivers]]
name = "Bochs Graphics Array"
class = 3
vendor = 33006
device = 48879
command = ["bgad", "$NAME", "$BAR0"]

@ -1 +0,0 @@
Subproject commit 1c30f4a3c1f55974aed694b478ff77c0552a1576

1
isolinux Submodule

@ -0,0 +1 @@
Subproject commit 3cf79d335400af8fc3a87a13f0ae12777a766b3b

Some files were not shown because too many files have changed in this diff Show More