Giter Club home page Giter Club logo

atmosphere's Introduction

Banner

License Chat on Discord

Atmosphère is a work-in-progress customized firmware for the Nintendo Switch.

Components

Atmosphère consists of multiple components, each of which replaces/modifies a different component of the system:

  • Fusée: First-stage Loader, responsible for loading and validating stage 2 (custom TrustZone) plus package2 (Kernel/FIRM sysmodules), and patching them as needed. This replaces all functionality normally in Package1loader/NX Bootloader.
    • Sept: Payload used to enable support for runtime key derivation on 7.0.0.
  • Exosphère: Customized TrustZone, to run a customized Secure Monitor
  • Thermosphère: EL2 EmuNAND support, i.e. backing up and using virtualized/redirected NAND images
  • Stratosphère: Custom Sysmodule(s), both Rosalina style to extend the kernel/provide new features, and of the loader reimplementation style to hook important system actions
  • Troposphère: Application-level Horizon OS patches, used to implement desirable CFW features

Licensing

This software is licensed under the terms of the GPLv2, with exemptions for specific projects noted below.

You can find a copy of the license in the LICENSE file.

Exemptions:

  • Nintendo is exempt from GPLv2 licensing and may (at its option) instead license any source code authored for the Atmosphère project under the Zero-Clause BSD license.

Credits

Atmosphère is currently being developed and maintained by SciresM, TuxSH, hexkyz, and fincs.
In no particular order, we credit the following for their invaluable contributions:

  • switchbrew for the libnx project and the extensive documentation, research and tool development pertaining to the Nintendo Switch.
  • devkitPro for the devkitA64 toolchain and libnx support.
  • ReSwitched Team for additional documentation, research and tool development pertaining to the Nintendo Switch.
  • ChaN for the FatFs module.
  • Marcus Geelnard for the bcl-1.2.0 library.
  • naehrwert and st4rk for the original hekate project and its hwinit code base.
  • CTCaer for the continued hekate project's fork and the minerva_tc project.
  • m4xw for development of the emuMMC project.
  • Riley for suggesting "Atmosphere" as a Horizon OS reimplementation+customization project name.
  • hedgeberg for research and hardware testing.
  • lioncash for code cleanup and general improvements.
  • jaames for designing and providing Atmosphère's graphical resources.
  • Everyone who submitted entries for Atmosphère's splash design contest.
  • All those who actively contribute to the Atmosphère repository.

atmosphere's People

Contributors

adubbz avatar aurorawright avatar darkmattercore avatar davidbuchanan314 avatar desowin avatar drakiaxyz avatar encounter avatar fincs avatar hexkyz avatar hylianeternal avatar igoticecream avatar jam1garner avatar kronos2308 avatar ktemkin avatar langerhans avatar leo60228 avatar leoetlino avatar liamwhite avatar lioncash avatar merrymage avatar misson20000 avatar ndeadly avatar neobrain avatar resaec avatar sciresm avatar thatnerdypikachu avatar thedax avatar traiver avatar tslater2006 avatar tuxsh 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  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  avatar  avatar  avatar  avatar

Watchers

 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  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  avatar  avatar  avatar  avatar

atmosphere's Issues

Re-implement the PM sysmodule.

Switchbrew Docs

Wanted extensions:

Modify NotifyBootFinished

[10:37 PM] SciresM: Basically....it comes down to the SD card issue
[10:37 PM] SciresM: Loader wants to be able to redirect boot2 content
[10:37 PM] SciresM: Loader can't mount the SD card until PSC/PCV/Bus are all launched
[10:37 PM] SciresM: those are launched by boot2.
[10:37 PM] SciresM: How do you resolve the chicken and egg problem?
[10:38 PM] SciresM: By replacing NotifyBootFinished with an embedded custom boot2, clearly :P

Multi Language support

I would like to constribute something but don't know what. If you want to I can translate English strings to German for multi language support.

build stratosphere failed

now build stratosphere/boot failed.
I realized some lib missing in my environment or something like that.
But I dont know what it is.
So I check the path in the command line, found devkitPro/portlibs does not exist.
I find portlibs in the website, but did not found anything.
Including "https://sourceforge.net/projects/devkitpro/files/portlibs/" and "https://github.com/devkitPro/3ds_portlibs", does not have portlibs/switch .

