Rust: Difference between revisions

From OSDev.wiki
Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content added Content deleted
m (Substituted link to Rust wiki backup for Internet Archive link)
m (Add my bare bones tutorial)
Line 32: Line 32:
* [http://jvns.ca/blog/2014/03/12/the-rust-os-story/ Writing an OS in Rust in tiny steps (Steps 1-5)]
* [http://jvns.ca/blog/2014/03/12/the-rust-os-story/ Writing an OS in Rust in tiny steps (Steps 1-5)]
* [[Rust Bare Bones]]
* [[Rust Bare Bones]]
* [http://blog.phil-opp.com/ Writing an OS in Rust (Bare Bones Tutorial)]


[[Category:Languages]]
[[Category:Languages]]

Revision as of 21:50, 25 October 2015

Rust is a new systems language under development by Mozilla, designed to offer better safety and concurrency than other, more traditional systems programming languages. The syntax is a C dialect with the familiar braces and semi-colons. It features constructs from imperative programming (such as if and while), functional programming (such as lambda's, multi-directional pattern matching and immutable variables) and object oriented languages (traits and objects).

Rust has a strong focus on memory safety and control. Object allocation happens on the stack by default, but they can explicitly be stored on the heap. Objects are automatically deallocated as soon as they are no longer needed. Rust's references prevent dangling pointers, null references, and out of bounds memory access.

Operating System Development

While Rust has its own runtime (that uses libc), Rust can easily be configured to compile programs without it. This gives developers the freedom to implement their own memory allocation and other low-level services. This makes Rust ideal for operating system development.

Projects

  • Meaty Bare-Bones
  • "Tifflin"
    • Multiboot image for x86_64
    • Actively developed, has VFS and userland
  • RustBoot
    • x86 bootsector, doesn't use libcore
    • Out-of-date, written in pre 1.0 code
  • Ryanra's RustOS
    • Uses libcore/collections/alloc
    • Actively develped

Libraries

  • green-rs: Original green threads in early rust. No longer maintainted.
  • libfringe: Lightweight threading/task library based on libgreen.
  • libx86: Library to program x86 hardware.
  • libcpu: Library to program CPUs.
  • slabmalloc: Low-level memory allocator for liballoc.
  • multiboot: Library to read multiboot layout.

See Also