about summary refs log tree commit diff
path: root/library/std/src/os/mod.rs
AgeCommit message (Collapse)AuthorLines
2021-09-28Add SOLID targetsTomoaki Kawada-0/+2
SOLID[1] is an embedded development platform provided by Kyoto Microcomputer Co., Ltd. This commit introduces a basic Tier 3 support for SOLID. # New Targets The following targets are added: - `aarch64-kmc-solid_asp3` - `armv7a-kmc-solid_asp3-eabi` - `armv7a-kmc-solid_asp3-eabihf` SOLID's target software system can be divided into two parts: an RTOS kernel, which is responsible for threading and synchronization, and Core Services, which provides filesystems, networking, and other things. The RTOS kernel is a μITRON4.0[2][3]-derived kernel based on the open-source TOPPERS RTOS kernels[4]. For uniprocessor systems (more precisely, systems where only one processor core is allocated for SOLID), this will be the TOPPERS/ASP3 kernel. As μITRON is traditionally only specified at the source-code level, the ABI is unique to each implementation, which is why `asp3` is included in the target names. More targets could be added later, as we support other base kernels (there are at least three at the point of writing) and are interested in supporting other processor architectures in the future. # C Compiler Although SOLID provides its own supported C/C++ build toolchain, GNU Arm Embedded Toolchain seems to work for the purpose of building Rust. # Unresolved Questions A μITRON4 kernel can support `Thread::unpark` natively, but it's not used by this commit's implementation because the underlying kernel feature is also used to implement `Condvar`, and it's unclear whether `std` should guarantee that parking tokens are not clobbered by other synchronization primitives. # Unsupported or Unimplemented Features Most features are implemented. The following features are not implemented due to the lack of native support: - `fs::File::{file_attr, truncate, duplicate, set_permissions}` - `fs::{symlink, link, canonicalize}` - Process creation - Command-line arguments Backtrace generation is not really a good fit for embedded targets, so it's intentionally left unimplemented. Unwinding is functional, however. ## Dynamic Linking Dynamic linking is not supported. The target platform supports dynamic linking, but enabling this in Rust causes several problems. - The linker invocation used to build the shared object of `std` is too long for the platform-provided linker to handle. - A linker script with specific requirements is required for the compiled shared object to be actually loadable. As such, we decided to disable dynamic linking for now. Regardless, the users can try to create shared objects by manually invoking the linker. ## Executable Building an executable is not supported as the notion of "executable files" isn't well-defined for these targets. [1] https://solid.kmckk.com/SOLID/ [2] http://ertl.jp/ITRON/SPEC/mitron4-e.html [3] https://en.wikipedia.org/wiki/ITRON_project [4] https://toppers.jp/
2021-09-13Move fortanix module position in std::os reexports for alpha sortGuillaume Gomez-20/+34
2021-09-13Remove usage of cfg_if in std/src/os/mod.rsGuillaume Gomez-31/+71
2021-09-13Simplify std::os module reexports to fix rustdoc linking issuesGuillaume Gomez-109/+74
2021-08-19Factor out a common `RawFd`/`AsRawFd`/etc for Unix and WASI.Dan Gohman-1/+1
2021-08-19Factor out Unix and WASI fd code into a common module.Dan Gohman-0/+3
2021-08-10STD support for the ESP-IDF frameworkivmarkov-0/+2
2021-05-03Allow documenting on `hermit`Christiaan Dirkx-2/+0
2021-05-03Rework `os` to avoid using `cfg_if!` with public itemsChristiaan Dirkx-87/+115
2021-05-03Move `std::sys::wasi::ext` to `std::os::wasi`Christiaan Dirkx-2/+1
2021-05-03Move `std::sys::unix::ext` to `std::os::unix`Christiaan Dirkx-4/+2
2021-05-03Move `std::sys::windows::ext` to `std::os::windows`Christiaan Dirkx-4/+2
2021-05-03Move `std::sys::hermit::ext` to `std::os::hermit`Christiaan Dirkx-1/+6
2021-05-03Cleanup `std::os`Christiaan Dirkx-74/+89
2021-03-03Rollup merge of #82712 - CDirkx:cfg-target_os, r=dtolnayYuki Okushi-1/+1
Remove unnecessary conditional `cfg(target_os)` for `redox` and `vxworks` `redox` and `vxworks` are now part of target_family `unix`, thus `cfg(unix)` already implies `cfg(target_os="redox")` and `cfg(target_os="vxworks")` https://github.com/rust-lang/rust/blob/35dbef235048f9a2939dc20effe083ca483c37ff/compiler/rustc_target/src/spec/redox_base.rs#L26 https://github.com/rust-lang/rust/blob/35dbef235048f9a2939dc20effe083ca483c37ff/compiler/rustc_target/src/spec/vxworks_base.rs#L27
2021-03-03Remove unnecessary conditional `cfg(target_os)` for `redox` and `vxworks`Christiaan Dirkx-1/+1
`redox` and `vxworks` are part of target_family `unix`, thus `cfg(unix)` already implies `cfg(target_os="redox")` and `(target_os="vxworks")`
2021-03-01Add missing stability attributes in libstdGuillaume Gomez-0/+1
2021-02-24Mention "wasi" in the comment about "main modules".Dan Gohman-1/+1
2021-02-24Make the main `wasi` module `cfg(not(doc))`.Dan Gohman-2/+4
2021-02-23Enable API documentation for `std::os::wasi`.Dan Gohman-0/+3
This adds API documentation support for `std::os::wasi` modeled after how `std::os::unix` works, so that WASI can be documented [here] along with the other platforms. [here]: https://doc.rust-lang.org/stable/std/os/index.html Two changes of particular interest: - This changes the `AsRawFd` for `io::Stdin` for WASI to return `libc::STDIN_FILENO` instead of `sys::stdio::Stdin.as_raw_fd()` (and similar for `Stdout` and `Stderr`), which matches how the `unix` version works. `STDIN_FILENO` etc. may not always be explicitly reserved at the WASI level, but as long as we have Rust's `std` and `libc`, I think it's reasonable to guarantee that we'll always use `libc::STDIN_FILENO` for stdin. - This duplicates the `osstr2str` utility function, rather than trying to share it across all the configurations that need it.
2021-02-22Avoid `cfg_if` in `std::os`Jonas Schievink-27/+27
2020-07-27mv std libs to library/mark-0/+74