make -C boot make[1]: Entering directory '/home/chengstone/Downloads/Atmosphere/stratosphere/boot' boot_main.cpp aarch64-none-elf-g++ -MMD -MP -MF /home/chengstone/Downloads/Atmosphere/stratosphere/boot/build/boot_main.d -g -Wall -O2 -ffunction-sections -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE -DDISABLE_IPC -I/home/chengstone/Downloads/Atmosphere/stratosphere/boot/include -I/home/chengstone/devkitPro/portlibs/switch/include -I/home/chengstone/devkitPro/libnx/include -I/home/chengstone/Downloads/Atmosphere/stratosphere/boot/../libstratosphere/include -I/home/chengstone/Downloads/Atmosphere/stratosphere/boot/build -D__SWITCH__ -fno-rtti -fno-exceptions -std=gnu++17 -c /home/chengstone/Downloads/Atmosphere/stratosphere/boot/source/boot_main.cpp -o boot_main.o ... ipc_templating.hpp:17:5: error: 'BufferType' does not name a type; ipc_templating.hpp:198:26: error: 'struct IpcParsedCommand' has no member named 'Statics' ipc_templating.hpp:317:134: error: 'struct IpcParsedCommand' has no member named 'RawWithoutPadding' ... servicesession.hpp:119:30: error: 'IpcCommandType_LegacyControl' was not declared in this scope ... systemevent.hpp:15:26: error: 'svcCreateEvent' was not declared in this scope ... boot_main.cpp:1392:14: error: 'svcReadWriteRegister' was not declared in this scope ... boot_main.cpp:1478:18: error: 'svcReadWriteRegister' was not declared in this scope

whats wrong with this issue?
thx lot.

"large integer implicitly truncated to unsigned type" error occurred when build Atmosphere

hi, when I do build Atmosphere at Ubuntu , got following errors, I Know its a uul type problem, but I dont know how to fix that:

make -C exosphere make[1]: Entering directory '/home/chengstone/Downloads/Atmosphere/exosphere' arm-none-eabi-gcc -march=armv8-a -mtune=cortex-a57 -g -O2 -ffunction-sections -fdata-sections -fomit-frame-pointer -std=gnu11 -Werror -Wall -c -o build/sealedkeys.o src/sealedkeys.c arm-none-eabi-gcc -march=armv8-a -mtune=cortex-a57 -g -O2 -ffunction-sections -fdata-sections -fomit-frame-pointer -std=gnu11 -Werror -Wall -c -o build/coldboot_main.o src/coldboot_main.c In file included from src/coldboot_main.c:4:0: src/coldboot_main.c: In function 'coldboot_main': src/memory_map.h:132:53: error: large integer implicitly truncated to unsigned type [-Werror=overflow] #define TZRAM_GET_SEGMENT_ADDRESS(segment_id) (TUPLE_FOLD_LEFT_2(EVAL(segment_id), _MMAPTZS, PLUS) EVAL(TZRAM_SEGMENT_BASE)) ^ src/coldboot_main.c:12:24: note: in expansion of macro 'TZRAM_GET_SEGMENT_ADDRESS' uintptr_t pk2ldr = TZRAM_GET_SEGMENT_ADDRESS(TZRAM_SEGMENT_ID_PK2LDR); ^~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Makefile:71: recipe for target 'build/coldboot_main.o' failed make[1]: *** [build/coldboot_main.o] Error 1 make[1]: Leaving directory '/home/chengstone/Downloads/Atmosphere/exosphere' Makefile:8: recipe for target 'exosphere' failed make: *** [exosphere] Error 2

is there has some compile arguments? like -m64? or is this a c13, c15, c17 features?
I only know use unsigned long long xxx replace #define xxx, but the work is huge.
so you guys how to build that correctly? pls help.

Fusée: Finish nxboot

  • Improve the special case loadlist to better match what we need
  • Implement validation of loadlist specials at top of nxboot to make sure booting is possible given a config
  • Implement TSEC key and keyblob retrieval from boot partition 0
  • Finish preparation for handoff to Exosphére
  • Debug why Exosphére doesn't boot
  • Implement BPMP finalization

Underclocking

Hi.I would suggest if the cpu/gpu frecuences can be underclocked (an example i think than games as puyo puyo tennis doesnt need full frecuency speed for running and this would make the batery give extra time) as we can do on psp.
Thanks

i've got error

in fusee secondary i've got this error : Failed to mount at least one partition: I/O error

if this sd related can you respond me ?

Re-implement SMC API.

The SMCs need to be re-implemented -- this is a pretty tiny API, and is fully reversed. Should be pretty reasonable.

Debug process?

Hi there! I'm a dev with zero console hacking experience (aside from following the 3DS guide lol).

I'd like to work on Atmosphere but would like some information on how exactly you debug/run. You compile... and then what? Put it on an SD.. and? I'm probably just missing the entrypoint guide but whatever.

Thanks!

Other control options

Hi,i would love suggest If it would allow port/use diferent inputs ,as HID to VPAD on wii u.

