Giter Club home page Giter Club logo

mirage's Introduction

Mirage

Rust Discord License FOSSA Status Built with cargo-make

Mirage is a reimplementation of the Nintendo Switch firmware, based on reverse-engineering results. It (obviously) targets the Switch itself.

Components

  • bootstrap: The initial first-stage bootloader

  • libtegra: Low-level hardware access library for the Switch

  • linker-scripts: Various linker scripts used for the build

  • mmio: Memory-Mapped I/O abstractions for Rust

  • targets: Rust target specifications for the Switch

Support

If something isn't working as expected or you have questions, feel free to open an issue.

If you're looking for a more direct way to contact the developers, we have a Discord server right here.

Compiling

If you want to compile individual components of Mirage, please take a look at the README files in the respective directories for more specific instructions.

For a full build of Mirage, cargo-make is required. It takes care of all the build dependencies.

Install it with:

cargo install --force cargo-make

Then you can build Mirage:

cargo make --profile production

Debug builds (default profile) aren't recommended here, please consider building the individual components respectively.

Roadmap

Mirage is very young and under heavy development. You can view development items and their progress state in the Mirage project boards.

Contributing

Coming soon.

FAQ

There are some frequently asked questions that come up every now and then. This section is dedicated to answering those.

Where does it differ from CFW projects, such as Atmosphère or ReiNX?

The aim of these projects is to patch and customize the behavior of Horizon OS, to make the platform more open and allow for unsigned code execution. Ideally speaking, these projects are similar to a Jailbreak on your iDevice.

Mirage, on the other hand, aims for a fully-featured reimplementation of the entire Operating System, without depending on Nintendo's firmware, however providing the same functionality.

Why are you doing this?

Fun, research, and as a tribute to the wonderful and modern architecture of Horizon.

Some milestones for the far future:

  • Very accurate reflection of the actual Horizon OS.

  • Getting commercial games and homebrew applications to boot

    • Providing a Rust toolchain for application development
  • Providing build options for purposefully including Horizon's flaws

    • Eases up research and exploit development, due to the open platform.
  • Getting Mirage to run on other architectures, such as x86

    • Why not?

License

Mirage is distributed under the terms of either the Apache License (Version 2.0) or the MIT license, at the user's choice.

See LICENSE-APACHE and LICENSE-MIT for details.

FOSSA Status

mirage's People

Contributors

stupremee avatar vbe0201 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mirage's Issues

Implement libswitch::power module

This is the tracking issue for the libswitch::power module containing drivers for the Switch's TI BQ24193, the Maxim 17050, and the Maxim 77620.

Required to complete #1.

Implementation

Max77620 driver has the highest priority. The others are nice to have, however low priority at the moment.

BQ24193

This is used for battery charging and should provide at least a function to retrieve the value (i16) of one of the following device properties, represented in an enum:

/// Representation of the BQ24193 device properties.
pub enum Properties {
    InputVoltageLimit,
    InputCurrentLimit,
    SystemMinimumVoltage,
    FastChargeCurrentLimit,
    ChargeVoltageLimit,
    RechargeThreshold,
    ThermalRegulation,
    ChargeStatus,
    TempStatus,
    DevId,
    ProductNumber,
}

These are to be retrieved over I2C. See the Technical Reference for details.

Max17050

Used for fuel gauging. Similar to the BQ24193, this has a similar system of retrieving values for certain device properties. The enum would however contain different members (notably a whole bunch more) with different values. See Technical Reference for details.

Max77620

Used for PMIC stuff. Hence, the driver should contain an abstraction of the device that holds its ID and the corresponding methods for configuring and managing the regulators which is done via I2C.

Resources

Implement SE driver

For cryptographic operations, an implementation of a driver for the Tegra Security Engine is required.

Should be implemented as the libswitch::se module.

Implementation

The Security Engine has a whole bunch of registers (see Switchbrew) mapped to address 0x70012000. The driver should feature a general API for checking error registers, triggering interrupts, setting keyslots and keyslot flags, as well as a Secure AES API and an RSA API for crypto operations, a SHA256 Hash API, and an RNG API for random data generation.

Resources

Storage/Filesystem code?

Since RCM payloads are limited in size, it wouldn't make much sense to try to fit everything, including future crates and changes, into it.

Thus, we need the functionality to

  • mount and unmount SD cards

  • read/write files

  • process those in Rust code

and the same aspects for the Switch's internal storage, the eMMC.

This is probably out of scope for libswitch as it isn't totally Switch/Tegra210-related so a separate crate with no_std capability would be adequate.

Thus, we don't have std::fs and need a partial replacement for it. Since Switch only supports Fat32 and exFat by extension, https://github.com/sunriseos/libfat can be used for that. It doesn't support exFat, but this isn't high priority for now.

Once this is implemented, it can be used for chainloading from the SD card.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.