Re-implement the PM sysmodule

Switchbrew Docs

Wanted extensions:

Modify NotifyBootFinished

[10:37 PM] SciresM: Basically....it comes down to the SD card issue
[10:37 PM] SciresM: Loader wants to be able to redirect boot2 content
[10:37 PM] SciresM: Loader can't mount the SD card until PSC/PCV/Bus are all launched
[10:37 PM] SciresM: those are launched by boot2.
[10:37 PM] SciresM: How do you resolve the chicken and egg problem?
[10:38 PM] SciresM: By replacing NotifyBootFinished with an embedded custom boot2, clearly :P

build error

when i compile the source i'm unable to compile stratoshere and fusee secondary because of error :

https://pastebin.com/qJqyX1mC

Can you help me please and not close that with no solution

Re-implement CPU suspend code.

We'll want to be able to go back to sleep, and wake up. This will involve writing context save code, implementing a warmboot firmware, and making sure it works with the wakeup code from #4.

Undefined references when building

When I attempt to build Atmosphere I run into issues with fusee-secondary stratosphere:

build/stratosphere.o: In function `stratosphere_get_ini1':
/home/steve/projects/Atmosphere/fusee/fusee-secondary/src/stratosphere.c:41: undefined reference to `boot_100_kip_size'
/home/steve/projects/Atmosphere/fusee/fusee-secondary/src/stratosphere.c:41: undefined reference to `boot_200_kip_size'
/home/steve/projects/Atmosphere/fusee/fusee-secondary/src/stratosphere.c:41: undefined reference to `pm_kip_size'
/home/steve/projects/Atmosphere/fusee/fusee-secondary/src/stratosphere.c:41: undefined reference to `loader_kip_size'
/home/steve/projects/Atmosphere/fusee/fusee-secondary/src/stratosphere.c:41: undefined reference to `sm_kip_size'
build/nxboot.o: In function `nxboot_main':
/home/steve/projects/Atmosphere/fusee/fusee-secondary/src/nxboot.c:145: undefined reference to `exosphere_bin_size'
/home/steve/projects/Atmosphere/fusee/fusee-secondary/src/nxboot.c:145: undefined reference to `exosphere_bin'

I can't find where these are supposed to be defined.

Figure out what patches will be desirable.

At this stage in the game, not sure what exactly we'll want to patch. This all needs to be figured out so that we can have a reasonable initial round of patches.

This issue in particular relates to customization of usermode applications -- see Stratosphere for custom sysmodule patches.

Possible conflicting criteria for nxboot?

Was looking through the sources for fusee-secondary and unless I'm misunderstanding (which is quite possible) it seems there are conflicting criteria for nxboot_main() to be called.

Line 79 of main.c ensures that nxboot_main() only gets called if loader_ctx->chainload_entrypoint equals 0:

    g_do_nxboot = loader_ctx->chainload_entrypoint == 0;
    if (g_do_nxboot) {
        printf("Now performing nxboot.\n");
        nxboot_main();
    }

however line 223 in loader.c causes a panic if the chainload_entrypoint equals 0.

    if (ctx->chainload_entrypoint == 0 || ctx->nb_files_to_load > 0) {
        printf("Error: loadlist must be empty when booting Horizon!\n");
        generic_panic();
    }

Please forgive if this is unwarranted, just struck me as curious and maybe worth an issue. I'm probably just misunderstanding the intent so please feel free to close if I'm way off here.

Thanks for all the work!

tsec.c overwriting passed in tsec_fw

Probably out of my depth here too, but when nxboot.c calls derive_nx_keydata it passes in a tsec_fw (line 111) which is then passed along to get_tsec_key by key_derivation.c (line 75).

Inside tsec_query() a memcpy is done which copies a static _tsec_fw over the top of the passed in values.

A quick modification to derive_nx_keydata() shows this:

    if  (get_tsec_key(work_buffer, tsec_fw, tsec_fw_size, target_firmware) != 0) {
        printf("Failed to get tsec key.\n");
        printf("tsec firmware: 0x%08lx\n", (long unsigned int)tsec_fw);
        printf("tsec size: 0x%08x\n", tsec_fw_size);
        printf("target firmware: 0x%08lx\n", target_firmware);
        int j,h;
        for (j = 0; j < 0x300; j += 16) {
            for(h = 0; h < 8; h++) {
                printf("%02x ",((uint8_t*)tsec_fw)[j+h]);
            }
            printf("  ");
            for(h = 8; h < 16; h++) {
                printf("%02x ",((uint8_t*)tsec_fw)[j+h]);
            }
            printf("\n");
        }
        return -1;
    }

With the memcpy in place in tsec.c the result is:

image

removing this memcpy (line 61 of tsec.c) causes the memory to retain its values which I believe would be the intended behavior.
image

Also, removing the memcpy causes the compiler to report that the static const _tsec_fw (at the top) is no longer used, I'm guessing this is a leftover from before the data was being read from disk?

Unable to build Atmosphère : unrecognized command line option '-mthumb'

Hey there, I'm trying to build Atmosphère on Debian GNU/Linux 8 (jessie), but I got these errors :

$ make DEVKITPRO=/opt/devkitpro/ DEVKITARM=/opt/devkitpro/devkitA64
make -C exosphere 
make[1]: Entering directory '/home/mathieu/Documents/Atmosphere/exosphere'
make[2]: Entering directory '/home/mathieu/Documents/Atmosphere/exosphere/bpmpfw'
aarch64-none-elf-gcc -march=armv4t -mtune=arm7tdmi -mthumb -mthumb-interwork -g -O2 -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-inline -std=gnu11 -Werror -Wall   -c -o build/emc.o src/emc.c
aarch64-none-elf-gcc: error: unrecognized command line option '-mthumb'
aarch64-none-elf-gcc: error: unrecognized command line option '-mthumb-interwork'
Makefile:56: recipe for target 'build/emc.o' failed
make[2]: *** [build/emc.o] Error 1
make[2]: Leaving directory '/home/mathieu/Documents/Atmosphere/exosphere/bpmpfw'
Makefile:61: recipe for target 'bpmpfw/out/bpmpfw.bin' failed
make[1]: *** [bpmpfw/out/bpmpfw.bin] Error 2
make[1]: Leaving directory '/home/mathieu/Documents/Atmosphere/exosphere'
Makefile:8: recipe for target 'exosphere' failed
make: *** [exosphere] Error 2

Am I doing something wrong ?

Looking for list of compile dependencies

From reading the other issues I’ve infired I need libnx (compiling now) and switch-tools (unsure where to obtain.) Are there any others I need and can you point me to their locations. Thank you in advance. Sorry if I’m waiting your time.

Implement emunand.

Once #7 is resolved, actually implement. This will either involve patching up the FS module, or writing/implementing an EL2 driver. If the latter, will need support in custom TZ.

Create an emunand management tool.

We'll need a tool to back up a sysnand to emunand, and to format an SD card to contain the dumped NAND sectors.

Generally, this should be a NAND dump/restoration tool.

Readme file change suggestion & People request

For people like me who want to see and learn how this is done, but are annoyed and confused about how projects like these are structured, I say this:

Please include a readme section (or another text file) in how this project is structured rather than people like me wasting time reading C/C++ code and reading up again on switch stuff to find out what each does.

All in just an idea, and thank you for reading this as well as making this.

Also, I ask what people like me with basic programming practice (C#, python), can do to help?

Decide on an emunand approach.

There are two ways to do this -- do we want to virtualize NAND reads using EL2, or patch the FS module?

Probably the first one is preferable, but it'll also be a lot of work. A decision needs to be made here.

Microsoft buying github. Do we leave or stay?

I have been watching the news on github being bought and watched a few videos. Gitlab would be a great alternative and has the ability to import complete projects including all the commit history issues notes projects and wiki. (It’s basically exactly like github but not M$) The import is also verry straight forward and really doable with a single click.

Improve end-users communication on the projet

Hi !

I recently tried to run homebrews on the Switch with @ktemkin's exploit. In fact, it was quite diffucult since nothing is really clear and explained (to the end user I mean) and the sort-of wiki/guide to Switch dev was hard to found.

I have the competences needed to make a website (maybe hosted on GH pages ?) and am currently following a formation for this (also multimedia, etc...) + I'm willing to drink coffee with this.

This would be awesome to group all tutorials in "one" on THIS official website for the project, with all the steps needed to boot the payload and run the CFW.
I can use the assets already made for the project (from @jaames) too.

Development documentation

Is there some written documentation or diagrams to understand better Atmosphere OS? Should be easier to get hands dirty and eventually contributing to the project

Could change the intensity of the rumble

It would be some similar to the speaker/screen brightness when you can choose the intensity.I know many people which disable the rumble because it is too higth (usually with the pro controller).

As i have been said (Thanks for all CTCaer ) it already exist.Only need an option is settings that controls ApplyMasterVolume is needed in atmosphere.

I would love use this post for asking about if you have found how switchos joycons service works.I mean ,the last part where it subsamples them from 5ms to 15ms per sample in Switch.
The frequencies/amplitudes are then interpolated and sent to the joy-con. (Again thanks to CTCaer for answering all my questions)

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.