Compare commits

..

1026 Commits

Author SHA1 Message Date
lsp199308
d8a37b4b71
loader: add usb 3.0 enable patches for 20.1.0 (#2556)
* loader: add usb 3.0 enable patches for 20.1.0
2025-06-03 01:04:52 -07:00
Michael Scire
b11850b3a3 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "0f72b2ceb"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "0f72b2ceb"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2025-05-28 19:34:34 -07:00
Michael Scire
77603bf7e5 docs: add basic changelog for 1.9.1 2025-05-28 19:33:49 -07:00
Marcus Carter
6b01ebca9e Clarify that code type 0xC4 uses a 64-bit value in cheats.md by formatting the key values as such
Changes the formatting of the key values at `Code Type 0xC4: Begin Extended Keypress Conditional Block` in cheats.md so that it is perfectly clear that those values are 64-bit values rather than 32-bit or 28-bit like `Code Type 0x8: Begin Keypress Conditional Block`, and also for the fact that the formatting matches the rest of the document and is thus cleaner.
2025-05-28 14:47:45 -07:00
Michael Scire
17be65b4b9 git subrepo push emummc
subrepo:
  subdir:   "emummc"
  merged:   "a8e5f1a18"
upstream:
  origin:   "https://github.com/m4xw/emummc"
  branch:   "develop"
  commit:   "a8e5f1a18"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2025-05-28 12:29:54 -07:00
Michael Scire
409c3cf9e1 emummc: note 20.1.0 support in README 2025-05-28 12:29:17 -07:00
Michael Scire
f4e1d0bf9f kern: move spendsgir static assert 2025-05-28 12:18:51 -07:00
Michael Scire
ae65b5df0c fusee/emummc: add support for FS 20.1.0 2025-05-28 12:02:56 -07:00
Michael Scire
0a299a3d40 erpt: update IDs for 20.1.0 2025-05-28 11:48:04 -07:00
Michael Scire
801438953d kern: save/restore spendsgir in KInterruptController::Save/RestoreCoreLocal 2025-05-28 10:54:52 -07:00
Michael Scire
3fbc59cce1 kern: wait 100us after synchronizing cores before saving interrupt state on sleep 2025-05-28 10:48:42 -07:00
Michael Scire
f646d9c8f9 kern: use KLightLock for KCoreBarrierInterruptHandler 2025-05-28 10:44:31 -07:00
Michael Scire
69cc653e7f Add version enums for 20.1.0 2025-05-28 10:32:26 -07:00
Michael Scire
6da88f8f3e docs: add banner to readme 2025-05-27 22:24:41 -07:00
Michael Scire
1d3f3c6e56 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "9e8cbe3fa"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "9e8cbe3fa"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2025-05-09 12:11:13 -07:00
Michael Scire
4d4f0ba968 svc: bump supported kernel version 2025-05-09 12:05:01 -07:00
Michael Scire
cc4531e3bf git subrepo push emummc
subrepo:
  subdir:   "emummc"
  merged:   "7522f1f60"
upstream:
  origin:   "https://github.com/m4xw/emummc"
  branch:   "develop"
  commit:   "7522f1f60"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2025-05-09 12:02:17 -07:00
Michael Scire
0e2ef545f9 fusee: commit mtc table combined bins, to remove need for running py script outside of makefile 2025-05-09 12:00:44 -07:00
Michael Scire
f1ca7db562 boot: use --embed-dir for fusee embed 2025-05-09 11:58:56 -07:00
Michael Scire
d5567b5363 pm: update for fsp-pr RegisterProgram api change 2025-05-09 11:55:21 -07:00
Michael Scire
f9165c472e docs: add gcc15 to changelog 2025-05-09 11:55:21 -07:00
Michael Scire
b2dd3b7dce boot: use #embed for fusee 2025-05-09 11:55:21 -07:00
Michael Scire
66acab02db exo: use #embed for loader stub 2025-05-09 11:55:21 -07:00
Michael Scire
2c50ef717a fusee: use embed in mtc/sdram param scripts 2025-05-09 11:55:21 -07:00
Michael Scire
d305d48a7e ams: basic support for compiling with gcc 15 2025-05-09 11:55:21 -07:00
Michael Scire
cb032006d5 fusee: fix off-by-one in nogc patches for exFAT firm 2025-05-09 11:55:21 -07:00
Michael Scire
8da6bc59a7 docs: add provisional changelog for ams 1.9.0 2025-05-09 11:55:21 -07:00
Michael Scire
b7ec64ea16 fs.mitm: add and use memlet module to temporarily steal applet memory while building romfs images.
Starting in 20.0.0, the browser needs more applet memory to function, so we can't steal as much any more.
Thus, we now steal 14 MB on 20.0.0+ instead of 40MB.

However, since this reduces memory available for custom system modules, we are adjusting to compensate.
ams.mitm's heap size has been reduced from 32MB to 12MB (recovering 20MB).
In addition, fs.mitm now uses a new mechanism for stealing memory from the applet pool while romfs is being built.

On net, we are compromising:
    * Custom sysmodules lose memory available to them.
        On 19.0.0/AMS 1.8.0, there was 30 MB available for custom sysmodules.
        Stealing 14 MB instead of 40 MB, we lose 26 MB of that. Reducing ams.mitm's usage will gain us back 20.
        Nintendo also appears to...use 4 extra MB, in 20.0.0, from my test homebrew.
        So on 20.0.0/AMS 1.9.0, there should be 20 MB available for custom sysmodules.
        On the bright side, on <20.0.0/AMS 1.9.0, I guess there will be 50 MB available for custom sysmodules now?
    * totk mods will lose the ability to...put every file in the romfs on sd card. There will be some unknown maximum filecount for totk mods.
        On the bright side, implementing the transient memory stealing should improve compatibility for some mods which strictly add files?
2025-05-09 11:55:21 -07:00
Michael Scire
bc44ffe70d emummc: fix offsets for 20.0.0-exfat 2025-05-09 11:55:21 -07:00
Michael Scire
a6847ca70e ams: add enum support for 20.0.1/18.0.1 2025-05-09 11:55:21 -07:00
Michael Scire
3af8757c3b erpt: initial support (incomplete) for 20.0.0 2025-05-09 11:55:21 -07:00
Michael Scire
f55cf42433 ldr/pm: update for 20.0.0 abi changes 2025-05-09 11:55:21 -07:00
Michael Scire
07df13e2a0 strat: update for fsp-ldr 20.0.0 changes 2025-05-09 11:55:21 -07:00
Michael Scire
791edf87a0 ncm: update to implement new ContentMetaDatabase function for 20.0.0 2025-05-09 11:55:21 -07:00
Michael Scire
b1ca5b4049 kern: plutoo is an intellectual, I am a fool, fix chicanery 2025-05-09 11:55:21 -07:00
Michael Scire
4580a352c0 kern: use callback to note pte updates in KPageTableImpl 2025-05-09 11:55:21 -07:00
Michael Scire
28296e2aac kern: refactor FindFreeArea region search logic per 20.0.0 changes 2025-05-09 11:55:21 -07:00
Michael Scire
b80f0944ab kern: update instruction cache invalidation logic in KPageTableBase to reflect 20.0.0 changes 2025-05-09 11:55:21 -07:00
Michael Scire
96d4546498 kern: reorder resource manager implementation 2025-05-09 11:55:21 -07:00
Michael Scire
86e4bed056 kern: support null resource limit in KSecureSystemResource 2025-05-09 11:55:21 -07:00
Michael Scire
2e204ccbaf kern: update synchronous exception handlers to assume FAR validity on TLB conflict 2025-05-09 11:55:21 -07:00
Michael Scire
b27999a116 kern: adjust system registers during exception handling on MTE-violation or kernel address fault 2025-05-09 11:55:21 -07:00
Michael Scire
98e5bd4411 kern: update UserspaceAccess functions for 20.0.0 changes 2025-05-09 11:55:21 -07:00
Michael Scire
4c5c5c85e3 kern: update crt0 to reflect 20.0.0 changes 2025-05-09 11:55:21 -07:00
Michael Scire
3e19e4d004 kern: update KAddressSpaceInfo to reflect 20.0.0 changes 2025-05-09 11:55:21 -07:00
Michael Scire
66fcf33a2c kern: invert meaning of KTargetSystem/KSystemControl bools 2025-05-09 11:55:21 -07:00
Michael Scire
d147f6f93b erpt: update ids for 20.0.0 2025-05-09 11:55:21 -07:00
Michael Scire
3dd5c98f52 readme: sept has not been in the project for many years 2025-05-09 11:55:21 -07:00
Michael Scire
b9b01bbbd1 loader: add usb 3.0 enable patches for 20.0.0 2025-05-09 11:55:21 -07:00
Michael Scire
6352397203 emummc: add offsets for 20.0.0 (untested) 2025-05-09 11:55:21 -07:00
Michael Scire
ef5334c3ca fusee/exo/ams: update with new keydata/version enums 2025-05-09 11:55:21 -07:00
Michael Scire
6125f40bdb ams: various fixes to support booting debug configuration 2025-04-08 13:43:29 -07:00
Michael Scire
85fd13f724 kern: update KernelLdr for 19.0.0 (new checks, dummy function call).
Also, fix a few very embarassing mistakes in kernel ldr:
* We have been mapping the page table region RWX for a few years now, accidentally.
* My attempt at making initial page tables not use bit 58 was broken in multiple ways.
2025-04-07 16:49:10 -07:00
tomvita
4e99a5e08d
Add extensions to dmnt cheat virtual machine (#2479)
* dmnt_extension

* update type 8 extension

* clearify that bit 27 does not correspond to a button

* update cheat.md with new code type 0xC4

* implement code type 0xC4

* Add type 1 extension

* remove C0Tcr6Ma aaaaaaaa VVVVVVVV (VVVVVVVV)

* Type 9 extension for floating point math

* updated according to review
2025-01-09 19:38:59 -07:00
Michael Scire
9f8d17b9e6 crypto: implement CmacGenerator 2024-10-30 18:08:29 -07:00
Michael Scire
3a5f70dceb fs: fix uninit warnings on windows localfilesystem 2024-10-29 20:00:08 -07:00
Michael Scire
e51e11a71c libstrat: re-nolto files when compiling for windows-audit 2024-10-29 19:30:30 -07:00
Michael Scire
57e15f3622 strat: ldr::PlatformId -> ncm::ContentMetaPlatform 2024-10-29 19:24:52 -07:00
Michael Scire
c6014b533f docs: add changelog for 1.8.0 2024-10-15 21:55:50 -07:00
Michael Scire
0c3608d1f4 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "989fb7be0"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "989fb7be0"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2024-10-15 21:52:50 -07:00
Michael Scire
be19749841 svc: bump supported kernel version 2024-10-15 21:51:17 -07:00
Michael Scire
7c31b21d4b git subrepo push emummc
subrepo:
  subdir:   "emummc"
  merged:   "d248ea6f7"
upstream:
  origin:   "https://github.com/m4xw/emummc"
  branch:   "develop"
  commit:   "d248ea6f7"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2024-10-15 21:50:20 -07:00
Michael Scire
9112461620 loader: add usb 3.0 enable patches for 19.0.0 2024-10-15 21:48:59 -07:00
Michael Scire
3522ac18c1 kern: support reboot to fatal error on mariko 2024-10-15 21:48:59 -07:00
Michael Scire
e63cae5c77 kern: Perform page table validity pass during KPageTableImpl::InitializeForKernel 2024-10-15 21:48:59 -07:00
Michael Scire
c911420d6a kern: fix more page table refactor bugs 2024-10-15 21:48:59 -07:00
Michael Scire
570989384b kern: first round of page table refactor bug fixes 2024-10-15 21:48:59 -07:00
Michael Scire
4c81432e94 kern: update KPageTable::Map for new refactor 2024-10-15 21:48:59 -07:00
Michael Scire
e1e84d4450 kern: update ChangePermissions to use new iteration logic 2024-10-15 21:48:59 -07:00
Michael Scire
d2656e3948 kern: update KPageTable::Finalize for the refactor 2024-10-15 21:48:59 -07:00
Michael Scire
62abb31122 kern: use new merge pages api 2024-10-15 21:48:59 -07:00
Michael Scire
cb970049db kern: implement KPageTableImpl merge 2024-10-15 21:48:59 -07:00
Michael Scire
9610f42dc0 kern: continue page table refactor, implement separate/unmap 2024-10-15 21:48:59 -07:00
Michael Scire
02e837d82e kern: start KPageTable(Impl) refactor, use array-with-levels for KPageTableImpl 2024-10-15 21:48:59 -07:00
Michael Scire
7aa0bed869 ldr: ProgramInfo is 0x410 now, and fix debug flags for hbl 2024-10-15 21:48:59 -07:00
Michael Scire
a80d5b5c86 pm: add new 19.0.0 commands
This is functionally correct, but I have no idea what these are meant to represent.
These functions are completely unused on NX.
2024-10-15 21:48:59 -07:00
Michael Scire
77d239265d ns_mitm: update to support new 19.0.0 command 2024-10-15 21:48:59 -07:00
Michael Scire
624f8d0d8d ro: support NROs with read-only first page 2024-10-15 21:48:59 -07:00
Michael Scire
9cfd535568 kern: invoke supervisor mode thread functions from C++ context with valid stack frame 2024-10-15 21:48:59 -07:00
Michael Scire
23ba31da1f kern: add note that N ifdef'd out calling HandleException() for EL1 faults 2024-10-15 21:48:59 -07:00
Michael Scire
3b03b9603c kern: specify allowable ipc client memory attr via inverted-whitelist, not blacklist 2024-10-15 21:48:59 -07:00
Michael Scire
912b84c4e3 kern: add minimum alignment support to KMemoryManager 2024-10-15 21:48:59 -07:00
Michael Scire
ff38a32a9b kern/ldr: add support for --x executables 2024-10-15 21:48:59 -07:00
Michael Scire
2855b8ee35 kern/strat: update for new DebugFlags capability semantics 2024-10-15 21:48:59 -07:00
Michael Scire
00716576cd kern: simplify KProcess max memory calculation 2024-10-15 21:48:59 -07:00
Michael Scire
743634c3fd kern: move KTargetSystem into .rodata, split init/verify 2024-10-15 21:48:59 -07:00
Michael Scire
3394a88a1a kern: fix debug build 2024-10-15 21:48:59 -07:00
Michael Scire
a72e39d657 kern: allocate all TTBR0 pages during init, use procidx as asid 2024-10-15 21:48:59 -07:00
Michael Scire
c3fa42d958 kern: clear gicd/gicc pointers in KInterruptController::Finalize 2024-10-15 21:48:59 -07:00
Michael Scire
126cb8bbdf kern: fix KMemoryBlock ctor reorder warn 2024-10-15 21:48:59 -07:00
Michael Scire
753cf74bf2 kern: eliminate use of KMemoryInfo, shuffle KMemoryBlock fields 2024-10-15 21:48:59 -07:00
Michael Scire
70bf833070 kern: KAddressSpaceInfo now takes CreateProcessFlags in getters 2024-10-15 21:48:59 -07:00
Michael Scire
a0ad3ef949 kern/svc: update WaitForAddress to support 64-bit WaitIfEqual 2024-10-15 21:48:59 -07:00
Michael Scire
5de551db29 kern: add InfoType_TransferMemoryHint 2024-10-15 21:48:59 -07:00
Michael Scire
77d17dc4ff emummc: update for 19.0.0 2024-10-15 21:48:59 -07:00
Michael Scire
4acfac539c erpt: add new IDs/categories 2024-10-15 21:48:59 -07:00
Michael Scire
c4a5d4db09 fusee/exo/ams: update with new keydata/version enums 2024-10-15 21:48:59 -07:00
Michael Scire
10c7a39528 kern/creport: use mod0 to locate symbol table for all modules 2024-09-24 13:15:21 -07:00
Michael Scire
009f581721 creport: optimize ScopedFile performance 2024-09-23 02:41:57 -07:00
Michael Scire
027e209073 kern/ldr: enable the use of relr for relocations 2024-09-01 22:27:48 -07:00
Michael Scire
423a05a1e9 meso: fix sign-comparison warn on svc/interrupt flag compare 2024-09-01 16:27:01 -07:00
hexkyz
4617fec672 fusee: add missing mtc tables 2024-07-10 21:36:22 +01:00
Michael Scire
e85bc4db0b fusee: add nogc case for 18.1 2024-06-11 10:29:02 -07:00
Michael Scire
39c201e37f git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "bb7678691"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "bb7678691"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2024-06-10 22:19:29 -07:00
Michael Scire
ab5cc75684 git subrepo push emummc
subrepo:
  subdir:   "emummc"
  merged:   "f23f943d4"
upstream:
  origin:   "https://github.com/m4xw/emummc"
  branch:   "develop"
  commit:   "f23f943d4"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2024-06-10 22:18:44 -07:00
Michael Scire
1e3349e99a emummc: update readme 2024-06-10 22:18:04 -07:00
Michael Scire
76628e273a ams: bump to 1.7.1 (support for 18.1.0) 2024-06-10 22:17:23 -07:00
Michael Scire
257ac2bd33 emummc: update to support 18.1.0 2024-06-10 22:16:24 -07:00
Michael Scire
9eb92f37db git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "d58ff30a1"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "d58ff30a1"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2024-06-05 11:29:13 -07:00
Michael Scire
5b135d12ca libstrat: fix more gnu++23 errors 2024-06-05 11:28:29 -07:00
Michael Scire
c41a6b80d7 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "087f68257"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "087f68257"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2024-06-05 09:22:53 -07:00
Michael Scire
05fde7b764 ams: may as well test removal of CRTP from Result 2024-06-01 22:36:37 -07:00
Michael Scire
1609f804f2 ams: build with -std=gnu++23 2024-06-01 22:36:37 -07:00
Michael Scire
f35c94810c ams: fix compilation with gcc 14 (closes #2330) 2024-06-01 22:36:37 -07:00
Michael Scire
548b48b2a6 loader: update to reflect latest 18.0.0 changes
well, this sure is late, whoops
2024-05-27 15:43:58 -07:00
Michael Scire
35d93a7c41 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "fadec2981"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "fadec2981"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2024-03-29 03:20:12 -07:00
Michael Scire
410f23035e docs: update changelog for 1.7.0 2024-03-29 03:19:17 -07:00
Michael Scire
29cc13543a kern: fix using memory config for half-of-true-size 2024-03-29 03:18:20 -07:00
Michael Scire
31ad4eec1d git subrepo push emummc
subrepo:
  subdir:   "emummc"
  merged:   "832b24426"
upstream:
  origin:   "https://github.com/m4xw/emummc"
  branch:   "develop"
  commit:   "832b24426"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2024-03-29 02:57:53 -07:00
Michael Scire
3ccb0ae02b git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "8b85add71"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "8b85add71"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2024-03-29 02:56:10 -07:00
Michael Scire
4f7db6e60e docs: add changelog for 1.7.0 2024-03-29 02:54:40 -07:00
Michael Scire
a325e18cb5 loader: add usb3 patches for 18.0.0 2024-03-29 02:41:14 -07:00
Michael Scire
af41272591 spl: add support for new spl:es command 33 2024-03-29 02:41:14 -07:00
Michael Scire
551821e7e2 erpt: actually support non-sequential ids, nintendo why 2024-03-29 02:41:14 -07:00
Michael Scire
b081762657 emummc: update for 18.0.0 2024-03-29 02:41:14 -07:00
Michael Scire
d2c2a94c5e erpt: add new IDs/categories 2024-03-29 02:41:14 -07:00
Michael Scire
4ff9278d11 jpegdec: stop bundling (TODO post-prerelease) 2024-03-29 02:41:14 -07:00
Michael Scire
21c85c6a4f exo/fusee: apparently 18.0.0 did not burn a fuse 2024-03-29 02:41:14 -07:00
Michael Scire
05090005b7 svc: advertise support for 18.3.0.0 2024-03-29 02:41:14 -07:00
Michael Scire
c0487ad384 kern: fix whoops in new page table logic 2024-03-29 02:41:14 -07:00
Michael Scire
ecbe5cd406 kern: refactor smc helpers to share more common logic 2024-03-29 02:41:14 -07:00
Michael Scire
4fe139ea52 kern: return ExceptionType_UnalignedData on data abort caused by alignment fault 2024-03-29 02:41:14 -07:00
Michael Scire
6922eae3e7 kern: add KPageGroup::CopyRangeTo 2024-03-29 02:41:14 -07:00
Michael Scire
952188fc73 kern: implement new attr tracking for memory range/traversal context 2024-03-29 02:41:14 -07:00
Michael Scire
c0a4fc30a8 kern: simplify size calculations in KPageTableBase::Read/WriteDebugIoMemory 2024-03-29 02:41:14 -07:00
Michael Scire
0b04c89a84 kern: pass properties directly to KPageTableBase::AllocateAndMapPagesImpl 2024-03-29 02:41:14 -07:00
Michael Scire
217dd1260a kern: take alignment argument in KMemoryManager::AllocateAndOpen 2024-03-29 02:41:14 -07:00
Michael Scire
8aa62a54d8 kern/os: support CreateProcessFlag_EnableAliasRegionExtraSize 2024-03-29 02:41:14 -07:00
Michael Scire
25bae14064 kern: revise KPageTableBase region layout logic to match 18.0.0 changes 2024-03-29 02:41:14 -07:00
Michael Scire
900913fe3b kern: fix longstanding bug in ConvertToKMemoryPermission 2024-03-29 02:41:14 -07:00
Michael Scire
7562f807fd kern: pass kernel base from KernelLdr to Kernel 2024-03-29 02:41:14 -07:00
Michael Scire
cf5895e04f kern: use userspace access instructions to read from tlr 2024-03-29 02:41:14 -07:00
Michael Scire
1f37fbed1d fusee/exo/ams: update with new keydata/version enums 2024-03-29 02:41:14 -07:00
JerryWn
9701d5b2ab readme: fix broken discord icon 2024-03-20 03:04:29 -07:00
Michael Scire
c8c76bf8f8 readme: I suppose we're living in 2024, then 2024-03-04 14:51:44 -07:00
Michael Scire
0220f67085 fssrv: fix dumb assert error 2024-02-23 13:55:51 -07:00
german77
615f8a3ef3 dmnt: Fix debug log for cheats 2024-02-14 10:28:16 -07:00
Liam
000e382c42 dmnt.gen2: avoid data abort when too many breakpoints are created 2024-02-14 10:27:45 -07:00
Liam
3627356d4b dmnt.gen2: enable gdbserver QStartNoAckMode 2024-02-14 10:27:36 -07:00
Michael Scire
72b0fe6c1c strat: fix nx_debug build target 2024-01-20 13:31:12 -07:00
Michael Scire
e919b80fa2 pm: improve resource limit management accuracy
This change was made for #2255, but the issue creator never confirmed if it resolved the issue.

This *does* better reflect what Nintendo's pm does, though, so I'm going to commit it regardless.
2024-01-20 13:09:04 -07:00
Michael Scire
fc16f28d0c settings: support PortugueseBr (closes #2264) 2024-01-08 12:20:53 -07:00
Michael Scire
e09ba765a1 kern: fix various comment/style hygiene issues (thanks @liamwhite) 2023-12-27 23:24:35 -07:00
Michael Scire
3217df147e kern: allow ktrace map capability when ktrace is disabled 2023-12-27 23:17:52 -07:00
Michael Scire
1fa41c3e2a loader/ro: abort if patching would go out of bounds 2023-12-27 23:05:10 -07:00
Michael Scire
db3dc4ebd2 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "bfc558348"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "bfc558348"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-11-28 13:02:32 -07:00
Michael Scire
742fd16080 sf: fix ipc serialization bug (out object id offsets) 2023-11-28 12:54:00 -07:00
Michael Scire
812b2aeb4c git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "d7a02b6ca"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "d7a02b6ca"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-11-16 16:25:52 -07:00
Michael Scire
46a4357882 fusee: remove ips patch parsing from sd filesystem
Parsing the SD fs is very slow. In addition, the only KIPs are either a) atmosphere modules, or b) FS.

The IPS subsystem was originally designed to make nogc/etc patches work for FS,
but these are now internal, and it appears that the literal only kip patches
that exist are for piracy.

It just doesn't make sense to slow down boot for every normal user for a feature
that has no actual usecase, and especially when fusee is already so minimal.
2023-11-13 12:45:00 -07:00
Michael Scire
872c18c501 kern: fix some comment typos 2023-11-01 10:25:31 -07:00
Michael Scire
afc0e14556 kern/svc: fix query/insecure names 2023-11-01 10:24:13 -07:00
Michael Scire
f7bf379cfe git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "80bf6aeee"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "80bf6aeee"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-10-27 16:22:45 -07:00
Michael Scire
9f26419b1a ams: bump version to 1.6.2, add changelog 2023-10-27 16:21:57 -07:00
Michael Scire
1b057d48c6 sm: fix compat with new service macros 2023-10-26 14:44:45 -07:00
Michael Scire
0c3afff4d3 pm: update to reflect 17.0.0 internal design changes 2023-10-26 14:44:32 -07:00
Michael Scire
274f6b63f2 erpt: add remaining SubmitFsInfo helpers 2023-10-25 16:08:12 -07:00
Michael Scire
2ed8450446 erpt: SubmitFileSystemProxyErrorInfo 2023-10-25 14:21:27 -07:00
Michael Scire
60974a5f4e erpt: GetMmcErrorInfo, GetSdCard*Info 2023-10-25 12:41:18 -07:00
Michael Scire
fa384fd920 erpt: begin SubmitFsinfo (SubmitMmcDetailInfo) 2023-10-25 04:45:41 -07:00
Michael Scire
3f19db0d96 jpegdec: fix abort check on output width 2023-10-18 02:33:59 -07:00
Michael Scire
a84f725e21 jpegdec: update to reflect 17.0.0 changes 2023-10-18 02:31:26 -07:00
Michael Scire
7f61dfdb8d pm: since 15.0.0, WaitApplicationMemoryAvailable is more lenient 2023-10-17 11:25:35 -07:00
Michael Scire
c44da84869 pm: adjust resource limit function names 2023-10-17 11:10:09 -07:00
Liam
7f4450f930 haze: pretend to be able to write MTP server code 2023-10-16 17:31:09 -04:00
Michael Scire
edb4e2ea56 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "965e05b3c"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "965e05b3c"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-10-16 12:31:15 -07:00
Michael Scire
183f3e0d7e ams: bump version to 1.6.1 2023-10-16 12:30:35 -07:00
Michael Scire
7650c5eb96 docs: add changelog for 1.6.1 2023-10-16 12:30:18 -07:00
Liam
0ff197b300 haze: fix bMaxPacketSize0 2023-10-16 08:36:33 -07:00
Liam
d9fff85bc4 haze: use gpu console for rendering 2023-10-16 08:36:10 -07:00
Liam
c866c15856 haze: implement GetObjectPropList 2023-10-16 08:36:10 -07:00
Michael Scire
e8ac23e2ee ncm: fix two comments 2023-10-16 08:24:07 -07:00
Michael Scire
3a8cffef57 ncm: better detect + fix 17 brick after-the-fact
This adds detection for missing-save or empty-save, and rebuilds in either case.
2023-10-16 02:38:30 -07:00
Liam
13411902c9 fs: add missing stub for GetProgramId 2023-10-14 07:52:47 -07:00
Michael Scire
693fb423cb kern: fix minor sin 2023-10-12 14:25:17 -07:00
Michael Scire
8a9eb85e05 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "132558c33"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "132558c33"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-10-12 09:23:31 -07:00
Michael Scire
d389ef639e docs: add changelog for 1.6.0 2023-10-12 09:19:26 -07:00
Michael Scire
719858ad18 git subrepo push emummc
subrepo:
  subdir:   "emummc"
  merged:   "9513a5412"
upstream:
  origin:   "https://github.com/m4xw/emummc"
  branch:   "develop"
  commit:   "9513a5412"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-10-12 09:02:30 -07:00
Michael Scire
e4d08ae0c5 erpt: amend min-version for latest CreateReportWithAttachments 2023-10-12 08:55:58 -07:00
Michael Scire
0c063db926 loader: add usb3 patches for 17.0.0 2023-10-12 08:55:58 -07:00
Michael Scire
02e987819b ncm: work around change in Nintendo save handling behavior
Static save files do not require an entry in the save data indexer to mount.
Prior to 17.0.0, save data files were considered static if userid was 0.
In 17.0.0+, only 8000000000000000 is static.

However, some users using cfw do not have an entry for 8000000000000120 in the indexer,
for various reasons (but mostly manual nand-restore, I think). Thus, on boot of 17.0.0+,
FS will say 8000000000000120 is not present (not in indexer), and NCM will create it anew.

The 8000000000000120 save will then be empty, and then the firmware can't boot.

To workaround this, logic has been re-enabled on 17.0.0+ for building the content meta database.
Thus, if the user encounters this error, the 8000000000000120 save will be emptied, but then
it will be automatically reconstructed, fixing the problem.
2023-10-12 08:55:58 -07:00
Michael Scire
2ec3e141c7 bpc.mitm/exo: support pmic reboot/shutdown on mariko (thanks @CTCaer) 2023-10-12 08:55:58 -07:00
Michael Scire
71d0274884 erpt: remove deprecated fields, they didn't actually change IDs, just the mapping between id and name table index 2023-10-12 08:55:58 -07:00
Michael Scire
05259b7519 emummc: fix offsets for 17.0.0 2023-10-12 08:55:58 -07:00
Michael Scire
59a24fa646 fusee: support parsing 17.0.0+ INI 2023-10-12 08:55:58 -07:00
Michael Scire
f5b2eab4a8 exo: fix up new titlekey option extents 2023-10-12 08:55:58 -07:00
Michael Scire
e96e1063e2 jpegdec: stop bundling (TODO post-prerelease) 2023-10-12 08:55:58 -07:00
Michael Scire
aa170a72a9 erpt: Add basic (TODO-impl post-prerelease) support for 17.0.0 changes 2023-10-12 08:55:58 -07:00
Michael Scire
9d4cb685a7 fs: update OpenCodeFileSystem abi for 17.0.0 2023-10-12 08:55:58 -07:00
Michael Scire
c95741142e ncm: update for new 17.0.0 apis 2023-10-12 08:55:58 -07:00
Michael Scire
ef9b111bbf emummc: update for 17.0.0 2023-10-12 08:55:58 -07:00
Michael Scire
114b82284d exo/spl: Add new EsCommonKeyType 2023-10-12 08:55:58 -07:00
Michael Scire
c5d7ca5159 fusee/exo: implement the usual changes for new firmware support 2023-10-12 08:55:58 -07:00
Michael Scire
6d0bf70783 kern: fix assert usage in process load 2023-10-12 08:55:58 -07:00
Michael Scire
aba6ca7329 kern: bump supported version to 17.x 2023-10-12 08:55:58 -07:00
Michael Scire
06a840e550 kern: fix operation type enum-value whoops 2023-10-12 08:55:58 -07:00
Michael Scire
11c02e22e0 kern: implement support for applying relr relocations 2023-10-12 08:55:58 -07:00
Michael Scire
f93aea4c06 kern: split Process/Thread exit to separate WorkerTaskManagers 2023-10-12 08:55:58 -07:00
Michael Scire
4ddfb6183c kern: split out GetInstructionDataUserMode in exception handler 2023-10-12 08:55:58 -07:00
Michael Scire
3737151a2f kern: Add special-case for InvalidateProcessDataCache on current process 2023-10-12 08:55:58 -07:00
Michael Scire
2a4d68f916 kern: KPageTable: remove MapFirst operation, replace with MapFirstGroup 2023-10-12 08:55:58 -07:00
Michael Scire
7b523cfc8d kern: note OnFinalize calls in KPageTable::Finalize 2023-10-12 08:55:58 -07:00
Michael Scire
39a95d4023 kern: implement new default application system resource field in KProcess 2023-10-12 08:55:58 -07:00
Michael Scire
2c5002ce50 kern: update KMemoryRegionType values for new ids + SecureUnknown region 2023-10-12 08:55:58 -07:00
Michael Scire
b7384a8667 kern: KSupervisorPageTable now checks wxn instead of setting it 2023-10-12 08:55:58 -07:00
Michael Scire
85b5f20395 kern: KPageTable::Initialize no longer takes unused process id 2023-10-12 08:55:58 -07:00
Michael Scire
ad5bd81d3f kern: implement PermissionLock, update KPageTableBase attribute/alignment checks 2023-10-12 08:55:58 -07:00
Michael Scire
777b6d285c kern: KPageTableBase::CheckMemoryState now invokes a helper 2023-10-12 08:55:58 -07:00
Michael Scire
ae2c25e9c8 kern: update KMemoryState, remove bijection (separate IoRegister/IoMemory) 2023-10-12 08:55:58 -07:00
Michael Scire
3b8f65d502 kern: update initial process load logic to do per-segment mapping/decompression 2023-10-12 08:55:58 -07:00
Michael Scire
cfd2d5b012 kern: clear new pages in init page allocator, not init page table 2023-10-12 08:55:58 -07:00
Michael Scire
c72ba35684 kern: add speculation barriers after eret 2023-10-12 08:55:58 -07:00
Michael Scire
ec96203cb7 kern: remove unnecessary fields from InitArgs (0x80 -> 0x40) 2023-10-12 08:55:58 -07:00
Michael Scire
1491a7b159 kern: on second thought, move vectors back to end of text 2023-10-12 08:55:58 -07:00
Michael Scire
0daef4a6e8 kern/ldr: move crt0 into .rodata 2023-10-12 08:55:58 -07:00
Michael Scire
4ca3c44e5f kern: pass ini1 size from loader to kernel, remove slab memset from init0 2023-10-12 08:55:58 -07:00
Michael Scire
add4b3fdc3 utils: update erpt script 2023-10-12 08:55:58 -07:00
Liam
159f8d384b dmnt.gen2: enable attach to arbitrary program id 2023-10-11 19:50:09 -07:00
Liam
92a8c8eb88 haze: implement android operations 2023-10-11 18:57:49 -07:00
Liam
9e0daff46e haze: split operations by type 2023-10-11 18:57:49 -07:00
Liam
6b72dbd22d haze: refactor constant use for cleaner separation 2023-10-11 18:57:49 -07:00
Michael Scire
ba91f070e8 mesosphere: remove nostartfiles from specs files (should only be passed to linker wrapper) 2023-09-17 09:33:56 -07:00
Michael Scire
4fe9a89ab8 docs: commit saddest changelog of all time, this is your brain on going to vacation 2023-08-21 17:30:06 -07:00
Michael Scire
de73f6c5bb git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "c3dc418a2"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "c3dc418a2"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-08-21 17:27:16 -07:00
Michael Scire
e488b6ee47 ams: add enum recognition for 16.1.0 2023-08-21 17:26:27 -07:00
Michael Scire
99810dc091 fssystem: fix typo error in BucketTree::Visitor::MoveNext 2023-08-15 14:47:09 -07:00
Liam
e54957285f libstrat: comment fixes for fssystem 2023-08-12 11:33:29 -07:00
Michael Scire
fca213460b libstrat: fix more minor style issues pointed out by Pharynx 2023-08-10 11:48:28 -07:00
Michael Scire
4e6bd19fcd fssystem: fix stupid issue in NodeBuffer move-ctor
Code compiles with this constructor deleted, so it wasn't used, but even so...
2023-08-03 16:58:55 -07:00
Michael Scire
8b88351cb4 mitm: fix errant include on non-hos 2023-06-06 19:32:06 -07:00
Michael Scire
63ea152349 fatal: take good idea from shrek 2023-05-19 11:47:38 -07:00
Michael Scire
3cb54e2b4b git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "f4a966eb4"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "f4a966eb4"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-05-14 03:17:20 -07:00
Michael Scire
e9de11a746 ams: bump version to 1.5.4 2023-05-14 03:16:27 -07:00
Michael Scire
b979b5aa36 docs: 1.5.4 changelog, zelda why the fuck 2023-05-14 03:16:15 -07:00
SciresM
f2ee44da74
romfs/ams.mitm/pm: refactor to dynamically steal heap for certain games. (#2122)
* fs.mitm: skeleton the use of special allocation in romfs build

* pm: add api for ams.mitm to steal application memory

* pm/mitm: okay, that api won't work, try a different one

* romfs: revert memory usage increases; we'll handle torture games case-by-case.

* pm/romfs: first (broken?) pass at dynamic heap.

I cannot wait to figure out all the ways this is wrong.

* Release the dynamic heap a little more eagerly

* romfs: animal crossing is also not a nice game

* romfs: fix issues in close-during-build

* romfs: zelda is a blight upon this earth
2023-05-14 03:06:52 -07:00
Michael Scire
85c23b5781 fusee: actually identify new FS 2023-05-08 18:38:13 -07:00
Michael Scire
8e042f2262 git subrepo push emummc
subrepo:
  subdir:   "emummc"
  merged:   "30205111e"
upstream:
  origin:   "https://github.com/m4xw/emummc"
  branch:   "develop"
  commit:   "30205111e"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-05-08 18:25:25 -07:00
Michael Scire
81e9154a52 emummc: add enums for 16.0.3 2023-05-08 18:24:49 -07:00
Michael Scire
e9b9dbc2aa docs: add changelog for 1.5.3 2023-05-08 18:19:31 -07:00
Michael Scire
7e6c849ca4 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "cd0fc2c1d"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "cd0fc2c1d"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-05-08 18:06:50 -07:00
Michael Scire
8ec7c096d0 git subrepo push emummc
subrepo:
  subdir:   "emummc"
  merged:   "d2fcc73eb"
upstream:
  origin:   "https://github.com/m4xw/emummc"
  branch:   "develop"
  commit:   "d2fcc73eb"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-05-08 18:05:36 -07:00
Michael Scire
6e5b901a9b emummc: support 16.0.3 2023-05-08 18:03:35 -07:00
Michael Scire
b800953d66 ams: recognize 16.0.3('s FS) 2023-05-08 17:51:13 -07:00
Michael Scire
f0240db75a fs.mitm: mitm glue for font replacement, before I forget 2023-05-08 17:40:10 -07:00
Michael Scire
1f5ec68a5c ams: fix compilation with gcc 13 2023-05-07 03:36:46 -07:00
Michael Scire
ed9e60acb9 kern: track heap in KPageTableBase::MemoryRange 2023-04-30 16:50:53 -07:00
Liam
a7300b0fa4 haze: fix file size transmission issue 2023-04-18 22:15:48 -07:00
Liam
8e2eca2004 haze: abstract firmware version and serial number fetch 2023-04-18 22:15:48 -07:00
Michael Scire
9f83b3c838 ams: I really need to automate keeping this in sync 2023-04-17 20:57:57 -07:00
Michael Scire
434c8cefc4 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "ecc8b1811"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "ecc8b1811"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-04-17 20:40:41 -07:00
Michael Scire
d8aed7de6d ams: add 16.0.2 enum 2023-04-17 20:40:02 -07:00
Liam
a346014dc7 haze: get serial number and firmware version from set:sys 2023-04-17 22:22:28 -04:00
Michael Scire
4b3c801e9f dist: add haze to output zip 2023-04-17 14:35:25 -07:00
Michael Scire
90db1223f6 docs: avoid unintended insinuations 2023-04-17 14:24:27 -07:00
Michael Scire
fa64a6ff4d docs: pretend to be literate 2023-04-17 14:20:16 -07:00
Michael Scire
0c6a06a0cf git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "7340e2eab"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "7340e2eab"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-04-17 14:19:59 -07:00
Michael Scire
5efb4a2a98 docs: bump version, 16.0.1 exists too 2023-04-17 14:19:18 -07:00
liamwhite
3b662122f9
troposphere: add haze MTP server (#2095)
* troposphere: add haze MTP server

* haze: adjust banner, new lines between class sections, single-statement if

* haze: remove additional newlines between sections

* haze: avoid use of reference out parameter

* haze: console_main_loop: style

* haze: event_reactor, file_system_proxy, ptp: style

* haze: ptp_data_builder, ptp_object_database, ptp_object_heap, results, usb_session: style

* haze: event_reactor, ptp_data_parser, async_usb_server, ptp_object_database, ptp_object_heap: style

* haze: ptp_responder: style

* haze: usb_session: style

* haze: use svc defs from vapours

* haze: misc comments

* haze: fix pointer overflow check

* haze: fix copy paste error

* haze: use alignment, invalidate cached use values in console

* haze: fix stray hex constant

* haze: misc style

* haze: fixes for windows

* haze: add GetObjectPropsSupported, GetObjectPropDesc, GetObjectPropValue

* haze: add SetObjectPropValue

* haze: improve object database API

* haze: improve WriteVariableLengthData readability

* haze: fix directory renames on windows

* haze: ptp_object_database: fix collation

* haze: event_reactor: fix size validation

* haze: ptp_responder: improve documentation

* haze: ptp_responder: avoid unnecessary fs interaction in GetObjectPropValue

* haze: ptp_responder: fix object deletion on windows

* haze: tear down sessions on suspension

* haze: prefer more specific data types

* haze: misc

* haze: fix usb 3.0 support

* haze: improve host-to-device file transfer performance

* haze: report device serial

* haze: move static_assert to requires, fix alignment
2023-04-17 14:08:05 -07:00
Michael Scire
e9b28ab4b1 kern: adjust wording to be more technically correct 2023-03-27 10:54:58 -07:00
Michael Scire
1afb184c14 docs: pretend I know how to type common words 2023-03-14 01:52:06 -07:00
Michael Scire
5e070600a9 docs: add faq.md
"Alexa, what does June 15th mean?"
2023-03-14 01:48:19 -07:00
Michael Scire
8274081e39 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "b1607dc8a"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "b1607dc8a"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-03-13 17:17:50 -07:00
Michael Scire
f1ad26ce84 ams: bump version 2023-03-13 17:16:51 -07:00
Michael Scire
e4c314146e docs: update changelog 2023-03-13 17:16:33 -07:00
Michael Scire
52f00731d9 settings: add os guard 2023-03-12 22:34:23 -07:00
Michael Scire
476d658a79 ams: allow convertible-to-result in abort print macros 2023-03-11 15:14:33 -07:00
Michael Scire
7263022bac docs: mention bluetooth db feature 2023-03-10 10:24:19 -07:00
Michael Scire
e0e7aa1e2f set.mitm: misc style fixes for bluetooth db 2023-03-10 10:19:58 -07:00
ndeadly
bd9d8fff46
Add system setting to mirror bluetooth pairing database to sd card (#1787)
* ams_mitm: add ability to mirror bluetooth device pairing database to sd card via a system setting

* ams_mitm: address requested stylistic changes

* ams_mitm: make use of R_SUCCEED macro

* ams_mitm: use settings::BluetoothDevicesSettings instead of libnx type

* ams_mitm: fix logic error when truncating pairing database on read

* Update .ini comment

* ams_mitm: missing R_TRY around call to fs::FlushFile

* stratosphere: remove union from BluetoothDevicesSettings type

---------

Co-authored-by: ndeadly <24677491+ndeadly@users.noreply.github.com>
2023-03-10 10:06:38 -07:00
Michael Scire
61e3f0b391 windows: disable -fdata-sections
This causes all data to be emitted as .data$*. This breaks fzero-initialized-in-bss,
because linker puts stuff in .data even when it's all-zero and should end up in .bss.
2023-03-09 23:46:54 -07:00
Michael Scire
cd9b173318 windows: re-enable lto for os/fs libraries 2023-03-09 23:46:31 -07:00
Michael Scire
a8df400825 kern: fix stray addressof operator 2023-03-08 09:46:38 -07:00
Michael Scire
68040e2922 windows: add brave new mingw compat hook for gcc 12.2.0+ 2023-03-07 22:07:03 -07:00
Michael Scire
8da4d14e15 kern: minor cleanup (thanks @liamwhite) 2023-03-06 21:18:00 -07:00
Michael Scire
e2ebf9c0ff fatal: correct comment about pools 2023-03-01 03:21:51 -07:00
Michael Scire
5fb6f52b9e fatal: dynamically allocate memory as required (preferring system > nonsecure > unsafe) 2023-03-01 03:20:49 -07:00
Michael Scire
982389dceb os: add UnsafeMemory apis 2023-03-01 03:20:49 -07:00
Adubbz
f636596ee2 daybreak: scale title font size
(cherry picked from commit 035b37c615183bd387210a54d269346e3a9b379a)
2023-02-25 10:53:16 +11:00
Michael Scire
0a2440522f fatal: use a hack to be kinder wrt pl:u session limit 2023-02-23 22:06:49 -07:00
Michael Scire
3292ea5970 kern: fix stray comment copy/paste error 2023-02-23 22:00:00 -07:00
Michael Scire
33d42f4831 erpt: update server code for 16.0.0 logic changes 2023-02-23 21:51:51 -07:00
Michael Scire
46094cfb3e kern: increase non-dynamic heap sizes to 8 GB to match 2023-02-23 19:05:52 -07:00
Michael Scire
618691a500 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "af0d00890"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "af0d00890"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-02-23 09:01:41 -07:00
Michael Scire
356d89244f docs: add 1.5.0 pre-release changelog 2023-02-22 18:36:01 -07:00
Michael Scire
1ce3611695 git subrepo push emummc
subrepo:
  subdir:   "emummc"
  merged:   "bba1f1fb6"
upstream:
  origin:   "https://github.com/m4xw/emummc"
  branch:   "develop"
  commit:   "bba1f1fb6"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-02-22 18:26:15 -07:00
Michael Scire
1ab8b23444 emummc: try fixing commit id 2023-02-22 18:25:41 -07:00
Michael Scire
06b4738d54 emummc: re-update for 16.0.0 2023-02-22 18:24:51 -07:00
Michael Scire
b92c614347 git subrepo clone --force --branch=develop https://github.com/m4xw/emummc
subrepo:
  subdir:   "emummc"
  merged:   "4714b2df9"
upstream:
  origin:   "https://github.com/m4xw/emummc"
  branch:   "develop"
  commit:   "4714b2df9"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-02-22 18:23:27 -07:00
Michael Scire
99175c1149 loader: update usb3 patches for 16.0.0 2023-02-22 17:19:51 -08:00
Michael Scire
8876eedfb0 ncm: alignment was changed for PlaceHolderId/ContentId in 16.0.0 2023-02-22 17:19:51 -08:00
Michael Scire
bbcee8c77c ncm: fix inversion in activation skipping 2023-02-22 17:19:51 -08:00
Michael Scire
f7915c2c05 ncm: Add IntegratedContent*Impl 2023-02-22 17:19:51 -08:00
Michael Scire
668cabd4a2 ncm: first pass at ContentManagerImpl refactor (missing the IntegratedImpls, won't link) 2023-02-22 17:19:51 -08:00
Michael Scire
d64ab354ad kern: 16.x web applet crashes on exit with 48 MB stolen (rip) 2023-02-22 17:19:51 -08:00
Michael Scire
59b518783d ncm: fix copy/paste error in switch case 2023-02-22 17:19:51 -08:00
Michael Scire
6462101b6f strat: fix sysmodule building, bump version so I don't forget later 2023-02-22 17:19:51 -08:00
Michael Scire
0ea5dbcfbb libstrat: make build with new ncm/fs api changes (sysmodules probably fail to build) 2023-02-22 17:19:51 -08:00
Michael Scire
bb6446aada erpt: update for new ids 2023-02-22 17:19:51 -08:00
Michael Scire
e46e7e0eb1 boot2: update for 16.0.0 2023-02-22 17:19:51 -08:00
Michael Scire
cb89c66bd8 emummc: update for 16.0.0 2023-02-22 17:19:51 -08:00
Michael Scire
e85a512cf4 fusee/exo: implement the usual changes for new firmware support 2023-02-22 17:19:51 -08:00
Michael Scire
7d9fea01c3 kern: bump supported version to 16.x 2023-02-22 17:19:51 -08:00
Michael Scire
406320f6ec kern: better divide non-secure size, don't waste fatal memory unless necessary 2023-02-22 17:19:51 -08:00
Michael Scire
aad2be0a01 kern: delete creation time field from KProcess 2023-02-22 17:19:51 -08:00
Michael Scire
25383db524 kern: add InfoType_IoRegionHint 2023-02-22 17:19:51 -08:00
Michael Scire
48f4c526f3 kern: refactor priority inheritance to represent locks as C++ objects 2023-02-22 17:19:51 -08:00
Michael Scire
1279d236f3 kern: remove unnecessary interrupt disables from arbiter/condvar 2023-02-22 17:19:51 -08:00
Michael Scire
008eb974d4 kern: KConditionVariable::SignalToAddress now emits dmb before userspace write 2023-02-22 17:19:51 -08:00
Michael Scire
035cebef9d kern: refactor init (kill identity map, merge cpu on logic) 2023-02-22 17:19:51 -08:00
Michael Scire
8db22967bf kern: use variable-count parameter arrays for DebugEvents 2023-02-22 17:19:51 -08:00
Michael Scire
db510f96c3 kern: update KSystemControl::InitializePhase1, dynamically scale 39-bit address space regions 2023-02-22 17:19:51 -08:00
Michael Scire
6e2dd791b2 kern: update for new ChangePermissions page table operation 2023-02-22 17:19:51 -08:00
Michael Scire
bff61c68ab kern: adjust pool allocations 2023-02-22 17:19:51 -08:00
Michael Scire
ca7734ffaf kern: simplify KSchedulerLock::Lock 2023-02-22 17:19:51 -08:00
Michael Scire
ed22f802ee kern: allow QueryIoMapping to find Static mappings 2023-02-22 17:19:51 -08:00
Michael Scire
8ffc177b44 kern: update UnmapIoRegion for new Mapping_Memory handling 2023-02-22 17:19:51 -08:00
Michael Scire
c058376b3b kern: use tree for IoPool regions instead of list 2023-02-22 17:19:51 -08:00
Michael Scire
d5ebf13094 kern: optimize userspace access asm to use cheaper instruction in io memory loops 2023-02-22 17:19:51 -08:00
Michael Scire
695c125721 kern: use different psr masks for 64 and 32-bit El0 threads 2023-02-22 17:19:51 -08:00
Michael Scire
e7e3e7b374 kern: increase stack parameter size by 0x10 2023-02-22 17:19:51 -08:00
Michael Scire
3a5f406c5f kern: update scheduler for new switch count tracking logic 2023-02-21 03:12:17 -07:00
Michael Scire
8176f085f1 gpio: really not sure how this works before, lol 2023-01-30 23:13:45 -07:00
Michael Scire
7a69f2f062 kern/pm: only steal 8 MB from applet.
WebApplet crashes on exit with 16 more MB stolen, apparently.
2023-01-24 19:54:28 -07:00
Michael Scire
32b590e7ab git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "b7711b8fb"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "b7711b8fb"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2023-01-24 14:39:54 -07:00
Michael Scire
590f22933d docs/ams: bump version to 1.4.1 2023-01-24 14:39:06 -07:00
Michael Scire
0dd071b279 romfs: thank you fire emblem, very cool (closes #2021) 2023-01-24 14:07:50 -07:00
Michael Scire
f1132fbf5a romfs: push clobber fix missed by git add 2023-01-24 14:03:54 -07:00
Michael Scire
9cd57b6c61 romfs: reduce peak allocation sizes by enabling intermediate context frees 2023-01-24 14:02:05 -07:00
0x8ff
bf66e40a7b Update ReSwitched Team URL
reswitched.team is a dead domain no longer owned by the ReSwitched Team
2023-01-20 19:01:33 -08:00
Michael Scire
77cc53227a sdmmc: fix wrong mode select for GcAsic(Fpga)Speed 2023-01-19 21:47:19 -07:00
Michael Scire
59a295db79 sdmmc: fix missing call to GetSdStatus at non-uhsi mode 2023-01-19 21:44:44 -07:00
Michael Scire
e4b9930bf3 kern: fix unnecessarily strong load in aligned spinlock
Copy-paste error I didn't notice for two years, whoops
2022-12-25 01:56:31 -07:00
Michael Scire
04c9004e05 erpt: fix multiple issues with automatic report cleanup (thanks @yellows8)
* Setting retrieval was performed before the call that used the setting.
* Call to detect number of files passed incomplete path and was guaranteed to fail.
* Call to delete reports passed incomplete path and was guaranteed to do nothing.
2022-12-13 01:08:13 -07:00
Michael Scire
1f8798ace7 kern: fix GetProcessId wrong result on invalid parameter 2022-12-04 13:40:44 -07:00
Michael Scire
ff7a80e592 dmnt: allow string termination to end a toggle (closes #1980) 2022-10-28 14:14:38 -07:00
Michael Scire
e3ace4be15 exo: fix MemoryArrange enum typo 2022-10-19 15:18:08 -07:00
Michael Scire
36a33617a4 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "b2232894f"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "b2232894f"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2022-10-18 11:11:09 -07:00
Michael Scire
8ce4f19615 ncm: update enums, refactor comparison operators 2022-10-18 11:10:17 -07:00
Michael Scire
05fee5d53c fusee: fix 15.x exFAT nogc patch 2022-10-16 15:45:47 -07:00
Michael Scire
f88606fbc1 gdbstub: fix reading module name for homebrew 2022-10-15 15:13:05 -07:00
Michael Scire
e580c3970c git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "363fba0cf"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "363fba0cf"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2022-10-12 09:16:51 -07:00
Michael Scire
2603136e8b ams: add changelog for 1.4.0 2022-10-12 09:15:16 -07:00
Michael Scire
3d3f8629af loader: update usb3 enable patches for 15.0.0 2022-10-12 09:15:16 -07:00
Michael Scire
d178ea368a lr: new AOC commands use MapAlias for paths... 2022-10-12 09:15:16 -07:00
Michael Scire
b444385762 git subrepo push emummc
subrepo:
  subdir:   "emummc"
  merged:   "4714b2df9"
upstream:
  origin:   "https://github.com/m4xw/emummc"
  branch:   "develop"
  commit:   "4714b2df9"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2022-10-12 09:15:16 -07:00
Michael Scire
0c3f1bed33 emummc: update for 15.0.0 2022-10-12 09:15:16 -07:00
Michael Scire
bf4fdf6188 kern: update for new exception flag semantics 2022-10-12 09:15:16 -07:00
Michael Scire
13238fc4fd kern: use slab allocated KSessionRequest dynamic mappings 2022-10-12 09:15:16 -07:00
Michael Scire
e7a1e0fee2 kern: implement Svc(Un)MapInsecureMemory 2022-10-12 09:15:16 -07:00
Michael Scire
5a918f3bc9 kern: move SecureAppletMemory/KPageBuffer heap into the ResourceRegion 2022-10-12 09:15:16 -07:00
Michael Scire
ea82889e6c kern: increase stack region size when thread resource limit is increased 2022-10-12 09:15:16 -07:00
Michael Scire
7f2cbba543 kern: Implement new PageTable operations/PhysicalMemory reference semantics 2022-10-12 09:15:16 -07:00
Michael Scire
5ee7d8a5ed kern: update for new device map semantics 2022-10-12 09:15:16 -07:00
Michael Scire
947fdcf6f6 kern: merge/simplify KInterruptEventTask into KInterruptEvent 2022-10-12 09:15:16 -07:00
Michael Scire
2e73f33eb0 kern: implement K(Secure)SystemResource 2022-10-12 09:15:16 -07:00
Michael Scire
752704a798 kern: update handle table init 2022-10-12 09:15:16 -07:00
Michael Scire
d00406e089 os: update os namespace for 15.0.0, loader/ro: update to use csrng, spl: bump max sessions 2022-10-12 09:15:16 -07:00
Michael Scire
dddb5bfdea boot2: launch new eth sysmodule after bsdsockets 2022-10-12 09:15:16 -07:00
Michael Scire
ed0572bd53 erpt: update IDs for 15.0.0 2022-10-12 09:15:16 -07:00
Michael Scire
b3bbc99cfb ams.mitm: fix up ContentInfo construction 2022-10-12 09:15:16 -07:00
Michael Scire
0ebbbc839f fusee/exo: fix up dram id names/mappings 2022-10-12 09:15:16 -07:00
hexkyz
275c0234cb exo: add new dram ids 2022-10-12 09:15:16 -07:00
Michael Scire
427130a122 ncm: update for new add on content/attr changes 2022-10-12 09:15:16 -07:00
hexkyz
ef07964ea0 fusee: update sdram handling for 15.0.0 2022-10-12 09:15:16 -07:00
Michael Scire
e1aff401ba lr: add support for location resolver disable commands 2022-10-12 09:15:16 -07:00
Michael Scire
05de5538d6 ncm: GetContentAccessibilities, GetContentInfo* 2022-10-12 09:15:16 -07:00
Michael Scire
9929517a83 fusee/exo: enum support for 15.0.0 2022-10-12 09:15:16 -07:00
Michael Scire
545765d167 ams/fuse: update version numbers, update DramId read logic 2022-10-12 09:15:16 -07:00
Michael Scire
8d9e3f2a31 boot: fix ChargerDriver inititalization correctness (thanks @CTCaer) 2022-09-16 15:34:38 -07:00
Michael Scire
28f0940c58 diag: fix process name cache 2022-08-11 14:19:26 -07:00
Michael Scire
d954e85826 fs/emummc: fix DirectoryRedirectionFileSystem not stripping prefix 2022-08-06 08:48:51 -07:00
Michael Scire
7e6b369605 ns.mitm/fs.mitm: allow program specific web override for non-hbl, if present 2022-07-25 16:24:57 -07:00
Liam
e702eab21c KScheduler: fix documentation mistakes 2022-06-29 17:28:26 -07:00
Liam
592b9c66d1 gdbstub: report architecture tag for ARM targets 2022-06-29 17:28:03 -07:00
Michael Scire
8e17feff94 os: pthread_yield is deprecated, don't use it on linux 2022-06-27 15:36:04 -07:00
Michael Scire
6514e365ad gdbstub: fix threads with invalid characters for packets (closes #1904) 2022-06-16 00:11:44 -07:00
Michael Scire
efa4a346af os: silence warning building with gcc 12 on windows 2022-06-12 01:38:04 -07:00
Michael Scire
d75f9bbedf fs: add extension GetEntryList to AesCtrCounterExtendedStorage 2022-06-11 16:54:02 -07:00
Michael Scire
ea7f51a279 os: fix whoops in SetMemoryPermission on windows 2022-06-11 00:58:14 -07:00
Michael Scire
a65b6df8d2 os: implement MemoryHeapManager, SetMemoryAttribute 2022-06-10 22:36:03 -07:00
Michael Scire
4e112de223 dmnt.gen2: fix gt, optimize 2022-06-08 00:49:47 -07:00
Michael Scire
20d200471d kern: optimize postfix-compare to prefix-compare, result logic is identical but breaks earlier in some paths 2022-06-07 23:49:31 -07:00
Michael Scire
5f2d713fe4 kern: mea culpa (some time since 7.x) 2022-06-07 23:40:32 -07:00
Michael Scire
114d2598da dmnt.gen2: sanitize brackets in thread names to be valid xml 2022-06-07 22:03:37 -07:00
Michael Scire
36bdb83cfc util: prevent optimizer from removing endian-swapped writes 2022-06-05 22:57:18 -07:00
Michael Scire
a975689c59 ams: address some warnings when building with gcc-12 2022-06-05 22:57:08 -07:00
Michael Scire
a809e23320 lr: update capacity constants to reflect 12.0.0 changes 2022-05-26 18:44:12 -07:00
Michael Scire
4db485083b strat: update for code changes found in boot (closes #1797) 2022-05-05 17:45:55 -07:00
Michael Scire
e96972c939 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "b91294d3b"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "b91294d3b"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2022-04-29 16:15:06 -07:00
Michael Scire
3545c0aac2 ams: fs accuracy fixes, bump to 1.3.2 2022-04-29 16:14:01 -07:00
Michael Scire
d85875b910 os: fix various regressions since 1.3.1 2022-04-29 15:46:55 -07:00
Michael Scire
b1367942a2 os: fix minor bug (and simplify) MapProcessCodeMemory 2022-04-18 01:43:49 -07:00
Michael Scire
c2c0a2e169 ro/os: use os primitives for MapProcessCodeMemory 2022-04-18 01:39:22 -07:00
Michael Scire
f5052b4bca loader: update for changes in 14.0.0 2022-04-17 20:11:05 -07:00
Michael Scire
70d67bb115 loader: use os apis for interacting with process memory 2022-04-17 18:51:36 -07:00
Michael Scire
9056e0b05f strat: fix linux clang build 2022-04-17 14:01:03 -07:00
Michael Scire
895b6d0470 optional: add c++23 monadic interface 2022-04-17 12:17:25 -07:00
Michael Scire
dfba595cdc fs: fix null check in AesXtsStorageExternal 2022-04-16 12:28:40 -07:00
Michael Scire
175a34da43 os: silence a maybe-uninit warning 2022-04-16 12:28:21 -07:00
Michael Scire
02b126c2be os: refactor multi wait apis to better match Nintendo's latest implementation 2022-04-12 16:47:36 -07:00
Michael Scire
b45671fd35 fs: QueryEntry uses NonSecure buffers 2022-04-08 11:23:39 -07:00
Michael Scire
106599895d fs: fix memory leak when path is reallocated (closes #1842) 2022-04-08 11:02:17 -07:00
Michael Scire
80154b0a54 os: broadcast, not signal, on release more than 1 sema 2022-04-07 12:17:13 -07:00
Michael Scire
62eb4d6989 docs: add changelog for 1.3.1 2022-04-04 17:48:18 -07:00
Michael Scire
b52e44e798 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "590cdaf02"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "590cdaf02"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2022-04-04 17:47:56 -07:00
Michael Scire
72baa4ff18 ams: add enum recognition for 14.1.0 2022-04-04 17:44:56 -07:00
Michael Scire
442656899f util: update some bit utility logic 2022-04-03 10:51:46 -07:00
Michael Scire
d7f89a0c31 fs: update signature for VerifySign1 2022-04-01 21:06:26 -07:00
Michael Scire
2e6223d9d0 fssystem: add unique lock apis 2022-03-28 14:29:22 -07:00
Michael Scire
28f11a86fd fs: update romfs types 2022-03-28 13:57:06 -07:00
Michael Scire
a8b52dc123 fs: remove dead code 2022-03-28 08:37:08 -07:00
Michael Scire
9b47ddf01f fs: update LocalFileSystem 2022-03-28 01:33:40 -07:00
Michael Scire
0fbf007bcf fs: fixup all OperateRange implementations 2022-03-28 00:54:10 -07:00
Michael Scire
4ad8dad416 os: add DetachIoRegionHandle 2022-03-28 00:00:36 -07:00
Michael Scire
8e258bde9d util: LockFreeAtomicType (for time) 2022-03-27 20:15:10 -07:00
Michael Scire
c0d5140ef0 strat: add windows socket api, linux/macos TODO 2022-03-27 14:36:31 -07:00
Michael Scire
1bef1b58d4 fs: also update comment, for locking 2022-03-26 15:29:38 -07:00
Michael Scire
07cd682460 fs: fix inverted optional-lock condition 2022-03-26 15:28:40 -07:00
Michael Scire
e5c3d264ec fs: implement new 14.0.0 spl-ctr dispatch semantics 2022-03-26 15:21:12 -07:00
Michael Scire
bbf22b4c60 ams: globally prefer R_RETURN to return for ams::Result 2022-03-26 14:48:33 -07:00
Michael Scire
dd78ede99f ams: use R_SUCCEED, R_THROW globally 2022-03-26 00:14:36 -07:00
Michael Scire
e5b1739f65 fatal: yield our lbl session unless needed 2022-03-25 23:47:20 -07:00
Michael Scire
a4a2cc2218 fs: update IStorage::Check functions for 14.0.0 2022-03-25 23:29:36 -07:00
Michael Scire
5ffbed1bee fs: update a few loose missed results 2022-03-25 10:02:55 -07:00
Michael Scire
ec44eaa263 fs: update nca drivers (and dependents/callees) for 14.0.0 changes 2022-03-25 09:48:24 -07:00
Michael Scire
20e53fcd82 fs: update HashGeneratorFactorySelector to reflect 14.0.0 2022-03-24 21:57:37 -07:00
SciresM
64c6ef2de7
fs: reduce path size 0x28 -> 0x18
This implements two optimizations on fs::Path, which N added in 12.0.0.

The current structure looks like: 

```cpp
struct Path {
    const char *m_str; // Points to the read-only path string
    char *m_write_buffer_buffer; // Part of std::unique_ptr<char[], ams::fs::impl::Deleter>
    ams::fs::impl::Deleter m_write_buffer_deleter; // Parse of std::unique_ptr<char[], ams::fs::impl::Deleter>, stores the size of the buffer.
    size_t m_write_buffer_length; // Copy of the write buffer's size accessible to the Path() structure.
    bool m_is_normalized; // Whether the path buffer is normalized
};
```

This is pretty wasteful. The write buffer size is stored twice, wasting 8 bytes, because one copy of the size isn't accessible to the path.

In addition, due to alignment, the bool wastes 7 padding bytes.

This commit:

* Encodes normalized in the low bit of the write buffer length, saving 8 bytes.
* Use a custom WriteBuffer class rather than generic unique_ptr, to avoid needing to store the WriteBuffer twice.


These each save 8 bytes, for a final size of 0x18 rather than 0x28.
2022-03-24 20:22:47 -07:00
Michael Scire
817ad8f98d util: pointer traits only if <memory>/stratosphere 2022-03-24 18:24:19 -07:00
Michael Scire
dfa475a769 util: add pointer utils, use to constrain fs pointers 2022-03-24 16:21:03 -07:00
Michael Scire
141ae5c7ab fs: fix removed include 2022-03-24 13:31:49 -07:00
Michael Scire
4646581e93 fs: for my sanity, begin tracking version where code was last checked for accuracy 2022-03-24 08:43:40 -07:00
Michael Scire
b69fa13576 fatal: fix usage of removed bpc api in 14.0.0 2022-03-23 19:11:37 -07:00
Michael Scire
0da15a30fd git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "726a7efdd"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "726a7efdd"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2022-03-23 13:45:59 -07:00
Michael Scire
44d553d12e loader: add usb-3 patch for 14.0.0 2022-03-23 13:45:28 -07:00
Michael Scire
6f54ab5716 fs: fix out of bounds access when parsing directory paths 2022-03-23 13:38:34 -07:00
Michael Scire
596a0f2551 ams.mitm: wrong stack was increased 2022-03-23 11:51:16 -07:00
Michael Scire
ff828dc0bc ams.mitm: increase sysupdater stack size (as needed by new ncm code) 2022-03-23 11:37:30 -07:00
Michael Scire
027f3b4911 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "af48924e5"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "af48924e5"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2022-03-23 11:25:46 -07:00
Michael Scire
3fff114b14 crypto: fix aes-128 dec on arm64/cortex-a57 2022-03-23 11:24:43 -07:00
Michael Scire
f23f490cb4 strat: fix clang build 2022-03-23 10:39:20 -07:00
Michael Scire
c503629ac8 ams.mitm: fix reboot to payload 2022-03-23 10:17:00 -07:00
Michael Scire
6b436739be git subrepo push emummc
subrepo:
  subdir:   "emummc"
  merged:   "56a2e8a20"
upstream:
  origin:   "https://github.com/m4xw/emummc"
  branch:   "develop"
  commit:   "56a2e8a20"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2022-03-23 09:22:50 -07:00
Michael Scire
4f763b2aa4 emummc: integrate updates for 14.0.0 2022-03-23 09:22:22 -07:00
Michael Scire
12d83106fd git subrepo clone --branch=develop https://github.com/m4xw/emummc emummc
subrepo:
  subdir:   "emummc"
  merged:   "a9d569594"
upstream:
  origin:   "https://github.com/m4xw/emummc"
  branch:   "develop"
  commit:   "a9d569594"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2022-03-23 09:20:54 -07:00
Michael Scire
e3cb5e74b9 emummc: temp delete 2022-03-23 09:20:31 -07:00
Michael Scire
b1a4a0db67 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "d97cdde1a"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "d97cdde1a"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2022-03-23 09:17:52 -07:00
Michael Scire
847fee4901 docs: fix changelog, some 2022-03-23 09:13:47 -07:00
Michael Scire
f2b48d466f docs: add basic changelog for 1.3.0 2022-03-23 09:10:50 -07:00
Michael Scire
6e97dff27f exo: fix typo causing mishandling of carveouts 2022-03-23 09:10:50 -07:00
Michael Scire
be399772c0 emummc: add 14.0.0 patches 2022-03-23 09:10:50 -07:00
Michael Scire
45da60f902 kern: turns out changing base address gives pretty elfs but breaks relocs 2022-03-23 09:10:50 -07:00
Michael Scire
01fd324d4f os/dd: add missing semicolon to new cache logic 2022-03-23 09:10:50 -07:00
Michael Scire
f95bdb87a0 exo: right, Mariko* is a wiki-ism 2022-03-23 09:10:50 -07:00
Michael Scire
91d3d242f5 exo: update for new dram ids 2022-03-23 09:10:50 -07:00
Michael Scire
383fc2cc99 kern: codegen tweaks, now that we're no longer -Os 2022-03-23 09:10:50 -07:00
Michael Scire
1ca2f61527 kern: good night sweet prince 2022-03-23 09:10:50 -07:00
Michael Scire
cdc619a8a6 kern: on second thought, gcc built ins are for chumps 2022-03-23 09:10:50 -07:00
Michael Scire
ff07ba4201 kern: implement revised IPI/SGI semantics 2022-03-23 09:10:50 -07:00
Michael Scire
9d89835ff8 kern: update for new hw maintenance semantics 2022-03-23 09:10:50 -07:00
Michael Scire
6e17317d5d kern: implement new thread context/fpu semantics 2022-03-23 09:10:50 -07:00
hexkyz
79afa3b64c fusee: add unused mtc table 2022-03-23 09:10:50 -07:00
hexkyz
f3968f5f7c fusee: add new sdram params 2022-03-23 09:10:50 -07:00
hexkyz
a8e23adffe fusee: add new mtc tables 2022-03-23 09:10:50 -07:00
Michael Scire
401047f603 kern: implement additional randomness in KPageHeap allocations 2022-03-23 09:10:50 -07:00
Michael Scire
24739f245e kern: enforce end of dram == end of partitions (move our probably outdated KTraceBuffer to new location) 2022-03-23 09:10:50 -07:00
Michael Scire
8cb3cfd835 kern: add new KCapability checks before creating process 2022-03-23 09:10:50 -07:00
Michael Scire
14e768cd10 kern: add InfoType_IsSvcPermitted 2022-03-23 09:10:50 -07:00
Michael Scire
ef1b67b87b kern: enforce maximum secure region size 2022-03-23 09:10:50 -07:00
Michael Scire
8ef6c49d30 kern: print kernel backtrace on panic 2022-03-23 09:10:50 -07:00
Michael Scire
a89c5dd5d7 ncm: hot take, uninitialized data bad 2022-03-23 09:10:50 -07:00
Michael Scire
dfcb5005d2 fs/sprof/build: fix minor issues 2022-03-23 09:10:50 -07:00
Michael Scire
f3e3649bd5 pm: grant access to GetResourceLimitPeakValue 2022-03-23 09:10:50 -07:00
Michael Scire
07f91f0a83 boot2: launch omm before am 2022-03-23 09:10:50 -07:00
Michael Scire
81005fa3f8 pgl: style nitpick 2022-03-23 09:10:50 -07:00
Michael Scire
60d78bbf75 pgl: hook up logic for enabling extra system threads 2022-03-23 09:10:50 -07:00
Michael Scire
247852db3a pm: hook up the new libnx apis 2022-03-23 09:10:50 -07:00
Michael Scire
51c145f6c9 fusee: update static_assert on key generation 2022-03-23 09:10:50 -07:00
Michael Scire
74fddf667a pm: loosen restriction on resource limit boost 2022-03-23 09:10:50 -07:00
Michael Scire
027242e909 erpt: update id map 2022-03-23 09:10:50 -07:00
Michael Scire
86f98e49c7 sf: add another sanity assert 2022-03-23 09:10:50 -07:00
Michael Scire
3579797309 sf: add new debug-interface-id in cmif out header 2022-03-23 09:10:50 -07:00
Michael Scire
77b3bfcd16 sprofile: fix/simplify import count calculation 2022-03-23 09:10:50 -07:00
Michael Scire
fa98bf9434 libstrat: misc fixes for unused arg warnings 2022-03-23 09:10:50 -07:00
Michael Scire
e975784179 fatal: update for new 14.0.0 command 2022-03-23 09:10:50 -07:00
Michael Scire
dc643daaa7 kern: update version (note: actual 14-kernel diff/impl todo) 2022-03-23 09:10:50 -07:00
Michael Scire
e05df99342 pm/kern: update for 14.0.0 2022-03-23 09:10:50 -07:00
Michael Scire
0cfc93d423 sprofile: update for 14.0.0 (orphaned profiles now deleted on import) 2022-03-23 09:10:50 -07:00
Michael Scire
588d761615 exo/fusee: first pass at updating enums for 14.0.0 2022-03-23 09:10:50 -07:00
Michael Scire
320a946fc7 ncm: update client code to better reflect latest sysupdate 2022-03-21 17:21:44 -07:00
Michael Scire
ca142889c4 strat: only include windows.h in translation units where actually needed 2022-03-21 17:21:44 -07:00
Michael Scire
000713186f windows: link libgcc/libstdc++ statically 2022-03-21 17:21:44 -07:00
Michael Scire
c35114bacc fs: utilities for hac2l to print gc headers 2022-03-21 17:21:44 -07:00
Michael Scire
2d984822c6 fs: add gc validation wrappers for hac2l 2022-03-21 17:21:44 -07:00
Michael Scire
32d443977e fs: add indirection to raw storage open, for hac2l 2022-03-21 17:21:44 -07:00
Michael Scire
9866285f0e util: update function dtors, update gitignore 2022-03-21 17:21:44 -07:00
Michael Scire
9911c44670 lz4: update to git-master 2022-03-21 17:21:44 -07:00
Michael Scire
741efd04ec strat: minor result/overflow check fixes 2022-03-21 17:21:44 -07:00
Michael Scire
e13b81aa9e fs: revise allocation-fail result names 2022-03-21 17:21:44 -07:00
Michael Scire
11e4bed199 strat: revise fs unsupported operation results, add overflow utils 2022-03-21 17:21:44 -07:00
Michael Scire
ba4e7c5866 fs: fix inverted alignment determination in compressed storage 2022-03-21 17:21:44 -07:00
Michael Scire
da1b24b9b5 fs: fix locking in FileSystemBufferManager 2022-03-21 17:21:44 -07:00
Michael Scire
cb3d20ef79 fs: fix clang-build, os: StackGuardManager 2022-03-21 17:21:44 -07:00
Michael Scire
be9338eb33 fs: move bitmap classes out of save:: 2022-03-21 17:21:44 -07:00
Michael Scire
7a69723021 fs: fix missing mutex acquire in compressed storage invalidate/find 2022-03-21 17:21:44 -07:00
Michael Scire
d638bbbb62 fs: first pass at compressed storage (works on iridium with wip hac2l code) 2022-03-21 17:21:44 -07:00
Michael Scire
df631d74f0 fssrv: add ExternalKeyManager (rights-id crypto) for hac2l 2022-03-21 17:21:44 -07:00
Michael Scire
3c6d965e1a symbols: use same strategy on windows as on macOS 2022-03-21 17:21:44 -07:00
Michael Scire
49cddd68e4 use cxxabi for demangling on linux/windows 2022-03-21 17:21:44 -07:00
Michael Scire
ee5f99fdb4 Implement working macOS backtrace symbolization 2022-03-21 17:21:44 -07:00
Michael Scire
7456a77ba9 os: add working stack logic for macOS 2022-03-21 17:21:44 -07:00
Michael Scire
a3865e721a fix stack getting on linux, add test 2022-03-21 17:21:44 -07:00
Michael Scire
6aab36fc6a diag: fix typo in hos-specific backtrace getter 2022-03-21 17:21:44 -07:00
Michael Scire
79b1835a2b crypto: add ability to hash data at compile time, for future diag use 2022-03-21 17:21:44 -07:00
Michael Scire
646f84bad1 abort/error: print backtrace, abuse templates, overhaul result/diag (macos not done yet) 2022-03-21 17:21:44 -07:00
Michael Scire
18168d54c3 lib: simplify pragma macros 2022-03-21 17:21:44 -07:00
Michael Scire
edf80192d9 remove leftover debug print 2022-03-21 17:21:44 -07:00
Michael Scire
13697fa921 libs: add ongoing work to facilitate hactool rewrite 2022-03-21 17:21:44 -07:00
Michael Scire
706b8492fd libs: begin adding capacity for doing crypto on generic os (using externally-preset keys) 2022-03-21 17:21:44 -07:00
Michael Scire
6368d8063a fs: add just in case bounds checking to linux/macos dirent read 2022-03-21 17:21:44 -07:00
Michael Scire
1933f35db6 add basic tests for os::Event/SystemEvent functionality 2022-03-21 17:21:44 -07:00
Michael Scire
64a97576d0 ams: support building unit test programs on windows/linux/macos 2022-03-21 17:21:44 -07:00
Michael Scire
9a38be201a erpt: add automatic report cleanup mechanism on boot (closes #1795) 2022-03-17 00:31:38 -07:00
merry
9545cbb4cb KThreadContext: Use El0PsrMask constant in GetUserContext 2022-03-06 11:22:28 -08:00
Michael Scire
2b6719ec25 ams_mitm: update to use new NcaFileSystemDriver intf 2022-02-21 15:17:17 -08:00
Michael Scire
e08f754646 crypto: fix asm constraints for memory comparison 2022-02-21 15:17:17 -08:00
Michael Scire
3f6010b4dc fix SubStorage copy ctor/= op for new shared_ptr member 2022-02-21 15:17:17 -08:00
Michael Scire
01f7f567b9 fs: add Sha256HashGenerator, LZ4 decompressor 2022-02-21 15:17:17 -08:00
Michael Scire
a2aec363d7 fs: remove now unused StorageOption 2022-02-21 15:17:17 -08:00
Michael Scire
52296fc2dd fs: revise NcaFileSystemDriver for latest semantics 2022-02-21 15:17:17 -08:00
Michael Scire
ccf29a1302 fssystem: revise allocator logic for latest semantics 2022-02-21 15:17:17 -08:00
Michael Scire
28ea6555f8 fssrv: flesh out the program registry 2022-02-21 15:17:17 -08:00
Michael Scire
e8d14eb77d fssrv: skeleton more program registry logic 2022-02-21 15:17:17 -08:00
Michael Scire
33701bb387 fssrv: add skeleton getters for service object sf::SharedPointers 2022-02-21 15:17:17 -08:00
Michael Scire
f3dbdc2391 fs: allocations with mutex held must be unsafe 2022-02-21 15:17:17 -08:00
Michael Scire
64b4cc25fc fs: implement newer allocator templates 2022-02-21 15:17:17 -08:00
Michael Scire
ace409ccec fssrv: skeleton server manager setup/registration 2022-02-21 15:17:17 -08:00
Michael Scire
0e08aa0a31 fssrv: add placeholder for ipc interface 2022-02-21 15:17:17 -08:00
Michael Scire
94de5bf4f4 fs: add skeleton dir for sysmodule code
Please note this isn't likely to immediately be the active ams project.
2022-02-21 15:17:17 -08:00
Michael Scire
4c7fd70c10 kern: fix syntax in audit statement 2022-02-19 13:26:08 -08:00
Michael Scire
36e3519982 strat: add missing semicolon 2022-02-16 22:13:41 -08:00
Michael Scire
7668dfb756 lib: add missing semicolon 2022-02-16 12:55:12 -08:00
Michael Scire
2fce50471b build: remove unnecessary g-dwarf4 flags 2022-02-14 14:58:52 -08:00
SciresM
96f95b9f95
Integrate new result macros. (#1780)
* result: try out some experimental shenanigans

* result: sketch out some more shenanigans

* result: see what it looks like to convert kernel to use result conds instead of guards

* make rest of kernel use experimental new macro-ing
2022-02-14 14:45:32 -08:00
Michael Scire
375ba615be typofix: boogaloo: electric. 2022-02-10 19:49:05 -08:00
Michael Scire
42124fd7d8 fix typo-bug in HierarchicalSha256Storage::Read 2022-02-10 19:43:00 -08:00
Michael Scire
173d5c2d3a docs: add changelog for 1.2.6 2022-01-19 16:41:20 -08:00
Michael Scire
52c1cef064 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "0d161b858"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "0d161b858"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2022-01-19 16:29:16 -08:00
Michael Scire
4efa5d7dd0 ams: first attempt at 13.2.1 support 2022-01-19 16:28:32 -08:00
Michael Scire
275da52305 kern: add missing debug mode check to WriteDebugProcessMemory 2022-01-03 08:59:27 -08:00
Michael Scire
30fac905af ams: deduplicate static initialization logic 2021-12-13 13:07:03 -08:00
Michael Scire
78f7218c4f kern: fix vi devicename missing in HsSupported device list 2021-12-10 18:58:18 -08:00
Michael Scire
09c6aa29dd sf/cmif: optimize dispatch table walk to use binary search over linear search 2021-12-06 13:13:46 -08:00
Michael Scire
1019bc54e6 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "c4d0335b7"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "c4d0335b7"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-11-30 16:53:56 -08:00
Michael Scire
96631d8225 bump version to 1.2.5, fix enum for 13.2.0 2021-11-30 16:53:32 -08:00
Michael Scire
d32dd0f04a git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "b670c079f"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "b670c079f"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-11-30 16:35:09 -08:00
Michael Scire
ddfc16731f ams/hos: add enum support for 13.2.0 2021-11-30 16:22:57 -08:00
Pablo Curiel
26714c7f3b
ldr_embedded_usb_patches: add support for HOS 13.0.0 and 13.1.0 + remove superfluous comments. (#1718) 2021-11-26 00:39:22 -07:00
Michael Scire
767e702a70 kern: correct TotalUserPhysicalMemorySize (closes #1710) 2021-11-16 23:18:47 -08:00
Michael Scire
9d5e652fbd kern: be a little more consistent about pragma GCC location 2021-11-16 11:25:57 -08:00
Michael Scire
1d39e06f32 test/svc: add test for thread create 2021-11-08 13:29:00 -08:00
Michael Scire
21b7884653 test/svc: add test for thread pinning/SynchronizePreemptionState 2021-11-08 13:05:06 -08:00
Michael Scire
14ad2f0ba0 unit testing: catch -> doctest (faster compile, thread-safe) 2021-11-08 11:55:21 -08:00
Michael Scire
fcc7ce49d9 sm/tipc: ensure technical-correctness of sins (no page cost) 2021-11-06 20:05:32 -07:00
Michael Scire
f98c7cba98 sm: save 0x5000 of memory by sinning 2021-11-06 19:33:08 -07:00
Léo Lam
496adb0018
Minor header fixes to reduce parsing issues with Clang (#1700)
* Work around Clang's incomplete C++20 support for omitting typename

* vapours: fix Clang error about missing return in constexpr function

* stratosphere: fix call to non-constexpr strlen in constexpr function

strlen being constexpr is a non-compliant GCC extension; Clang
explicitly rejects it: https://reviews.llvm.org/D23692

* stratosphere: add a bunch of missing override specifiers

* stratosphere: work around Clang consteval bug

Minimal example: https://godbolt.org/z/MoM64v93M

The issue seems to be that Clang does not consider f(x) to be a
constant expression if x comes from a template argument that isn't
a non-type auto template argument (???)

We can work around this by relaxing GetMessageHeaderForCheck (by using
constexpr instead of consteval). This produces no functional changes
because the result of GetMessageHeaderForCheck() is assigned to a
constexpr variable, so the result is guaranteed to be computed
at compile-time.

* stratosphere: fix missing require clauses in definitions

GCC not requiring the require clauses to be repeated for member
definitions is actually a compiler bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96830

Clang rejects declarations with missing require clauses.

* Fix ALWAYS_INLINE_LAMBDA and parameter list relative order

While GCC doesn't seem to care about the position of the always_inline
attribute relative to the parameter list, Clang is very picky
and requires the attribute to appear after the parameter list
(and before a trailing return type)

* stratosphere: fix static constexpr member variable with incomplete type

GCC accepts this for some reason (because of the lambda?) but Clang
correctly rejects this.
2021-11-06 18:19:34 -07:00
Michael Scire
09074798cd KScheduler big brain strat for mdscr_el1 cfg change 2021-11-05 23:38:43 -07:00
Michael Scire
e256261b80 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "ff2883361"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "ff2883361"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-11-04 13:40:55 -07:00
Michael Scire
47218f0da8 ams: overhaul fs.mitm romfs ownership, bump to 1.2.4 2021-11-04 13:38:41 -07:00
Michael Scire
409a48ec73 docs: add changelog for 1.2.3 2021-11-04 00:23:23 -07:00
Michael Scire
0c93cefd39 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "e7b84767c"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "e7b84767c"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-11-04 00:00:26 -07:00
Michael Scire
0bbc907907 git subrepo pull (merge) libraries
subrepo:
  subdir:   "libraries"
  merged:   "8764bd406"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "12d0ba172"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-11-03 23:59:17 -07:00
Michael Scire
4a4a1f0e87 ams: bump api version to 1.2.3 2021-11-03 23:57:30 -07:00
Michael Scire
705dd95375 dmnt2: fix gdb register output 2021-11-03 23:56:25 -07:00
Michael Scire
2d5751356b creport: fix errant ) 2021-11-03 23:56:25 -07:00
Michael Scire
b140834b7e dmnt2: try to avoid writing out of bounds when generating packets 2021-11-03 23:56:25 -07:00
Michael Scire
e3d2af6b3f dmnt2: fix module name detection, add auto-break on hb nro launch 2021-11-03 23:56:25 -07:00
jam1garner
c17ad1e0e3 dmnt2: fix missing null-terminator for invalid command error 2021-11-03 23:56:25 -07:00
Michael Scire
6145b3b72c dmnt2: detect thread name, add monitor get mapping(s), increase buffer sizes 2021-11-03 23:56:25 -07:00
Michael Scire
aba7e4ca7d dmnt2: remove memory-map output which does nothing for us 2021-11-03 23:56:25 -07:00
Michael Scire
4cc5e9cdfd kern/dmnt2: allow retrieval of process info via extension
This also fixes ctrl-c break in gdbstub, and fixes crash on unknown monitor cmd.
2021-11-03 23:56:25 -07:00
Michael Scire
ca0308c7ca dmnt2: first pass at wait-for-application 2021-11-03 23:56:25 -07:00
Michael Scire
1d908295fe dmnt2: add monitor get base, TODO responses for monitor wait * 2021-11-03 23:56:25 -07:00
Michael Scire
277bd101c5 dmnt2: add memory-map read, improve module shared-lib names 2021-11-03 23:56:25 -07:00
Michael Scire
3dce23773a Adding setting usage to dmnt2 means dmnt2 needs settings access 2021-11-03 23:56:25 -07:00
Michael Scire
4489513f7c dmnt: enable experimental standalone usage of gdbstub, while starlink is in dev 2021-11-03 23:56:25 -07:00
Michael Scire
5eabca7f04 ams.mitm: more romfs building space/time tradeoffs.
This is needed for Animal Crossing 2.0.0, which has >99000 fucking files.

We now do several passes over dir/file tables instead of one pass,
doing entire hash tables before we touch dir/file tables. Thus we
no longer need to simultaneously allocate hash table and dir/file table space.

In addition, we now do repeated passes building a segment of hash tables
at a time, when insufficient memory is available. Similar is also now the
case for file/dir tables, we try 0x40000 work buffer and divide by 2
until we successfully alloc. We don't allow a work buffer <0x4000, for
write/perf reasons. If a game triggers that, let me know I guess.

Hard to imagine a worse torture-test for this code than animal crossing.
2021-11-03 23:52:38 -07:00
Michael Scire
a73e0e8f16 ams: add arm/armv8a to gitignore 2021-10-31 11:20:32 -07:00
Michael Scire
2161365f4f ams: update for awareness of architecture revision 2021-10-31 11:18:17 -07:00
Michael Scire
258a83684e creport: print symbols if they're present 2021-10-30 14:18:00 -07:00
Michael Scire
d2a757c39e git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "ceff2f371"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "ceff2f371"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-10-30 11:21:54 -07:00
Michael Scire
6cf5205a28 spl: fix legacy physical keyslot compatibility 2021-10-30 11:21:25 -07:00
Michael Scire
b9c90b9234 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "4d0f1b792"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "4d0f1b792"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-10-29 17:47:35 -07:00
Michael Scire
94e18b8c93 ams: bump version to 1.2.2 2021-10-29 17:47:01 -07:00
Michael Scire
4e92687cab sprofile: various correctness fixes. 2021-10-29 17:38:44 -07:00
Michael Scire
2a0b99d9f9 sprofile: fix off-by-one in struct definition, fix GetImportableProfileUrls 2021-10-29 15:41:25 -07:00
Michael Scire
d1f3c4904b kern: fix minor assembly bugs, avoid unnecessary function call in KScheduler hotloop 2021-10-28 19:16:23 -07:00
Michael Scire
92321ccbc8 kern: fix 32-bit light ipc svc handler asm
Nintendo used to do what we were doing because the function wasn't directly in the handler table,
but we've always been directly in the handler table, so we were trashing the last four arguments to light ipc
when called from aarch32. Nothing uses this, but needed to be fixed.
2021-10-28 15:42:52 -07:00
Michael Scire
db3004e844 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "0a0bd74ca"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "0a0bd74ca"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-10-27 22:57:39 -07:00
Michael Scire
3e97e4addf init: disable fsdev cwd to prevent abort on fsdev usage (fsdev should not be used) 2021-10-27 22:57:09 -07:00
Michael Scire
4b7b33809f kern: optimize and bring into line with N our pstate.i management 2021-10-27 15:00:07 -07:00
Michael Scire
e81a1ce5a8 kern: audit (and fix) our hardware maintenance instructions to match official kernel 2021-10-27 12:31:53 -07:00
Michael Scire
fb59d0ad43 Unfuck emummc to not corrupt remote on subrepo push.
subrepo:
  subdir:   "emummc"
  merged:   "a9d569594"
upstream:
  origin:   "https://github.com/m4xw/emuMMC"
  branch:   "develop"
  commit:   "a9d569594"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-10-26 01:52:41 -07:00
Michael Scire
73b74b904f docs: add changelog for 1.2.1 2021-10-26 01:46:10 -07:00
Michael Scire
ed41b01b69 git subrepo push emummc
subrepo:
  subdir:   "emummc"
  merged:   "f11d22d74"
upstream:
  origin:   "https://github.com/m4xw/emuMMC"
  branch:   "develop"
  commit:   "f11d22d74"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-10-26 01:13:50 -07:00
Michael Scire
24143d8813 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "13c6987cc"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "13c6987cc"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-10-26 01:12:06 -07:00
Michael Scire
cb38b0b929 ams: bump version to 1.2.1 2021-10-26 01:09:16 -07:00
Michael Scire
dd04113f5d emummc/fusee: support 13.1.0 FS 2021-10-26 01:08:37 -07:00
Michael Scire
0e81eac9d1 sprof: update for 13.1.0 (format version 1) 2021-10-26 00:51:44 -07:00
Michael Scire
a14dc6ed89 crypto: implement md5, which now used by sprof 2021-10-25 23:15:50 -07:00
Michael Scire
9cc6be4d57 kern: other dmbs in kernel were already dmb ish 2021-10-25 17:38:50 -07:00
Michael Scire
1d5f66be56 kern: implement 13.1.0 kernel changes 2021-10-25 17:34:47 -07:00
Michael Scire
ebca23305e kern: simplify random bitmap selection to match latest Nintendo logic 2021-10-25 17:31:14 -07:00
Michael Scire
273f4a87ae kern: add (and use) generic KSystemControlBase 2021-10-25 17:31:14 -07:00
Michael Scire
1f8bf41f0b kern/test: add some scheduler tests (yields work correctly, all non-special priorities are cooperative/not pre-emptive 2021-10-25 17:31:14 -07:00
Michael Scire
ad03be9a38 hos: whoops 2021-10-25 17:31:14 -07:00
Michael Scire
d63be0737b hos: better safe than sorry 2021-10-25 17:31:14 -07:00
Michael Scire
018ae08409 hos: allow turning off ams extension hard-reqs for unit testing 2021-10-25 17:31:14 -07:00
Michael Scire
2a842791eb kern: add toggleable support for 40-bit physaddr caps 2021-10-25 17:31:14 -07:00
Michael Scire
d8a2b47b0a util: add trait/macro for is_constexpr_constructible 2021-10-25 17:31:14 -07:00
Michael Scire
7c1347e692 test: add tests for SetMemoryPermission 2021-10-25 17:31:14 -07:00
Michael Scire
0a58e803be kern/test: add wip qemu-virt board support to mesosphere 2021-10-25 17:31:14 -07:00
Michael Scire
10ed579c38 kernel_ldr: bring initial cache flush in line with Nintendo 2021-10-25 13:38:52 -07:00
Michael Scire
6ad3219656 kern: reflect nintendo cache management behavior for initial processes 2021-10-25 13:02:35 -07:00
Michael Scire
54dde406bc kern: devirtualize KReadableEvent::Reset, KWorkerTask::DoWorkerTask 2021-10-24 20:41:38 -07:00
Michael Scire
fd187f952e kern: enable lto for global instants (saves about a page in deduplicated code) 2021-10-24 17:06:43 -07:00
Michael Scire
8a661cee6e kern: devirtualize KAutoObjectWithList::GetId() 2021-10-24 17:00:05 -07:00
Michael Scire
3e4acc62f3 kern: fix reorder-init in KHandleTable 2021-10-24 13:08:08 -07:00
Michael Scire
d0cd511c0e kern: devirtualize most things that are free to devirtualize (see #1672) 2021-10-24 13:04:31 -07:00
Michael Scire
aaa3770806 kern: optimize timespan -> tick codegen, improve .text layout 2021-10-24 01:16:24 -07:00
Michael Scire
89926f44c6 kern: use optimized red black tree finds for remaining holdouts 2021-10-23 21:58:48 -07:00
Michael Scire
436613401a kern: devirtualize several KAutoObject functions 2021-10-23 21:13:26 -07:00
Michael Scire
2490bbf4f9 kern: KCacheHelper: better reflect nintendo coremask clearing logic 2021-10-23 17:44:30 -07:00
Michael Scire
71e4313d0c kern: devirtualize remaining vcall for class token/dyncast 2021-10-23 16:04:04 -07:00
SciresM
36e4914be8
kern: avoid constexpr init for many objects (avoids unnecessary memory clear) (#1668) 2021-10-23 15:25:20 -07:00
Michael Scire
20716cb3de kern: use new AtomicRef, use Atomic<bool> 2021-10-20 13:29:38 -07:00
Michael Scire
aed9d3f535 util: better match true std::atomic semantics 2021-10-20 11:02:17 -07:00
Michael Scire
c6d7174dd3 exo: use the fancy new optimal atomics 2021-10-20 08:52:54 -07:00
Michael Scire
d74f364107 kern/util: use custom atomics wrapper to substantially improve codegen 2021-10-19 15:24:15 -07:00
Michael Scire
52332e8d75 kern: use 13.0.0 revised KLightLock logic 2021-10-19 02:45:29 -07:00
Michael Scire
3fc695aff8 kern: fix capability check for thread priorities 2021-10-19 01:41:23 -07:00
Michael Scire
d3eb1268bc kern: remove spurious assertion 2021-10-19 01:21:23 -07:00
Michael Scire
f3b532070b kern: update scheduler for 13.0.0 change, fix some ctz/clz bugs 2021-10-19 01:20:28 -07:00
Michael Scire
42b6c2dd95 kern: fix use of plr vs plr_heap, fix close/unlock order in ArbitrateLock 2021-10-19 01:19:31 -07:00
Michael Scire
52c914afcc ams-libs: move -Wno-invalid-offsetof to cxxflags, not cflags 2021-10-18 13:10:02 -07:00
Michael Scire
692247b26b ams-libs: use nintendo_nx identifier for source file compat bpmp<->ccplex 2021-10-18 11:10:25 -07:00
Michael Scire
799a9a5f98 lr: fix EraseRedirection hang introduced by refactoring 2021-10-18 11:00:55 -07:00
Michael Scire
889d843718 ams: improve offsetof style consistency 2021-10-18 00:17:13 -07:00
Michael Scire
ec6d1a92ef util: improve (and use) offsetof that's """standard compliant""" 2021-10-17 21:45:02 -07:00
Michael Scire
ad4c794aea constexpr: resign ourselves to gcc dropping void -> T support 2021-10-17 02:39:16 -07:00
Michael Scire
96d3187f3e kern: remove need for explicit reserved member in KAutoObject 2021-10-16 17:17:26 -07:00
Michael Scire
bfffe6b119 kern: devirtualize KAutoObject::DynamicCast<>()
This is an optimization that saves the most common type of virtual call in the kernel (DynamicCast)
by storing class token as a member, rather than getting it via virtual call every time.

This does not currently cost any memory space on 64-bit targets, due to pre-existing padding space.

This optimization can be turned off via a compile-time flag for accuracy.
2021-10-16 16:24:06 -07:00
Michael Scire
26c02e2019 kern/util: update structure layouts to match Nintendo (saves 0x10 per KThread/KSession) 2021-10-16 16:13:10 -07:00
Michael Scire
7805a3624e fusee: accept non-zero rather than rejecting non-one for emummc enable 2021-10-16 12:26:17 -07:00
Michael Scire
64950dbd31 powctl: remove unused arm_neon header after last commit 2021-10-16 10:11:45 -07:00
Michael Scire
03efc31f9c powctl: don't require arm64 arch for floating -> fixed conversion 2021-10-16 10:04:19 -07:00
Michael Scire
f7f83b4742 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "cf765c094"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "cf765c094"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-10-15 23:55:53 -07:00
Michael Scire
8634ea0f7c docs: add changelog for 1.2.0 2021-10-15 23:54:25 -07:00
Michael Scire
2541f6dd71 tipc: implement special-case templating used by 13.0.0 pgl 2021-10-15 21:23:55 -07:00
Michael Scire
ff5f376c33 tipc: enable named-thread dispatch 2021-10-15 19:59:29 -07:00
Michael Scire
d1bc1a5c57 boot: update for 13.0.0/aula parameter changes (closes #1477) 2021-10-15 19:03:11 -07:00
Michael Scire
990daec3a2 powctl: integrate 13.0.0 changes (aula params not done yet) 2021-10-15 16:30:27 -07:00
Michael Scire
c04a262d49 boot: update display logic for 13.0.0 changes 2021-10-14 19:48:13 -07:00
Michael Scire
7e536f74ae strat: fix some mitm server management logic 2021-10-14 00:40:43 -07:00
Michael Scire
891fa32bf1 tipc/sm: update more fully for 13.0.0 changes 2021-10-13 23:50:57 -07:00
Michael Scire
ca25a884b5 tipc: add additional logic from 13.0.0 2021-10-12 00:57:54 -07:00
Michael Scire
0189c5f1e6 sm/tipc: minor cleanup 2021-10-12 00:20:21 -07:00
Michael Scire
124a1a1ea0 sm: update for 13.0.0, optimize layout to reduce storage size. 2021-10-11 22:16:37 -07:00
Michael Scire
82d07e04aa strat: don't force fs globals to link into every process 2021-10-11 22:16:12 -07:00
Michael Scire
bd1bcdf52b sf: prevent emitting mitm/defer code unless server in process supports it 2021-10-11 19:01:27 -07:00
Michael Scire
d27fe8a229 util: fix consteval CountTrailingZeroes impl 2021-10-11 13:15:11 -07:00
Michael Scire
1c5edaf4fb fatal: use align up for width calc 2021-10-11 12:41:43 -07:00
Michael Scire
3cd8ec509c boot: probably should have done this a few months ago huh 2021-10-11 01:01:31 -07:00
Michael Scire
3bee3e77ca ams: bump api verrsion pre-emptively to 1.2.0 2021-10-11 01:00:07 -07:00
Michael Scire
5708bb1557 ams: allow bootloader to merely approximate correct target firmware 2021-10-11 00:54:17 -07:00
Michael Scire
d41de21753 fusee: fix loader stub 2021-10-11 00:19:47 -07:00
Michael Scire
06f68a8159 loader: refactor to remove fake namespaces 2021-10-10 21:37:29 -07:00
Michael Scire
d9dc04318d loader: refactor ro manager/improve accuracy 2021-10-10 18:22:32 -07:00
Michael Scire
d8a36e39f2 spl: refactor for accuracy/move into libstrat 2021-10-10 12:57:36 -07:00
ndeadly
4758dfa933
docs: add hactool to list of build dependencies (#1662)
Co-authored-by: ndeadly <24677491+ndeadly@users.noreply.github.com>
2021-10-10 04:50:57 -07:00
Michael Scire
bc96ebb74c os: add FlushDataCache 2021-10-10 00:33:52 -07:00
Michael Scire
a595c232b9 strat: use m_ for member variables 2021-10-10 00:14:06 -07:00
Michael Scire
ce28591ab2 svc: use m_ for member variables 2021-10-09 16:14:00 -07:00
Michael Scire
00116450c3 sdmmc: use m_ for member variables 2021-10-09 15:59:59 -07:00
Michael Scire
179d91a563 kern: fix some lingering non-m_ member variables 2021-10-09 15:46:04 -07:00
Michael Scire
67a45c97ef exo/vapours: refactor member variables to m_ over this-> 2021-10-09 15:40:06 -07:00
Michael Scire
5a38311ebf libstrat: remove lingering debugging edits 2021-10-09 14:51:44 -07:00
Michael Scire
1ab0bd1765 ams: replace most remaining operator & with std::addressof 2021-10-09 14:49:53 -07:00
Michael Scire
ce8aacef21 settings: fix correctness issue in LazyFileAccessor 2021-10-09 14:20:37 -07:00
Michael Scire
ec65c39d17 strat: refactor address taking of form &var[...] 2021-10-09 12:45:31 -07:00
Michael Scire
b0e520112b strat: always use explicit result namespacing 2021-10-09 10:36:21 -07:00
Adubbz
303c6eb5f9
settings: implement KeyValueStore (#1659)
* settings: implement KeyValueStore and dependencies

* settings: update KeyValueStore for recent refactoring

* settings: address feedback
2021-10-09 09:16:40 -07:00
Michael Scire
14c8801259 sm: remove apm:p compatibility hack
Homebrew which would hang when doing this were compiled with libnx < 3.0.0.

Homebrew which is compiled with < 3.0.0 cannot send messages to sm, because
of the incorrect serialization problem (which required homebrew recompile when
12.0.0 released).

Thus, there is no case where this makes a difference.
2021-10-08 15:25:52 -07:00
Michael Scire
960ba52a43 kern: put rela in bss
NOTE: This saves ~0x4000 of space at the cost of crimes against the linker script.
2021-10-08 12:48:53 -07:00
Michael Scire
fba962ef11 kern: clean up mesosphere buildscript 2021-10-08 12:32:23 -07:00
Michael Scire
9def4b5925 kern: tidy up capability calc 2021-10-08 12:29:41 -07:00
Michael Scire
578843f92c fusee: fix loader stub size alignment 2021-10-08 11:18:12 -07:00
Michael Scire
e5cce0f61c git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "0a4c2759a"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "0a4c2759a"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-10-07 23:38:51 -07:00
Michael Scire
d14290e357 os: fix mutex push/pop prototypes 2021-10-07 23:38:15 -07:00
Michael Scire
812acb8b68 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "80d72af9f"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "80d72af9f"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-10-07 23:07:34 -07:00
Michael Scire
229651fe72 ams.mitm: avoid using std::unordered_map, it manifests exception code 2021-10-07 22:59:16 -07:00
Michael Scire
41a4bf53f6 cs: prevent exceptions from manifesting 2021-10-07 19:48:40 -07:00
Michael Scire
888b35833e boot: save 12KB 2021-10-07 19:33:07 -07:00
Michael Scire
afccc35e79 erpt: save 8KB 2021-10-07 19:14:31 -07:00
Michael Scire
e7ca22abd7 jpegdec: save 128KB of memory 2021-10-07 18:03:11 -07:00
Michael Scire
ffc143860b strat: use ams::Main() instead of main(argc, argv) 2021-10-07 17:44:54 -07:00
Michael Scire
6a53726833 strat: build sysmodules with -Wextra/-Werror 2021-10-06 23:22:54 -07:00
Michael Scire
e8f1efd01b libstrat: fix compilation without pre-compiled header/without lto 2021-10-06 17:58:42 -07:00
Michael Scire
7ca83c9d3b libstrat: enable -Wextra, -Werror
This caught an embarrassingly large number of bugs.
2021-10-06 15:20:48 -07:00
Michael Scire
e1fbf27398 os: fix MapTransferMemory output not being set 2021-10-06 12:07:26 -07:00
Michael Scire
4866e80769 svc: refactor/rename MemoryInfo fields 2021-10-05 15:16:54 -07:00
Michael Scire
d9159f81d2 ro: double whoops 2021-10-05 12:40:58 -07:00
Michael Scire
306f413874 ro/dmnt: fix process address space detection 2021-10-05 12:34:09 -07:00
Michael Scire
719ead824e strat: remove map namespace, svc: add address space defs 2021-10-05 12:22:34 -07:00
Michael Scire
69777cf792 strat: use sf::NativeHandle for ipc templating 2021-10-05 00:11:36 -07:00
Michael Scire
d97e97258e sf: add NativeHandle type
TODO: figure out how to integrate this into templating...
2021-10-04 17:34:16 -07:00
Michael Scire
d0041a33ac strat: prefer os::NativeHandle to Handle/svc::Handle where sensible 2021-10-04 17:12:32 -07:00
Michael Scire
597d521f52 pm: use svc::LimitableResource where relevant 2021-10-04 16:33:18 -07:00
Michael Scire
6f680fe63b strat: use svc:: over ::svc 2021-10-04 14:54:13 -07:00
Michael Scire
77fe5cf6f5 ams: the copyright^H^H^H^H^H^H^Hmplex plane is the algebraic closure of the reals 2021-10-04 12:59:10 -07:00
Michael Scire
6f76066d24 os: remove ManagedHandle, refactor to use NativeHandle typename 2021-10-04 12:33:09 -07:00
Michael Scire
a774833790 ro: simplify program id logic 2021-10-01 19:10:19 -07:00
Michael Scire
65fd967550 pm/cfg: simplify initial process id range logic 2021-10-01 17:37:39 -07:00
Michael Scire
18825866ac strat: automatic program id detection 2021-10-01 17:18:50 -07:00
Michael Scire
9ecec1b935 result: improve Includes codegen 2021-10-01 15:12:38 -07:00
Michael Scire
2b37e5d486 os: adopt nintendo ReaderWriter naming over ReadWrite 2021-10-01 11:42:34 -07:00
Michael Scire
00d0c94f2d os: amend io region api 2021-10-01 01:02:48 -07:00
Michael Scire
3eac814268 os: improve thread name codegen 2021-10-01 00:41:35 -07:00
Michael Scire
82f3416799 os: implement SharedMemory, update AslrSpaceManager 2021-10-01 00:36:18 -07:00
Michael Scire
101e3087fe os: fix AttachTransferMemory return type 2021-09-30 22:18:46 -07:00
Michael Scire
24d6933145 strat: use consistent include style for lib headers 2021-09-30 19:21:08 -07:00
Michael Scire
7444a68cd1 os: adopt multiwait naming over waitable 2021-09-30 19:00:47 -07:00
Michael Scire
d9b4009f82 os: add IoRegion 2021-09-30 11:43:17 -07:00
Michael Scire
2d214f5e1e os: add tentative IoRegionType 2021-09-30 11:32:45 -07:00
Michael Scire
c31060f0b8 lmem: fix assert with side effects 2021-09-29 23:56:30 -07:00
Michael Scire
427ab78bc6 pm: implement newer-N-pm's dynamic resource logic 2021-09-29 23:33:25 -07:00
Michael Scire
41ab4c2c68 stratosphere: use SdkMutex/SdkRecursiveMutex over Mutex 2021-09-29 22:52:50 -07:00
Michael Scire
a4fe1bb5d8 libstrat: uncomment some asserts 2021-09-29 22:02:58 -07:00
Michael Scire
9b04ff0f54 ams-libs: AMS_ASSERT no longer invokes expression 2021-09-29 21:32:40 -07:00
Michael Scire
5dc64bc1f7 os: implement Barrier 2021-09-29 18:03:11 -07:00
Michael Scire
b25218c918 os: implement SdkRecursiveMutex 2021-09-29 14:56:53 -07:00
Michael Scire
c949779b3d stratosphere: grant access to SynchronizePreemptionState 2021-09-29 14:18:03 -07:00
Michael Scire
6b438c7adf ddsf: We can use LightEvent now 2021-09-29 14:17:40 -07:00
Michael Scire
8fc7d715a5 os: add unit tests for ExpandUnsignedValueToAscii 2021-09-29 13:55:40 -07:00
Michael Scire
15ff64e03a os: implement ExpandUnsignedValueToAscii
Nintendo does this as of latest firmware.

It's desirable because it removes the only usage of util::SNPrintf() from os library,
which means programs which don't otherwise use SNPrintf do not need to link it into .text.

This saves ~0xD40 of .text as of time-of-commit when successfully unlinking, and e.g.
reduces our sm (and other modules) memory size by a page.
2021-09-29 13:42:11 -07:00
Michael Scire
1e7a327a25 os: implement LightSemaphore 2021-09-29 13:24:03 -07:00
Michael Scire
b8a1ebd11a os: implement LightMessageQueue 2021-09-29 12:55:52 -07:00
Michael Scire
cf5f431058 os: refactor MessageQueue to use new MessageQueueHelper template 2021-09-29 12:24:18 -07:00
Michael Scire
c7634c66c4 os: tweak LightEvent codegen 2021-09-28 19:11:52 -07:00
Michael Scire
632b6b3330 os: implement LightEvent 2021-09-28 18:54:09 -07:00
Michael Scire
5e0bbb61b1 os: implement ReadWriteBusyMutex 2021-09-28 17:01:11 -07:00
Michael Scire
09570c470c os: implement BusyMutex 2021-09-28 14:53:55 -07:00
Michael Scire
d00cec38b0 kern: use util::BitFlagSet for capability flags 2021-09-27 11:37:27 -07:00
BestPig
273206f314 Reduce insert_splash_screen processing time with python3 from ~1m20s to ~0.6s 2021-09-27 11:35:21 -07:00
Michael Scire
98f438e742 kern: fix/update thread permissions on pin 2021-09-26 14:51:54 -07:00
Michael Scire
99c74469e6 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "e05183a6f"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "e05183a6f"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-09-24 09:17:32 -07:00
Michael Scire
a3d9efb18c ams: bump version to 1.1.1 2021-09-24 09:16:30 -07:00
Michael Scire
3fe072a1d0 kern: devirtualize page table operations 2021-09-21 10:09:27 -07:00
Michael Scire
ab81ed2795 fs.mitm: fix memory leak in romfs build (closes #1031) 2021-09-20 17:53:29 -07:00
shchmue
56bfbb02ec Make build_package3.py Python 2&3 compatible 2021-09-20 12:37:25 -07:00
Michael Scire
006f8022c0 pkg3: fix build when revision collides with a previous commit 2021-09-19 11:07:23 -07:00
Michael Scire
296d049257 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "dc52a3228"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "dc52a3228"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-09-19 11:01:23 -07:00
Michael Scire
155f158197 ncm: fix destructor availability 2021-09-19 11:00:57 -07:00
Michael Scire
3dc51e164f loader: fix enum cast 2021-09-19 10:42:28 -07:00
Michael Scire
801f784fae git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "33ae401bc"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "33ae401bc"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-09-19 10:36:39 -07:00
Michael Scire
ed295c4cb5 docs: add changelog for 1.0.0 2021-09-19 10:34:31 -07:00
Michael Scire
790f7498c1 loader: update for 13.0.0 ncm changes 2021-09-19 10:34:31 -07:00
Michael Scire
7cdfa68dd5 svc: bump supported version 2021-09-19 10:34:31 -07:00
Michael Scire
90732ff311 kern: unify all waiting semantics to use single api 2021-09-19 10:34:31 -07:00
Michael Scire
f6fb5f2c8d kern/svc: implement IoPool/Region svc support 2021-09-19 10:34:31 -07:00
Michael Scire
ce7dd55257 svc/kern/dd: remove MapDeviceAddressSpace() 2021-09-19 10:34:31 -07:00
Michael Scire
481ce12b7b kern: update Initialize0 for new arguments/randomization semantics 2021-09-19 10:34:31 -07:00
Michael Scire
2f2c36b22b kern: KMemoryManager/KPageGroup use physical addresses instead of virtual, now 2021-09-19 10:34:31 -07:00
Michael Scire
2c4bd44d7e kern: support dynamic resource expansion for system heaps/events/sessions. 2021-09-19 10:34:31 -07:00
Michael Scire
2b91956051 kern: improve kdebug attach semantics 2021-09-19 10:34:31 -07:00
Michael Scire
4c73c461f1 kern: update KPageTable::Unmap block closing logic 2021-09-19 10:34:31 -07:00
Michael Scire
8b49cea4a9 kern: optimize logging for release kernel strings (saves printf space in .text) 2021-09-19 10:34:31 -07:00
Michael Scire
fdf008108c kern: add new KMemoryState 2021-09-19 10:34:31 -07:00
Michael Scire
252486913b kern: KWorkerTaskManager no longer tracks id 2021-09-19 10:34:31 -07:00
Michael Scire
44d10da7b8 kern: KSchedulerInterruptTask -> KSchedulerInterruptHandler 2021-09-19 10:34:31 -07:00
Michael Scire
cb28150912 kern: kill the interrupt task manager thread 2021-09-19 10:34:31 -07:00
Michael Scire
29cc3d1c09 kern: remove per-KInterruptEventTask locks 2021-09-19 10:34:31 -07:00
Michael Scire
e6a6fe6f38 kern: delete KWritableEvent, devirtualize KReadableEvent Signal/Clear 2021-09-19 10:34:31 -07:00
Michael Scire
d80ad222cc kern: KConditionVariable arbiter functions now static 2021-09-19 10:34:31 -07:00
Michael Scire
572cbd8619 kern: KAutoObject doesn't need (virtual) destructor 2021-09-19 10:34:31 -07:00
Michael Scire
183243bf16 kern: optimize handle table layout 2021-09-19 10:34:31 -07:00
Michael Scire
6407786059 kern: update GetInfo logic for tick count InfoTypes 2021-09-19 10:34:31 -07:00
Michael Scire
6cbfaaf835 kern: port limit is now 0x180 2021-09-19 10:34:31 -07:00
Adubbz
b6b09d6944 ncm: updated to 13.0.0 2021-09-19 10:34:31 -07:00
Michael Scire
c1c07af99a git subrepo pull emummc
subrepo:
  subdir:   "emummc"
  merged:   "7a3db0fb"
upstream:
  origin:   "https://github.com/m4xw/emuMMC"
  branch:   "develop"
  commit:   "f6608731"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-09-19 10:34:31 -07:00
Michael Scire
05b54c4c2a erpt: launch sprofile only on 13.0.0+ 2021-09-19 10:34:31 -07:00
Michael Scire
619a7b2074 git subrepo pull emummc
subrepo:
  subdir:   "emummc"
  merged:   "4e1ac0a7"
upstream:
  origin:   "https://github.com/m4xw/emuMMC"
  branch:   "develop"
  commit:   "c6a2e9cc"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-09-19 10:34:31 -07:00
Adubbz
a941e4be03 ncm: skeleton new commands 2021-09-19 10:34:31 -07:00
Michael Scire
e2a74a9e38 git subrepo pull emummc
subrepo:
  subdir:   "emummc"
  merged:   "2e001dd2"
upstream:
  origin:   "https://github.com/m4xw/emuMMC"
  branch:   "develop"
  commit:   "29deabb2"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-09-19 10:34:31 -07:00
Michael Scire
89541c8042 sprofile: fully reimplement sprof:bg + sprof:sp 2021-09-19 10:34:31 -07:00
Michael Scire
ae54ec5981 sprofile: implement non-importer bgagent commands 2021-09-19 10:34:31 -07:00
Michael Scire
75d5e2aef0 sprofile: implement OpenProfileUpdateObserver 2021-09-19 10:34:31 -07:00
Michael Scire
bd240b23d8 erpt: skeleton sprofile apis 2021-09-19 10:34:31 -07:00
Michael Scire
568a3b62eb set.mitm: pointer buffer size was increased to 0x200 in 13.0.0 2021-09-19 10:34:31 -07:00
Michael Scire
04cbc06bc1 ams: update current target firmware 2021-09-19 10:34:31 -07:00
Michael Scire
385f00c375 fusee: bump package2 check 2021-09-19 10:34:31 -07:00
Michael Scire
23a1cee2e3 exo: more fixes for 13.0.0 2021-09-19 10:34:31 -07:00
Michael Scire
fedd684a1c fusee/exo: update for new dram id changes 2021-09-19 10:34:31 -07:00
Michael Scire
cb299d9260 fusee/exo: update for recognition of 13.0.0 2021-09-19 10:34:31 -07:00
Michael Scire
724bd2b4d2 boot2: launch nintendo lm from built in system, not none 2021-09-12 12:40:27 -07:00
Michael Scire
50c1b628a8 linguist: add vanity corrections 2021-09-11 20:03:42 -07:00
Michael Scire
f2da92184b cs: fix launching of tio server 2021-09-11 19:41:47 -07:00
Michael Scire
a595091be0 cs: fix screenshot packet semantics 2021-09-11 19:41:47 -07:00
Michael Scire
0ec23e74b5 cs: implement TakeScreenShot command 2021-09-11 19:41:47 -07:00
Michael Scire
8acf0a4fa9 cs: fix allocator aborts 2021-09-11 19:41:47 -07:00
Michael Scire
ebb0bd2b41 kern: improve single-step around user-exception entry 2021-09-11 19:41:47 -07:00
Michael Scire
c10265676f kern: fix spsr register in RestoreContext 2021-09-11 19:41:47 -07:00
Michael Scire
9e7b56b33c kern: optimize hw-single-step management 2021-09-11 19:41:47 -07:00
Michael Scire
05ea0c53d7 dmnt: use hardware single step extension if available 2021-09-11 19:41:47 -07:00
Michael Scire
4075d24e0c kern: add hardware single step extension 2021-09-11 19:41:47 -07:00
Michael Scire
904ab19823 dmnt: implement remaining basic gdbstub packets 2021-09-11 19:41:47 -07:00
Michael Scire
534c2c76f5 dmnt: reload modules on NRO load/unload 2021-09-11 19:41:47 -07:00
Michael Scire
d216a77187 dmnt: first pass at breakpoints/watchpoints 2021-09-11 19:41:47 -07:00
Michael Scire
1401f3520e dmnt: refactor to use process accessor 2021-09-11 19:41:47 -07:00
Michael Scire
c6fad1b0ee osdbg: implement thread info api 2021-09-11 19:41:47 -07:00
Michael Scire
9f1f0c7cbd dmnt: add attach support to gdbstub 2021-09-11 19:41:47 -07:00
Michael Scire
649a0052d0 dmnt: refactor/add support for getting process list in gdb 2021-09-11 19:41:47 -07:00
Michael Scire
a7f9729f63 dmnt: begin working on packet parser 2021-09-11 19:41:47 -07:00
Michael Scire
f85df27875 dmnt: add basic gdb packet receive logic 2021-09-11 19:41:47 -07:00
Michael Scire
db7268de2e dmnt2: add logging logic, for use with gdbstub development 2021-09-11 19:41:47 -07:00
Michael Scire
a2c0cc924b fix dmnt.gen2 title id (not sure how I typo'd this) 2021-09-11 19:41:47 -07:00
Michael Scire
206516411f boot2: launch dmnt.gen2 over dmnt, when using htc 2021-09-11 19:41:47 -07:00
Michael Scire
b61797224d tma2: include sysmodules in stratosphere.romfs 2021-09-11 19:41:47 -07:00
Michael Scire
899efec302 cs: implement GetFirmwareVersion command 2021-09-11 19:41:47 -07:00
Michael Scire
1a1b1355ba scs: implement EventHandlerThread for shell 2021-09-11 19:41:47 -07:00
Michael Scire
aa2dce7316 scs: implement DoShellServer 2021-09-11 19:41:47 -07:00
SciresM
e9849c74cf
LogManager: implement system module, client api, logging api (#1617)
Some notes:

* Unless `atmosphere!enable_log_manager` is true, Nintendo's log manager will be used instead.
  * This prevents paying memory costs for LM when not enabling logging.
  * To facilitate this, Atmosphere's log manager has a different program id from Nintendo's.
  * `atmosphere!enable_htc` implies `atmosphere!enable_log_manager`.
* LogManager logs to tma, and the SD card (if `lm!enable_sd_card_logging` is true, which it is by default).
* Binary logs are saved to `lm!sd_card_log_output_directory`, which is `atmosphere/binlogs` by default.
2021-09-11 19:32:14 -07:00
HamletDuFromage
a1fb8a91c8
Add arguments support to Daybreak (#1616)
* Add arguments support to Daybreak

* Check if Daybreak is run as NRO
2021-09-11 10:55:25 -07:00
Michael Scire
bfeba7c1e8 build: fix building with directory existing 2021-09-09 00:15:35 -07:00
Michael Scire
31d44d821f fusee: fix log_inverted flag parse 2021-09-08 14:32:15 -07:00
Michael Scire
44beeecc9e fusee: fix prodinfo blanking flag detection for sysmmc (closes #1610) 2021-09-07 04:34:57 -07:00
Michael Scire
844e88bdfe git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "0c0bb815"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "0c0bb815"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-09-06 16:33:59 -07:00
Michael Scire
a1af1af74d docs: mention custom splash script in changelog
Also, bring commit count for the fusee_cpp PR to a nice point before merging.
2021-09-06 16:26:50 -07:00
Michael Scire
5e64460bb9 utils: add script for inserting custom image into package3 2021-09-06 16:26:50 -07:00
Michael Scire
960161741d ams: docs/build update 2021-09-06 16:26:50 -07:00
Michael Scire
443271de35 fusee: accept spaces inside ini values (we still left/right strip) 2021-09-06 16:26:50 -07:00
Michael Scire
4ad300c33c fusee: add package3 magic 2021-09-06 16:26:50 -07:00
Michael Scire
715eacbf8e fusee: accept ini files without empty line at end 2021-09-06 16:26:50 -07:00
Michael Scire
dda7ea6ac2 fusee: attempt reboot to self if possible, better abort/fatal handlers 2021-09-06 16:26:50 -07:00
Michael Scire
005aac5a2b package3: fix hekate compatibility (use real sizes) 2021-09-06 16:26:50 -07:00
Michael Scire
1e4356cdb9 build: fix clean target 2021-09-06 16:26:50 -07:00
Michael Scire
e0f45d54f1 stratosphere: remove 0.19.0 update cleanup logic. 2021-09-06 16:26:50 -07:00
Michael Scire
8da223468f fusee: remove TODO comments in buildscript 2021-09-06 16:26:50 -07:00
Michael Scire
045f9b2f15 fusee: fix buildsystem, rename secondary -> package3 2021-09-06 16:26:50 -07:00
Michael Scire
b7521465ee fusee: tactically don't trash PLLA1, fixes audio corruption on boot 2021-09-06 16:26:50 -07:00
Michael Scire
a8f898b591 patches: nogc patches now embedded in fusee rather than being .ips 2021-09-06 16:26:50 -07:00
Michael Scire
158da95b9f config: BCT.ini no longer exists 2021-09-06 16:26:50 -07:00
Michael Scire
36c470ad11 ams-1.0.0: bump version number well ahead of time 2021-09-06 16:26:50 -07:00
Michael Scire
62f8408a2e fusee_cpp: rename source dir to fusee 2021-09-06 16:26:50 -07:00
Michael Scire
a6ea490615 fusee: delete fusee (this will break build temporarily) 2021-09-06 16:26:50 -07:00
Michael Scire
da208f8001 ams-1.0.0: meso no longer optional, remove conditional logic 2021-09-06 16:26:50 -07:00
Michael Scire
320f0bbcfd fusee_cpp: improve/fix file-based emummc 2021-09-06 16:26:50 -07:00
Michael Scire
2247f97cdc fusee: fix sd card size detection for emummc 2021-09-06 16:26:50 -07:00
Michael Scire
0ef9f7ccc8 fusee_cpp: improved relocation logic 2021-09-06 16:26:50 -07:00
Michael Scire
596f5c3f52 fusee_cpp: various fixes, unpatched erista boots now 2021-09-06 16:26:50 -07:00
Michael Scire
e5106ffa2c fusee_cpp: implement package2 rebuild/kip patching 2021-09-06 16:26:50 -07:00
Michael Scire
968ced677e fusee_cpp: fix mariko mtc (mariko now gets as far as erista) 2021-09-06 16:26:50 -07:00
Michael Scire
5950ff5b5e fusee_cpp: validate mtc overlay before jumping to it.
mtc will jump back to us, so we need a compatible binary.

This also makes some changes to our layout to minimize the likelihood of
an incompatible mtc binary (I made some arbitrary .text/.rodata/.rwdata changes)
and saw identical mtc binaries, so hopefully this all works out.
2021-09-06 16:26:50 -07:00
Michael Scire
b520f5c53b fusee_cpp: emummc implies decompressed text segment 2021-09-06 16:26:50 -07:00
Michael Scire
c5d021c172 fusee_cpp: implement ips patching of kips 2021-09-06 16:26:50 -07:00
Michael Scire
07779b787a fusee_cpp: implement nogc patches 2021-09-06 16:26:50 -07:00
Michael Scire
cefdda77e5 fusee_cpp: implement KIP selection 2021-09-06 16:26:50 -07:00
Michael Scire
622650623c fusee_cpp: we're over the size limit with mtc in nv-text 2021-09-06 16:26:50 -07:00
Michael Scire
7ea9b533d9 fusee_cpp: only check pk11 header2 on mariko (thanks @slp32) 2021-09-06 16:26:50 -07:00
Michael Scire
c2a930965a fusee_cpp: import mariko mtc 2021-09-06 16:26:50 -07:00
Michael Scire
c4fee796ea fusee_cpp: begin mariko mtc work 2021-09-06 16:26:50 -07:00
Michael Scire
598edc0a46 fusee_cpp: move mtc code/used-tables to nv memory (needed for mariko downtrain fix) 2021-09-06 16:26:50 -07:00
Michael Scire
40e2d4bbe6 fusee_cpp: implement cpu startup 2021-09-06 16:26:50 -07:00
Michael Scire
648ad51056 fusee_cpp: fix some careless search/replace mistakes 2021-09-06 16:26:50 -07:00
Michael Scire
e0a41e9d33 fusee_cpp: implement exosphere load/configuration 2021-09-06 16:26:50 -07:00
Michael Scire
1dd0297db3 fusee_cpp: implement warmboot firmware load 2021-09-06 16:26:50 -07:00
Michael Scire
4355a2b036 fusee_cpp: implement read/decryption of package2 2021-09-06 16:26:50 -07:00
Michael Scire
dbad464323 fusee_cpp: list remaining tasks for setup 2021-09-06 16:26:50 -07:00
Michael Scire
565282d06e fusee_cpp: implement target firmware detection 2021-09-06 16:26:50 -07:00
Michael Scire
2f7012cbc6 fusee_cpp: implement emummc/system partition mounting 2021-09-06 16:26:50 -07:00
Michael Scire
8560713a60 fusee: implement parsing for emummc.ini 2021-09-06 16:26:50 -07:00
Michael Scire
6c5f2804ab fusee_cpp: implement all required key derivation 2021-09-06 16:26:50 -07:00
Michael Scire
51cf28339b fusee_cpp: implement tsec_keygen firmware execution 2021-09-06 16:26:50 -07:00
Michael Scire
80999988d4 fusee_cpp: skeleton the remaining code flow 2021-09-06 16:26:50 -07:00
Michael Scire
ecbf13e45d fusee_cpp: import full erista mtc logic 2021-09-06 16:26:50 -07:00
Michael Scire
237b11892e fusee_cpp: implement mtc erista patram writes 2021-09-06 16:26:50 -07:00
Michael Scire
d7192343d8 fusee_cpp: implement erista pll selection logic for mtc 2021-09-06 16:26:50 -07:00
Michael Scire
d2f3b806d6 fusee_cpp: implement inline storage of EmcDvfsTimingTables 2021-09-06 16:26:50 -07:00
Michael Scire
3bcdd0c3c8 fusee_cpp: add logic for loading mtc overlays 2021-09-06 16:26:50 -07:00
Michael Scire
4480e7a8a5 fusee_cpp: implement bpmp overclock 2021-09-06 16:26:50 -07:00
Michael Scire
1a8f886a6e fusee_cpp: Implement fatal display, reading of fusee-secondary 2021-09-06 16:26:50 -07:00
Michael Scire
ee1d1ea527 fusee_cpp: Add display init/fatal error display logic 2021-09-06 16:26:50 -07:00
Michael Scire
e7d7d8adfb fusee_cpp: cache cleanup, confirmed working on hardware 2021-09-06 16:26:50 -07:00
Michael Scire
5cff5e629b fusee_cpp: implement bpmp cache driver 2021-09-06 16:26:50 -07:00
Michael Scire
49d0a51d6b fusee_cpp: implement sd card init 2021-09-06 16:26:50 -07:00
Michael Scire
25cd3d17de fusee_cpp: implement sdram lp0 scratch param save 2021-09-06 16:26:50 -07:00
Michael Scire
3b460e94d4 fusee-cpp: minor fixes (thanks @hexkyz) 2021-09-06 16:26:50 -07:00
Michael Scire
349a16ce39 fusee_cpp: implement SDRAM initialization 2021-09-06 16:26:50 -07:00
Michael Scire
f2a1c60218 fusee_cpp: tweaks, now completes SecureInitialize on hardware 2021-09-06 16:26:50 -07:00
Michael Scire
c91f95e8f6 fusee-cpp: a little more init in SecureInitialize 2021-09-06 16:26:50 -07:00
Michael Scire
53ede217a5 fusee-cpp: finish SecureInitialize 2021-09-06 16:26:50 -07:00
Michael Scire
669564b022 fusee-cpp: implement SecureInitialize besides InitializeClock() 2021-09-06 16:26:50 -07:00
Michael Scire
c9bd97192f fusee-cpp: sketch out remainder of secure initialize 2021-09-06 16:26:50 -07:00
Michael Scire
c333a84b6b fusee-cpp: Implement mbist workaround 2021-09-06 16:26:50 -07:00
Michael Scire
3e81796db7 fusee-cpp: setup exception handlers during crt0 2021-09-06 16:26:50 -07:00
Michael Scire
5f60bc7186 fusee-cpp: add basic structural stubs 2021-09-06 16:26:50 -07:00
Michael Scire
165c926135 ams: bump version to 0.20.1 2021-08-30 07:32:35 -07:00
Michael Scire
d43bc68d0b fusee: fix MSELECT clkrst values 2021-08-30 07:24:36 -07:00
Michael Scire
c5edb031fa fusee: restore DRAM to 204MHz before starting main cpu on Mariko (closes #1600).
Nintendo's Mariko tables result in trained frequency of 1599999 instead of 1600000.

PCV checks for rate == 1600000 exactly, when doing EMC init.

Thus EMC init does not succeed if we are trained to 1600000.

PCV has a fudge factor of 1000 used in SetEmcDvfsFreq, but this is not used in InitEmcDvfs.

This failure means that PCV cannot change rate back to 204MHz before sleep, and then after
wake extremely degraded performance is observed.

Restoring DRAM to 204MHz before boot causes EMC init to succeed/fixes performance degradation.
2021-08-30 07:19:28 -07:00
Michael Scire
1f065e3bac git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "87a1de0b"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "87a1de0b"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-08-20 13:34:30 -07:00
Michael Scire
9296a56303 ams: bump to 0.2.0
NOTE: Release will not occur until hekate is ready to handle new sept-less release format.
2021-08-20 13:31:59 -07:00
Michael Scire
481b209ae8 docs: wipe sept from the docs 2021-08-20 13:17:11 -07:00
SciresM
17ca463c3f
ams: replace sept with tsec firmware (#1594)
* ams: replace sept with tsec firmware

This replaces sept with a custom tsec key derivation firmware.

NOTE: This does not use any TSEC exploits whatsoever; it is a well-signed
TSEC binary assembled with envyas and signed with the real cauth key.

For more details, contact SciresM#0524.

* fusee: only set SBK if it's readable
2021-08-20 13:13:29 -07:00
Michael Scire
f175802136 kern: improve some debug output 2021-08-20 00:06:43 -07:00
Michael Scire
fe79bc253a kern: fix same is_current check in GetThreadContext 2021-08-19 07:38:25 -07:00
Michael Scire
81bf8c577a kern: fix check for thread-is-current in KDebugBase::SetThreadContext 2021-08-19 07:34:08 -07:00
SciresM
aee89db748
mtc: implement memory training for mariko (#1593)
* mtc: implement memory training for mariko

* mtc: fix apply_periodic_compensation_trimmer, train_wr_vref results

* mtc: fix clktree calculations
2021-08-17 17:27:12 -07:00
Michael Scire
f5704d25f8 kern: remove firmare-specific SignalAndModify impl
Nintendo made this breaking change because there was zero official software relying on it,
so it's safe for us to make the same change.
2021-07-22 15:56:45 -07:00
Michael Scire
73afa042f1 dmnt: fix opcode decoding (closes #1575) 2021-07-22 06:06:48 -07:00
Michael Scire
2da31b122f kern: fix hardware watchpoint detection 2021-07-22 00:35:40 -07:00
Michael Scire
43bbfd29bb kern: fix inverted condition in context breakpoint validation 2021-07-21 23:56:28 -07:00
Michael Scire
4cb4707f34 dmnt: add theoretical 'else' support to cheat engine vm conditionals 2021-07-21 19:36:46 -07:00
Michael Scire
389c3b6baa dmnt: various cheat changes/suggestions that have been cooking a while 2021-07-21 19:21:58 -07:00
Michael Scire
0c596e682f exo/daybreak: advertise (and check against) supported hos version 2021-07-21 18:21:38 -07:00
tslater2006
4d430a4c61
Updates to Cheats documentation (#1568)
* docs: update cheats doc to clarify Code Type 5 encoding

This change removes references to the "M" nibble for the "Register Address" encoding of Code Type 5 whis is not used in this mode.

In the dword block the "M" has been replaced with a "0"

* docs: update cheats doc to clarify register usage on Code Type 5

This adds additional clarification for "Register Address Encoding" mode of Code Type 5 that the "R" nibble reflects both the destination as well as the base memory address.

* docs: update cheats doc to make Code Types consistent

Code Types are now consistently written in hex notation.
2021-07-16 11:17:03 -07:00
Michael Scire
0c41489f01 exo: fix SE aes-ctr usage in GetSecureData 2021-07-16 10:55:49 -07:00
Michael Scire
bd6155bcb4 kern: since 10.0.0, KDebug::GetThreadContext always returns X0-X7 2021-07-13 13:00:16 -07:00
Michael Scire
3bedf56512 kern: fix incorrect waiter management in KProcess::ReleaseUserException 2021-07-13 05:27:19 -07:00
Michael Scire
1be74ea6e2 kern: fix bug in KConditionVariable::SignalImpl 2021-07-13 01:40:16 -07:00
Michael Scire
14d458522d kern: update initial cache management to match latest kernel 2021-07-12 18:30:01 -07:00
Michael Scire
12bf9612cb git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "e96b24f8"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "e96b24f8"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-07-12 02:00:12 -07:00
Michael Scire
ea7b6e14f9 ams-libs: fix change detection for library building 2021-07-12 01:59:37 -07:00
Michael Scire
5e3339e866 kern: add missing abort on unmap failure 2021-07-11 21:59:06 -07:00
Michael Scire
a7c14e03b9 ams: std::optional -> util::optional 2021-07-08 02:37:26 -07:00
Michael Scire
9df13781c2 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "eb667fea5"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "eb667fea5"
git-subrepo:
  version:  "0.4.0"
  origin:   "???"
  commit:   "???"
2021-07-06 07:29:10 -07:00
Michael Scire
283736878d docs: add changelog for 0.19.5 2021-07-06 07:28:12 -07:00
Michael Scire
f863164648 ams: basic support for 12.1.0 2021-07-06 07:13:56 -07:00
Michael Scire
3eb76fcd16 exo: update for 12.1.0 2021-07-06 06:55:59 -07:00
Michael Scire
2088c5a34a kern: fix handling of is_aligned parameter in DevicePageTable 2021-07-04 10:45:14 -07:00
Michael Scire
846cde52e0 fs.mitm: ns registers program index map info, not am 2021-06-28 22:43:56 -07:00
Michael Scire
a3dd445b32 fs.mitm: add OpenDataStorageWithProgramIndex support (theoretically, closes #1250) 2021-06-28 22:24:26 -07:00
Michael Scire
c362838e11 erpt: fix 0x100 byte memory leak on creation of new report 2021-06-28 17:36:42 -07:00
Michael Scire
e086022b77 build: use DWARFv4 explicitly for IDA compatibility with debug elfs 2021-06-25 23:48:41 -07:00
Michael Scire
70c1bad08b git subrepo push emummc
subrepo:
  subdir:   "emummc"
  merged:   "cbc294c3"
upstream:
  origin:   "https://github.com/m4xw/emuMMC"
  branch:   "develop"
  commit:   "cbc294c3"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-06-22 16:13:04 -07:00
Michael Scire
38f9a76ba0 emummc: add custom ld/specs file 2021-06-22 16:12:27 -07:00
Michael Scire
4892ffae15 kern: implement improved [new page tables are zero] invariant 2021-06-17 13:03:46 -07:00
Michael Scire
25305257d6 kern: fix missing peak set in KResourceLimit::SetLimitValue 2021-06-17 12:57:56 -07:00
Michael Scire
e423aef033 kern: ensure InitArguments do not cross page boundaries 2021-06-17 12:49:25 -07:00
Michael Scire
8a6afe7909 dns.mitm: fix wildcardcmp failure case (#1539) 2021-06-15 16:35:26 -07:00
Aurora
c02f32f1bf
reboot_to_payload: Use ams:bpc API to set payload, reboot safely and prevent usage on Mariko (#1543) 2021-06-13 16:55:46 -05:00
Michael Scire
2ab01ad33c git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "11ea38a7"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "11ea38a7"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-06-08 08:09:48 -07:00
Michael Scire
3dbc79dd5c ams: bump version to 0.19.4 2021-06-08 08:09:05 -07:00
Michael Scire
90b54c03b3 git subrepo pull emummc
subrepo:
  subdir:   "emummc"
  merged:   "219c723c"
upstream:
  origin:   "https://github.com/m4xw/emuMMC"
  branch:   "develop"
  commit:   "219c723c"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-06-08 07:50:35 -07:00
Michael Scire
7821241356 kern: fix enormous whoops 2021-05-31 04:20:59 -07:00
Michael Scire
8fea8d9b2e sm: lighten abort restrictions on mitm handle acquisition (closes #1528) 2021-05-30 22:53:32 -07:00
Michael Scire
dcdf46f576 kern: slightly improve genericity of debugger break event 2021-05-30 21:13:42 -07:00
Michael Scire
df5537b748 mem: actually fully fix the heap bug, add comments for future self 2021-05-26 23:21:08 -07:00
Michael Scire
0f2855ada8 mem: fix rare crash/logic error in heap allocation code 2021-05-26 20:43:03 -07:00
Michael Scire
c790d03693 libstrat: fix override operator new to be noexcept (closes #1494) 2021-05-16 23:10:13 -07:00
Michael Scire
25be7c5b1b git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "b5b55f60"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "b5b55f60"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-05-12 22:47:42 -07:00
Michael Scire
7e05e12b83 sf/tipc: treat min/max as true min/max, rather than numeric 2021-05-12 22:43:39 -07:00
Michael Scire
99d7f72c51 warmboot: remove superfluous firmware version check 2021-05-12 16:57:10 -07:00
Michael Scire
691a453d77 docs: amend changelog 2021-05-12 09:11:19 -07:00
Michael Scire
88246f475c git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "9ac6f527"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "9ac6f527"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-05-12 09:10:13 -07:00
Michael Scire
269d4496b2 docs: update changelog for 0.19.3 2021-05-12 09:08:55 -07:00
Michael Scire
bb4c7a390b ams: update for 12.0.2 2021-05-12 09:08:47 -07:00
Dark-Mind
b846628362
Update issue template to ask whether sysmmc or emummc. 2021-05-12 08:27:21 -07:00
Michael Scire
26fb201518 dns.mitm: handle nullptr hostname 2021-05-10 13:27:14 -07:00
Michael Scire
01ce7cef14 exo: revert section sorting 2021-05-10 07:59:38 -07:00
Michael Scire
3f3aaa01fa git subrepo clone --force https://github.com/m4xw/emummc
subrepo:
  subdir:   "emummc"
  merged:   "c6717b93"
upstream:
  origin:   "https://github.com/m4xw/emummc"
  branch:   "develop"
  commit:   "c6717b93"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-05-10 07:50:39 -07:00
Michael Scire
bf8de39e69 ams: move around abort handler to avoid linker errors 2021-05-07 17:49:10 -07:00
Michael Scire
6bb4253df5 emummc: style-change 2021-05-05 09:34:29 -07:00
Michael Scire
cfd7121574 emummc: advance buffer for multi-file case 2021-05-05 08:44:53 -07:00
Michael Scire
972681c57e emummc: fix file-based accesses that cross file boundaries 2021-05-05 08:37:02 -07:00
Michael Scire
0a11cbc2d6 exo: sort sections by alignment 2021-05-02 10:50:18 -07:00
Michael Scire
32f487abfb sm: update to excise unnecessary library code 2021-05-02 10:33:15 -07:00
Michael Scire
7d61cab01c fs: add access log strings for DirectoryEntryType 2021-04-30 19:19:22 -07:00
Michael Scire
14ed4e4057 erpt: fix reading files that don't exist 2021-04-30 14:44:53 -07:00
Michael Scire
e8ba632606 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "acee57e8"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "acee57e8"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-04-30 10:04:30 -07:00
Michael Scire
dbcb1e1564 loader: avoid UB when doing count trailing zeros 2021-04-30 10:03:54 -07:00
Michael Scire
15381409dc fs: fix missed operation rename 2021-04-30 09:02:58 -07:00
Michael Scire
10ad6934ac git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "1c5df037"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "1c5df037"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-04-30 08:56:36 -07:00
Michael Scire
03e66efd85 docs: add changelog for 0.19.2 2021-04-30 08:56:03 -07:00
Michael Scire
7040e8976d i2c: add aula pmic device code 2021-04-30 08:42:25 -07:00
Michael Scire
296a6af058 boot: update all autogenerated parameters other than charge 2021-04-30 08:37:51 -07:00
Michael Scire
2c332d1cf8 ams: bump api version to 0.19.2 2021-04-30 05:00:25 -07:00
Michael Scire
243d7dc777 ams: write-protect stratosphere.romfs 2021-04-30 04:57:46 -07:00
Michael Scire
355010ad84 erpt: implement forced shutdown detection 2021-04-30 04:21:03 -07:00
Michael Scire
ef0c15b764 erpt: Implement 12.0.0 AppletTotalActiveTime tracking 2021-04-29 21:48:47 -07:00
Michael Scire
0dc308d92a fs: properly implement OperateRangeWithBuffer, correct OperationId names. 2021-04-29 20:09:45 -07:00
Michael Scire
eb5542963f git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "4a48e0ee"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "4a48e0ee"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-04-29 03:05:29 -07:00
Michael Scire
18673d96cb daybreak: fix compat with newer deko3d 2021-04-29 01:21:09 -07:00
Michael Scire
36f6bdc3a0 fusee/sept: update to suppress spurious gcc warnings 2021-04-29 01:13:48 -07:00
Michael Scire
d6fff49845 exo: remove duplicate flags 2021-04-29 01:07:01 -07:00
Michael Scire
d05e8fb23a exo: fix for newer binutils 2021-04-29 01:04:26 -07:00
Michael Scire
0767d9f8da ams: assume gcc 11 2021-04-28 15:13:29 -07:00
Michael Scire
21f3d29df7 strat: compat with gcc 11 2021-04-26 20:06:28 -07:00
Michael Scire
4f16106702 exo/meso: update for gcc 11 compatibility 2021-04-26 20:06:18 -07:00
Michael Scire
19be54ff95 kern: fix initial process binary load on 2.0.0-4.1.0 (closes #1460) 2021-04-21 19:24:41 -07:00
Michael Scire
ed80d6ec8c util: add compile-time validation tests for intrusive red black trees 2021-04-21 05:06:11 -07:00
Michael Scire
57b6c71c1c util: implement red black trees as templates over macros 2021-04-20 16:56:33 -07:00
Michael Scire
0a11d341b7 kern: fix constant evaluation correctness, codegen tweak 2021-04-20 14:25:06 -07:00
Michael Scire
8010290472 kern: tweak KHandleTable codegen 2021-04-19 18:04:02 -07:00
Michael Scire
fbc526d163 kern: tweak KAutoObject::Open/Close codegen 2021-04-19 18:03:27 -07:00
Michael Scire
5bb790e4a7 erpt: implement AppletActiveTimeInfoList 2021-04-16 00:55:22 -07:00
Michael Scire
0a6219e6e0 kern: add names/links to kern_assembly_offsets.h 2021-04-15 15:43:29 -07:00
Michael Scire
037b04ac60 kern: mostly kill magic numbers in assembly, fix SVCs >= 0x80 2021-04-14 18:01:08 -07:00
Michael Scire
9e563d590b pm: account for 12.0.0 resource limit changes 2021-04-14 00:41:31 -07:00
Michael Scire
bdcf02a3ef tipc: ports use objects in the object manager 2021-04-14 00:34:46 -07:00
Michael Scire
88ac85c423 sm: save 0x1000 in data costs by not aligning server manager to 0x1000 2021-04-14 00:12:21 -07:00
Michael Scire
2e1a93f1d1 strat: no longer materially constrained by sm session limit 2021-04-13 23:58:10 -07:00
Michael Scire
997e4dd665 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "86c2eec8"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "86c2eec8"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-04-12 17:14:38 -07:00
Michael Scire
aa2d03d8e1 ams: bump to 0.19.1 2021-04-12 17:14:07 -07:00
Michael Scire
274c1deae4 git subrepo push libraries
subrepo:
  subdir:   "libraries"
  merged:   "68ddbc73"
upstream:
  origin:   "https://github.com/Atmosphere-NX/Atmosphere-libs"
  branch:   "master"
  commit:   "68ddbc73"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2021-04-12 17:13:43 -07:00
Michael Scire
d5bbf32a26 docs: add 0.19.1 changelog 2021-04-12 17:13:12 -07:00
Michael Scire
97a251b4b2 ncm: fix iteration of nested-subdirectory content files 2021-04-12 17:10:27 -07:00
Michael Scire
9d30917f4e boot2: migration also not launched in 12.0.0 2021-04-11 10:37:04 -07:00
Michael Scire
c67c29ebd5 ncm: fix random error when deleting content 2021-04-11 05:44:13 -07:00
4089 changed files with 206558 additions and 181111 deletions

13
.gitattributes vendored
View File

@ -1 +1,14 @@
config_templates/hbl_html/accessible-urls/accessible-urls.txt text eol=lf
# Mark C++ "include" files as C++
*.inc linguist-language=C++
# Mark RapidJSON include as vendored
libraries/include/stratosphere/rapidjson/** linguist-vendored
# Mark emummc as vendored
emummc/** linguist-vendored
# Mark fatfs as vendored
exosphere/mariko_fatal/source/fatfs/** linguist-vendored
fusee/program/source/fatfs/** linguist-vendored

View File

@ -49,6 +49,8 @@ X.X.X</br>
- [ Ex: Kosmos' distribution of Atmosphère ]
- Do you have additional kips or sysmodules you're loading:
- Homebrew software installed: [ * ]
- EmuMMC or SysNAND:
- [ If using an EmuMMC, include whether it's partition-based or file-based. ]
### Additional context?

15
.gitignore vendored
View File

@ -79,21 +79,32 @@ dkms.conf
*.nam
*.til
# KEYS file for sept-secondary.
# Compiled python files.
*.pyc
sept/sept-secondary/KEYS.py
.**/
# macOS horseshittery
.DS_Store
# NOTE: make sure to make exceptions to this pattern when needed!
*.bin
*.enc
**/out
**/build
**/lib
**/build_nintendo_nx_arm64
**/build_nintendo_nx_arm64_armv8a
**/build_nintendo_nx_arm
**/build_nintendo_nx_arm_armv8a
**/build_nintendo_nx_arm_armv7a
**/build_nintendo_nx_arm_armv4t
**/build_nintendo_nx_x64
**/build_nintendo_nx_x86
tools/*/
package3
stratosphere/test/

182
Makefile
View File

@ -1,168 +1,42 @@
ifeq ($(strip $(DEVKITPRO)),)
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>devkitPro)
endif
ATMOSPHERE_BUILD_CONFIGS :=
all: nx_release
clean: clean-nx_release
include $(DEVKITPRO)/devkitA64/base_tools
THIS_MAKEFILE := $(abspath $(lastword $(MAKEFILE_LIST)))
CURRENT_DIRECTORY := $(abspath $(dir $(THIS_MAKEFILE)))
TOPTARGETS := all clean dist-no-debug dist
AMSBRANCH := $(shell git symbolic-ref --short HEAD)
AMSHASH := $(shell git rev-parse --short HEAD)
AMSREV := $(AMSBRANCH)-$(AMSHASH)
define ATMOSPHERE_ADD_TARGET
ifneq (, $(strip $(shell git status --porcelain 2>/dev/null)))
AMSREV := $(AMSREV)-dirty
endif
ATMOSPHERE_BUILD_CONFIGS += $(strip $1)
COMPONENTS := fusee stratosphere mesosphere exosphere thermosphere troposphere libraries
$(strip $1):
@echo "Building $(strip $1)"
@$$(MAKE) -f $(CURRENT_DIRECTORY)/atmosphere.mk ATMOSPHERE_MAKEFILE_TARGET="$(strip $1)" ATMOSPHERE_BUILD_NAME="$(strip $2)" ATMOSPHERE_BOARD="$(strip $3)" ATMOSPHERE_CPU="$(strip $4)" $(strip $5)
all: $(COMPONENTS)
clean-$(strip $1):
@echo "Cleaning $(strip $1)"
@$$(MAKE) -f $(CURRENT_DIRECTORY)/atmosphere.mk clean ATMOSPHERE_MAKEFILE_TARGET="$(strip $1)" ATMOSPHERE_BUILD_NAME="$(strip $2)" ATMOSPHERE_BOARD="$(strip $3)" ATMOSPHERE_CPU="$(strip $4)" $(strip $5)
thermosphere:
$(MAKE) -C thermosphere all
endef
exosphere: thermosphere
$(MAKE) -C exosphere all
define ATMOSPHERE_ADD_TARGETS
stratosphere: exosphere libraries
$(MAKE) -C stratosphere all
$(eval $(call ATMOSPHERE_ADD_TARGET, $(strip $1)_release, release, $(strip $2), $(strip $3), \
ATMOSPHERE_BUILD_SETTINGS="$(strip $4)" \
))
mesosphere: exosphere libraries
$(MAKE) -C mesosphere all
$(eval $(call ATMOSPHERE_ADD_TARGET, $(strip $1)_debug, debug, $(strip $2), $(strip $3), \
ATMOSPHERE_BUILD_SETTINGS="$(strip $4) -DAMS_BUILD_FOR_DEBUGGING" ATMOSPHERE_BUILD_FOR_DEBUGGING=1 \
))
troposphere: stratosphere
$(MAKE) -C troposphere all
$(eval $(call ATMOSPHERE_ADD_TARGET, $(strip $1)_audit, audit, $(strip $2), $(strip $3), \
ATMOSPHERE_BUILD_SETTINGS="$(strip $4) -DAMS_BUILD_FOR_AUDITING" ATMOSPHERE_BUILD_FOR_DEBUGGING=1 ATMOSPHERE_BUILD_FOR_AUDITING=1 \
))
sept: exosphere
$(MAKE) -C sept all
endef
fusee: exosphere mesosphere stratosphere sept
$(MAKE) -C $@ all
$(eval $(call ATMOSPHERE_ADD_TARGETS, nx, nx-hac-001, arm-cortex-a57,))
libraries:
$(MAKE) -C libraries all
clean-all: $(foreach config,$(ATMOSPHERE_BUILD_CONFIGS),clean-$(config))
clean:
$(MAKE) -C fusee clean
rm -rf out
dist-no-debug: all
$(eval MAJORVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MAJOR\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
| tr -s [:blank:] \
| cut -d' ' -f3))
$(eval MINORVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MINOR\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
| tr -s [:blank:] \
| cut -d' ' -f3))
$(eval MICROVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MICRO\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
| tr -s [:blank:] \
| cut -d' ' -f3))
$(eval AMSVER = $(MAJORVER).$(MINORVER).$(MICROVER)-$(AMSREV))
rm -rf atmosphere-$(AMSVER)
rm -rf out
mkdir atmosphere-$(AMSVER)
mkdir atmosphere-$(AMSVER)/atmosphere
mkdir atmosphere-$(AMSVER)/sept
mkdir atmosphere-$(AMSVER)/switch
mkdir -p atmosphere-$(AMSVER)/atmosphere/fatal_errors
mkdir -p atmosphere-$(AMSVER)/atmosphere/config_templates
mkdir -p atmosphere-$(AMSVER)/atmosphere/config
mkdir -p atmosphere-$(AMSVER)/atmosphere/flags
touch atmosphere-$(AMSVER)/atmosphere/flags/clean_stratosphere_for_0.19.0.flag
cp fusee/fusee-primary/fusee-primary.bin atmosphere-$(AMSVER)/atmosphere/reboot_payload.bin
cp fusee/fusee-mtc/fusee-mtc.bin atmosphere-$(AMSVER)/atmosphere/fusee-mtc.bin
cp fusee/fusee-secondary/fusee-secondary-experimental.bin atmosphere-$(AMSVER)/atmosphere/fusee-secondary.bin
cp fusee/fusee-secondary/fusee-secondary-experimental.bin atmosphere-$(AMSVER)/sept/payload.bin
cp sept/sept-primary/sept-primary.bin atmosphere-$(AMSVER)/sept/sept-primary.bin
cp sept/sept-secondary/sept-secondary.bin atmosphere-$(AMSVER)/sept/sept-secondary.bin
cp sept/sept-secondary/sept-secondary_00.enc atmosphere-$(AMSVER)/sept/sept-secondary_00.enc
cp sept/sept-secondary/sept-secondary_01.enc atmosphere-$(AMSVER)/sept/sept-secondary_01.enc
cp sept/sept-secondary/sept-secondary_dev_00.enc atmosphere-$(AMSVER)/sept/sept-secondary_dev_00.enc
cp sept/sept-secondary/sept-secondary_dev_01.enc atmosphere-$(AMSVER)/sept/sept-secondary_dev_01.enc
cp config_templates/BCT.ini atmosphere-$(AMSVER)/atmosphere/config_templates/BCT.ini
cp config_templates/override_config.ini atmosphere-$(AMSVER)/atmosphere/config_templates/override_config.ini
cp config_templates/system_settings.ini atmosphere-$(AMSVER)/atmosphere/config_templates/system_settings.ini
cp config_templates/exosphere.ini atmosphere-$(AMSVER)/atmosphere/config_templates/exosphere.ini
cp -r config_templates/kip_patches atmosphere-$(AMSVER)/atmosphere/kip_patches
cp -r config_templates/hbl_html atmosphere-$(AMSVER)/atmosphere/hbl_html
mkdir -p atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000008
mkdir -p atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000008
mkdir -p atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/010000000000000D
mkdir -p atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/010000000000002B
mkdir -p atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000032
mkdir -p atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000034
mkdir -p atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000036
mkdir -p atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000037
mkdir -p atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/010000000000003C
mkdir -p atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000042
cp stratosphere/boot2/boot2.nsp atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000008/exefs.nsp
cp stratosphere/dmnt/dmnt.nsp atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/010000000000000D/exefs.nsp
cp stratosphere/erpt/erpt.nsp atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/010000000000002B/exefs.nsp
cp stratosphere/eclct.stub/eclct.stub.nsp atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000032/exefs.nsp
cp stratosphere/fatal/fatal.nsp atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000034/exefs.nsp
cp stratosphere/creport/creport.nsp atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000036/exefs.nsp
cp stratosphere/ro/ro.nsp atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000037/exefs.nsp
cp stratosphere/jpegdec/jpegdec.nsp atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/010000000000003C/exefs.nsp
cp stratosphere/pgl/pgl.nsp atmosphere-$(AMSVER)/stratosphere_romfs/atmosphere/contents/0100000000000042/exefs.nsp
@build_romfs atmosphere-$(AMSVER)/stratosphere_romfs atmosphere-$(AMSVER)/atmosphere/stratosphere.romfs
rm -r atmosphere-$(AMSVER)/stratosphere_romfs
cp troposphere/reboot_to_payload/reboot_to_payload.nro atmosphere-$(AMSVER)/switch/reboot_to_payload.nro
cp troposphere/daybreak/daybreak.nro atmosphere-$(AMSVER)/switch/daybreak.nro
cd atmosphere-$(AMSVER); zip -r ../atmosphere-$(AMSVER).zip ./*; cd ../;
cp fusee/fusee-secondary/fusee-secondary.bin atmosphere-$(AMSVER)/atmosphere/fusee-secondary.bin
cp fusee/fusee-secondary/fusee-secondary.bin atmosphere-$(AMSVER)/sept/payload.bin
cd atmosphere-$(AMSVER); zip -r ../atmosphere-$(AMSVER)-WITHOUT_MESOSPHERE.zip ./*; cd ../;
rm -r atmosphere-$(AMSVER)
mkdir out
mv atmosphere-$(AMSVER).zip out/atmosphere-$(AMSVER).zip
mv atmosphere-$(AMSVER)-WITHOUT_MESOSPHERE.zip out/atmosphere-$(AMSVER)-WITHOUT_MESOSPHERE.zip
cp fusee/fusee-primary/fusee-primary.bin out/fusee-primary.bin
dist: dist-no-debug
$(eval MAJORVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MAJOR\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
| tr -s [:blank:] \
| cut -d' ' -f3))
$(eval MINORVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MINOR\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
| tr -s [:blank:] \
| cut -d' ' -f3))
$(eval MICROVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MICRO\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
| tr -s [:blank:] \
| cut -d' ' -f3))
$(eval AMSVER = $(MAJORVER).$(MINORVER).$(MICROVER)-$(AMSREV))
rm -rf atmosphere-$(AMSVER)-debug
mkdir atmosphere-$(AMSVER)-debug
cp fusee/fusee-primary/fusee-primary.elf atmosphere-$(AMSVER)-debug/fusee-primary.elf
cp fusee/fusee-mtc/fusee-mtc.elf atmosphere-$(AMSVER)-debug/fusee-mtc.elf
cp fusee/fusee-secondary/fusee-secondary-experimental.elf atmosphere-$(AMSVER)-debug/fusee-secondary.elf
cp sept/sept-primary/sept-primary.elf atmosphere-$(AMSVER)-debug/sept-primary.elf
cp sept/sept-secondary/sept-secondary.elf atmosphere-$(AMSVER)-debug/sept-secondary.elf
cp sept/sept-secondary/key_derivation/key_derivation.elf atmosphere-$(AMSVER)-debug/sept-secondary-key-derivation.elf
cp exosphere/loader_stub/loader_stub.elf atmosphere-$(AMSVER)-debug/exosphere-loader-stub.elf
cp exosphere/program/program.elf atmosphere-$(AMSVER)-debug/exosphere-program.elf
cp exosphere/warmboot/warmboot.elf atmosphere-$(AMSVER)-debug/exosphere-warmboot.elf
cp exosphere/mariko_fatal/mariko_fatal.elf atmosphere-$(AMSVER)-debug/exosphere-mariko-fatal.elf
cp exosphere/program/sc7fw/sc7fw.elf atmosphere-$(AMSVER)-debug/exosphere-sc7fw.elf
cp exosphere/program/rebootstub/rebootstub.elf atmosphere-$(AMSVER)-debug/exosphere-rebootstub.elf
cp mesosphere/kernel_ldr/kernel_ldr.elf atmosphere-$(AMSVER)-debug/kernel_ldr.elf
cp mesosphere/kernel/kernel.elf atmosphere-$(AMSVER)-debug/kernel.elf
cp stratosphere/ams_mitm/ams_mitm.elf atmosphere-$(AMSVER)-debug/ams_mitm.elf
cp stratosphere/boot/boot.elf atmosphere-$(AMSVER)-debug/boot.elf
cp stratosphere/boot2/boot2.elf atmosphere-$(AMSVER)-debug/boot2.elf
cp stratosphere/creport/creport.elf atmosphere-$(AMSVER)-debug/creport.elf
cp stratosphere/dmnt/dmnt.elf atmosphere-$(AMSVER)-debug/dmnt.elf
cp stratosphere/eclct.stub/eclct.stub.elf atmosphere-$(AMSVER)-debug/eclct.stub.elf
cp stratosphere/erpt/erpt.elf atmosphere-$(AMSVER)-debug/erpt.elf
cp stratosphere/fatal/fatal.elf atmosphere-$(AMSVER)-debug/fatal.elf
cp stratosphere/jpegdec/jpegdec.elf atmosphere-$(AMSVER)-debug/jpegdec.elf
cp stratosphere/loader/loader.elf atmosphere-$(AMSVER)-debug/loader.elf
cp stratosphere/ncm/ncm.elf atmosphere-$(AMSVER)-debug/ncm.elf
cp stratosphere/pgl/pgl.elf atmosphere-$(AMSVER)-debug/pgl.elf
cp stratosphere/pm/pm.elf atmosphere-$(AMSVER)-debug/pm.elf
cp stratosphere/ro/ro.elf atmosphere-$(AMSVER)-debug/ro.elf
cp stratosphere/sm/sm.elf atmosphere-$(AMSVER)-debug/sm.elf
cp stratosphere/spl/spl.elf atmosphere-$(AMSVER)-debug/spl.elf
cp troposphere/daybreak/daybreak.elf atmosphere-$(AMSVER)-debug/daybreak.elf
cd atmosphere-$(AMSVER)-debug; zip -r ../atmosphere-$(AMSVER)-debug.zip ./*; cd ../;
rm -r atmosphere-$(AMSVER)-debug
mv atmosphere-$(AMSVER)-debug.zip out/atmosphere-$(AMSVER)-debug.zip
.PHONY: $(TOPTARGETS) $(COMPONENTS)
.PHONY: all clean clean-all $(foreach config,$(ATMOSPHERE_BUILD_CONFIGS), $(config) clean-$(config))

View File

@ -3,7 +3,8 @@
=====
![License](https://img.shields.io/badge/License-GPLv2-blue.svg)
[![Chat on Discord](https://camo.githubusercontent.com/b4175720ede4f2621aa066ffbabb70ae30044679/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636861742d446973636f72642d627269676874677265656e2e737667)](https://discordapp.com/invite/ZdqEhed)
[![Chat on Discord](https://img.shields.io/badge/Discord-5865f2?logo=discord&logoColor=white)](https://discordapp.com/invite/ZdqEhed)
![Made with Notepad++](img/np++.png?raw=true)
Atmosphère is a work-in-progress customized firmware for the Nintendo Switch.
@ -13,7 +14,6 @@ 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
@ -27,7 +27,6 @@ This software is licensed under the terms of the GPLv2, with exemptions for spec
You can find a copy of the license in the [LICENSE file](LICENSE).
Exemptions:
* The [yuzu Nintendo Switch emulator](https://github.com/yuzu-emu/yuzu) and the [Ryujinx Team and Contributors](https://github.com/orgs/Ryujinx) are exempt from GPLv2 licensing. They are permitted, each at their individual discretion, to instead license any source code authored for the Atmosphère project as either GPLv2 or later or the [MIT license](https://github.com/Atmosphere-NX/Atmosphere/blob/master/docs/licensing_exemptions/MIT_LICENSE). In doing so, they may alter, supplement, or entirely remove the copyright notice for each file they choose to relicense. Neither the Atmosphère project nor its individual contributors shall assert their moral rights against any of the aforementioned projects.
* [Nintendo](https://github.com/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
@ -38,7 +37,7 @@ In no particular order, we credit the following for their invaluable contributio
* __switchbrew__ for the [libnx](https://github.com/switchbrew/libnx) project and the extensive [documentation, research and tool development](http://switchbrew.org) pertaining to the Nintendo Switch.
* __devkitPro__ for the [devkitA64](https://devkitpro.org/) toolchain and libnx support.
* __ReSwitched Team__ for additional [documentation, research and tool development](https://reswitched.team/) pertaining to the Nintendo Switch.
* __ReSwitched Team__ for additional [documentation, research and tool development](https://reswitched.github.io/) pertaining to the Nintendo Switch.
* __ChaN__ for the [FatFs](http://elm-chan.org/fsw/ff/00index_e.html) module.
* __Marcus Geelnard__ for the [bcl-1.2.0](https://sourceforge.net/projects/bcl/files/bcl/bcl-1.2.0) library.
* __naehrwert__ and __st4rk__ for the original [hekate](https://github.com/nwert/hekate) project and its hwinit code base.

173
atmosphere.mk Normal file
View File

@ -0,0 +1,173 @@
#---------------------------------------------------------------------------------
# pull in common atmosphere configuration
#---------------------------------------------------------------------------------
THIS_MAKEFILE := $(abspath $(lastword $(MAKEFILE_LIST)))
CURRENT_DIRECTORY := $(abspath $(dir $(THIS_MAKEFILE)))
include $(CURRENT_DIRECTORY)/libraries/config/common.mk
# Get Atmosphere version fields
ATMOSPHERE_MAJOR_VERSION := $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MAJOR\b' $(ATMOSPHERE_LIBRARIES_DIR)/libvapours/include/vapours/ams/ams_api_version.h | tr -s [:blank:] | cut -d' ' -f3)
ATMOSPHERE_MINOR_VERSION := $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MINOR\b' $(ATMOSPHERE_LIBRARIES_DIR)/libvapours/include/vapours/ams/ams_api_version.h | tr -s [:blank:] | cut -d' ' -f3)
ATMOSPHERE_MICRO_VERSION := $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MICRO\b' $(ATMOSPHERE_LIBRARIES_DIR)/libvapours/include/vapours/ams/ams_api_version.h | tr -s [:blank:] | cut -d' ' -f3)
ATMOSPHERE_SUPPORTED_HOS_MAJOR_VERSION := $(shell grep 'define ATMOSPHERE_SUPPORTED_HOS_VERSION_MAJOR\b' $(ATMOSPHERE_LIBRARIES_DIR)/libvapours/include/vapours/ams/ams_api_version.h | tr -s [:blank:] | cut -d' ' -f3)
ATMOSPHERE_SUPPORTED_HOS_MINOR_VERSION := $(shell grep 'define ATMOSPHERE_SUPPORTED_HOS_VERSION_MINOR\b' $(ATMOSPHERE_LIBRARIES_DIR)/libvapours/include/vapours/ams/ams_api_version.h | tr -s [:blank:] | cut -d' ' -f3)
ATMOSPHERE_SUPPORTED_HOS_MICRO_VERSION := $(shell grep 'define ATMOSPHERE_SUPPORTED_HOS_VERSION_MICRO\b' $(ATMOSPHERE_LIBRARIES_DIR)/libvapours/include/vapours/ams/ams_api_version.h | tr -s [:blank:] | cut -d' ' -f3)
ATMOSPHERE_VERSION := $(ATMOSPHERE_MAJOR_VERSION).$(ATMOSPHERE_MINOR_VERSION).$(ATMOSPHERE_MICRO_VERSION)-$(ATMOSPHERE_GIT_REVISION)
dist: dist-no-debug
$(eval DIST_DIR = $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)/atmosphere-$(ATMOSPHERE_VERSION)-debug)
rm -rf $(DIST_DIR)
mkdir $(DIST_DIR)
cp $(CURRENT_DIRECTORY)/fusee/loader_stub/$(ATMOSPHERE_BOOT_OUT_DIR)/loader_stub.elf $(DIST_DIR)/fusee-loader-stub.elf
cp $(CURRENT_DIRECTORY)/fusee/program/$(ATMOSPHERE_BOOT_OUT_DIR)/program.elf $(DIST_DIR)/fusee-program.elf
cp $(CURRENT_DIRECTORY)/exosphere/loader_stub/$(ATMOSPHERE_OUT_DIR)/loader_stub.elf $(DIST_DIR)/exosphere-loader-stub.elf
cp $(CURRENT_DIRECTORY)/exosphere/program/$(ATMOSPHERE_OUT_DIR)/program.elf $(DIST_DIR)/exosphere-program.elf
cp $(CURRENT_DIRECTORY)/exosphere/warmboot/$(ATMOSPHERE_BOOT_OUT_DIR)/warmboot.elf $(DIST_DIR)/exosphere-warmboot.elf
cp $(CURRENT_DIRECTORY)/exosphere/mariko_fatal/$(ATMOSPHERE_OUT_DIR)/mariko_fatal.elf $(DIST_DIR)/exosphere-mariko-fatal.elf
cp $(CURRENT_DIRECTORY)/exosphere/program/sc7fw/$(ATMOSPHERE_BOOT_OUT_DIR)/sc7fw.elf $(DIST_DIR)/exosphere-sc7fw.elf
cp $(CURRENT_DIRECTORY)/exosphere/program/rebootstub/$(ATMOSPHERE_BOOT_OUT_DIR)/rebootstub.elf $(DIST_DIR)/exosphere-rebootstub.elf
cp $(CURRENT_DIRECTORY)/mesosphere/kernel_ldr/$(ATMOSPHERE_OUT_DIR)/kernel_ldr.elf $(DIST_DIR)/kernel_ldr.elf
cp $(CURRENT_DIRECTORY)/mesosphere/kernel/$(ATMOSPHERE_OUT_DIR)/kernel.elf $(DIST_DIR)/kernel.elf
cp $(CURRENT_DIRECTORY)/stratosphere/ams_mitm/$(ATMOSPHERE_OUT_DIR)/ams_mitm.elf $(DIST_DIR)/ams_mitm.elf
cp $(CURRENT_DIRECTORY)/stratosphere/boot/$(ATMOSPHERE_OUT_DIR)/boot.elf $(DIST_DIR)/boot.elf
cp $(CURRENT_DIRECTORY)/stratosphere/boot2/$(ATMOSPHERE_OUT_DIR)/boot2.elf $(DIST_DIR)/boot2.elf
cp $(CURRENT_DIRECTORY)/stratosphere/creport/$(ATMOSPHERE_OUT_DIR)/creport.elf $(DIST_DIR)/creport.elf
cp $(CURRENT_DIRECTORY)/stratosphere/cs/$(ATMOSPHERE_OUT_DIR)/cs.elf $(DIST_DIR)/cs.elf
cp $(CURRENT_DIRECTORY)/stratosphere/dmnt/$(ATMOSPHERE_OUT_DIR)/dmnt.elf $(DIST_DIR)/dmnt.elf
cp $(CURRENT_DIRECTORY)/stratosphere/dmnt.gen2/$(ATMOSPHERE_OUT_DIR)/dmnt.gen2.elf $(DIST_DIR)/dmnt.gen2.elf
cp $(CURRENT_DIRECTORY)/stratosphere/eclct.stub/$(ATMOSPHERE_OUT_DIR)/eclct.stub.elf $(DIST_DIR)/eclct.stub.elf
cp $(CURRENT_DIRECTORY)/stratosphere/erpt/$(ATMOSPHERE_OUT_DIR)/erpt.elf $(DIST_DIR)/erpt.elf
cp $(CURRENT_DIRECTORY)/stratosphere/fatal/$(ATMOSPHERE_OUT_DIR)/fatal.elf $(DIST_DIR)/fatal.elf
cp $(CURRENT_DIRECTORY)/stratosphere/htc/$(ATMOSPHERE_OUT_DIR)/htc.elf $(DIST_DIR)/htc.elf
cp $(CURRENT_DIRECTORY)/stratosphere/jpegdec/$(ATMOSPHERE_OUT_DIR)/jpegdec.elf $(DIST_DIR)/jpegdec.elf
cp $(CURRENT_DIRECTORY)/stratosphere/loader/$(ATMOSPHERE_OUT_DIR)/loader.elf $(DIST_DIR)/loader.elf
cp $(CURRENT_DIRECTORY)/stratosphere/LogManager/$(ATMOSPHERE_OUT_DIR)/LogManager.elf $(DIST_DIR)/LogManager.elf
cp $(CURRENT_DIRECTORY)/stratosphere/ncm/$(ATMOSPHERE_OUT_DIR)/ncm.elf $(DIST_DIR)/ncm.elf
cp $(CURRENT_DIRECTORY)/stratosphere/pgl/$(ATMOSPHERE_OUT_DIR)/pgl.elf $(DIST_DIR)/pgl.elf
cp $(CURRENT_DIRECTORY)/stratosphere/pm/$(ATMOSPHERE_OUT_DIR)/pm.elf $(DIST_DIR)/pm.elf
cp $(CURRENT_DIRECTORY)/stratosphere/ro/$(ATMOSPHERE_OUT_DIR)/ro.elf $(DIST_DIR)/ro.elf
cp $(CURRENT_DIRECTORY)/stratosphere/sm/$(ATMOSPHERE_OUT_DIR)/sm.elf $(DIST_DIR)/sm.elf
cp $(CURRENT_DIRECTORY)/stratosphere/spl/$(ATMOSPHERE_OUT_DIR)/spl.elf $(DIST_DIR)/spl.elf
cp $(CURRENT_DIRECTORY)/stratosphere/TioServer/$(ATMOSPHERE_OUT_DIR)/TioServer.elf $(DIST_DIR)/TioServer.elf
cp $(CURRENT_DIRECTORY)/stratosphere/memlet/$(ATMOSPHERE_OUT_DIR)/memlet.elf $(DIST_DIR)/memlet.elf
cp $(CURRENT_DIRECTORY)/troposphere/daybreak/daybreak.elf $(DIST_DIR)/daybreak.elf
cp $(CURRENT_DIRECTORY)/troposphere/haze/haze.elf $(DIST_DIR)/haze.elf
cp $(CURRENT_DIRECTORY)/troposphere/reboot_to_payload/reboot_to_payload.elf $(DIST_DIR)/reboot_to_payload.elf
cd $(DIST_DIR); zip -r ../atmosphere-$(ATMOSPHERE_VERSION)-debug.zip ./*; cd ../;
rm -rf $(DIST_DIR)
dist-no-debug: package3 $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)
$(eval DIST_DIR = $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)/atmosphere-$(ATMOSPHERE_VERSION))
rm -rf $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)/*
rm -rf $(DIST_DIR)
mkdir $(DIST_DIR)
mkdir $(DIST_DIR)/atmosphere
mkdir $(DIST_DIR)/switch
mkdir -p $(DIST_DIR)/atmosphere/fatal_errors
mkdir -p $(DIST_DIR)/atmosphere/config_templates
mkdir -p $(DIST_DIR)/atmosphere/config
mkdir -p $(DIST_DIR)/atmosphere/flags
cp fusee/$(ATMOSPHERE_BOOT_OUT_DIR)/fusee.bin $(DIST_DIR)/atmosphere/reboot_payload.bin
cp fusee/$(ATMOSPHERE_BOOT_OUT_DIR)/package3 $(DIST_DIR)/atmosphere/package3
cp config_templates/stratosphere.ini $(DIST_DIR)/atmosphere/config_templates/stratosphere.ini
cp config_templates/override_config.ini $(DIST_DIR)/atmosphere/config_templates/override_config.ini
cp config_templates/system_settings.ini $(DIST_DIR)/atmosphere/config_templates/system_settings.ini
cp config_templates/exosphere.ini $(DIST_DIR)/atmosphere/config_templates/exosphere.ini
mkdir -p config_templates/kip_patches
cp -r config_templates/kip_patches $(DIST_DIR)/atmosphere/kip_patches
cp -r config_templates/hbl_html $(DIST_DIR)/atmosphere/hbl_html
mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000008
mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000000d
mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000017
mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000002b
mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000032
mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000034
mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000036
mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000037
#mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000003c
mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000042
mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000420
mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000421
mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000b240
mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000d609
mkdir -p $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000d623
cp stratosphere/boot2/$(ATMOSPHERE_OUT_DIR)/boot2.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000008/exefs.nsp
cp stratosphere/dmnt/$(ATMOSPHERE_OUT_DIR)/dmnt.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000000d/exefs.nsp
cp stratosphere/cs/$(ATMOSPHERE_OUT_DIR)/cs.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000017/exefs.nsp
cp stratosphere/erpt/$(ATMOSPHERE_OUT_DIR)/erpt.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000002b/exefs.nsp
cp stratosphere/eclct.stub/$(ATMOSPHERE_OUT_DIR)/eclct.stub.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000032/exefs.nsp
cp stratosphere/fatal/$(ATMOSPHERE_OUT_DIR)/fatal.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000034/exefs.nsp
cp stratosphere/creport/$(ATMOSPHERE_OUT_DIR)/creport.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000036/exefs.nsp
cp stratosphere/ro/$(ATMOSPHERE_OUT_DIR)/ro.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000037/exefs.nsp
#cp stratosphere/jpegdec/$(ATMOSPHERE_OUT_DIR)/jpegdec.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000003c/exefs.nsp
cp stratosphere/pgl/$(ATMOSPHERE_OUT_DIR)/pgl.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000042/exefs.nsp
cp stratosphere/LogManager/$(ATMOSPHERE_OUT_DIR)/LogManager.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000420/exefs.nsp
cp stratosphere/htc/$(ATMOSPHERE_OUT_DIR)/htc.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000b240/exefs.nsp
cp stratosphere/dmnt.gen2/$(ATMOSPHERE_OUT_DIR)/dmnt.gen2.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000d609/exefs.nsp
cp stratosphere/TioServer/$(ATMOSPHERE_OUT_DIR)/TioServer.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000d623/exefs.nsp
cp stratosphere/memlet/$(ATMOSPHERE_OUT_DIR)/memlet.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000421/exefs.nsp
@build_romfs $(DIST_DIR)/stratosphere_romfs $(DIST_DIR)/atmosphere/stratosphere.romfs
rm -r $(DIST_DIR)/stratosphere_romfs
cp troposphere/reboot_to_payload/reboot_to_payload.nro $(DIST_DIR)/switch/reboot_to_payload.nro
cp troposphere/daybreak/daybreak.nro $(DIST_DIR)/switch/daybreak.nro
cp troposphere/haze/haze.nro $(DIST_DIR)/switch/haze.nro
cd $(DIST_DIR); zip -r ../atmosphere-$(ATMOSPHERE_VERSION).zip ./*; cd ../;
rm -rf $(DIST_DIR)
cp fusee/$(ATMOSPHERE_BOOT_OUT_DIR)/fusee.bin $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)/fusee.bin
package3: emummc fusee stratosphere mesosphere exosphere troposphere
@python fusee/build_package3.py $(CURRENT_DIRECTORY) $(ATMOSPHERE_OUT_DIR) $(ATMOSPHERE_BOOT_OUT_DIR) $(ATMOSPHERE_GIT_HASH) $(ATMOSPHERE_MAJOR_VERSION) $(ATMOSPHERE_MINOR_VERSION) $(ATMOSPHERE_MICRO_VERSION) 0 $(ATMOSPHERE_SUPPORTED_HOS_MAJOR_VERSION) $(ATMOSPHERE_SUPPORTED_HOS_MINOR_VERSION) $(ATMOSPHERE_SUPPORTED_HOS_MICRO_VERSION) 0
@echo "Built package3!"
emummc:
$(MAKE) -C $(CURRENT_DIRECTORY)/emummc all
fusee: libexosphere_boot
@$(MAKE) --no-print-directory -C $(CURRENT_DIRECTORY)/fusee -f $(CURRENT_DIRECTORY)/fusee/fusee.mk ATMOSPHERE_CPU="$(strip $(ATMOSPHERE_BOOT_CPU))"
exosphere: libexosphere libexosphere_boot
@$(MAKE) --no-print-directory -C $(CURRENT_DIRECTORY)/exosphere -f $(CURRENT_DIRECTORY)/exosphere/exosphere.mk ATMOSPHERE_CHECKED_LIBEXOSPHERE=1 ATMOSPHERE_CHECKED_BOOT_LIBEXOSPHERE=1
stratosphere: fusee libstratosphere
@$(MAKE) --no-print-directory -C $(CURRENT_DIRECTORY)/stratosphere -f $(CURRENT_DIRECTORY)/stratosphere/stratosphere.mk ATMOSPHERE_CHECKED_LIBSTRATOSPHERE=1 ATMOSPHERE_CHECKED_FUSEE=1
mesosphere: libmesosphere
@$(MAKE) --no-print-directory -C $(CURRENT_DIRECTORY)/mesosphere -f $(CURRENT_DIRECTORY)/mesosphere/mesosphere.mk ATMOSPHERE_CHECKED_LIBMESOSPHERE=1
troposphere:
$(MAKE) -C $(CURRENT_DIRECTORY)/troposphere all
libexosphere:
@$(MAKE) --no-print-directory -C $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere -f $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/libexosphere.mk
ifneq ($(strip $(ATMOSPHERE_LIBRARY_DIR)),$(strip $(ATMOSPHERE_BOOT_LIBRARY_DIR)))
libexosphere_boot:
@$(MAKE) --no-print-directory -C $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere -f $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/libexosphere.mk ATMOSPHERE_CPU="$(strip $(ATMOSPHERE_BOOT_CPU))"
else
libexosphere_boot: libexosphere
endif
libmesosphere:
@$(MAKE) --no-print-directory -C $(ATMOSPHERE_LIBRARIES_DIR)/libmesosphere -f $(ATMOSPHERE_LIBRARIES_DIR)/libmesosphere/libmesosphere.mk
libstratosphere:
@$(MAKE) --no-print-directory -C $(ATMOSPHERE_LIBRARIES_DIR)/libstratosphere -f $(ATMOSPHERE_LIBRARIES_DIR)/libstratosphere/libstratosphere.mk
clean:
$(MAKE) -C $(CURRENT_DIRECTORY)/fusee -f $(CURRENT_DIRECTORY)/fusee/fusee.mk clean ATMOSPHERE_CPU="$(strip $(ATMOSPHERE_BOOT_CPU))"
$(MAKE) -C $(CURRENT_DIRECTORY)/emummc clean
$(MAKE) -C $(CURRENT_DIRECTORY)/exosphere -f $(CURRENT_DIRECTORY)/exosphere/exosphere.mk clean
$(MAKE) -C $(CURRENT_DIRECTORY)/mesosphere -f $(CURRENT_DIRECTORY)/mesosphere/mesosphere.mk clean
$(MAKE) -C $(CURRENT_DIRECTORY)/stratosphere -f $(CURRENT_DIRECTORY)/stratosphere/stratosphere.mk clean
$(MAKE) -C $(CURRENT_DIRECTORY)/troposphere clean
$(MAKE) -C $(ATMOSPHERE_LIBRARIES_DIR)/libstratosphere -f $(ATMOSPHERE_LIBRARIES_DIR)/libstratosphere/libstratosphere.mk clean
$(MAKE) -C $(ATMOSPHERE_LIBRARIES_DIR)/libmesosphere -f $(ATMOSPHERE_LIBRARIES_DIR)/libmesosphere/libmesosphere.mk clean
$(MAKE) -C $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere -f $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/libexosphere.mk clean
$(MAKE) -C $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere -f $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/libexosphere.mk clean ATMOSPHERE_CPU="$(strip $(ATMOSPHERE_BOOT_CPU))"
rm -rf $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)
$(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR) $(CURRENT_DIRECTORY)/$(ATMOSPHERE_BUILD_DIR):
@[ -d $@ ] || mkdir -p $@
.PHONY: dist dist-no-debug clean package3 emummc fusee stratosphere mesosphere exosphere troposphere

View File

@ -1,12 +0,0 @@
BCT0
[stage1]
stage2_path = atmosphere/fusee-secondary.bin
stage2_mtc_path = atmosphere/fusee-mtc.bin
stage2_addr = 0xF0000000
stage2_entrypoint = 0xF0000000
[stratosphere]
; To force-enable nogc, add nogc = 1
; To force-disable nogc, add nogc = 0
; To opt out of using Atmosphere's NCM reimplementation, add disable_ncm = 1

View File

@ -1,6 +1,6 @@
# Key: debugmode, default: 1.
# Desc: Controls whether kernel is debug mode.
# Disabling this may break Atmosphere's debugger in a future release.
# Disabling this will break Atmosphere.
# Key: debugmode_user, default: 0.
# Desc: Controls whether userland is debug mode.

View File

@ -0,0 +1,4 @@
[stratosphere]
; To force-enable nogc, add nogc = 1
; To force-disable nogc, add nogc = 0

View File

@ -9,7 +9,17 @@
; Control whether RO should ease its validation of NROs.
; (note: this is normally not necessary, and ips patches can be used.)
; ease_nro_restriction = u8!0x1
[lm]
; Control whether lm should log to the SD card.
; Note that this setting does nothing when log manager is not enabled.
; enable_sd_card_logging = u8!0x1
; Control the output directory for SD card logs.
; Note that this setting does nothing when log manager is not enabled/sd card logging is not enabled.
; sd_card_log_output_directory = str!atmosphere/binlogs
; Atmosphere custom settings
[erpt]
; Control whether erpt reports should always be preserved, instead of automatically cleaning periodically.
; disable_automatic_report_cleanup = u8!0x0
[atmosphere]
; Reboot from fatal automatically after some number of milliseconds.
; If field is not present or 0, fatal will wait indefinitely for user input.
@ -53,6 +63,14 @@
; Controls whether htc is enabled
; 0 = Disabled, 1 = Enabled
; enable_htc = u8!0x0
; Controls whether atmosphere's log manager is enabled
; Note that this setting is ignored (and treated as 1) when htc is enabled.
; 0 = Disabled, 1 = Enabled
; enable_log_manager = u8!0x0
; Controls whether the bluetooth pairing database is redirected to the SD card (shared across sysmmc/all emummcs)
; NOTE: On <13.0.0, the database size was 10 instead of 20; booting pre-13.0.0 will truncate the database.
; 0 = Disabled, 1 = Enabled
; enable_external_bluetooth_db = u8!0x0
[hbloader]
; Controls the size of the homebrew heap when running as applet.
; If set to zero, all available applet memory is used as heap.

View File

@ -7,9 +7,10 @@ Building Atmosphère is a very straightforward process that relies almost exclus
+ [Python 2](https://www.python.org) (Python 3 may work as well, but this is not guaranteed)
+ [LZ4](https://pypi.org/project/lz4)
+ [PyCryptodome](https://pypi.org/project/pycryptodome) (optional)
+ [hactool](https://github.com/SciresM/hactool)
## Instructions
1. Follow the guide located [here](https://devkitpro.org/wiki/Getting_Started) to install and configure all the tools necessary for the build process.
1. Follow the guide located [here](https://devkitpro.org/wiki/Getting_Started) to install and configure all the tools necessary for the build process.
2. Install the following packages via (dkp-)pacman:
+ `switch-dev`
@ -17,16 +18,9 @@ Building Atmosphère is a very straightforward process that relies almost exclus
+ `switch-libjpeg-turbo`
+ `devkitARM`
+ `devkitarm-rules`
+ `hactool`
3. Install the following library via python's package manager `pip`, required by [exosphere](components/exosphere.md):
+ `lz4`
4. (Optional) In order to build [sept](components/sept.md) the pycryptodome PyPi package is required, which can be installed by running `pip install pycryptodome` under the installed Python environment of your choice or by installing the complete zip package to support the `make dist` recipe. This is an optional step included for advanced users who have the ability to provide the necessary encryption/signing keys themselves.
5. It is, instead, possible to build [sept](components/sept.md) by providing previously encrypted/signed binaries distributed by official Atmosphère release packages. In order to do so, export the following variables in your current environment:
+ `SEPT_00_ENC_PATH` (must point to the `sept-secondary_00.enc` file)
+ `SEPT_01_ENC_PATH` (must point to the `sept-secondary_01.enc` file)
+ `SEPT_DEV_00_ENC_PATH` (must point to the `sept-secondary_dev_00.enc` file)
+ `SEPT_DEV_01_ENC_PATH` (must point to the `sept-secondary_dev_01.enc` file)
6. Finally, clone the Atmosphère repository and run `make` under its root directory.
4. Finally, clone the Atmosphère repository and run `make` under its root directory.

View File

@ -1,4 +1,477 @@
# Changelog
## 1.9.1
+ Basic support was added for 20.1.0.
+ General system stability improvements to enhance the user's experience.
## 1.9.0
+ Basic support was added for 20.0.0.
+ The console should boot and atmosphère should be fully functional. However, not all modules have been fully updated to reflect the latest changes.
+ There shouldn't be anything user visible resulting from this, but it will be addressed in a future atmosphère update.
+ The same action item from 18.0.0 remains, and I believe in my heart of hearts that it will be addressed eventually. Someone has told me they're working on it.
+ There aren't (to my knowledge) outstanding 19.0.0 items any more.
+ **Please note**: As a result of changes made to nintendo's software in 20.0.0, there is roughly 10MB less memory available for custom system modules.
+ We can only steal a maximum of 14MB from the applet pool, down from 40MB.
+ To compensate for this, `ams.mitm`'s heap usage has been reduced by 20MB.
+ To facilitate this, a new helper module (`memlet`) was added, so that memory may be temporarily stolen during the romfs building process.
+ Hopefully, this results in relatively little breakage, however it is possible that user mods which replace extremely large numbers of files in The Legend of Zelda: Tears of the Kingdom may no longer function.
+ If you are affected by this, you will see "Data abort (0x101)" when trying to launch the game with mods.
+ Please reach out to `sciresm` on discord if this occurs to share your error report binary. However, some issues may be impossible to fix.
+ I apologize sincerely if the issue is impossible to resolve, but I have been forced unavoidably to make compromises here, and I think this is the best balance to be struck.
+ `exosphère` was updated to reflect the latest official secure monitor behavior.
+ `mesosphère` was updated to reflect the latest official kernel behavior.
+ `loader` was updated to reflect the latest official behavior.
+ `pm` was updated to reflect the latest official behavior.
+ `ncm` was partially updated to reflect the latest official behavior.
+ `erpt` was updated to reflect the latest official behavior.
+ Atmosphère was updated to use GCC 15/newlib (latest devkitA64/devkitARM releases).
+ A number of improvements were made to the dmnt cheat engine.
+ New instructions were added, and instructions were updated for improved/new functionality.
+ Please see the documents for details -- thanks @tomvita!
+ General system stability improvements to enhance the user's experience.
## 1.8.0
+ Basic support was added for 19.0.0.
+ The console should boot and atmosphère should be fully functional. However, not all modules have been fully updated to reflect the latest changes.
+ There shouldn't be anything user visible resulting from this, but it will be addressed in a future atmosphère update. There is still one action item from 18.0.0 to be addressed, as well.
+ `exosphère` was updated to reflect the latest official secure monitor behavior.
+ `mesosphère` was updated to reflect the latest official kernel behavior.
+ `loader` was updated to reflect the latest official behavior.
+ `pm` was updated to reflect the latest official behavior.
+ `ro` was updated to reflect the latest official behavior.
+ `creport`'s file acces patterns were optimized, greatly improving performance when generating a crash report.
+ Atmosphère now uses `relr` relocations where possible.
+ This reduces the filesize of a number of atmosphère's modules.
+ A number of minor issues were fixed and improvements were made, including:
+ Support was fixed for running Atmosphère on newer units with specific Hynix/Micron DRAM chips.
+ General system stability improvements to enhance the user's experience.
## 1.7.1
+ Support was added for 18.1.0.
+ Atmosphère was updated to use GCC 14/newlib (latest devkitA64/devkitARM releases).
+ Further changes were for 18.0.0:
+ `loader` was updated to reflect the latest official behavior.
+ General system stability improvements to enhance the user's experience.
## 1.7.0
+ Basic support was added for 18.0.0.
+ The console should boot and atmosphère should be fully functional. However, not all modules have been fully updated to reflect the latest changes.
+ There shouldn't be anything user visible resulting from this, but it will be addressed in a future atmosphère update, once I am not traveling so much.
+ `exosphère` was updated to reflect the latest official secure monitor behavior.
+ `mesosphère` was updated to reflect the latest official kernel behavior.
+ `spl` was updated to reflect the latest official behavior.
+ `fusee`'s no longer supports applying IPS patches to KIPs.
+ The only KIPs that are ever present are a) atmosphère modules, b) custom system modules, or c) FS.
+ The IPS subsystem was originally designed to make nogc patches work for FS, but these are now internal, and it appears the literal only kip patches that exist are for piracy.
+ I could not find any kip patches posted anywhere made for any other purpose.
+ It fundamentally does not make sense to slow down boot for every normal user for a feature that has no actual use-case, especially when `fusee` seeks to be a minimal bootloader.
+ Minor improvements were made to atmosphere's gdbstub, including:
+ Support was added for QStartNoAckMode.
+ An issue was fixed that could cause a fatal error when creating too many breakpoints.
+ A number of minor issues were fixed and improvements were made, including:
+ `pt-BR` (`PortugueseBr`) is now accepted as a valid language when overriding game locales.
+ A bug was fixed that could cause atmosphere to incorrectly serialize output object IDs over IPC when using domain objects.
+ A bug was fixed in `pm`'s resource limit boost logic that could potentially cause legitimate boosts to fail in certain circumstances.
+ `loader`/`ro` will now throw a fatal error when using invalid IPS patches that go out of bounds, instead of corrupting memory.
+ Support was fixed for booting using a memory configuration of half of the true available memory (e.g. forcing a 4GB configuration on an 8GB board).
+ General system stability improvements to enhance the user's experience.
## 1.6.2
+ Support was finished for 17.0.0.
+ `erpt` was updated to support the latest official behavior.
+ `jpegdec` was updated to support the latest official behavior.
+ `pm` was updated to support the latest official behavior.
+ General system stability improvements to enhance the user's experience.
## 1.6.1
+ An improved solution to [the problem that would cause consoles which had previously re-built their SYSTEM partition to brick on update-to-17.0.0](https://gist.github.com/SciresM/2ddb708c812ed585c4d99f54e25205ff) was added.
+ In particular, booting atmosphère will now automatically detect the problem and unbrick any consoles which have fallen into this state.
+ Some improvements were made to `haze`, including:
+ Performance was greatly improved:
+ Support was added for GetObjectPropList, which decreases the amount of requests made by ~8x.
+ Haze now performs rendering on the GPU, freeing up the CPU to respond to requests in a more timely manner.
+ An issue was fixed with how `haze` configures `bMaxPacketSize0` which improves support for USB3.
+ General system stability improvements to enhance the user's experience.
## 1.6.0
+ Basic support was added for 17.0.0.
+ The console should boot and atmosphère should be fully functional. However, not all modules have been fully updated to reflect the latest changes.
+ There shouldn't be anything user visible resulting from this, but it will be addressed in a soon-to-come atmosphère update.
+ `exosphère` was updated to reflect the latest official secure monitor behavior.
+ `mesosphère` was updated to reflect the latest official kernel behavior.
+ `ncm` was updated to reflect the latest official behavior.
+ `erpt` was partially updated to support the latest official behavior.
+ Atmosphere's gdbstub now supports waiting to attach to a specific program id on launch (as opposed to any application).
+ The monitor command for this is `monitor wait <hex program id>`, where program id can optionally have an `0x` prefix.
+ Support was added to `haze` for editing files in-place and performing 64-bit transfers (files larger than 4 GB).
+ `bpc.mitm` was enabled on Mariko units, and now triggers pmic-based shutdowns/reboots (thanks @CTCaer).
+ This should cause the console to no longer wake ~15 seconds after shutdown on Mariko.
+ A number of minor issues were fixed and improvements were made, including:
+ A workaround was added for a change in 17.0.0 that would cause consoles which had previously re-built their SYSTEM partition to brick on update-to-17.0.0.
+ General system stability improvements to enhance the user's experience.
## 1.5.5
+ Support was added for 16.1.0.
+ General system stability improvements to enhance the user's experience.
## 1.5.4
+ Experimental new functionality was implemented to prevent crashing when building romfs for certain games with obscene file counts.
+ This includes both Fire Emblem: Engage (~190000 files), and The Legend of Zelda: Tears of the Kingdom (~300000) files.
+ The solution involved adding functionality to ams.mitm/pm to dynamically steal memory from the application (and system) pool as needed when the games have romfs mods.
+ No memory is taken, and there is no cost to this functionality when playing without mods (or with overrides disabled).
+ The Legend of Zelda: Tears of the Kingdom is currently the absolute worst case game, requiring ~48 MB of memory to build a romfs image to play with mods.
+ Right now, the memory is sourced as follows: 32 MB (base ams.mitm heap), 10 MB (stolen from application pool), 8 MB (dynamically stolen from system pool).
+ This is 50 MB, which allows a little overhead in the worst case (prevents crashing due to exhausting the heap for other allocations in ams.mitm).
+ Zelda is remarkably sensitive to memory being stolen from the application pool, tolerating no more than 16 MB on 1.0.0 and 12 MB on 1.1.0. I have chosen to steal 10 MB, to be safe, for now.
+ This may break on a future game update, but I will fix it if and when that happens. There is no perfect solution; the game simply requires too much memory to support mods flawlessly, and I am forced to compromise.
+ As usual, if you encounter a game that exhausts ams.mitm's memory (crashing it) when loading layeredfs mods, please contact `SciresM#0524`.
"I am jinxing myself by saying this, but it's really hard to imagine any game being worse than The Legend of Zelda: Tears of the Kingdom, but if it happens again I will drop everything to fix it as usual".
+ General system stability improvements to enhance the user's experience.
## 1.5.3
+ Support was added for 16.0.3.
+ Atmosphère was updated to use GCC 13/newlib (latest devkitA64/devkitARM releases).
+ **Please note**: This introduces a known issue, which is currently being worked on.
+ As you may recall from the 1.4.1 changelog, Fire Emblem: Engage requires enormous amounts of memory to support using layeredfs mods with the game.
+ Latest GCC/newlib slightly increases malloc overhead size, which makes the previous memory increase insufficient.
+ A general-case solution to this is in the works, which should hopefully fix the problem in a way that doesn't jinx me for the future.
+ A number of minor issues were fixed and improvements were made, including:
+ An issue was fixed that caused system font replacement to not work on 16.0.0+.
+ An minor accuracy issue was addressed in mesosphere's management of certain memory ranges; this issue would have had zero visible impact to the end-user.
+ General system stability improvements to enhance the user's experience.
## 1.5.2
+ A homebrew application (`haze`) was added for performing USB file transfer (with thanks to @liamwhite for both design and implementation).
+ `haze` is included with atmosphère, and provides access to the SD card via the PTP/MTP protocol.
+ **Please note**: haze will show inside the homebrew menu under the name "USB File Transfer".
+ **Please note**: Atmosphère cannot be updated at runtime, and trying to install an atmosphère update via haze will fail as usual.
+ General system stability improvements to enhance the user's experience.
## 1.5.1
+ `fatal` was updated to reduce memory footprint.
+ Starting in 16.0.0, official `fatal` has no framebuffer or rendering logic, and instead calls other system service commands to draw the screen.
+ However, these commands aren't usable by atmosphère (too small rendering window, bad color support).
+ To reduce the relative memory footprint differential between atmosphère and official code, the framebuffer (2 MB) is now dynamically allocated when needed.
+ This will try to allocate from multiple pools (preferring System > System_NonSecure > Application).
+ This technically requires that 2 MB be available in at least one of these pools for the fatal screen to render (otherwise, a reboot-to-black-and-white-fatal will occur), but this should be a non-issue in almost all cases.
+ A feature was added to optionally mirror the bluetooth pairing database to the SD card (thanks @ndeadly).
+ This allows device pairings to be automatically kept in-sync across sysmmc/all emummcs.
+ This is opt-in, and can be controlled by setting `atmosphere!enable_external_bluetooth_db = u8!0x1`.
+ When enabled, the pairing database will be synchronized to `/atmosphere/bluetooth_devices.db`.
+ General system stability improvements to enhance the user's experience.
## 1.5.0
+ Support was added for 16.0.0
+ `mesosphère` was updated to reflect the latest official kernel behavior.
+ `ncm` was updated to reflect the latest official behavior.
+ Many FS apis were updated under the hood to reflect the latest official behavior.
+ **Please Note**: 16.0.0 made breaking changes to a number of system APIs, including in FS/NCM/Shared Font commands that some homebrew programs may use.
+ These programs may encounter strange errors, and may need to be recompiled with a libnx updated to support 16.0.0's changes to function properly.
+ A number of minor issues were fixed and improvements were made, including:
+ An issue was fixed that could cause GPIO outputs to be misconfigured under certain circumstances.
+ General system stability improvements to enhance the user's experience.
## 1.4.1
+ A number of minor issues were fixed and improvements were made, including:
+ `dmnt` cheat toggle files are no longer ignored when they are missing a trailing newline.
+ The mechanism for automatically cleaning up `erpt_reports` added in 1.3.0 was fixed.
+ This was actually just very fundamentally broken and has never worked, but it is verified working now.
+ Minor fixes were made in `mesosphère` to match official kernel behavior (spin lock assembly was corrected, wrong result on failure in in GetProcessId was corrected).
+ A missing call to GetSdStatus when initializing SD cards at non uhs-i mode was added in the sdmmc driver.
+ `ams.mitm`'s memory usage was increased by 16 MB, to prevent crashing when building romfs for games with obscene file counts.
+ To quote the changelog for 1.2.3: "Animal Crossing's 2.0.0 update contains >99000 files [...] It's really hard to imagine any game being worse than Animal Crossing".
+ As it turns out, Fire Emblem: Engage has ~186000 files, and is approximately twice as bad as animal crossing.
+ The additional memory here is taken from the applet pool; no issues are expected to arise from this, but please report anything you may run into.
+ As usual, if you encounter a game that exhausts ams.mitm's memory (crashing it) when loading layeredfs mods, please contact `SciresM#0524`.
+ I am jinxing myself by saying this, but it's really hard to imagine any game being worse than Fire Emblem: Engage, but if it happens again I will drop everything to fix it as usual.
+ General system stability improvements to enhance the user's experience.
## 1.4.0
+ Support was added for 15.0.0.
+ `mesosphère` was updated to reflect the latest official kernel behavior.
+ `ncm` was updated to reflect the latest official behavior.
+ A number of minor issues were fixed and improvements were made, including:
+ The capacity limit on registered add-on contents was fixed in NCM to reflect the increase that occurred in 12.0.0.
+ An off-by-one was fixed in mesosphere when computing the new value for an address arbiter signaled with ModifyByWaitingCountIfEqual.
+ dmnt.gen2's gdbstub now sanitizes thread names to prevent invalid characters from breaking gdb.
+ dmnt.gen2's gdbstub now reports the architecture tag correctly when attached to 32-bit processes.
+ Support for program-specific html manual content overrides was added for non-hbl takeover context.
+ A bug was fixed in how emummc constructed the alternate Nintendo directory path.
+ Previously, this was using `/*/Nintendo/Nintendo` instead of `/*/Nintendo`.
+ Code was added to automatically move the old folders to the new ones when booting into emummc.
+ A bug was fixed in boot that caused an incorrectly low input voltage limit to be set.
+ General system stability improvements to enhance the user's experience.
## 1.3.2
+ Support was improved for 14.0.0+.
+ `loader` was updated to reflect the latest official behaviors.
+ `ro` was updated to reflect the latest official behaviors.
+ A number of minor issues were fixed and improvements were made, including:
+ A memory leak was fixed in filesystem path management; this could cause a crash when launching games ~100 times, or when deleting/re-downloading games.
+ A bug was fixed that could cause threads to not see a newly signaled semaphore.
+ A number of minor inaccuracies were fixed in the updated FileSystem APIs.
+ General system stability improvements to enhance the user's experience.
## 1.3.1
+ Support was added for 14.1.0.
+ A number of minor under the hood improvements to accuracy were made to better reflect latest official system module behavior, particularly around FS apis.
+ General system stability improvements to enhance the user's experience.
## 1.3.0
+ Support was added for 14.0.0.
+ `mesosphère` was updated to reflect the latest official kernel behavior.
+ `erpt` was updated to reflect the latest official behaviors.
+ `pm` was updated to reflect the latest official behaviors.
+ `fatal` was updated to reflect the latest official behaviors.
+ A mechanism for automatically cleaning up `erpt_reports` was added.
+ When booting, if the console has more than 1000 reports inside `/atmosphere/erpt_reports`, the folder will be cleaned to empty.
+ This behavior can be disabled by setting `erpt!disable_automatic_report_cleanup` = u8!0x1 in system_settings.ini.
+ Atmosphère's build system was re-written, and now allows globally building for various builds/configs.
+ All boards now automatically support release/debugging/auditing targets; it is now possible to build a full debugging/auditing build of atmosphère for the first time.
+ Support was added for compiling libstratosphère to run on PC.
+ The currently implemented/tested targets are Windows (x64), Linux (x64, arm64), macOS (x64, arm64).
+ If you are a developer interested in adding support for another target, please reach out to `SciresM#0524` on discord.
+ This is intended to finally allow sanely testing Atmosphère's code, by allowing most of it to run on a PC (with access to a debugger) instead of on game console hardware.
+ In addition, this will allow making PC tools which reuse code written for Atmosphère directly..
+ **Please Note**: This has no relation to interacting with official software on PC whatsoever. This really allows for making tests and self-contained atmosphère-based command-line tools; the Atmosphère project continues to have zero interest in attempting to run official software of any kind.
+ In the course of adding this support (and working on tooling using it), a number of fairly major revisions were made to stratosphere (particularly surrounding filesystem code).
+ **Please Note**: A number of changes made for this (and ones necessary in the process of adding support for 14.0.0) are api-breaking.
+ If you're a developer and any of this caused your code to break, please feel free to contact `SciresM#0524` for help updating your program.
+ General system stability improvements to enhance the user's experience.
## 1.2.6
+ Support was added for 13.2.1.
+ A number of minor issues were fixed and improvements were made, including:
+ A minor performance improvement was implemented in service table dispatch by sorting and binary-searching the service command table instead of using linear search.
+ Static initialization logic in Atmosphere was made much more regular.
+ General system stability improvements to enhance the user's experience.
## 1.2.5
+ Support was added for 13.2.0.
+ A number of minor issues were fixed and improvements were made, including:
+ A bug was fixed that caused `mesosphère` to underreport the total memory size by 8MB for certain games which use newer system-resource-size memory management.
+ This caused FIFA 19 to crash, and possibly other issues.
+ Memory management changes were made to `sm` that save 0x5000 of memory.
+ A microoptimization was made to the way `mesosphère` manages updating the debug register for hardware single-step support.
+ Support was fixed for enabling `usb!usb30_force_enabled` on 13.0.0+.
+ The work-in-progress unit testing framework was updated to use doctest instead of catch2.
+ General system stability improvements to enhance the user's experience.
## 1.2.4
+ Changes were made to the way fs.mitm builds images when providing a layeredfs romfs.
+ Cache management (to avoid unnecessary rebuild) was revised, to add a grace period of ~500ms-1s between process closing romfs image and ams.mitm needing to rebuild if romfs is re-opened.
+ This makes our cache much more effective, previously we were re-building romfs several times.
+ RomFS image ownership was overhauled, with a new reference-counting implementation added (used to implement the above grace period).
+ Certain games (e.g. Puyo Puyo Tetris 2, probably others) were sensitive to this timing, and could use access patterns which would trigger creation of romfs image while previous romfs image was in the middle of destructor.
+ This could cause a fatal error, because the destructor for the old image could run simultaneously with building the new image.
+ This also provides a speedup versus the 1.2.3 code, with Animal Crossing now taking ~8 fewer seconds to get past the Nintendo Switch logo.
+ General system stability improvements to enhance the user's experience.
## 1.2.3
+ Because ams.TMA is taking longer to develop than expected, experimental support for Atmosphère's gdbstub as a standalone is now available.
+ To enable it, set `atmosphere!enable_standalone_gdbstub` = u8!0x1 in system_settings.ini.
+ The standalone also requires `atmosphere!enable_htc` = u8!0x0, but this should be the case for everyone since ams.TMA isn't actually usable yet.
+ Once enabled, open the devkitPro provided-gdb (`aarch64-none-elf-gdb` for 64-bit or `arm-none-eabi-gdb` for 32-bit).
+ The standalone stub exposes itself on port 22225 -- so the command to connect is `target extended-remote <ip address>:22225`.
+ Type `info os processes` to get a list of process IDs that can be attached to.
+ The stub should work on both system programs, games, and homebrew -- but please note that debugging certain processes (like sockets) can cause hang due to the stub using them itself.
+ Software break-points, hardware break-points, hardware watch-points, and hardware single-step are all supported/implemented.
+ The following monitor commands are currently supported:
+ `monitor get info`: Get process info, address space layout, and information on modules.
+ `monitor get mappings`: Get all memory mappings.
+ `monitor get mapping <addr>`: Get the memory mapping for a specific address.
+ `monitor wait application`: Causes the stub to wait for an application to be launched. The next application will be started suspended.
+ User is expected to send `attach <pid>` after launching, which will cause attach-on-first-instruction. Failure to attach may cause system instability, this probably needs work.
+ **Please Note**: The GDBstub is new and may have bugs/need work. If you find issues, please report them to SciresM#0524 -- all help finding/fixing bugs is appreciated, here.
+ Generally speaking, if you would like to report information about fixes needed/discuss development of the gdbstub, join ReSwitched's #dev-support channel.
+ Changes were made to the way fs.mitm builds images when providing a layeredfs romfs.
+ Animal Crossing's 2.0.0 update contains >99000 files, and has tables so big that we ran out of memory even after the optimizations made in 0.10.5.
+ Previously, we used fixed-sized 0x40000 work buffers for file/directory tables and simultaneously built hash/content tables in one loop over files/directories.
+ We now iterate over the file/directory tables multiple times, first once to determine the hash table indices, then repeatedly to build hash tables, then once to build content tables.
+ We also now allow smaller-than-0x40000 work buffers, trying half-as-big buffers until allocation succeeds (or work buffer would be <0x4000, which is a safeguard against truly horrible performance).
+ There is a slight speed penalty to these changes, but it's on the order of seconds for the worst case (Animal Crossing) and trivial for most games with reasonable tables.
+ If you encounter a game that exhausts ams.mitm's memory (crashing it) when loading layeredfs mods, please contact `SciresM#0524`.
+ It's really hard to imagine any game being worse than Animal Crossing, but if it happens again I will drop everything to fix it as usual.
+ `creport` now attempts to parse symbol tables if present.
+ If a game executable has a symbol for a given address, the function-relative-offset will now be printed after the module-relative-offset.
+ General system stability improvements to enhance the user's experience.
## 1.2.2
+ A number of fixes were made to Atmosphère's implementation of the new "sprofile" service added in 13.0.0.
+ Nintendo is finally transmitting data over the internet to certain consoles, which has allowed for validating our service implementation.
+ Unfortunately, there were several problems, and if your console began trying to use the new services atmosphere would show a fatal error with code 0xCAF6 (sprofile::ResultInvalidState()).
+ With actual test data in hand, a test program was written and it was verified that our implementation can successfully import/access profile data now.
+ Hopefully there are no more issues, and I sincerely apologize for anyone who got an 0xCAF6 fatal due to this.
+ A number of minor improvements were made to `mesosphère`, including:
+ KThread::GetContextForSchedulerLoop was implemented in assembly (using static assertions to verify offset-of-context-in-struct is correct).
+ This saves an unnecessary function call in the middle of the scheduler hot loop, replacing it with an addition instruction, which should improve microperformance.
+ Mesosphere's hardware maintenance instructions were audited via a script and now directly match Nintendo's kernels.
+ Notably, this inserts a missing instruction synchronization barrier when validating that slab heaps may be constructed.
+ This missing ISB could cause an abort on certain (see: particularly sensitive) hardware on boot if the relevant codepath was speculatively executed (it normally only executes on game launch...)
+ The SVC handlers for performing light IPC (normally unused) from 32-bit process were fixed in Mesosphere.
+ A bug was fixed that would cause the register x27 to be overwritten with the contents of x26 when returning from a user exception handler.
+ A bug was fixed that would cause the kernel to use the userland stack pointer instead of the kernel stack pointer while generating an error report for a kernel abort.
+ General system stability improvements to enhance the user's experience.
## 1.2.1
+ Support was implemented for 13.1.0.
+ `mesosphère` was updated to reflect the kernel behavioral changes made in 13.1.0.
+ KScheduler now issues a data memory barrier when unlocking the scheduler lock and when early-returning due to top-thread-is-current during scheduling.
+ `erpt` was updated to reflect the latest official behaviors.
+ The new service added in 13.0.0 ("sprofile") was revised, and the data formats it expects was changed.
+ This still appears to be (possibly(?)) untestable due to data not being transmitted yet, but I have greater confidence things will go smoothly than I did when 1.1.0 released.
+ A number of improvements were made to `mesosphère`, including:
+ A build target was created to build targeting the qemu `virt` board.
+ This facilitates writing unit tests for the kernel (and other atmosphere components) and running them under PC.
+ **Please Note**: Official system software will not work at all under this, and the Atmosphère project has zero interest in attempting to run official software of any kind. This is unit testing machinery, and explicitly not more than that.
+ This should hopefully allow us to have greater confidence that all of atmosphere's components work the way they're theoretically supposed to in the future.
+ **Please Note**: If you are a developer who is familiar with the Horizon operating system (or capable of becoming familiar), I would greatly appreciate help writing tests and improving the testing framework.
+ Please contact `SciresM#0524` if you are capable and interested.
+ Really, if you are actually a developer who would like to help me get this off the ground, I would deeply appreciate it.
+ That said, if you are not a developer but want to be one, this probably isn't the best opportunity; I expect it to be highly technical.
+ Consider the ReSwitched discord's #hack-n-all channel for your educational purposes.
+ We are (at least for now) using [catch2](https://github.com/catchorg/Catch2) for unit tests.
+ Almost all virtual calls in the kernel are now resolved statically.
+ This eliminates substantial virtual call overhead, and should lead to improved kernel microperformance in pretty much every function.
+ The remaining red black tree find operations which weren't using the optimized "find key" variant are now using the optimized version.
+ Custom assembly was written to improve tick-to-timespan conversion.
+ This works around gcc emitting suboptimal assembly at -Os (it emits good assembly at -O3, clang is fine at both -O3 and -Os).
+ KThread and KSession structures were updated to optimize member layout, saving 0x10 bytes per KThread/KSession object.
+ Rather than unnecessarily zero-ing all data in kernel objects only to overwrite members later, we now only initialize the members we need to in kernel object constructors.
+ This is what Nintendo was doing already.
+ A set of custom optimized atomic primitives were implemented and are used in place of std::atomic<>
+ This works around a gcc bug which downgrades specified memory order to seq_cst, and introduces clrex in places where it is appropriate.
+ This should strictly improve microperformance of many system calls.
+ An compile-time toggleable extension was added to support 40-bit physical addresses in MapRange capabilities (using currently reserved bits).
+ A number of minor bugs were fixed, including:
+ Initial cache management now better reflects official behavior.
+ This fixes an issue that caused certain hardware with cache sensitivity to produce cryptic kernel panics during boot.
+ Incorrect logic when checking thread priority capabilities was fixed to reflect official behavior.
+ The scheduler was updated to reflect latest official behavior, and a number of minor bugs involving clz/ctz were fixed.
+ Accesses to the processes local region were fixed to properly use kernel linear region, not userland pointers.
+ The cache SVCs exposed for 32-bit processes now better reflect official core mask request semantics.
+ A bug was fixed that could cause a kernel panic if SvcArbitrateLock was called on a thread with exactly one reference in the middle of handling a user-mode exception.
+ General system stability improvements to enhance the user's experience.
## 1.2.0
+ `boot` was updated to reflect the latest official behavior for display/battery management.
+ This should fix any issues that might result from running older releases on the OLED model, if you're somehow in a position to do so.
+ The "target firmware" system was changed to allow the bootloader to specify an approximation, rather than the true target firmware.
+ Previously we expected compliant bootloaders to inspect SYSTEM:/ to determine the specific target firmware.
+ Now, we only require an approximate version, with major version == true major version and approximate version <= true version.
+ This greatly simplifies bootloader requirements, and correspondingly all code for accessing SYSTEM has been removed from fusee.
+ This should result in a substantial speedup when booting emummc with fusee, as SYSTEM accesses were the most expensive thing done previously.
+ This should resolve any inconsistency in firmware detection when booting via fusee vs hekate.
+ This should also improve our compatibility with micro firmware releases, making it more likely that atmosphere "just works" if nothing important has changed.
+ Dynamic resource limit determination logic was implemented in `pm` to match latest official behavior.
+ This greatly simplifies/makes consistent the resource limits on older firmwares, as well.
+ An enormous amount of refactoring was performed under the hood, including:
+ **Please Note**: If you are a developer who uses Atmosphere-libs, a number of changes here are breaking.
+ Feel free to contact SciresM#0524 for help updating your program.
+ The OS namespace had many primitives implemented/made more accurate.
+ Since mesosphere is now always-on, os::LightEvent (which required newer SVCs) is now globally usable (and used by stratosphere where relevant).
+ Assertions are now true no-ops when building for release.
+ Stratosphere is now built with -Wextra/-Werror.
+ Most "common" logic in system module main.cpp files was moved into libstratosphere.
+ **Please Note**: main.cpp files for prior atmosphere-libs will no longer work, for a really large number of reasons.
+ A number of longstanding code style issues were corrected.
+ Mesosphere now uses util::BitFlagSet for SVC permissions.
+ Mesosphere now puts its relocation table inside .bss, which allows that memory to be reclaimed after relocations are performed.
+ These changes save ~16KB of memory in the kernel, all said and done.
+ A number of locations in stratosphere where memory could be saved were spotted and taken advantage of, leading to ~150-200KB of saved memory.
+ The `spl` and `loader` system module was refactored to better reflect official logic.
+ `sf` ipc server code was updated to only emit mitm/defer logic when that logic is actually required somewhere in process.
+ `tipc` ipc server code was updated to reflect changes to official logic made in 13.0.0.
+ Many, many other minor changes, please talk to SciresM#0524 or read the relevant commits if you want to know more.
+ A number of minor issues were fixed, including:
+ Mesosphere's handling of SVC permissions on thread pin/unpin was updated to reflect official kernel behavior.
+ util::CountTrailingZeros() was fixed to calculate the correct value when used at compile-time.
+ General system stability improvements to enhance the user's experience.
## 1.1.1
+ A bug was fixed which caused some memory to leak when launching a game with mods enabled, eventually causing a crash after enough game launches without rebooting.
+ General system stability improvements to enhance the user's experience.
## 1.1.0
+ Support was implemented for 13.0.0.
+ `mesosphère` was updated to reflect the latest official kernel behavior.
+ `ncm` was updated to reflect the latest official behaviors.
+ `erpt` was updated to reflect the latest official behaviors.
+ Two new services ("sprofile") were added to `erpt`, and have been fully reimplemented.
+ **Please Note**: These services provide a way for settings to be pushed to consoles over the internet without system update.
+ Because there appear to be no settings pushed out yet, this implementation fundamentally cannot be fully tested right now, but hopefully there are no issues once settings begin being distributed.
+ The `LogManager` system module was reimplemented.
+ This system module provides services that some games use for logging.
+ Atmosphere's reimplementation supports logging to the SD card (if `lm!enable_sd_card_logging` is true) and to ams.TMA.
+ To control the directory where logs are saved, modify the `lm!sd_card_log_output_directory` setting.
+ Atmosphere's reimplementation is disabled by default (in order to save memory), but can be enabled by setting `lm!enable_log_manager` to true.
+ This will allow reading over logs from games which use the services (or potentially logging from homebrew in the future), which can be useful to developers.
+ Please note that when TMA is fully implemented in the future, enabling TMA will forcibly enable `LogManager`.
+ General system stability improvements to enhance the user's experience.
## 1.0.0
+ `fusee` was completely re-written in C++ to use the same atmosphere-libs APIs as the rest of atmosphere's code.
+ The rewrite was performed with a big emphasis on ensuring a good boot speed, and generally boot should be much faster than it was previously.
+ Depending on SD card/environment, boot speed may now be slightly faster than, roughly the same as, or slightly slower than when booting with hekate.
+ The obvious low-hanging fruit for performance improvements has been picked, so hopefully the improved performance is to everybody's liking.
+ SD card compatibility was improved: fusee should now have SD card compatibility identical to the official OS driver.
+ **Please Note**: various components were renamed (fusee-primary.bin -> fusee.bin, fusee-secondary.bin -> package3).
+ If you use another bootloader (like hekate), you may need to update your configuration to use the new layout.
+ **Please Note**: BCT.ini no longer exists, nogc configuration has been moved to `/atmosphere/stratosphere.ini`.
+ If you rely on custom nogc configuration, please be sure to update accordingly.
+ Custom splash screen BMP parsing is no longer supported (as it slows down boot for 99% of users).
+ To compensate for this, a script to insert a custom splash screen into a `package3` binary has been added to the `utilities` folder of the atmosphere repository.
+ The release build should be equivalent to running the following command from the root of the atmosphere repository: `python utilities/insert_splash_screen.py img/splash.png fusee/package3`
+ A number of pending changes were made, following the end of the relevant testing periods:
+ `mesosphere` is no longer opt-out, and stratosphere code will begin depending on its being present/in use.
+ `NCM` is no longer opt-out.
+ The cleanup to ease the transition from < 0.19.0 to 0.19.0 has been removed.
+ General system stability improvements to enhance the user's experience.
## 0.20.1
+ An issue was fixed that caused severely degraded performance after wake-from-sleep on Mariko hardware.
+ This was due to Mariko MTC resulting in a frequency of 1599.999MHz instead of 1600MHz.
+ Due to this off-by-one, Nintendo's EMC management code failed to initialize/take over, and after wake from sleep RAM would be in a strange state.
+ General system stability improvements to enhance the user's experience.
## 0.20.0
+ DRAM training (MTC) was implemented for Mariko hardware, increasing RAM speed from 204MHz to 1600MHz.
+ This significantly optimizes Mariko boot speed, cutting boot time roughly in half.
+ Typical boot time reductions (measured as "select fusee" to "home menu visible"):
+ Normal (Iowa): ~35 seconds -> ~18 seconds.
+ Lite (Hoag): ~65 seconds -> ~30 seconds.
+ NOTE: Work is being started on a re-written `fusee` component, with an eye specifically towards ensuring a good boot speed.
+ With any luck, boot will be much much faster on all units (Mariko and Erista) in an upcoming release.
+ Sept was replaced, and deleted from the repository.
+ Erista units now use a custom TSEC firmware to manage key derivation.
+ For more details, contact SciresM#0524 on discord.
+ This has a number of benefits, including:
+ This greatly simplifies key derivation logic by making it consistent on all firmwares.
+ Fusee no longer accesses/uses keyblobs at all, so units which have accidentally destroyed/lost keyblobs can boot without them.
+ This greatly increases stability (sept was the biggest source of boot failures).
+ This improves boot speed (sept rebooted multiple times, performed hardware init multiple times, and was generally very slow).
+ Atmosphère build process is now much saner.
+ A number of improvements were made to the dmnt cheat engine.
+ Cheats which take in a memory region operand may now use types "2" or "3" to perform accesses relative to the alias/aslr regions, respectively.
+ Support was added for an "else" opcode in the cheat engine, to make writing certain conditional logic more natural.
+ Support was added for a cheat orchestrator homebrew (like edizon) to detach from a cheat process/set the master cheat programmatically.
+ Daybreak now provides a warning when attempting to install a firmware newer than the highest version atmosphère knows it supports.
+ To facilitate this, exosphere now exposes the supported HOS version via an extension ConfigItem.
+ A number of minor issues were fixed, including:
+ Several mesosphere debug SVC implementations were updated to reflect the semantics of the latest kernel.
+ Support was fixed for deriving BIS encryption keys on certain prototype hardware.
+ General system stability improvements to enhance the user's experience.
## 0.19.5
+ Support was added for 12.1.0.
+ LayeredFS support was added for OpenDataStorageWithProgramIndex commands.
+ Certain games using newer (7.0.0+ APIs) which include multiple programs under a single title previously could not be modified.
+ These are now supported as normal, and LayeredFS should have 100% compatibility again.
+ A number of minor issues were fixed, including:
+ The Reboot to Payload NRO was updated to allow the OS to save state prior to rebooting (thanks @AuroraWright)!
+ An issue was fixed that could cause dns.mitm to fail when games requested resolution of an empty string.
+ An issue was fixed that caused a memory leak in the erpt system module.
+ This would eventually cause a system crash after ~540 reports were generated without rebooting.
+ A number of minor improvements were made to improve mesosphere's accuracy.
+ General system stability improvements to enhance the user's experience.
## 0.19.4
+ Support was added for 12.0.3.
+ A number of minor issues were fixed, including:
+ An issue was fixed that could cause heap memory corruption when allocation was highly contended.
+ An issue was fixed that could cause sleep to fail under certain conditions.
+ An issue was fixed that could cause a scheduler slow path to be taken more often than necessary.
+ General system stability improvements to enhance the user's experience.
## 0.19.3
+ Support was added for 12.0.2.
+ A number of minor issues were fixed, including:
+ An issue was fixed in dns.mitm that caused a crash when games attempted to resolve the IP address of nullptr.
+ An issue was fixed in erpt that would cause an abort when booting without having ever booted stock previously.
+ An issue was fixed in (file-based) emummc that caused an error on system format/downloading certain games.
+ General system stability improvements to enhance the user's experience.
## 0.19.2
+ Atmosphère's components were further updated to reflect latest official behaviors as of 12.0.0.
+ Notably, `erpt` was updated to implement the new forced shutdown detection feature.
+ When a forced-shutdown occurs, an erpt_report will be generated and saved to the SD card on the next boot.
+ Atmosphere-libs was updated to use GCC 11 (latest devkitA64/devkitARM releases).
+ Initial inspections show mild-to-moderate optimizer improvements in several important places (kernel is 0x3000 smaller).
+ General system stability improvements to enhance the user's experience.
+ A number of minor issues were fixed, including:
+ A bug was fixed that caused a black screen when attempting to boot firmware versions 2.0.0-4.1.0.
+ A bug was fixed that caused sm to abort when at the session limit, rather than returning error codes.
+ A bug was fixed that allowed for resource exhaustion on 12.0.0, under certain circumstances.
+ Several issues were fixed, and usability and stability were improved.
## 0.19.1
+ An issue was fixed that caused a fatal error when using official `migration` services to transfer data between consoles.
+ An issue was fixed in `ncm` that caused an error when the OS tried to enumerate installed SD card content.
+ Several issues were fixed, and usability and stability were improved.
## 0.19.0
+ Support was added for 12.0.0.
+ `mesosphère` was updated to reflect the latest official kernel behavior.

View File

@ -1,22 +1,8 @@
# fusée
fusée is a custom bootloader used to start the Atmosphère environment.
It is divided into three sub-components: fusée-primary, fusée-mtc and fusée-secondary.
fusée is also capable of chainloading other payloads (e.g.: Android).
fusée's behavior can be configured via the [BCT.ini](../features/configurations.md) file located on the SD card.
## fusée-primary
fusée-primary is the first piece of Atmosphère's code that runs on the hardware.
## fusée
fusée is the first piece of Atmosphère's code that runs on the hardware.
It is distributed as a standalone payload designed to be launched via RCM by abusing the CVE-2018-6242 vulnerability.
This payload is responsible for all the low-level hardware initialization required by the Nintendo Switch, plus the extra task of initializing the SD card and reading the next fusée sub-components from it.
## fusée-mtc
fusée-mtc is an optional, but heavily recommended sub-component that performs DRAM memory training.
This ensures a proper environment for running the final fusée sub-component.
## fusée-secondary
fusée-secondary is the last fusée sub-component that runs on the system.
It is responsible for configuring and bootstrapping the Atmosphère environment by mimicking the Horizon OS's design.
This includes setting up the cryptosystem, mounting or emulating the eMMC, injecting or patching system modules and launching the exosphère component.
This payload is responsible for all the low-level hardware initialization required by the Nintendo Switch, setting up the cryptosystem, mounting/emulating the eMMC, injecting/patching system modules, and launching the exosphère component.

View File

@ -1,14 +0,0 @@
# sept
Sept is a payload that facilitates booting Atmosphère when targeting firmware version 7.0.0+.
It consists of a primary and a secondary payload.
## sept-primary
sept-primary is essentially a stand-in for Nintendo's package1ldr, on 7.0.0+. To use it, the caller (normally fusée-secondary) loads the sept-primary binary to `0x4003F000`, loads the 7.0.0+ TSEC firmware to `0x40010F00`, and loads a signed, encrypted payload to `0x40016FE0`.
This signed, encrypted payload is normally sept-secondary.
## sept-secondary
sept-secondary is a payload that performs 7.0.0+ key derivation, and then chainloads to `sept/payload.bin`.
It is normally stored encrypted/signed. Therefore, if one wishes to build sept-secondary instead of using release builds, one must bring their own keys.

18
docs/faq.md Normal file
View File

@ -0,0 +1,18 @@
# Frequently Asked Questions
This document serves as a place to store answers for common questions received about Atmosphère.
## What does "June 15th" mean?
When Atmosphère began development in February 2018, "June 15" was given as the estimate/target date for a first release, to coincide with the planned disclosure of a vulnerability.
This deadline was missed, hard.
People made rather a lot of fun of me (SciresM) for this.
Several months later, when the first Atmosphère release occurred, I captioned it "Happy June 15th!" and pretended like I hadn't missed the first deadline.
This amused me a lot, and so the practice has been kept up for every single release since.
Depending on who you ask, you may be told that this is a dumb joke and it is not funny.
This is incorrect. It is definitely a dumb joke, but it is also hilarious.

View File

@ -19,6 +19,8 @@ This behavior ensures that cheat codes are only loaded when the user would want
In cases where `dmnt` has not activated the cheat manager, but the user wants to make it do so anyway, the cheat manager's service API provides a `ForceOpenCheatProcess` command that homebrew can use. This command will cause the cheat manager to try to force itself to attach to the process.
In cases where `dmnt` has activated the cheat manager, but the user wants to use an alternate debugger, the cheat manager's service API provides a `ForceCloseCheatProcess` command that homebrew can use. This command will cause the cheat manager to detach itself from the process.
By default, all cheat codes listed in the loaded .txt file will be toggled on. This is configurable by the user by editing the `atmosphere!dmnt_cheats_enabled_by_default` [system setting](configurations.md).
Users may use homebrew programs to toggle cheats on and off at runtime via the cheat manager's service API.
@ -40,31 +42,33 @@ The following provides documentation of the instruction format for the virtual m
Typically, instruction type is encoded in the upper nybble of the first instruction u32.
### Code Type 0: Store Static Value to Memory
Code type 0 allows writing a static value to a memory address.
### Code Type 0x0: Store Static Value to Memory
Code type 0x0 allows writing a static value to a memory address.
#### Encoding
`0TMR00AA AAAAAAAA VVVVVVVV (VVVVVVVV)`
+ T: Width of memory write (1, 2, 4, or 8 bytes).
+ M: Memory region to write to (0 = Main NSO, 1 = Heap).
+ M: Memory region to write to (0 = Main NSO, 1 = Heap, 2 = Alias, 3 = Aslr, 4 = non-relative).
+ R: Register to use as an offset from memory region base.
+ A: Immediate offset to use from memory region base.
+ V: Value to write.
---
### Code Type 1: Begin Conditional Block
Code type 1 performs a comparison of the contents of memory to a static value.
### Code Type 0x1: Begin Conditional Block
Code type 0x1 performs a comparison of the contents of memory to a static value.
If the condition is not met, all instructions until the appropriate conditional block terminator are skipped.
If the condition is not met, all instructions until the appropriate End or Else conditional block terminator are skipped.
#### Encoding
`1TMC00AA AAAAAAAA VVVVVVVV (VVVVVVVV)`
`1TMCXrAA AAAAAAAA VVVVVVVV (VVVVVVVV)`
+ T: Width of memory write (1, 2, 4, or 8 bytes).
+ M: Memory region to write to (0 = Main NSO, 1 = Heap).
+ T: Width of memory read (1, 2, 4, or 8 bytes).
+ M: Memory region to read from (0 = Main NSO, 1 = Heap, 2 = Alias, 3 = Aslr, 4 = non-relative).
+ C: Condition to use, see below.
+ X: Operand Type, see below.
+ r: Offset Register (operand types 1).
+ A: Immediate offset to use from memory region base.
+ V: Value to compare to.
@ -76,18 +80,25 @@ If the condition is not met, all instructions until the appropriate conditional
+ 5: ==
+ 6: !=
#### Operand Type
+ 0: Memory Base + Relative Offset
+ 1: Memory Base + Offset Register + Relative Offset
---
### Code Type 2: End Conditional Block
Code type 2 marks the end of a conditional block (started by Code Type 1 or Code Type 8).
### Code Type 0x2: End Conditional Block
Code type 0x2 marks the end of a conditional block (started by Code Type 0x1 or Code Type 0x8).
When an Else is executed, all instructions until the appropriate End conditional block terminator are skipped.
#### Encoding
`20000000`
`2X000000`
+ X: End type (0 = End, 1 = Else).
---
### Code Type 3: Start/End Loop
Code type 3 allows for iterating in a loop a fixed number of times.
### Code Type 0x3: Start/End Loop
Code type 0x3 allows for iterating in a loop a fixed number of times.
#### Start Loop Encoding
`300R0000 VVVVVVVV`
@ -102,8 +113,8 @@ Code type 3 allows for iterating in a loop a fixed number of times.
---
### Code Type 4: Load Register with Static Value
Code type 4 allows setting a register to a constant value.
### Code Type 0x4: Load Register with Static Value
Code type 0x4 allows setting a register to a constant value.
#### Encoding
`400R0000 VVVVVVVV VVVVVVVV`
@ -113,29 +124,44 @@ Code type 4 allows setting a register to a constant value.
---
### Code Type 5: Load Register with Memory Value
Code type 5 allows loading a value from memory into a register, either using a fixed address or by dereferencing the destination register.
### Code Type 0x5: Load Register with Memory Value
Code type 0x5 allows loading a value from memory into a register, either using a fixed address or by dereferencing the destination register.
#### Load From Fixed Address Encoding
`5TMR00AA AAAAAAAA`
+ T: Width of memory read (1, 2, 4, or 8 bytes).
+ M: Memory region to write to (0 = Main NSO, 1 = Heap).
+ M: Memory region to write to (0 = Main NSO, 1 = Heap, 2 = Alias, 3 = Aslr, 4 = non-relative).
+ R: Register to load value into.
+ A: Immediate offset to use from memory region base.
#### Load from Register Address Encoding
`5TMR10AA AAAAAAAA`
`5T0R10AA AAAAAAAA`
+ T: Width of memory read (1, 2, 4, or 8 bytes).
+ M: Memory region to write to (0 = Main NSO, 1 = Heap).
+ R: Register to load value into.
+ R: Register to load value into. (This register is also used as the base memory address).
+ A: Immediate offset to use from register R.
#### Load from Register Address Encoding
`5T0R2SAA AAAAAAAA`
+ T: Width of memory read (1, 2, 4, or 8 bytes).
+ R: Register to load value into.
+ S: Register to use as the base memory address.
+ A: Immediate offset to use from register R.
#### Load From Fixed Address Encoding with offset register
`5TMR3SAA AAAAAAAA`
+ T: Width of memory read (1, 2, 4, or 8 bytes).
+ M: Memory region to write to (0 = Main NSO, 1 = Heap, 2 = Alias, 3 = Aslr, 4 = non-relative).
+ R: Register to load value into.
+ S: Register to use as offset register.
+ A: Immediate offset to use from memory region base.
---
### Code Type 6: Store Static Value to Register Memory Address
Code type 6 allows writing a fixed value to a memory address specified by a register.
### Code Type 0x6: Store Static Value to Register Memory Address
Code type 0x6 allows writing a fixed value to a memory address specified by a register.
#### Encoding
`6T0RIor0 VVVVVVVV VVVVVVVV`
@ -149,10 +175,10 @@ Code type 6 allows writing a fixed value to a memory address specified by a regi
---
### Code Type 7: Legacy Arithmetic
Code type 7 allows performing arithmetic on registers.
### Code Type 0x7: Legacy Arithmetic
Code type 0x7 allows performing arithmetic on registers.
However, it has been deprecated by Code type 9, and is only kept for backwards compatibility.
However, it has been deprecated by Code type 0x9, and is only kept for backwards compatibility.
#### Encoding
`7T0RC000 VVVVVVVV`
@ -171,8 +197,8 @@ However, it has been deprecated by Code type 9, and is only kept for backwards c
---
### Code Type 8: Begin Keypress Conditional Block
Code type 8 enters or skips a conditional block based on whether a key combination is pressed.
### Code Type 0x8: Begin Keypress Conditional Block
Code type 0x8 enters or skips a conditional block based on whether a key combination is pressed.
#### Encoding
`8kkkkkkk`
@ -213,8 +239,8 @@ Note: This is the direct output of `hidKeysDown()`.
---
### Code Type 9: Perform Arithmetic
Code type 9 allows performing arithmetic on registers.
### Code Type 0x9: Perform Arithmetic
Code type 0x9 allows performing arithmetic on registers.
#### Register Arithmetic Encoding
`9TCRS0s0`
@ -245,11 +271,14 @@ Code type 9 allows performing arithmetic on registers.
+ 7: Logical Not (discards right-hand operand)
+ 8: Logical Xor
+ 9: None/Move (discards right-hand operand)
+ 10: Float Addition, T==4 single T==8 double
+ 11: Float Subtraction, T==4 single T==8 double
+ 12: Float Multiplication, T==4 single T==8 double
+ 13: Float Division, T==4 single T==8 double
---
### Code Type 10: Store Register to Memory Address
Code type 10 allows writing a register to memory.
### Code Type 0xA: Store Register to Memory Address
Code type 0xA allows writing a register to memory.
#### Encoding
`ATSRIOxa (aaaaaaaa)`
@ -272,13 +301,13 @@ Code type 10 allows writing a register to memory.
---
### Code Type 11: Reserved
Code Type 11 is currently reserved for future use.
### Code Type 0xB: Reserved
Code Type 0xB is currently reserved for future use.
---
### Code Type 12-15: Extended-Width Instruction
Code Types 12-15 signal to the VM to treat the upper two nybbles of the first dword as instruction type, instead of just the upper nybble.
### Code Type 0xC-0xF: Extended-Width Instruction
Code Types 0xC-0xF signal to the VM to treat the upper two nybbles of the first dword as instruction type, instead of just the upper nybble.
This reserves an additional 64 opcodes for future use.
@ -375,6 +404,61 @@ Code type 0xC3 reads or writes a static register with a given register.
---
### Code Type 0xC4: Begin Extended Keypress Conditional Block
Code type 0xC4 enters or skips a conditional block based on whether a key combination is pressed.
#### Encoding
`C4r00000 kkkkkkkk kkkkkkkk`
+ r: Auto-repeat, see below.
+ kkkkkkkkkk: Keypad mask to check against output of `hidKeysDown()`.
Note that for multiple button combinations, the bitmasks should be OR'd together.
#### Auto-repeat
+ 0: The conditional block executes only once when the keypad mask matches. The mask must stop matching to reset for the next trigger.
+ 1: The conditional block executes as long as the keypad mask matches.
#### Keypad Values
Note: This is the direct output of `hidKeysDown()`.
+ 00000000 00000001: A
+ 00000000 00000002: B
+ 00000000 00000004: X
+ 00000000 00000008: Y
+ 00000000 00000010: Left Stick Pressed
+ 00000000 00000020: Right Stick Pressed
+ 00000000 00000040: L
+ 00000000 00000080: R
+ 00000000 00000100: ZL
+ 00000000 00000200: ZR
+ 00000000 00000400: Plus
+ 00000000 00000800: Minus
+ 00000000 00001000: Left
+ 00000000 00002000: Up
+ 00000000 00004000: Right
+ 00000000 00008000: Down
+ 00000000 00010000: Left Stick Left
+ 00000000 00020000: Left Stick Up
+ 00000000 00040000: Left Stick Right
+ 00000000 00080000: Left Stick Down
+ 00000000 00100000: Right Stick Left
+ 00000000 00200000: Right Stick Up
+ 00000000 00400000: Right Stick Right
+ 00000000 00800000: Right Stick Down
+ 00000000 01000000: SL Left Joy-Con
+ 00000000 02000000: SR Left Joy-Con
+ 00000000 04000000: SL Right Joy-Con
+ 00000000 08000000: SR Right Joy-Con
+ 00000000 10000000: Top button on Poké Ball Plus (Palma) controller
+ 00000000 20000000: Verification
+ 00000000 40000000: B button on Left NES/HVC controller in Handheld mode
+ 00000000 80000000: Left C button in N64 controller
+ 00000001 00000000: Up C button in N64 controller
+ 00000002 00000000: Right C button in N64 controller
+ 00000004 00000000: Down C button in N64 controller
### Code Type 0xF0: Double Extended-Width Instruction
Code Type 0xF0 signals to the VM to treat the upper three nybbles of the first dword as instruction type, instead of just the upper nybble.

View File

@ -1,21 +1,10 @@
# Configurations
Atmosphère provides a variety of customizable configurations to better adjust to users' needs.
## BCT.ini
This is the configuration file used by fusée.
## stratosphere.ini
This is the configuration file used by fusée for configuring user-space system modules.
This file is located under the `/atmosphere/config/` folder on your SD card and a default template can be found inside the `/atmosphere/config_templates/` folder.
### Adding a Custom Boot Splashscreen
Atmosphère provides its own default splashscreen which is displayed at boot time. However, this can be replaced at will.
The boot splashscreen must be a BMP file, it must be 720x1280 (1280x720 rotated 90 degrees left/counterclockwise/anti-clockwise) resolution, and be in 32-bit ARGB format. You can use image editing software such as GIMP or Photoshop to export the image in this format.
Add the following lines to BCT.ini and change the value of `custom_splash` to the actual path and filename of your boot splashscreen:
```
[stage2]
custom_splash = /path/to/your/bootlogo.bmp
```
### Configuring "nogc" Protection
"nogc" is a feature provided by fusée-secondary which disables the Nintendo Switch's Game Card reader. Its purpose is to prevent the reader from being updated when the console has been updated, without burning fuses, from a lower firmware version. More specifically, from firmware versions 4.0.0 or 9.0.0 which introduced updates to the Game Card reader's firmware. By default, Atmosphère will protect the Game Card reader automatically, but you are free to change it.
@ -29,32 +18,15 @@ nogc = X
0 = force-disable nogc, so Atmosphère will always enable the Game Card reader.
```
### NCM opt-out
Atmosphère provides a reimplementation of the [ncm](../components/modules/ncm.md) system module. If you wish to disable this reimplementation add the following line to the `stratosphere` section:
```
[stratosphere]
disable_ncm = 1
```
## Adding a Custom Boot Splashscreen
Atmosphère provides its own default splashscreen which is displayed at boot time. However, this can be replaced at will.
### Logging
This is an advanced feature aimed at developers trying to debug boot time issues. It enables logging of the fusée stages to be displayed on screen.
Boot splash screens must be 1280x720 resolution.
Add the following lines to BCT.ini and change the value of `X` according to the following list:
```
[config]
log_level = X
```
```
0 = NONE
1 = ERROR
2 = WARNING
3 = MANDATORY
4 = INFO
5 = DEBUG
```
A script can be found inside the source tree (`/utilities/insert_splash_screen.py`) for inserting a custom splash screen into a release binary.
A special level is also provided to prevent prefix creation. To use it, do a bitwise OR with this mask:
`0x100 = NO_PREFIX`
To do so, execute the following command on the script:
`python insert_splash_screen.py <path to your splash screen image> <path to /atmosphere/package3 on your SD card>`
## emummc.ini
This is the configuration file used for the [emummc](../components/emummc.md) component.

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2018-2020 Atmosphère-NX
Copyright (c) Atmosphère-NX
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -12,7 +12,6 @@ Atmosphère provides six core components, mimicking to some degree the various l
Additionally, Atmosphère also provides the following secondary components:
+ [emummc](components/emummc.md)
+ [sept](components/sept.md)
+ [libraries](components/libraries.md)
## Features
@ -28,3 +27,6 @@ A list of planned features for Atmosphère can be found [here](roadmap.md).
## Release History
A changelog of previous versions of Atmosphère can be found [here](changelog.md).
## Frequently Asked Questions
Answers to one or more frequently asked questions may be found [here](faq.md).

8
emummc/.gitrepo vendored
View File

@ -4,9 +4,9 @@
; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
;
[subrepo]
remote = https://github.com/m4xw/emuMMC
remote = https://github.com/m4xw/emummc
branch = develop
commit = b355ee6a8f376faa615785419c7d73a8814d9d65
parent = b24784f5c13a142bd0cb5d7edb82691c71f4bd00
method = rebase
commit = a8e5f1a184aeb8ba884166a1e4f386088d4a6cf1
parent = 409c3cf9e190dbb65fe76570954939cbe8a5eca0
method = merge
cmdver = 0.4.1

7
emummc/Makefile vendored
View File

@ -32,7 +32,7 @@ CFLAGS += $(INCLUDE) -D__SWITCH__
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++17
ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
LDFLAGS = -specs=$(EMUMMCDIR)/emummc.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
ifneq ($(BUILD),$(notdir $(CURDIR)))
@ -98,7 +98,10 @@ else
DEPENDS := $(OFILES:.o=.d)
all : $(OUTPUT).kip
all : $(OUTPUT)_unpacked.kip
$(OUTPUT)_unpacked.kip : $(OUTPUT).kip
@hactool -t kip --uncompressed=$(OUTPUT)_unpacked.kip $(OUTPUT).kip
$(OUTPUT).kip : $(OUTPUT).elf

2
emummc/README.md vendored
View File

@ -2,7 +2,7 @@
*A SDMMC driver replacement for Nintendo's Filesystem Services, by **m4xw***
### Supported Horizon Versions
**1.0.0 - 11.0.0**
**1.0.0 - 20.1.0**
## Features
* Arbitrary SDMMC backend selection

201
emummc/emummc.ld vendored Normal file
View File

@ -0,0 +1,201 @@
OUTPUT_ARCH(aarch64)
ENTRY(_start)
PHDRS
{
code PT_LOAD FLAGS(5) /* Read | Execute */;
rodata PT_LOAD FLAGS(4) /* Read */;
data PT_LOAD FLAGS(6) /* Read | Write */;
dyn PT_DYNAMIC;
}
SECTIONS
{
/* =========== CODE section =========== */
PROVIDE(__start__ = 0x0);
. = __start__;
__code_start = . ;
.crt0 :
{
KEEP (*(.crt0))
. = ALIGN(8);
} :code
.init :
{
KEEP( *(.init) )
. = ALIGN(8);
} :code
.plt :
{
*(.plt)
*(.iplt)
. = ALIGN(8);
} :code
.text :
{
*(.text.unlikely .text.*_unlikely .text.unlikely.*)
*(.text.exit .text.exit.*)
*(.text.startup .text.startup.*)
*(.text.hot .text.hot.*)
*(.text .stub .text.* .gnu.linkonce.t.*)
. = ALIGN(8);
} :code
.fini :
{
KEEP( *(.fini) )
. = ALIGN(8);
} :code
/* =========== RODATA section =========== */
. = ALIGN(0x1000);
__rodata_start = . ;
.nx-module-name : { KEEP (*(.nx-module-name)) } :rodata
.rodata :
{
*(.rodata .rodata.* .gnu.linkonce.r.*)
. = ALIGN(8);
} :rodata
.eh_frame_hdr : { __eh_frame_hdr_start = .; *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) __eh_frame_hdr_end = .; } :rodata
.eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } :rodata
.gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } :rodata
.gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } : rodata
.dynamic : { *(.dynamic) } :rodata :dyn
.dynsym : { *(.dynsym) } :rodata
.dynstr : { *(.dynstr) } :rodata
.rela.dyn : { *(.rela.*) } :rodata
.interp : { *(.interp) } :rodata
.hash : { *(.hash) } :rodata
.gnu.hash : { *(.gnu.hash) } :rodata
.gnu.version : { *(.gnu.version) } :rodata
.gnu.version_d : { *(.gnu.version_d) } :rodata
.gnu.version_r : { *(.gnu.version_r) } :rodata
.note.gnu.build-id : { *(.note.gnu.build-id) } :rodata
/* =========== DATA section =========== */
. = ALIGN(0x1000);
__data_start = . ;
.eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) *(.eh_frame.*) } :data
.gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } :data
.gnu_extab : ONLY_IF_RW { *(.gnu_extab*) } : data
.exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } :data
.tdata ALIGN(8) :
{
__tdata_lma = .;
*(.tdata .tdata.* .gnu.linkonce.td.*)
. = ALIGN(8);
__tdata_lma_end = .;
} :data
.tbss ALIGN(8) :
{
*(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
. = ALIGN(8);
} :data
.preinit_array ALIGN(8) :
{
PROVIDE (__preinit_array_start = .);
KEEP (*(.preinit_array))
PROVIDE (__preinit_array_end = .);
} :data
.init_array ALIGN(8) :
{
PROVIDE (__init_array_start = .);
KEEP( *(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)) )
KEEP( *(.init_array .ctors) )
PROVIDE (__init_array_end = .);
} :data
.fini_array ALIGN(8) :
{
PROVIDE (__fini_array_start = .);
KEEP( *(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)) )
KEEP( *(.fini_array .dtors) )
PROVIDE (__fini_array_end = .);
} :data
__got_start__ = .;
.got : { *(.got) *(.igot) } :data
.got.plt : { *(.got.plt) *(.igot.plt) } :data
__got_end__ = .;
.data ALIGN(8) :
{
*(.data .data.* .gnu.linkonce.d.*)
SORT(CONSTRUCTORS)
} :data
__bss_start__ = .;
.bss ALIGN(8) :
{
*(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
. = ALIGN(8);
/* Reserve space for the TLS segment of the main thread */
__tls_start = .;
. += + SIZEOF(.tdata) + SIZEOF(.tbss);
__tls_end = .;
} : data
__bss_end__ = .;
__end__ = ABSOLUTE(.) ;
. = ALIGN(0x1000);
__argdata__ = ABSOLUTE(.) ;
/* ==================
==== Metadata ====
================== */
/* Discard sections that difficult post-processing */
/DISCARD/ : { *(.group .comment .note) }
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0. */
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
}

8
emummc/emummc.specs vendored Normal file
View File

@ -0,0 +1,8 @@
%rename link old_link
*link:
%(old_link) -T %:getenv(TOPDIR /emummc.ld) -pie --no-dynamic-linker --spare-dynamic-tags=0 --gc-sections -z text -z nodynamic-undefined-weak --build-id=sha1 --nx-module-name
*startfile:
crti%O%s crtbegin%O%s

11
emummc/source/FS/FS.h vendored
View File

@ -37,4 +37,15 @@
#define BOOT_PARTITION_SIZE 0x2000
#define FS_READ_WRITE_ERROR 1048
#define NAND_PATROL_SECTOR 0xC20
#define NAND_PATROL_OFFSET 0x184000
typedef struct _fs_nand_patrol_t
{
uint8_t hmac[0x20];
unsigned int offset;
unsigned int count;
uint8_t rsvd[0x1D8];
} fs_nand_patrol_t;
#endif /* __FS_H__ */

View File

@ -53,6 +53,32 @@
#include "offsets/1100_exfat.h"
#include "offsets/1200.h"
#include "offsets/1200_exfat.h"
#include "offsets/1203.h"
#include "offsets/1203_exfat.h"
#include "offsets/1300.h"
#include "offsets/1300_exfat.h"
#include "offsets/1310.h"
#include "offsets/1310_exfat.h"
#include "offsets/1400.h"
#include "offsets/1400_exfat.h"
#include "offsets/1500.h"
#include "offsets/1500_exfat.h"
#include "offsets/1600.h"
#include "offsets/1600_exfat.h"
#include "offsets/1603.h"
#include "offsets/1603_exfat.h"
#include "offsets/1700.h"
#include "offsets/1700_exfat.h"
#include "offsets/1800.h"
#include "offsets/1800_exfat.h"
#include "offsets/1810.h"
#include "offsets/1810_exfat.h"
#include "offsets/1900.h"
#include "offsets/1900_exfat.h"
#include "offsets/2000.h"
#include "offsets/2000_exfat.h"
#include "offsets/2010.h"
#include "offsets/2010_exfat.h"
#include "../utils/fatal.h"
#define GET_OFFSET_STRUCT_NAME(vers) g_offsets##vers
@ -117,6 +143,32 @@ DEFINE_OFFSET_STRUCT(_1100);
DEFINE_OFFSET_STRUCT(_1100_EXFAT);
DEFINE_OFFSET_STRUCT(_1200);
DEFINE_OFFSET_STRUCT(_1200_EXFAT);
DEFINE_OFFSET_STRUCT(_1203);
DEFINE_OFFSET_STRUCT(_1203_EXFAT);
DEFINE_OFFSET_STRUCT(_1300);
DEFINE_OFFSET_STRUCT(_1300_EXFAT);
DEFINE_OFFSET_STRUCT(_1310);
DEFINE_OFFSET_STRUCT(_1310_EXFAT);
DEFINE_OFFSET_STRUCT(_1400);
DEFINE_OFFSET_STRUCT(_1400_EXFAT);
DEFINE_OFFSET_STRUCT(_1500);
DEFINE_OFFSET_STRUCT(_1500_EXFAT);
DEFINE_OFFSET_STRUCT(_1600);
DEFINE_OFFSET_STRUCT(_1600_EXFAT);
DEFINE_OFFSET_STRUCT(_1603);
DEFINE_OFFSET_STRUCT(_1603_EXFAT);
DEFINE_OFFSET_STRUCT(_1700);
DEFINE_OFFSET_STRUCT(_1700_EXFAT);
DEFINE_OFFSET_STRUCT(_1800);
DEFINE_OFFSET_STRUCT(_1800_EXFAT);
DEFINE_OFFSET_STRUCT(_1810);
DEFINE_OFFSET_STRUCT(_1810_EXFAT);
DEFINE_OFFSET_STRUCT(_1900);
DEFINE_OFFSET_STRUCT(_1900_EXFAT);
DEFINE_OFFSET_STRUCT(_2000);
DEFINE_OFFSET_STRUCT(_2000_EXFAT);
DEFINE_OFFSET_STRUCT(_2010);
DEFINE_OFFSET_STRUCT(_2010_EXFAT);
const fs_offsets_t *get_fs_offsets(enum FS_VER version) {
switch (version) {
@ -194,6 +246,58 @@ const fs_offsets_t *get_fs_offsets(enum FS_VER version) {
return &(GET_OFFSET_STRUCT_NAME(_1200));
case FS_VER_12_0_0_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_1200_EXFAT));
case FS_VER_12_0_3:
return &(GET_OFFSET_STRUCT_NAME(_1203));
case FS_VER_12_0_3_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_1203_EXFAT));
case FS_VER_13_0_0:
return &(GET_OFFSET_STRUCT_NAME(_1300));
case FS_VER_13_0_0_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_1300_EXFAT));
case FS_VER_13_1_0:
return &(GET_OFFSET_STRUCT_NAME(_1310));
case FS_VER_13_1_0_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_1310_EXFAT));
case FS_VER_14_0_0:
return &(GET_OFFSET_STRUCT_NAME(_1400));
case FS_VER_14_0_0_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_1400_EXFAT));
case FS_VER_15_0_0:
return &(GET_OFFSET_STRUCT_NAME(_1500));
case FS_VER_15_0_0_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_1500_EXFAT));
case FS_VER_16_0_0:
return &(GET_OFFSET_STRUCT_NAME(_1600));
case FS_VER_16_0_0_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_1600_EXFAT));
case FS_VER_16_0_3:
return &(GET_OFFSET_STRUCT_NAME(_1603));
case FS_VER_16_0_3_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_1603_EXFAT));
case FS_VER_17_0_0:
return &(GET_OFFSET_STRUCT_NAME(_1700));
case FS_VER_17_0_0_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_1700_EXFAT));
case FS_VER_18_0_0:
return &(GET_OFFSET_STRUCT_NAME(_1800));
case FS_VER_18_0_0_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_1800_EXFAT));
case FS_VER_18_1_0:
return &(GET_OFFSET_STRUCT_NAME(_1810));
case FS_VER_18_1_0_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_1810_EXFAT));
case FS_VER_19_0_0:
return &(GET_OFFSET_STRUCT_NAME(_1900));
case FS_VER_19_0_0_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_1900_EXFAT));
case FS_VER_20_0_0:
return &(GET_OFFSET_STRUCT_NAME(_2000));
case FS_VER_20_0_0_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_2000_EXFAT));
case FS_VER_20_1_0:
return &(GET_OFFSET_STRUCT_NAME(_2010));
case FS_VER_20_1_0_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_2010_EXFAT));
default:
fatal_abort(Fatal_UnknownVersion);
}

View File

@ -77,6 +77,45 @@ enum FS_VER
FS_VER_12_0_0,
FS_VER_12_0_0_EXFAT,
FS_VER_12_0_3,
FS_VER_12_0_3_EXFAT,
FS_VER_13_0_0,
FS_VER_13_0_0_EXFAT,
FS_VER_13_1_0,
FS_VER_13_1_0_EXFAT,
FS_VER_14_0_0,
FS_VER_14_0_0_EXFAT,
FS_VER_15_0_0,
FS_VER_15_0_0_EXFAT,
FS_VER_16_0_0,
FS_VER_16_0_0_EXFAT,
FS_VER_16_0_3,
FS_VER_16_0_3_EXFAT,
FS_VER_17_0_0,
FS_VER_17_0_0_EXFAT,
FS_VER_18_0_0,
FS_VER_18_0_0_EXFAT,
FS_VER_18_1_0,
FS_VER_18_1_0_EXFAT,
FS_VER_19_0_0,
FS_VER_19_0_0_EXFAT,
FS_VER_20_0_0,
FS_VER_20_0_0_EXFAT,
FS_VER_20_1_0,
FS_VER_20_1_0_EXFAT,
FS_VER_MAX,
};

60
emummc/source/FS/offsets/1203.h vendored Normal file
View File

@ -0,0 +1,60 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
* Copyright (c) 2021 CTCaer
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1203_H__
#define __FS_1203_H__
// Accessor vtable getters
#define FS_OFFSET_1203_SDMMC_ACCESSOR_GC 0x1550E0
#define FS_OFFSET_1203_SDMMC_ACCESSOR_SD 0x156EF0
#define FS_OFFSET_1203_SDMMC_ACCESSOR_NAND 0x155610
// Hooks
#define FS_OFFSET_1203_SDMMC_WRAPPER_READ 0x150A80
#define FS_OFFSET_1203_SDMMC_WRAPPER_WRITE 0x150B40
#define FS_OFFSET_1203_RTLD 0x688
#define FS_OFFSET_1203_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1203_CLKRST_SET_MIN_V_CLK_RATE 0x14FDD0
// Misc funcs
#define FS_OFFSET_1203_LOCK_MUTEX 0x29350
#define FS_OFFSET_1203_UNLOCK_MUTEX 0x293A0
#define FS_OFFSET_1203_SDMMC_WRAPPER_CONTROLLER_OPEN 0x150960
#define FS_OFFSET_1203_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1509F0
// Misc Data
#define FS_OFFSET_1203_SD_MUTEX 0xE3D3E8
#define FS_OFFSET_1203_NAND_MUTEX 0xE38768
#define FS_OFFSET_1203_ACTIVE_PARTITION 0xE387A8
#define FS_OFFSET_1203_SDMMC_DAS_HANDLE 0xE20DB0
// NOPs
#define FS_OFFSET_1203_SD_DAS_INIT 0x27244
// Nintendo Paths
#define FS_OFFSET_1203_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x0006E920, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0007AFD0, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x00081364, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x00092960, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1203_H__

60
emummc/source/FS/offsets/1203_exfat.h vendored Normal file
View File

@ -0,0 +1,60 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
* Copyright (c) 2021 CTCaer
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1203_EXFAT_H__
#define __FS_1203_EXFAT_H__
// Accessor vtable getters
#define FS_OFFSET_1203_EXFAT_SDMMC_ACCESSOR_GC 0x1550E0
#define FS_OFFSET_1203_EXFAT_SDMMC_ACCESSOR_SD 0x156EF0
#define FS_OFFSET_1203_EXFAT_SDMMC_ACCESSOR_NAND 0x155610
// Hooks
#define FS_OFFSET_1203_EXFAT_SDMMC_WRAPPER_READ 0x150A80
#define FS_OFFSET_1203_EXFAT_SDMMC_WRAPPER_WRITE 0x150B40
#define FS_OFFSET_1203_EXFAT_RTLD 0x688
#define FS_OFFSET_1203_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1203_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x14FDD0
// Misc funcs
#define FS_OFFSET_1203_EXFAT_LOCK_MUTEX 0x29350
#define FS_OFFSET_1203_EXFAT_UNLOCK_MUTEX 0x293A0
#define FS_OFFSET_1203_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x150960
#define FS_OFFSET_1203_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1509F0
// Misc Data
#define FS_OFFSET_1203_EXFAT_SD_MUTEX 0xE4B3E8
#define FS_OFFSET_1203_EXFAT_NAND_MUTEX 0xE46768
#define FS_OFFSET_1203_EXFAT_ACTIVE_PARTITION 0xE467A8
#define FS_OFFSET_1203_EXFAT_SDMMC_DAS_HANDLE 0xE2EDB0
// NOPs
#define FS_OFFSET_1203_EXFAT_SD_DAS_INIT 0x27244
// Nintendo Paths
#define FS_OFFSET_1203_EXFAT_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x0006E920, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0007AFD0, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x00081364, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x00092960, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1203_EXFAT_H__

59
emummc/source/FS/offsets/1300.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1300_H__
#define __FS_1300_H__
// Accessor vtable getters
#define FS_OFFSET_1300_SDMMC_ACCESSOR_GC 0x158C80
#define FS_OFFSET_1300_SDMMC_ACCESSOR_SD 0x15AA90
#define FS_OFFSET_1300_SDMMC_ACCESSOR_NAND 0x1591B0
// Hooks
#define FS_OFFSET_1300_SDMMC_WRAPPER_READ 0x154620
#define FS_OFFSET_1300_SDMMC_WRAPPER_WRITE 0x1546E0
#define FS_OFFSET_1300_RTLD 0x688
#define FS_OFFSET_1300_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1300_CLKRST_SET_MIN_V_CLK_RATE 0x153820
// Misc funcs
#define FS_OFFSET_1300_LOCK_MUTEX 0x29690
#define FS_OFFSET_1300_UNLOCK_MUTEX 0x296E0
#define FS_OFFSET_1300_SDMMC_WRAPPER_CONTROLLER_OPEN 0x154500
#define FS_OFFSET_1300_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x154590
// Misc Data
#define FS_OFFSET_1300_SD_MUTEX 0xE133E8
#define FS_OFFSET_1300_NAND_MUTEX 0xE0E768
#define FS_OFFSET_1300_ACTIVE_PARTITION 0xE0E7A8
#define FS_OFFSET_1300_SDMMC_DAS_HANDLE 0xDF6E18
// NOPs
#define FS_OFFSET_1300_SD_DAS_INIT 0x27744
// Nintendo Paths
#define FS_OFFSET_1300_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x0006EBE0, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0007BEEC, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x00082294, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0009422C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1300_H__

59
emummc/source/FS/offsets/1300_exfat.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1300_EXFAT_H__
#define __FS_1300_EXFAT_H__
// Accessor vtable getters
#define FS_OFFSET_1300_EXFAT_SDMMC_ACCESSOR_GC 0x158C80
#define FS_OFFSET_1300_EXFAT_SDMMC_ACCESSOR_SD 0x15AA90
#define FS_OFFSET_1300_EXFAT_SDMMC_ACCESSOR_NAND 0x1591B0
// Hooks
#define FS_OFFSET_1300_EXFAT_SDMMC_WRAPPER_READ 0x154620
#define FS_OFFSET_1300_EXFAT_SDMMC_WRAPPER_WRITE 0x1546E0
#define FS_OFFSET_1300_EXFAT_RTLD 0x688
#define FS_OFFSET_1300_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1300_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x153820
// Misc funcs
#define FS_OFFSET_1300_EXFAT_LOCK_MUTEX 0x29690
#define FS_OFFSET_1300_EXFAT_UNLOCK_MUTEX 0x296E0
#define FS_OFFSET_1300_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x154500
#define FS_OFFSET_1300_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x154590
// Misc Data
#define FS_OFFSET_1300_EXFAT_SD_MUTEX 0xE203E8
#define FS_OFFSET_1300_EXFAT_NAND_MUTEX 0xE1B768
#define FS_OFFSET_1300_EXFAT_ACTIVE_PARTITION 0xE1B7A8
#define FS_OFFSET_1300_EXFAT_SDMMC_DAS_HANDLE 0xE03E18
// NOPs
#define FS_OFFSET_1300_EXFAT_SD_DAS_INIT 0x27744
// Nintendo Paths
#define FS_OFFSET_1300_EXFAT_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x0006EBE0, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0007BEEC, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x00082294, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0009422C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1300_EXFAT_H__

59
emummc/source/FS/offsets/1310.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1310_H__
#define __FS_1310_H__
// Accessor vtable getters
#define FS_OFFSET_1310_SDMMC_ACCESSOR_GC 0x158C20
#define FS_OFFSET_1310_SDMMC_ACCESSOR_SD 0x15AA30
#define FS_OFFSET_1310_SDMMC_ACCESSOR_NAND 0x159150
// Hooks
#define FS_OFFSET_1310_SDMMC_WRAPPER_READ 0x1545C0
#define FS_OFFSET_1310_SDMMC_WRAPPER_WRITE 0x154680
#define FS_OFFSET_1310_RTLD 0x688
#define FS_OFFSET_1310_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1310_CLKRST_SET_MIN_V_CLK_RATE 0x1537C0
// Misc funcs
#define FS_OFFSET_1310_LOCK_MUTEX 0x29690
#define FS_OFFSET_1310_UNLOCK_MUTEX 0x296E0
#define FS_OFFSET_1310_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1544A0
#define FS_OFFSET_1310_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x154530
// Misc Data
#define FS_OFFSET_1310_SD_MUTEX 0xE133E8
#define FS_OFFSET_1310_NAND_MUTEX 0xE0E768
#define FS_OFFSET_1310_ACTIVE_PARTITION 0xE0E7A8
#define FS_OFFSET_1310_SDMMC_DAS_HANDLE 0xDF6E18
// NOPs
#define FS_OFFSET_1310_SD_DAS_INIT 0x27744
// Nintendo Paths
#define FS_OFFSET_1310_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x0006EBE0, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0007BEEC, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x00082294, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0009422C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1310_H__

59
emummc/source/FS/offsets/1310_exfat.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1310_EXFAT_H__
#define __FS_1310_EXFAT_H__
// Accessor vtable getters
#define FS_OFFSET_1310_EXFAT_SDMMC_ACCESSOR_GC 0x158C20
#define FS_OFFSET_1310_EXFAT_SDMMC_ACCESSOR_SD 0x15AA30
#define FS_OFFSET_1310_EXFAT_SDMMC_ACCESSOR_NAND 0x159150
// Hooks
#define FS_OFFSET_1310_EXFAT_SDMMC_WRAPPER_READ 0x1545C0
#define FS_OFFSET_1310_EXFAT_SDMMC_WRAPPER_WRITE 0x154680
#define FS_OFFSET_1310_EXFAT_RTLD 0x688
#define FS_OFFSET_1310_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1310_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1537C0
// Misc funcs
#define FS_OFFSET_1310_EXFAT_LOCK_MUTEX 0x29690
#define FS_OFFSET_1310_EXFAT_UNLOCK_MUTEX 0x296E0
#define FS_OFFSET_1310_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1544A0
#define FS_OFFSET_1310_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x154530
// Misc Data
#define FS_OFFSET_1310_EXFAT_SD_MUTEX 0xE203E8
#define FS_OFFSET_1310_EXFAT_NAND_MUTEX 0xE1B768
#define FS_OFFSET_1310_EXFAT_ACTIVE_PARTITION 0xE1B7A8
#define FS_OFFSET_1310_EXFAT_SDMMC_DAS_HANDLE 0xE03E18
// NOPs
#define FS_OFFSET_1310_EXFAT_SD_DAS_INIT 0x27744
// Nintendo Paths
#define FS_OFFSET_1310_EXFAT_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x0006EBE0, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0007BEEC, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x00082294, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0009422C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1310_EXFAT_H__

59
emummc/source/FS/offsets/1400.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1400_H__
#define __FS_1400_H__
// Accessor vtable getters
#define FS_OFFSET_1400_SDMMC_ACCESSOR_GC 0x189F50
#define FS_OFFSET_1400_SDMMC_ACCESSOR_SD 0x18BD60
#define FS_OFFSET_1400_SDMMC_ACCESSOR_NAND 0x18A480
// Hooks
#define FS_OFFSET_1400_SDMMC_WRAPPER_READ 0x185AF0
#define FS_OFFSET_1400_SDMMC_WRAPPER_WRITE 0x185B50
#define FS_OFFSET_1400_RTLD 0x282B8
#define FS_OFFSET_1400_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1400_CLKRST_SET_MIN_V_CLK_RATE 0x1A5D90
// Misc funcs
#define FS_OFFSET_1400_LOCK_MUTEX 0x17E9F0
#define FS_OFFSET_1400_UNLOCK_MUTEX 0x17EA40
#define FS_OFFSET_1400_SDMMC_WRAPPER_CONTROLLER_OPEN 0x185AA0
#define FS_OFFSET_1400_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x185AD0
// Misc Data
#define FS_OFFSET_1400_SD_MUTEX 0xF2E3F0
#define FS_OFFSET_1400_NAND_MUTEX 0xF292F8
#define FS_OFFSET_1400_ACTIVE_PARTITION 0xF29338
#define FS_OFFSET_1400_SDMMC_DAS_HANDLE 0xDFE9C8
// NOPs
#define FS_OFFSET_1400_SD_DAS_INIT 0x27004
// Nintendo Paths
#define FS_OFFSET_1400_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x0006D9C0, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0007AC24, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x000813E8, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0009387C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1400_H__

59
emummc/source/FS/offsets/1400_exfat.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1400_EXFAT_H__
#define __FS_1400_EXFAT_H__
// Accessor vtable getters
#define FS_OFFSET_1400_EXFAT_SDMMC_ACCESSOR_GC 0x1952D0
#define FS_OFFSET_1400_EXFAT_SDMMC_ACCESSOR_SD 0x1970E0
#define FS_OFFSET_1400_EXFAT_SDMMC_ACCESSOR_NAND 0x195800
// Hooks
#define FS_OFFSET_1400_EXFAT_SDMMC_WRAPPER_READ 0x190E70
#define FS_OFFSET_1400_EXFAT_SDMMC_WRAPPER_WRITE 0x190ED0
#define FS_OFFSET_1400_EXFAT_RTLD 0x282B8
#define FS_OFFSET_1400_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1400_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1B1110
// Misc funcs
#define FS_OFFSET_1400_EXFAT_LOCK_MUTEX 0x189D70
#define FS_OFFSET_1400_EXFAT_UNLOCK_MUTEX 0x189DC0
#define FS_OFFSET_1400_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x190E20
#define FS_OFFSET_1400_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x190E50
// Misc Data
#define FS_OFFSET_1400_EXFAT_SD_MUTEX 0x10123F0
#define FS_OFFSET_1400_EXFAT_NAND_MUTEX 0x100D2F8
#define FS_OFFSET_1400_EXFAT_ACTIVE_PARTITION 0x100D338
#define FS_OFFSET_1400_EXFAT_SDMMC_DAS_HANDLE 0xE0B9C8
// NOPs
#define FS_OFFSET_1400_EXFAT_SD_DAS_INIT 0x27004
// Nintendo Paths
#define FS_OFFSET_1400_EXFAT_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x0006D9C0, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0007AC24, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x000813E8, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0009387C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1400_EXFAT_H__

59
emummc/source/FS/offsets/1500.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1500_H__
#define __FS_1500_H__
// Accessor vtable getters
#define FS_OFFSET_1500_SDMMC_ACCESSOR_GC 0x183E20
#define FS_OFFSET_1500_SDMMC_ACCESSOR_SD 0x185AA0
#define FS_OFFSET_1500_SDMMC_ACCESSOR_NAND 0x1842E0
// Hooks
#define FS_OFFSET_1500_SDMMC_WRAPPER_READ 0x17FCF0
#define FS_OFFSET_1500_SDMMC_WRAPPER_WRITE 0x17FD50
#define FS_OFFSET_1500_RTLD 0x26518
#define FS_OFFSET_1500_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1500_CLKRST_SET_MIN_V_CLK_RATE 0x1A0870
// Misc funcs
#define FS_OFFSET_1500_LOCK_MUTEX 0x1791A0
#define FS_OFFSET_1500_UNLOCK_MUTEX 0x1791F0
#define FS_OFFSET_1500_SDMMC_WRAPPER_CONTROLLER_OPEN 0x17FCB0
#define FS_OFFSET_1500_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x17FCD0
// Misc Data
#define FS_OFFSET_1500_SD_MUTEX 0xFF33F0
#define FS_OFFSET_1500_NAND_MUTEX 0xFEE2E8
#define FS_OFFSET_1500_ACTIVE_PARTITION 0xFEE328
#define FS_OFFSET_1500_SDMMC_DAS_HANDLE 0xFD38D8
// NOPs
#define FS_OFFSET_1500_SD_DAS_INIT 0x25454
// Nintendo Paths
#define FS_OFFSET_1500_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00063050, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0006FDE8, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x000768D4, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x00089364, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1500_H__

59
emummc/source/FS/offsets/1500_exfat.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1500_EXFAT_H__
#define __FS_1500_EXFAT_H__
// Accessor vtable getters
#define FS_OFFSET_1500_EXFAT_SDMMC_ACCESSOR_GC 0x18EDB0
#define FS_OFFSET_1500_EXFAT_SDMMC_ACCESSOR_SD 0x190A30
#define FS_OFFSET_1500_EXFAT_SDMMC_ACCESSOR_NAND 0x18F270
// Hooks
#define FS_OFFSET_1500_EXFAT_SDMMC_WRAPPER_READ 0x18AC80
#define FS_OFFSET_1500_EXFAT_SDMMC_WRAPPER_WRITE 0x18ACE0
#define FS_OFFSET_1500_EXFAT_RTLD 0x26518
#define FS_OFFSET_1500_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1500_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1AB800
// Misc funcs
#define FS_OFFSET_1500_EXFAT_LOCK_MUTEX 0x184130
#define FS_OFFSET_1500_EXFAT_UNLOCK_MUTEX 0x184180
#define FS_OFFSET_1500_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x18AC40
#define FS_OFFSET_1500_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x18AC60
// Misc Data
#define FS_OFFSET_1500_EXFAT_SD_MUTEX 0x10053F0
#define FS_OFFSET_1500_EXFAT_NAND_MUTEX 0x10002E8
#define FS_OFFSET_1500_EXFAT_ACTIVE_PARTITION 0x1000328
#define FS_OFFSET_1500_EXFAT_SDMMC_DAS_HANDLE 0xFE08D8
// NOPs
#define FS_OFFSET_1500_EXFAT_SD_DAS_INIT 0x25454
// Nintendo Paths
#define FS_OFFSET_1500_EXFAT_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00063050, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0006FDE8, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x000768D4, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x00089364, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1500_EXFAT_H__

59
emummc/source/FS/offsets/1600.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1600_H__
#define __FS_1600_H__
// Accessor vtable getters
#define FS_OFFSET_1600_SDMMC_ACCESSOR_GC 0x1862A0
#define FS_OFFSET_1600_SDMMC_ACCESSOR_SD 0x187F20
#define FS_OFFSET_1600_SDMMC_ACCESSOR_NAND 0x186760
// Hooks
#define FS_OFFSET_1600_SDMMC_WRAPPER_READ 0x1821F0
#define FS_OFFSET_1600_SDMMC_WRAPPER_WRITE 0x182250
#define FS_OFFSET_1600_RTLD 0x269B0
#define FS_OFFSET_1600_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1600_CLKRST_SET_MIN_V_CLK_RATE 0x1A2D30
// Misc funcs
#define FS_OFFSET_1600_LOCK_MUTEX 0x17B730
#define FS_OFFSET_1600_UNLOCK_MUTEX 0x17B780
#define FS_OFFSET_1600_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1821B0
#define FS_OFFSET_1600_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1821D0
// Misc Data
#define FS_OFFSET_1600_SD_MUTEX 0xFFB3F0
#define FS_OFFSET_1600_NAND_MUTEX 0xFF6B58
#define FS_OFFSET_1600_ACTIVE_PARTITION 0xFF6B98
#define FS_OFFSET_1600_SDMMC_DAS_HANDLE 0xFDC8B0
// NOPs
#define FS_OFFSET_1600_SD_DAS_INIT 0x258D4
// Nintendo Paths
#define FS_OFFSET_1600_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00063B48, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x00070D6C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0007790C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0008A754, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1600_H__

59
emummc/source/FS/offsets/1600_exfat.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1600_EXFAT_H__
#define __FS_1600_EXFAT_H__
// Accessor vtable getters
#define FS_OFFSET_1600_EXFAT_SDMMC_ACCESSOR_GC 0x190F80
#define FS_OFFSET_1600_EXFAT_SDMMC_ACCESSOR_SD 0x192C00
#define FS_OFFSET_1600_EXFAT_SDMMC_ACCESSOR_NAND 0x191440
// Hooks
#define FS_OFFSET_1600_EXFAT_SDMMC_WRAPPER_READ 0x18CED0
#define FS_OFFSET_1600_EXFAT_SDMMC_WRAPPER_WRITE 0x18CF30
#define FS_OFFSET_1600_EXFAT_RTLD 0x269B0
#define FS_OFFSET_1600_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1600_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1ADA10
// Misc funcs
#define FS_OFFSET_1600_EXFAT_LOCK_MUTEX 0x186410
#define FS_OFFSET_1600_EXFAT_UNLOCK_MUTEX 0x186460
#define FS_OFFSET_1600_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x18CE90
#define FS_OFFSET_1600_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x18CEB0
// Misc Data
#define FS_OFFSET_1600_EXFAT_SD_MUTEX 0x100D3F0
#define FS_OFFSET_1600_EXFAT_NAND_MUTEX 0x1008B58
#define FS_OFFSET_1600_EXFAT_ACTIVE_PARTITION 0x1008B98
#define FS_OFFSET_1600_EXFAT_SDMMC_DAS_HANDLE 0xFE98B0
// NOPs
#define FS_OFFSET_1600_EXFAT_SD_DAS_INIT 0x258D4
// Nintendo Paths
#define FS_OFFSET_1600_EXFAT_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00063B48, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x00070D6C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0007790C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0008A754, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1600_EXFAT_H__

59
emummc/source/FS/offsets/1603.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1603_H__
#define __FS_1603_H__
// Accessor vtable getters
#define FS_OFFSET_1603_SDMMC_ACCESSOR_GC 0x1862F0
#define FS_OFFSET_1603_SDMMC_ACCESSOR_SD 0x187F70
#define FS_OFFSET_1603_SDMMC_ACCESSOR_NAND 0x1867B0
// Hooks
#define FS_OFFSET_1603_SDMMC_WRAPPER_READ 0x182240
#define FS_OFFSET_1603_SDMMC_WRAPPER_WRITE 0x1822A0
#define FS_OFFSET_1603_RTLD 0x269B0
#define FS_OFFSET_1603_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1603_CLKRST_SET_MIN_V_CLK_RATE 0x1A2D80
// Misc funcs
#define FS_OFFSET_1603_LOCK_MUTEX 0x17B780
#define FS_OFFSET_1603_UNLOCK_MUTEX 0x17B7D0
#define FS_OFFSET_1603_SDMMC_WRAPPER_CONTROLLER_OPEN 0x182200
#define FS_OFFSET_1603_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x182220
// Misc Data
#define FS_OFFSET_1603_SD_MUTEX 0xFFB3F0
#define FS_OFFSET_1603_NAND_MUTEX 0xFF6B58
#define FS_OFFSET_1603_ACTIVE_PARTITION 0xFF6B98
#define FS_OFFSET_1603_SDMMC_DAS_HANDLE 0xFDC8B0
// NOPs
#define FS_OFFSET_1603_SD_DAS_INIT 0x258D4
// Nintendo Paths
#define FS_OFFSET_1603_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00063B98, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x00070DBC, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0007795C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0008A7A4, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1603_H__

59
emummc/source/FS/offsets/1603_exfat.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1603_EXFAT_H__
#define __FS_1603_EXFAT_H__
// Accessor vtable getters
#define FS_OFFSET_1603_EXFAT_SDMMC_ACCESSOR_GC 0x190FD0
#define FS_OFFSET_1603_EXFAT_SDMMC_ACCESSOR_SD 0x192C50
#define FS_OFFSET_1603_EXFAT_SDMMC_ACCESSOR_NAND 0x191490
// Hooks
#define FS_OFFSET_1603_EXFAT_SDMMC_WRAPPER_READ 0x18CF20
#define FS_OFFSET_1603_EXFAT_SDMMC_WRAPPER_WRITE 0x18CF80
#define FS_OFFSET_1603_EXFAT_RTLD 0x269B0
#define FS_OFFSET_1603_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1603_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1ADA60
// Misc funcs
#define FS_OFFSET_1603_EXFAT_LOCK_MUTEX 0x186460
#define FS_OFFSET_1603_EXFAT_UNLOCK_MUTEX 0x1864B0
#define FS_OFFSET_1603_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x18CEE0
#define FS_OFFSET_1603_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x18CF00
// Misc Data
#define FS_OFFSET_1603_EXFAT_SD_MUTEX 0x100D3F0
#define FS_OFFSET_1603_EXFAT_NAND_MUTEX 0x1008B58
#define FS_OFFSET_1603_EXFAT_ACTIVE_PARTITION 0x1008B98
#define FS_OFFSET_1603_EXFAT_SDMMC_DAS_HANDLE 0xFE98B0
// NOPs
#define FS_OFFSET_1603_EXFAT_SD_DAS_INIT 0x258D4
// Nintendo Paths
#define FS_OFFSET_1603_EXFAT_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00063B98, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x00070DBC, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0007795C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0008A7A4, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1603_EXFAT_H__

59
emummc/source/FS/offsets/1700.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1700_H__
#define __FS_1700_H__
// Accessor vtable getters
#define FS_OFFSET_1700_SDMMC_ACCESSOR_GC 0x18AD00
#define FS_OFFSET_1700_SDMMC_ACCESSOR_SD 0x18C9D0
#define FS_OFFSET_1700_SDMMC_ACCESSOR_NAND 0x18B1D0
// Hooks
#define FS_OFFSET_1700_SDMMC_WRAPPER_READ 0x186BC0
#define FS_OFFSET_1700_SDMMC_WRAPPER_WRITE 0x186C20
#define FS_OFFSET_1700_RTLD 0x29D10
#define FS_OFFSET_1700_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1700_CLKRST_SET_MIN_V_CLK_RATE 0x1A7B60
// Misc funcs
#define FS_OFFSET_1700_LOCK_MUTEX 0x17FEA0
#define FS_OFFSET_1700_UNLOCK_MUTEX 0x17FEF0
#define FS_OFFSET_1700_SDMMC_WRAPPER_CONTROLLER_OPEN 0x186B80
#define FS_OFFSET_1700_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x186BA0
// Misc Data
#define FS_OFFSET_1700_SD_MUTEX 0xFCE3F0
#define FS_OFFSET_1700_NAND_MUTEX 0xFC9B78
#define FS_OFFSET_1700_ACTIVE_PARTITION 0xFC9BB8
#define FS_OFFSET_1700_SDMMC_DAS_HANDLE 0xFAF840
// NOPs
#define FS_OFFSET_1700_SD_DAS_INIT 0x28C64
// Nintendo Paths
#define FS_OFFSET_1700_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00068068, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0007510C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0007BEAC, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0008F674, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1700_H__

59
emummc/source/FS/offsets/1700_exfat.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1700_EXFAT_H__
#define __FS_1700_EXFAT_H__
// Accessor vtable getters
#define FS_OFFSET_1700_EXFAT_SDMMC_ACCESSOR_GC 0x195B60
#define FS_OFFSET_1700_EXFAT_SDMMC_ACCESSOR_SD 0x197830
#define FS_OFFSET_1700_EXFAT_SDMMC_ACCESSOR_NAND 0x196030
// Hooks
#define FS_OFFSET_1700_EXFAT_SDMMC_WRAPPER_READ 0x191A20
#define FS_OFFSET_1700_EXFAT_SDMMC_WRAPPER_WRITE 0x191A80
#define FS_OFFSET_1700_EXFAT_RTLD 0x29D10
#define FS_OFFSET_1700_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1700_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1B29C0
// Misc funcs
#define FS_OFFSET_1700_EXFAT_LOCK_MUTEX 0x18AD00
#define FS_OFFSET_1700_EXFAT_UNLOCK_MUTEX 0x18AD50
#define FS_OFFSET_1700_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1919E0
#define FS_OFFSET_1700_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x191A00
// Misc Data
#define FS_OFFSET_1700_EXFAT_SD_MUTEX 0xFE03F0
#define FS_OFFSET_1700_EXFAT_NAND_MUTEX 0xFDBB78
#define FS_OFFSET_1700_EXFAT_ACTIVE_PARTITION 0xFDBBB8
#define FS_OFFSET_1700_EXFAT_SDMMC_DAS_HANDLE 0xFBC840
// NOPs
#define FS_OFFSET_1700_EXFAT_SD_DAS_INIT 0x28C64
// Nintendo Paths
#define FS_OFFSET_1700_EXFAT_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00068068, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0007510C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0007BEAC, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0008F674, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1700_EXFAT_H__

59
emummc/source/FS/offsets/1800.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1800_H__
#define __FS_1800_H__
// Accessor vtable getters
#define FS_OFFSET_1800_SDMMC_ACCESSOR_GC 0x18AB00
#define FS_OFFSET_1800_SDMMC_ACCESSOR_SD 0x18C800
#define FS_OFFSET_1800_SDMMC_ACCESSOR_NAND 0x18AFE0
// Hooks
#define FS_OFFSET_1800_SDMMC_WRAPPER_READ 0x186A50
#define FS_OFFSET_1800_SDMMC_WRAPPER_WRITE 0x186AB0
#define FS_OFFSET_1800_RTLD 0x2A3A4
#define FS_OFFSET_1800_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x44)))
#define FS_OFFSET_1800_CLKRST_SET_MIN_V_CLK_RATE 0x1A77D0
// Misc funcs
#define FS_OFFSET_1800_LOCK_MUTEX 0x17FCC0
#define FS_OFFSET_1800_UNLOCK_MUTEX 0x17FD10
#define FS_OFFSET_1800_SDMMC_WRAPPER_CONTROLLER_OPEN 0x186A10
#define FS_OFFSET_1800_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x186A30
// Misc Data
#define FS_OFFSET_1800_SD_MUTEX 0xFD13F0
#define FS_OFFSET_1800_NAND_MUTEX 0xFCCB28
#define FS_OFFSET_1800_ACTIVE_PARTITION 0xFCCB68
#define FS_OFFSET_1800_SDMMC_DAS_HANDLE 0xFB1950
// NOPs
#define FS_OFFSET_1800_SD_DAS_INIT 0x28F24
// Nintendo Paths
#define FS_OFFSET_1800_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00068B08, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x000758DC, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0007C77C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x000905C4, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1800_H__

59
emummc/source/FS/offsets/1800_exfat.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1800_EXFAT_H__
#define __FS_1800_EXFAT_H__
// Accessor vtable getters
#define FS_OFFSET_1800_EXFAT_SDMMC_ACCESSOR_GC 0x195B90
#define FS_OFFSET_1800_EXFAT_SDMMC_ACCESSOR_SD 0x197890
#define FS_OFFSET_1800_EXFAT_SDMMC_ACCESSOR_NAND 0x196070
// Hooks
#define FS_OFFSET_1800_EXFAT_SDMMC_WRAPPER_READ 0x191AE0
#define FS_OFFSET_1800_EXFAT_SDMMC_WRAPPER_WRITE 0x191B40
#define FS_OFFSET_1800_EXFAT_RTLD 0x2A3A4
#define FS_OFFSET_1800_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x44)))
#define FS_OFFSET_1800_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1B2860
// Misc funcs
#define FS_OFFSET_1800_EXFAT_LOCK_MUTEX 0x18AD50
#define FS_OFFSET_1800_EXFAT_UNLOCK_MUTEX 0x18ADA0
#define FS_OFFSET_1800_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x191AA0
#define FS_OFFSET_1800_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x191AC0
// Misc Data
#define FS_OFFSET_1800_EXFAT_SD_MUTEX 0xFE33F0
#define FS_OFFSET_1800_EXFAT_NAND_MUTEX 0xFDEB28
#define FS_OFFSET_1800_EXFAT_ACTIVE_PARTITION 0xFDEB68
#define FS_OFFSET_1800_EXFAT_SDMMC_DAS_HANDLE 0xFBE950
// NOPs
#define FS_OFFSET_1800_EXFAT_SD_DAS_INIT 0x28F24
// Nintendo Paths
#define FS_OFFSET_1800_EXFAT_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00068B08, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x000758DC, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0007C77C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x000905C4, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1800_EXFAT_H__

59
emummc/source/FS/offsets/1810.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1810_H__
#define __FS_1810_H__
// Accessor vtable getters
#define FS_OFFSET_1810_SDMMC_ACCESSOR_GC 0x18AB00
#define FS_OFFSET_1810_SDMMC_ACCESSOR_SD 0x18C800
#define FS_OFFSET_1810_SDMMC_ACCESSOR_NAND 0x18AFE0
// Hooks
#define FS_OFFSET_1810_SDMMC_WRAPPER_READ 0x186A50
#define FS_OFFSET_1810_SDMMC_WRAPPER_WRITE 0x186AB0
#define FS_OFFSET_1810_RTLD 0x2A3A4
#define FS_OFFSET_1810_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x44)))
#define FS_OFFSET_1810_CLKRST_SET_MIN_V_CLK_RATE 0x1A77D0
// Misc funcs
#define FS_OFFSET_1810_LOCK_MUTEX 0x17FCC0
#define FS_OFFSET_1810_UNLOCK_MUTEX 0x17FD10
#define FS_OFFSET_1810_SDMMC_WRAPPER_CONTROLLER_OPEN 0x186A10
#define FS_OFFSET_1810_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x186A30
// Misc Data
#define FS_OFFSET_1810_SD_MUTEX 0xFD13F0
#define FS_OFFSET_1810_NAND_MUTEX 0xFCCB28
#define FS_OFFSET_1810_ACTIVE_PARTITION 0xFCCB68
#define FS_OFFSET_1810_SDMMC_DAS_HANDLE 0xFB1950
// NOPs
#define FS_OFFSET_1810_SD_DAS_INIT 0x28F24
// Nintendo Paths
#define FS_OFFSET_1810_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00068B08, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x000758DC, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0007C77C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x000905C4, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1810_H__

59
emummc/source/FS/offsets/1810_exfat.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1810_EXFAT_H__
#define __FS_1810_EXFAT_H__
// Accessor vtable getters
#define FS_OFFSET_1810_EXFAT_SDMMC_ACCESSOR_GC 0x195B90
#define FS_OFFSET_1810_EXFAT_SDMMC_ACCESSOR_SD 0x197890
#define FS_OFFSET_1810_EXFAT_SDMMC_ACCESSOR_NAND 0x196070
// Hooks
#define FS_OFFSET_1810_EXFAT_SDMMC_WRAPPER_READ 0x191AE0
#define FS_OFFSET_1810_EXFAT_SDMMC_WRAPPER_WRITE 0x191B40
#define FS_OFFSET_1810_EXFAT_RTLD 0x2A3A4
#define FS_OFFSET_1810_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x44)))
#define FS_OFFSET_1810_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1B2860
// Misc funcs
#define FS_OFFSET_1810_EXFAT_LOCK_MUTEX 0x18AD50
#define FS_OFFSET_1810_EXFAT_UNLOCK_MUTEX 0x18ADA0
#define FS_OFFSET_1810_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x191AA0
#define FS_OFFSET_1810_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x191AC0
// Misc Data
#define FS_OFFSET_1810_EXFAT_SD_MUTEX 0xFE33F0
#define FS_OFFSET_1810_EXFAT_NAND_MUTEX 0xFDEB28
#define FS_OFFSET_1810_EXFAT_ACTIVE_PARTITION 0xFDEB68
#define FS_OFFSET_1810_EXFAT_SDMMC_DAS_HANDLE 0xFBE950
// NOPs
#define FS_OFFSET_1810_EXFAT_SD_DAS_INIT 0x28F24
// Nintendo Paths
#define FS_OFFSET_1810_EXFAT_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00068B08, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x000758DC, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0007C77C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x000905C4, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1810_EXFAT_H__

59
emummc/source/FS/offsets/1900.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1900_H__
#define __FS_1900_H__
// Accessor vtable getters
#define FS_OFFSET_1900_SDMMC_ACCESSOR_GC 0x195C00
#define FS_OFFSET_1900_SDMMC_ACCESSOR_SD 0x197F80
#define FS_OFFSET_1900_SDMMC_ACCESSOR_NAND 0x1963B0
// Hooks
#define FS_OFFSET_1900_SDMMC_WRAPPER_READ 0x191A70
#define FS_OFFSET_1900_SDMMC_WRAPPER_WRITE 0x191AD0
#define FS_OFFSET_1900_RTLD 0x275F0
#define FS_OFFSET_1900_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x50)))
#define FS_OFFSET_1900_CLKRST_SET_MIN_V_CLK_RATE 0x1B3880
// Misc funcs
#define FS_OFFSET_1900_LOCK_MUTEX 0x18AC20
#define FS_OFFSET_1900_UNLOCK_MUTEX 0x18AC70
#define FS_OFFSET_1900_SDMMC_WRAPPER_CONTROLLER_OPEN 0x191A30
#define FS_OFFSET_1900_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x191A50
// Misc Data
#define FS_OFFSET_1900_SD_MUTEX 0xFE1408
#define FS_OFFSET_1900_NAND_MUTEX 0xFDCB60
#define FS_OFFSET_1900_ACTIVE_PARTITION 0xFDCBA0
#define FS_OFFSET_1900_SDMMC_DAS_HANDLE 0xFC1908
// NOPs
#define FS_OFFSET_1900_SD_DAS_INIT 0x260C4
// Nintendo Paths
#define FS_OFFSET_1900_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00067FC8, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x00075D6C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0007D1E8, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x00092818, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1900_H__

59
emummc/source/FS/offsets/1900_exfat.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_1900_EXFAT_H__
#define __FS_1900_EXFAT_H__
// Accessor vtable getters
#define FS_OFFSET_1900_EXFAT_SDMMC_ACCESSOR_GC 0x1A1430
#define FS_OFFSET_1900_EXFAT_SDMMC_ACCESSOR_SD 0x1A37B0
#define FS_OFFSET_1900_EXFAT_SDMMC_ACCESSOR_NAND 0x1A1BE0
// Hooks
#define FS_OFFSET_1900_EXFAT_SDMMC_WRAPPER_READ 0x19D2A0
#define FS_OFFSET_1900_EXFAT_SDMMC_WRAPPER_WRITE 0x19D300
#define FS_OFFSET_1900_EXFAT_RTLD 0x275F0
#define FS_OFFSET_1900_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x50)))
#define FS_OFFSET_1900_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1BF0B0
// Misc funcs
#define FS_OFFSET_1900_EXFAT_LOCK_MUTEX 0x196450
#define FS_OFFSET_1900_EXFAT_UNLOCK_MUTEX 0x1964A0
#define FS_OFFSET_1900_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x19D260
#define FS_OFFSET_1900_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x19D280
// Misc Data
#define FS_OFFSET_1900_EXFAT_SD_MUTEX 0xFF4408
#define FS_OFFSET_1900_EXFAT_NAND_MUTEX 0xFEFB60
#define FS_OFFSET_1900_EXFAT_ACTIVE_PARTITION 0xFEFBA0
#define FS_OFFSET_1900_EXFAT_SDMMC_DAS_HANDLE 0xFCF908
// NOPs
#define FS_OFFSET_1900_EXFAT_SD_DAS_INIT 0x260C4
// Nintendo Paths
#define FS_OFFSET_1900_EXFAT_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00067FC8, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x00075D6C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0007D1E8, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x00092818, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1900_EXFAT_H__

59
emummc/source/FS/offsets/2000.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_2000_H__
#define __FS_2000_H__
// Accessor vtable getters
#define FS_OFFSET_2000_SDMMC_ACCESSOR_GC 0x1A7DB0
#define FS_OFFSET_2000_SDMMC_ACCESSOR_SD 0x1AA130
#define FS_OFFSET_2000_SDMMC_ACCESSOR_NAND 0x1A8560
// Hooks
#define FS_OFFSET_2000_SDMMC_WRAPPER_READ 0x1A3C20
#define FS_OFFSET_2000_SDMMC_WRAPPER_WRITE 0x1A3C80
#define FS_OFFSET_2000_RTLD 0x2B594
#define FS_OFFSET_2000_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x4C)))
#define FS_OFFSET_2000_CLKRST_SET_MIN_V_CLK_RATE 0x1C6150
// Misc funcs
#define FS_OFFSET_2000_LOCK_MUTEX 0x19CD80
#define FS_OFFSET_2000_UNLOCK_MUTEX 0x19CDD0
#define FS_OFFSET_2000_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1A3BE0
#define FS_OFFSET_2000_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1A3C00
// Misc Data
#define FS_OFFSET_2000_SD_MUTEX 0xFF5408
#define FS_OFFSET_2000_NAND_MUTEX 0xFF0CF0
#define FS_OFFSET_2000_ACTIVE_PARTITION 0xFF0D30
#define FS_OFFSET_2000_SDMMC_DAS_HANDLE 0xFD2B08
// NOPs
#define FS_OFFSET_2000_SD_DAS_INIT 0x289F4
// Nintendo Paths
#define FS_OFFSET_2000_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x0006DB14, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0007CE1C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x00084A08, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0009AE48, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_2000_H__

59
emummc/source/FS/offsets/2000_exfat.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_2000_EXFAT_H__
#define __FS_2000_EXFAT_H__
// Accessor vtable getters
#define FS_OFFSET_2000_EXFAT_SDMMC_ACCESSOR_GC 0x1B36D0
#define FS_OFFSET_2000_EXFAT_SDMMC_ACCESSOR_SD 0x1B5A50
#define FS_OFFSET_2000_EXFAT_SDMMC_ACCESSOR_NAND 0x1B3E80
// Hooks
#define FS_OFFSET_2000_EXFAT_SDMMC_WRAPPER_READ 0x1AF540
#define FS_OFFSET_2000_EXFAT_SDMMC_WRAPPER_WRITE 0x1AF5A0
#define FS_OFFSET_2000_EXFAT_RTLD 0x2B594
#define FS_OFFSET_2000_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x4C)))
#define FS_OFFSET_2000_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1D1A70
// Misc funcs
#define FS_OFFSET_2000_EXFAT_LOCK_MUTEX 0x1A86A0
#define FS_OFFSET_2000_EXFAT_UNLOCK_MUTEX 0x1A86F0
#define FS_OFFSET_2000_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1AF500
#define FS_OFFSET_2000_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1AF520
// Misc Data
#define FS_OFFSET_2000_EXFAT_SD_MUTEX 0x1006408
#define FS_OFFSET_2000_EXFAT_NAND_MUTEX 0x1001CF0
#define FS_OFFSET_2000_EXFAT_ACTIVE_PARTITION 0x1001D30
#define FS_OFFSET_2000_EXFAT_SDMMC_DAS_HANDLE 0xFDFB08
// NOPs
#define FS_OFFSET_2000_EXFAT_SD_DAS_INIT 0x289F4
// Nintendo Paths
#define FS_OFFSET_2000_EXFAT_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x0006DB14, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0007CE1C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x00084A08, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0009AE48, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_2000_EXFAT_H__

59
emummc/source/FS/offsets/2010.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_2010_H__
#define __FS_2010_H__
// Accessor vtable getters
#define FS_OFFSET_2010_SDMMC_ACCESSOR_GC 0x1A7DB0
#define FS_OFFSET_2010_SDMMC_ACCESSOR_SD 0x1AA130
#define FS_OFFSET_2010_SDMMC_ACCESSOR_NAND 0x1A8560
// Hooks
#define FS_OFFSET_2010_SDMMC_WRAPPER_READ 0x1A3C20
#define FS_OFFSET_2010_SDMMC_WRAPPER_WRITE 0x1A3C80
#define FS_OFFSET_2010_RTLD 0x2B594
#define FS_OFFSET_2010_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x4C)))
#define FS_OFFSET_2010_CLKRST_SET_MIN_V_CLK_RATE 0x1C6150
// Misc funcs
#define FS_OFFSET_2010_LOCK_MUTEX 0x19CD80
#define FS_OFFSET_2010_UNLOCK_MUTEX 0x19CDD0
#define FS_OFFSET_2010_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1A3BE0
#define FS_OFFSET_2010_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1A3C00
// Misc Data
#define FS_OFFSET_2010_SD_MUTEX 0xFF5408
#define FS_OFFSET_2010_NAND_MUTEX 0xFF0CF0
#define FS_OFFSET_2010_ACTIVE_PARTITION 0xFF0D30
#define FS_OFFSET_2010_SDMMC_DAS_HANDLE 0xFD2B08
// NOPs
#define FS_OFFSET_2010_SD_DAS_INIT 0x289F4
// Nintendo Paths
#define FS_OFFSET_2010_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x0006DB14, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0007CE1C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x00084A08, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0009AE48, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_2010_H__

59
emummc/source/FS/offsets/2010_exfat.h vendored Normal file
View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* Copyright (c) 2019 Atmosphere-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_2010_EXFAT_H__
#define __FS_2010_EXFAT_H__
// Accessor vtable getters
#define FS_OFFSET_2010_EXFAT_SDMMC_ACCESSOR_GC 0x1B36D0
#define FS_OFFSET_2010_EXFAT_SDMMC_ACCESSOR_SD 0x1B5A50
#define FS_OFFSET_2010_EXFAT_SDMMC_ACCESSOR_NAND 0x1B3E80
// Hooks
#define FS_OFFSET_2010_EXFAT_SDMMC_WRAPPER_READ 0x1AF540
#define FS_OFFSET_2010_EXFAT_SDMMC_WRAPPER_WRITE 0x1AF5A0
#define FS_OFFSET_2010_EXFAT_RTLD 0x2B594
#define FS_OFFSET_2010_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x4C)))
#define FS_OFFSET_2010_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1D1A70
// Misc funcs
#define FS_OFFSET_2010_EXFAT_LOCK_MUTEX 0x1A86A0
#define FS_OFFSET_2010_EXFAT_UNLOCK_MUTEX 0x1A86F0
#define FS_OFFSET_2010_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1AF500
#define FS_OFFSET_2010_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1AF520
// Misc Data
#define FS_OFFSET_2010_EXFAT_SD_MUTEX 0x1006408
#define FS_OFFSET_2010_EXFAT_NAND_MUTEX 0x1001CF0
#define FS_OFFSET_2010_EXFAT_ACTIVE_PARTITION 0x1001D30
#define FS_OFFSET_2010_EXFAT_SDMMC_DAS_HANDLE 0xFDFB08
// NOPs
#define FS_OFFSET_2010_EXFAT_SD_DAS_INIT 0x289F4
// Nintendo Paths
#define FS_OFFSET_2010_EXFAT_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x0006DB14, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0007CE1C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x00084A08, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0009AE48, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_2010_EXFAT_H__

View File

@ -89,7 +89,7 @@ static void _sdmmc_ensure_initialized(void)
}
}
static void _file_based_update_filename(char *outFilename, u32 sd_path_len, u32 part_idx)
static void _file_based_update_filename(char *outFilename, unsigned int sd_path_len, unsigned int part_idx)
{
snprintf(outFilename + sd_path_len, 3, "%02d", part_idx);
}
@ -103,9 +103,7 @@ static void _file_based_emmc_finalize(void)
f_close(&f_emu.fp_boot1);
for (int i = 0; i < f_emu.parts; i++)
{
f_close(&f_emu.fp_gpp[i]);
}
// Force unmount FAT volume.
f_mount(NULL, "", 1);
@ -114,12 +112,59 @@ static void _file_based_emmc_finalize(void)
}
}
static void _nand_patrol_ensure_integrity(void)
{
fs_nand_patrol_t nand_patrol;
static bool nand_patrol_checked = false;
if (!nand_patrol_checked)
{
if (emuMMC_ctx.EMMC_Type == emuMMC_SD_Raw)
{
unsigned int nand_patrol_sector = emuMMC_ctx.EMMC_StoragePartitionOffset + NAND_PATROL_SECTOR;
if (!sdmmc_storage_read(&sd_storage, nand_patrol_sector, 1, &nand_patrol))
goto out;
// Clear nand patrol if last offset exceeds storage.
if (nand_patrol.offset > sd_storage.sec_cnt)
{
memset(&nand_patrol, 0, sizeof(fs_nand_patrol_t));
sdmmc_storage_write(&sd_storage, nand_patrol_sector, 1, &nand_patrol);
}
}
else if (emuMMC_ctx.EMMC_Type == emuMMC_SD_File && fat_mounted)
{
FIL *fp = &f_emu.fp_boot0;
if (f_lseek(fp, NAND_PATROL_OFFSET) != FR_OK)
goto out;
if (f_read_fast(fp, &nand_patrol, sizeof(fs_nand_patrol_t)) != FR_OK)
goto out;
// Clear nand patrol if last offset exceeds total file based size.
if (nand_patrol.offset > f_emu.total_sect)
{
memset(&nand_patrol, 0, sizeof(fs_nand_patrol_t));
if (f_lseek(fp, NAND_PATROL_OFFSET) != FR_OK)
goto out;
if (f_write_fast(fp, &nand_patrol, sizeof(fs_nand_patrol_t)) != FR_OK)
goto out;
f_sync(fp);
}
}
out:
nand_patrol_checked = true;
}
}
void sdmmc_finalize(void)
{
if (!sdmmc_storage_end(&sd_storage))
{
fatal_abort(Fatal_InitSD);
}
storageSDinitialized = false;
}
@ -137,14 +182,14 @@ static void _file_based_emmc_initialize(void)
memcpy(path + path_len, "BOOT0", 6);
if (f_open(&f_emu.fp_boot0, path, FA_READ | FA_WRITE) != FR_OK)
fatal_abort(Fatal_FatfsFileOpen);
if (!f_expand_cltbl(&f_emu.fp_boot0, 0x400, f_emu.clmt_boot0, f_size(&f_emu.fp_boot0)))
if (!f_expand_cltbl(&f_emu.fp_boot0, EMUMMC_FP_CLMT_COUNT, f_emu.clmt_boot0, f_size(&f_emu.fp_boot0)))
fatal_abort(Fatal_FatfsMemExhaustion);
// Open BOOT1 physical partition.
memcpy(path + path_len, "BOOT1", 6);
if (f_open(&f_emu.fp_boot1, path, FA_READ | FA_WRITE) != FR_OK)
fatal_abort(Fatal_FatfsFileOpen);
if (!f_expand_cltbl(&f_emu.fp_boot1, 0x400, f_emu.clmt_boot1, f_size(&f_emu.fp_boot1)))
if (!f_expand_cltbl(&f_emu.fp_boot1, EMUMMC_FP_CLMT_COUNT, f_emu.clmt_boot1, f_size(&f_emu.fp_boot1)))
fatal_abort(Fatal_FatfsMemExhaustion);
// Open handles for GPP physical partition files.
@ -152,15 +197,14 @@ static void _file_based_emmc_initialize(void)
if (f_open(&f_emu.fp_gpp[0], path, FA_READ | FA_WRITE) != FR_OK)
fatal_abort(Fatal_FatfsFileOpen);
if (!f_expand_cltbl(&f_emu.fp_gpp[0], 0x400, &f_emu.clmt_gpp[0], f_size(&f_emu.fp_gpp[0])))
if (!f_expand_cltbl(&f_emu.fp_gpp[0], EMUMMC_FP_CLMT_COUNT, &f_emu.clmt_gpp[0], f_size(&f_emu.fp_gpp[0])))
fatal_abort(Fatal_FatfsMemExhaustion);
f_emu.part_size = f_size(&f_emu.fp_gpp[0]) >> 9;
f_emu.part_size = (uint64_t)f_size(&f_emu.fp_gpp[0]) >> 9;
f_emu.total_sect = f_emu.part_size;
// Iterate folder for split parts and stop if next doesn't exist.
// Supports up to 32 parts of any size.
// TODO: decide on max parts and define them. (hekate produces up to 30 parts on 1GB mode.)
for (f_emu.parts = 1; f_emu.parts < 32; f_emu.parts++)
for (f_emu.parts = 1; f_emu.parts < EMUMMC_FILE_MAX_PARTS; f_emu.parts++)
{
_file_based_update_filename(path, path_len, f_emu.parts);
@ -173,8 +217,13 @@ static void _file_based_emmc_initialize(void)
return;
}
if (!f_expand_cltbl(&f_emu.fp_gpp[f_emu.parts], 0x400, &f_emu.clmt_gpp[f_emu.parts * 0x400], f_size(&f_emu.fp_gpp[f_emu.parts])))
if (!f_expand_cltbl(&f_emu.fp_gpp[f_emu.parts], EMUMMC_FP_CLMT_COUNT,
&f_emu.clmt_gpp[f_emu.parts * EMUMMC_FP_CLMT_COUNT], f_size(&f_emu.fp_gpp[f_emu.parts])))
{
fatal_abort(Fatal_FatfsMemExhaustion);
}
f_emu.total_sect += (uint64_t)f_size(&f_emu.fp_gpp[f_emu.parts]) >> 9;
}
}
@ -189,7 +238,7 @@ bool sdmmc_initialize(void)
{
storageSDinitialized = true;
// File based emummc.
// Init file based emummc.
if ((emuMMC_ctx.EMMC_Type == emuMMC_SD_File) && !fat_mounted)
{
if (f_mount(&f_emu.sd_fs, "", 1) != FR_OK)
@ -200,6 +249,9 @@ bool sdmmc_initialize(void)
_file_based_emmc_initialize();
}
// Check if nand patrol offset is inside limits.
_nand_patrol_ensure_integrity();
break;
}
@ -207,9 +259,7 @@ bool sdmmc_initialize(void)
}
if (!storageSDinitialized)
{
fatal_abort(Fatal_InitSD);
}
}
return storageSDinitialized;
@ -239,19 +289,17 @@ sdmmc_accessor_t *sdmmc_accessor_get(int mmc_id)
void mutex_lock_handler(int mmc_id)
{
if (custom_driver)
{
lock_mutex(sd_mutex);
}
lock_mutex(nand_mutex);
}
void mutex_unlock_handler(int mmc_id)
{
unlock_mutex(nand_mutex);
if (custom_driver)
{
unlock_mutex(sd_mutex);
}
}
int sdmmc_nand_get_active_partition_index()
@ -271,12 +319,16 @@ int sdmmc_nand_get_active_partition_index()
static uint64_t emummc_read_write_inner(void *buf, unsigned int sector, unsigned int num_sectors, bool is_write)
{
if ((emuMMC_ctx.EMMC_Type == emuMMC_SD_Raw))
if (emuMMC_ctx.EMMC_Type == emuMMC_SD_Raw)
{
// raw partition sector offset: emuMMC_ctx.EMMC_StoragePartitionOffset.
sector += emuMMC_ctx.EMMC_StoragePartitionOffset;
// Set physical partition offset.
sector += (sdmmc_nand_get_active_partition_index() * BOOT_PARTITION_SIZE);
if (__builtin_expect(sector + num_sectors > sd_storage.sec_cnt, 0))
return 0; // Out of bounds. Can only happen with Nand Patrol if resized.
if (!is_write)
return sdmmc_storage_read(&sd_storage, sector, num_sectors, buf);
else
@ -290,32 +342,62 @@ static uint64_t emummc_read_write_inner(void *buf, unsigned int sector, unsigned
case FS_EMMC_PARTITION_GPP:
if (f_emu.parts)
{
if (__builtin_expect(sector + num_sectors > f_emu.total_sect, 0))
return 0; // Out of bounds. Can only happen with Nand Patrol if resized.
fp = &f_emu.fp_gpp[sector / f_emu.part_size];
sector = sector % f_emu.part_size;
// Special handling for reads/writes which cross file-boundaries.
if (__builtin_expect(sector + num_sectors > f_emu.part_size, 0))
{
unsigned int remaining = num_sectors;
while (remaining > 0) {
const unsigned int cur_sectors = MIN(remaining, f_emu.part_size - sector);
if (f_lseek(fp, (uint64_t)sector << 9) != FR_OK)
return 0; // Out of bounds.
if (!is_write)
{
if (f_read_fast(fp, buf, (uint64_t)cur_sectors << 9) != FR_OK)
return 0;
}
else
{
if (f_write_fast(fp, buf, (uint64_t)cur_sectors << 9) != FR_OK)
return 0;
}
buf = (char *)buf + ((uint64_t)cur_sectors << 9);
remaining -= cur_sectors;
sector = 0;
++fp;
}
return 1;
}
}
else
{
fp = &f_emu.fp_gpp[0];
}
break;
case FS_EMMC_PARTITION_BOOT1:
fp = &f_emu.fp_boot1;
break;
case FS_EMMC_PARTITION_BOOT0:
fp = &f_emu.fp_boot0;
break;
}
if (f_lseek(fp, sector << 9) != FR_OK)
return 0; // Out of bounds.
if (f_lseek(fp, (uint64_t)sector << 9) != FR_OK)
return 0; // Out of bounds. Can only happen with Nand Patrol if resized.
uint64_t res = 0;
if (!is_write)
res = !f_read_fast(fp, buf, num_sectors << 9);
return !f_read_fast(fp, buf, (uint64_t)num_sectors << 9);
else
res = !f_write_fast(fp, buf, num_sectors << 9);
return res;
return !f_write_fast(fp, buf, (uint64_t)num_sectors << 9);
}
// Controller open wrapper
@ -352,9 +434,7 @@ uint64_t sdmmc_wrapper_controller_close(int mmc_id)
if (_this != NULL)
{
if (mmc_id == FS_SDMMC_SD)
{
return 0;
}
if (mmc_id == FS_SDMMC_EMMC)
{
@ -474,8 +554,6 @@ uint64_t sdmmc_wrapper_write(int mmc_id, unsigned int sector, unsigned int num_s
mutex_lock_handler(mmc_id);
_current_accessor = _this;
sector += 0;
// Call hekates driver.
if (sdmmc_storage_write(&sd_storage, sector, num_sectors, buf))
{

View File

@ -36,6 +36,9 @@ extern "C" {
#include "../FS/FS.h"
#include "../libs/fatfs/ff.h"
#define EMUMMC_FILE_MAX_PARTS 32
#define EMUMMC_FP_CLMT_COUNT 1024
// FS typedefs
typedef sdmmc_accessor_t *(*_sdmmc_accessor_gc)();
typedef sdmmc_accessor_t *(*_sdmmc_accessor_sd)();
@ -63,11 +66,12 @@ typedef struct _file_based_ctxt
uint64_t parts;
uint64_t part_size;
FIL fp_boot0;
DWORD clmt_boot0[0x400];
DWORD clmt_boot0[EMUMMC_FP_CLMT_COUNT];
FIL fp_boot1;
DWORD clmt_boot1[0x400];
FIL fp_gpp[32];
DWORD clmt_gpp[0x8000];
DWORD clmt_boot1[EMUMMC_FP_CLMT_COUNT];
FIL fp_gpp[EMUMMC_FILE_MAX_PARTS];
DWORD clmt_gpp[EMUMMC_FILE_MAX_PARTS * EMUMMC_FP_CLMT_COUNT];
uint64_t total_sect;
} file_based_ctxt;
#ifdef __cplusplus

View File

@ -27,6 +27,10 @@ CODE_BEGIN armDCacheFlush
bic x8, x0, x10
mov x10, x1
mov w1, #1
mrs x0, tpidrro_el0
strb w1, [x0, #0x104]
armDCacheFlush_L0:
dc civac, x8
add x8, x8, x9
@ -34,6 +38,9 @@ armDCacheFlush_L0:
bcc armDCacheFlush_L0
dsb sy
strb wzr, [x0, #0x104]
ret
CODE_END
@ -48,6 +55,10 @@ CODE_BEGIN armDCacheClean
bic x8, x0, x10
mov x10, x1
mov w1, #1
mrs x0, tpidrro_el0
strb w1, [x0, #0x104]
armDCacheClean_L0:
dc cvac, x8
add x8, x8, x9
@ -55,6 +66,9 @@ armDCacheClean_L0:
bcc armDCacheClean_L0
dsb sy
strb wzr, [x0, #0x104]
ret
CODE_END
@ -68,6 +82,10 @@ CODE_BEGIN armICacheInvalidate
bic x8, x0, x10
mov x10, x1
mov w1, #1
mrs x0, tpidrro_el0
strb w1, [x0, #0x104]
armICacheInvalidate_L0:
ic ivau, x8
add x8, x8, x9
@ -75,6 +93,9 @@ armICacheInvalidate_L0:
bcc armICacheInvalidate_L0
dsb sy
strb wzr, [x0, #0x104]
ret
CODE_END
@ -89,6 +110,10 @@ CODE_BEGIN armDCacheZero
bic x8, x0, x10
mov x10, x1
mov w1, #1
mrs x0, tpidrro_el0
strb w1, [x0, #0x104]
armDCacheZero_L0:
dc zva, x8
add x8, x8, x9
@ -96,5 +121,8 @@ armDCacheZero_L0:
bcc armDCacheZero_L0
dsb sy
strb wzr, [x0, #0x104]
ret
CODE_END

View File

@ -18,6 +18,7 @@
#define _TYPES_H_
#include <stdint.h>
#include <stdbool.h>
#define ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
@ -58,12 +59,6 @@ typedef u32 Result; ///< Function error code result type.
#define INVALID_HANDLE ((Handle) 0)
#define CUR_PROCESS_HANDLE ((Handle) 0xFFFF8001)
#ifndef __cplusplus
typedef int bool;
#define true 1
#define false 0
#endif /* __cplusplus */
#define BOOT_CFG_AUTOBOOT_EN (1 << 0)
#define BOOT_CFG_FROM_LAUNCH (1 << 1)
#define BOOT_CFG_SEPT_RUN (1 << 7)

View File

@ -1,75 +1,41 @@
ATMOSPHERE_BUILD_CONFIGS :=
all: release
all: nx_release
THIS_MAKEFILE := $(abspath $(lastword $(MAKEFILE_LIST)))
CURRENT_DIRECTORY := $(abspath $(dir $(THIS_MAKEFILE)))
define ATMOSPHERE_ADD_TARGET
ATMOSPHERE_BUILD_CONFIGS += $(strip $1)
$(strip $1): exosphere$(strip $2).bin warmboot$(strip $2).bin mariko_fatal$(strip $2).bin
$(strip $1):
@echo "Building $(strip $1)"
@$$(MAKE) -f $(CURRENT_DIRECTORY)/exosphere.mk ATMOSPHERE_MAKEFILE_TARGET="$(strip $1)" ATMOSPHERE_BUILD_NAME="$(strip $2)" ATMOSPHERE_BOARD="$(strip $3)" ATMOSPHERE_CPU="$(strip $4)" $(strip $5)
exosphere$(strip $2).bin: loader_stub/loader_stub$(strip $2).bin
@cp loader_stub/loader_stub$(strip $2).bin exosphere$(strip $2).bin
@printf LENY >> exosphere$(strip $2).bin
@echo "Built exosphere$(strip $2).bin..."
warmboot$(strip $2).bin: warmboot/warmboot$(strip $2).bin
@cp warmboot/warmboot$(strip $2).bin warmboot$(strip $2).bin
@echo "Built warmboot$(strip $2).bin..."
mariko_fatal$(strip $2).bin: mariko_fatal/mariko_fatal$(strip $2).bin
@cp mariko_fatal/mariko_fatal$(strip $2).bin mariko_fatal$(strip $2).bin
@echo "Built mariko_fatal$(strip $2).bin..."
check_program_$(strip $1):
@$$(MAKE) -C program $(strip $1)
check_warmboot_$(strip $1):
@$$(MAKE) -C warmboot $(strip $1)
check_mariko_fatal_$(strip $1):
@$$(MAKE) -C mariko_fatal $(strip $1)
loader_stub/loader_stub$(strip $2).bin: check_program_$(strip $1)
@$$(MAKE) -C loader_stub $(strip $1)
warmboot/warmboot$(strip $2).bin: check_warmboot_$(strip $1)
mariko_fatal/mariko_fatal$(strip $2).bin: check_mariko_fatal_$(strip $1)
clean-$(strip $1): clean-program-$(strip $1) clean-loader_stub-$(strip $1) clean-warmboot-$(strip $1) clean-mariko_fatal-$(strip $1)
@rm -rf exosphere$(strip $2).bin warmboot$(strip $2).bin mariko_fatal$(strip $2).bin
clean-program-$(strip $1):
@$$(MAKE) -C program clean-$(strip $1)
clean-loader_stub-$(strip $1):
@$$(MAKE) -C loader_stub clean-$(strip $1)
clean-warmboot-$(strip $1):
@$$(MAKE) -C warmboot clean-$(strip $1)
clean-mariko_fatal-$(strip $1):
@$$(MAKE) -C mariko_fatal clean-$(strip $1)
clean-$(strip $1):
@echo "Cleaning $(strip $1)"
@$$(MAKE) -f $(CURRENT_DIRECTORY)/exosphere.mk clean ATMOSPHERE_MAKEFILE_TARGET="$(strip $1)" ATMOSPHERE_BUILD_NAME="$(strip $2)" ATMOSPHERE_BOARD="$(strip $3)" ATMOSPHERE_CPU="$(strip $4)" $(strip $5)
endef
$(eval $(call ATMOSPHERE_ADD_TARGET, release, ))
$(eval $(call ATMOSPHERE_ADD_TARGET, debug, _debug))
$(eval $(call ATMOSPHERE_ADD_TARGET, audit, _audit))
define ATMOSPHERE_ADD_TARGETS
clean: clean-program clean-loader_stub clean-warmboot
@rm -rf exosphere*.bin warmboot*.bin mariko_fatal*.bin
$(eval $(call ATMOSPHERE_ADD_TARGET, $(strip $1)_release, release, $(strip $2), $(strip $3), \
ATMOSPHERE_BUILD_SETTINGS="$(strip $4)" \
))
clean-program:
@$(MAKE) -C program clean
$(eval $(call ATMOSPHERE_ADD_TARGET, $(strip $1)_debug, debug, $(strip $2), $(strip $3), \
ATMOSPHERE_BUILD_SETTINGS="$(strip $4) -DAMS_BUILD_FOR_DEBUGGING" ATMOSPHERE_BUILD_FOR_DEBUGGING=1 \
))
clean-loader_stub:
@$(MAKE) -C loader_stub clean
$(eval $(call ATMOSPHERE_ADD_TARGET, $(strip $1)_audit, audit, $(strip $2), $(strip $3), \
ATMOSPHERE_BUILD_SETTINGS="$(strip $4) -DAMS_BUILD_FOR_AUDITING" ATMOSPHERE_BUILD_FOR_DEBUGGING=1 ATMOSPHERE_BUILD_FOR_AUDITING=1 \
))
clean-warmboot:
@$(MAKE) -C warmboot clean
endef
clean-mariko_fatal:
@$(MAKE) -C mariko_fatal clean
$(eval $(call ATMOSPHERE_ADD_TARGETS, nx, nx-hac-001, arm-cortex-a57,))
.PHONY: all clean clean-program clean-loader_stub clean-warmboot $(foreach config,$(ATMOSPHERE_BUILD_CONFIGS),check_program_$(config) check_warmboot_$(strip $1) clean-$(config) clean-program-$(config) clean-loader_stub-$(config) clean-warmboot-$(config))
clean: $(foreach config,$(ATMOSPHERE_BUILD_CONFIGS),clean-$(config))
.PHONY: all clean $(foreach config,$(ATMOSPHERE_BUILD_CONFIGS), $(config) clean-$(config))

75
exosphere/exosphere.mk Normal file
View File

@ -0,0 +1,75 @@
#---------------------------------------------------------------------------------
# pull in common atmosphere configuration
#---------------------------------------------------------------------------------
THIS_MAKEFILE := $(abspath $(lastword $(MAKEFILE_LIST)))
CURRENT_DIRECTORY := $(abspath $(dir $(THIS_MAKEFILE)))
include $(CURRENT_DIRECTORY)/../libraries/config/common.mk
all: $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)/exosphere.bin $(CURRENT_DIRECTORY)/warmboot/$(ATMOSPHERE_BOOT_OUT_DIR)/warmboot.bin $(CURRENT_DIRECTORY)/mariko_fatal/$(ATMOSPHERE_OUT_DIR)/mariko_fatal.bin
$(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)/exosphere.bin: $(CURRENT_DIRECTORY)/loader_stub/$(ATMOSPHERE_OUT_DIR)/loader_stub.bin $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)
@cp $(CURRENT_DIRECTORY)/loader_stub/$(ATMOSPHERE_OUT_DIR)/loader_stub.bin $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)/exosphere.bin
@printf LENY >> $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)/exosphere.bin
@echo "Built exosphere.bin..."
$(CURRENT_DIRECTORY)/loader_stub/$(ATMOSPHERE_OUT_DIR)/loader_stub.bin: check_loader_stub
@$(SILENTCMD)echo "Checked loader stub."
$(CURRENT_DIRECTORY)/program/$(ATMOSPHERE_OUT_DIR)/program.lz4: check_program
@$(SILENTCMD)echo "Checked program."
$(CURRENT_DIRECTORY)/warmboot/$(ATMOSPHERE_BOOT_OUT_DIR)/warmboot.bin: check_warmboot
@$(SILENTCMD)echo "Checked warmboot."
$(CURRENT_DIRECTORY)/mariko_fatal/$(ATMOSPHERE_OUT_DIR)/mariko_fatal.bin: check_mariko_fatal
@$(SILENTCMD)echo "Checked mariko fatal."
$(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/$(ATMOSPHERE_LIBRARY_DIR)/libexosphere.a: check_lib
@$(SILENTCMD)echo "Checked library."
ifneq ($(strip $(ATMOSPHERE_LIBRARY_DIR)),$(strip $(ATMOSPHERE_BOOT_LIBRARY_DIR)))
$(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/$(ATMOSPHERE_BOOT_LIBRARY_DIR)/libexosphere.a: check_boot_lib
@$(SILENTCMD)echo "Checked boot library."
endif
check_loader_stub: $(CURRENT_DIRECTORY)/program/$(ATMOSPHERE_OUT_DIR)/program.lz4
@$(MAKE) --no-print-directory -C $(CURRENT_DIRECTORY)/loader_stub -f $(CURRENT_DIRECTORY)/loader_stub/loader_stub.mk ATMOSPHERE_CHECKED_LIBEXOSPHERE=1 ATMOSPHERE_CHECKED_BOOT_LIBEXOSPHERE=1 ATMOSPHERE_CHECKED_EXOSPHERE_PROGRAM=1
check_program: $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/$(ATMOSPHERE_LIBRARY_DIR)/libexosphere.a $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/$(ATMOSPHERE_BOOT_LIBRARY_DIR)/libexosphere.a
@$(MAKE) --no-print-directory -C $(CURRENT_DIRECTORY)/program -f $(CURRENT_DIRECTORY)/program/program.mk ATMOSPHERE_CHECKED_LIBEXOSPHERE=1 ATMOSPHERE_CHECKED_BOOT_LIBEXOSPHERE=1
check_mariko_fatal: $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/$(ATMOSPHERE_LIBRARY_DIR)/libexosphere.a
@$(MAKE) --no-print-directory -C $(CURRENT_DIRECTORY)/mariko_fatal -f $(CURRENT_DIRECTORY)/mariko_fatal/mariko_fatal.mk ATMOSPHERE_CHECKED_LIBEXOSPHERE=1 ATMOSPHERE_CHECKED_BOOT_LIBEXOSPHERE=1
check_warmboot: $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/$(ATMOSPHERE_BOOT_LIBRARY_DIR)/libexosphere.a
@$(MAKE) --no-print-directory -C $(CURRENT_DIRECTORY)/warmboot -f $(CURRENT_DIRECTORY)/warmboot/warmboot.mk ATMOSPHERE_CHECKED_LIBEXOSPHERE=1 ATMOSPHERE_CHECKED_BOOT_LIBEXOSPHERE=1 ATMOSPHERE_CPU="$(strip $(ATMOSPHERE_BOOT_CPU))"
ifeq ($(ATMOSPHERE_CHECKED_LIBEXOSPHERE),1)
check_lib:
else
check_lib:
@$(MAKE) --no-print-directory -C $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere -f $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/libexosphere.mk
endif
ifeq ($(ATMOSPHERE_CHECKED_BOOT_LIBEXOSPHERE),1)
check_boot_lib:
else
check_boot_lib:
@$(MAKE) --no-print-directory -C $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere -f $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/libexosphere.mk ATMOSPHERE_CPU="$(strip $(ATMOSPHERE_BOOT_CPU))"
endif
$(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR):
@[ -d $@ ] || mkdir -p $@
clean:
@echo clean ...
@$(MAKE) --no-print-directory -C $(CURRENT_DIRECTORY)/loader_stub -f $(CURRENT_DIRECTORY)/loader_stub/loader_stub.mk clean
@$(MAKE) --no-print-directory -C $(CURRENT_DIRECTORY)/program -f $(CURRENT_DIRECTORY)/program/program.mk clean
@$(MAKE) --no-print-directory -C $(CURRENT_DIRECTORY)/mariko_fatal -f $(CURRENT_DIRECTORY)/mariko_fatal/mariko_fatal.mk clean
@$(MAKE) --no-print-directory -C $(CURRENT_DIRECTORY)/warmboot -f $(CURRENT_DIRECTORY)/warmboot/warmboot.mk clean ATMOSPHERE_CPU="$(strip $(ATMOSPHERE_BOOT_CPU))"
@$(MAKE) --no-print-directory -C $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere -f $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/libexosphere.mk clean
@$(MAKE) --no-print-directory -C $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere -f $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/libexosphere.mk clean ATMOSPHERE_CPU="$(strip $(ATMOSPHERE_BOOT_CPU))"
@rm -fr $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)
@for i in $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR); do [ -d $$i ] && rmdir --ignore-fail-on-non-empty $$i || true; done
.PHONY: all clean check_lib check_boot_lib check_loader_stub check_program check_mariko_fatal check_warmboot

View File

@ -1,158 +1,41 @@
#---------------------------------------------------------------------------------
# Define the atmosphere board and cpu
#---------------------------------------------------------------------------------
export ATMOSPHERE_BOARD := nx-hac-001
export ATMOSPHERE_CPU := arm-cortex-a57
ATMOSPHERE_BUILD_CONFIGS :=
all: nx_release
#---------------------------------------------------------------------------------
# pull in common atmosphere configuration
#---------------------------------------------------------------------------------
THIS_MAKEFILE := $(abspath $(lastword $(MAKEFILE_LIST)))
CURRENT_DIRECTORY := $(abspath $(dir $(THIS_MAKEFILE)))
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/../../libraries/config/templates/exosphere.mk
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(__RECURSIVE__),1)
#---------------------------------------------------------------------------------
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) $(CURDIR)/include \
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
CFILES := $(call FIND_SOURCE_FILES,$(SOURCES),c)
CPPFILES := $(call FIND_SOURCE_FILES,$(SOURCES),cpp)
SFILES := $(call FIND_SOURCE_FILES,$(SOURCES),s)
BINFILES :=
#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
#---------------------------------------------------------------------------------
export LD := $(CC)
#---------------------------------------------------------------------------------
else
#---------------------------------------------------------------------------------
export LD := $(CXX)
#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------
export OFILES_SRC := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
export OFILES := $(OFILES_SRC) program.lz4.o boot_code.lz4.o
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I.
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/$(ATMOSPHERE_LIBRARY_DIR))
export TOPDIR := $(CURRENT_DIRECTORY)
OUTPUT_BASE := $(TOPDIR)/$(notdir $(TOPDIR))
#---------------------------------------------------------------------------------
ATMOSPHERE_BUILD_CONFIGS :=
all: release
define ATMOSPHERE_ADD_TARGET
ATMOSPHERE_BUILD_CONFIGS += $(strip $1)
$(strip $1): check_libexo_$(strip $1) $$(ATMOSPHERE_BUILD_DIR)/$(strip $1)
@$$(MAKE) __RECURSIVE__=1 OUTPUT=$$(OUTPUT_BASE)$(strip $2) $(3) \
ATMOSPHERE_BUILD_TARGET_IDENTIFIER=$(strip $1)\
ATMOSPHERE_BUILD_TARGET_BINARY_SUFFIX=$(strip $2)\
DEPSDIR=$$(CURDIR)/$$(ATMOSPHERE_BUILD_DIR)/$(strip $1) \
LIBEXOSPHERE_NAME=exosphere$(strip $2) \
--no-print-directory -C $$(ATMOSPHERE_BUILD_DIR)/$(strip $1) \
-f $$(THIS_MAKEFILE)
check_libexo_$(strip $1):
@$$(MAKE) --no-print-directory -C $$(ATMOSPHERE_LIBRARIES_DIR)/libexosphere $$(ATMOSPHERE_ARCH_NAME)-$(strip $1)
$(strip $1):
@echo "Building $(strip $1)"
@$$(MAKE) -f $(CURRENT_DIRECTORY)/loader_stub.mk ATMOSPHERE_MAKEFILE_TARGET="$(strip $1)" ATMOSPHERE_BUILD_NAME="$(strip $2)" ATMOSPHERE_BOARD="$(strip $3)" ATMOSPHERE_CPU="$(strip $4)" $(strip $5)
clean-$(strip $1):
@echo clean $(strip $1) ...
@rm -fr $$(ATMOSPHERE_BUILD_DIR)/$(strip $1) $$(OUTPUT_BASE)$(strip $2).bin $$(OUTPUT_BASE)$(strip $2).elf $$(OUTPUT_BASE)$(strip $2).lz4 boot_code$(strip $2).lz4
@echo "Cleaning $(strip $1)"
@$$(MAKE) -f $(CURRENT_DIRECTORY)/loader_stub.mk clean ATMOSPHERE_MAKEFILE_TARGET="$(strip $1)" ATMOSPHERE_BUILD_NAME="$(strip $2)" ATMOSPHERE_BOARD="$(strip $3)" ATMOSPHERE_CPU="$(strip $4)" $(strip $5)
endef
$(eval $(call ATMOSPHERE_ADD_TARGET, release, , \
ATMOSPHERE_BUILD_SETTINGS="-DAMS_FORCE_DISABLE_DETAILED_ASSERTIONS" \
define ATMOSPHERE_ADD_TARGETS
$(eval $(call ATMOSPHERE_ADD_TARGET, $(strip $1)_release, release, $(strip $2), $(strip $3), \
ATMOSPHERE_BUILD_SETTINGS="$(strip $4)" \
))
$(eval $(call ATMOSPHERE_ADD_TARGET, debug, _debug, \
ATMOSPHERE_BUILD_SETTINGS="-DAMS_FORCE_DISABLE_DETAILED_ASSERTIONS -DAMS_BUILD_FOR_DEBUGGING" \
$(eval $(call ATMOSPHERE_ADD_TARGET, $(strip $1)_debug, debug, $(strip $2), $(strip $3), \
ATMOSPHERE_BUILD_SETTINGS="$(strip $4) -DAMS_BUILD_FOR_DEBUGGING" ATMOSPHERE_BUILD_FOR_DEBUGGING=1 \
))
$(eval $(call ATMOSPHERE_ADD_TARGET, audit, _audit, \
ATMOSPHERE_BUILD_SETTINGS="-DAMS_FORCE_DISABLE_DETAILED_ASSERTIONS -DAMS_BUILD_FOR_AUDITING" \
$(eval $(call ATMOSPHERE_ADD_TARGET, $(strip $1)_audit, audit, $(strip $2), $(strip $3), \
ATMOSPHERE_BUILD_SETTINGS="$(strip $4) -DAMS_BUILD_FOR_AUDITING" ATMOSPHERE_BUILD_FOR_DEBUGGING=1 ATMOSPHERE_BUILD_FOR_AUDITING=1 \
))
$(ATMOSPHERE_BUILD_DIR)/%:
@[ -d $@ ] || mkdir -p $@
endef
$(eval $(call ATMOSPHERE_ADD_TARGETS, nx, nx-hac-001, arm-cortex-a57,))
#---------------------------------------------------------------------------------
clean: $(foreach config,$(ATMOSPHERE_BUILD_CONFIGS),clean-$(config))
.PHONY: all clean $(foreach config,$(ATMOSPHERE_BUILD_CONFIGS),$(config) clean-$(config))
#---------------------------------------------------------------------------------
else
DEPENDS := $(OFILES:.o=.d)
#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
$(OUTPUT).bin : $(OUTPUT).elf
$(OBJCOPY) -S -O binary --set-section-flags .bss=alloc,load,contents $< $@
@echo built ... $(notdir $@)
$(OUTPUT).elf : $(OFILES)
$(OFILES) : $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/$(ATMOSPHERE_LIBRARY_DIR)/lib$(LIBEXOSPHERE_NAME).a
program.lz4.o: program_lz4.h
program_lz4.h: $(TOPDIR)/../program/program$(ATMOSPHERE_BUILD_TARGET_BINARY_SUFFIX).lz4
@echo $(notdir $<)
@rm -rf tmp_program_$(ATMOSPHERE_BUILD_TARGET_IDENTIFIER)
@mkdir -p tmp_program_$(ATMOSPHERE_BUILD_TARGET_IDENTIFIER)
@cp $(TOPDIR)/../program/program$(ATMOSPHERE_BUILD_TARGET_BINARY_SUFFIX).lz4 tmp_program_$(ATMOSPHERE_BUILD_TARGET_IDENTIFIER)/program.lz4
@bin2s -a 8 -H program_lz4.h tmp_program_$(ATMOSPHERE_BUILD_TARGET_IDENTIFIER)/program.lz4 | $(AS) -o program.lz4.o
@rm -rf tmp_program_$(ATMOSPHERE_BUILD_TARGET_IDENTIFIER)
$(TOPDIR)/../program/program$(ATMOSPHERE_BUILD_TARGET_BINARY_SUFFIX).lz4:
@$(MAKE) __RECURSIVE__=0 --no-print-directory -C $(TOPDIR)/../program $(ATMOSPHERE_BUILD_TARGET_IDENTIFIER)
boot_code.lz4.o: boot_code_lz4.h
boot_code_lz4.h: $(TOPDIR)/../program/boot_code$(ATMOSPHERE_BUILD_TARGET_BINARY_SUFFIX).lz4
@echo $(notdir $<)
@rm -rf tmp_boot_code_$(ATMOSPHERE_BUILD_TARGET_IDENTIFIER)
@mkdir -p tmp_boot_code_$(ATMOSPHERE_BUILD_TARGET_IDENTIFIER)
@cp $(TOPDIR)/../program/boot_code$(ATMOSPHERE_BUILD_TARGET_BINARY_SUFFIX).lz4 tmp_boot_code_$(ATMOSPHERE_BUILD_TARGET_IDENTIFIER)/boot_code.lz4
@bin2s -a 8 -H boot_code_lz4.h tmp_boot_code_$(ATMOSPHERE_BUILD_TARGET_IDENTIFIER)/boot_code.lz4 | $(AS) -o boot_code.lz4.o
@rm -rf tmp_boot_code_$(ATMOSPHERE_BUILD_TARGET_IDENTIFIER)
$(TOPDIR)/../program/boot_code$(ATMOSPHERE_BUILD_TARGET_BINARY_SUFFIX).lz4: $(TOPDIR)/../program/program$(ATMOSPHERE_BUILD_TARGET_BINARY_SUFFIX).lz4
%.elf:
@echo linking $(notdir $@)
$(LD) $(LDFLAGS) $(OFILES) $(LIBPATHS) $(LIBS) -o $@
@$(NM) -CSn $@ > $(notdir $*.lst)
$(OFILES_SRC) : program_lz4.h boot_code_lz4.h
-include $(DEPENDS)
#---------------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------------
.PHONY: all clean $(foreach config,$(ATMOSPHERE_BUILD_CONFIGS), $(config) clean-$(config))

View File

@ -0,0 +1,117 @@
#---------------------------------------------------------------------------------
# pull in common atmosphere configuration
#---------------------------------------------------------------------------------
THIS_MAKEFILE := $(abspath $(lastword $(MAKEFILE_LIST)))
CURRENT_DIRECTORY := $(abspath $(dir $(THIS_MAKEFILE)))
include $(CURRENT_DIRECTORY)/../../libraries/config/templates/exosphere.mk
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(__RECURSIVE__),1)
#---------------------------------------------------------------------------------
export ATMOSPHERE_TOPDIR := $(CURRENT_DIRECTORY)
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) $(CURDIR)/include \
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
CFILES := $(call FIND_SOURCE_FILES,$(SOURCES),c)
CPPFILES := $(call FIND_SOURCE_FILES,$(SOURCES),cpp)
SFILES := $(call FIND_SOURCE_FILES,$(SOURCES),s)
BINFILES :=
#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
#---------------------------------------------------------------------------------
export LD := $(CC)
#---------------------------------------------------------------------------------
else
#---------------------------------------------------------------------------------
export LD := $(CXX)
#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------
export OFILES_BIN := $(addsuffix .o,$(BINFILES))
export OFILES_SRC := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
export OFILES := $(OFILES_BIN) $(OFILES_SRC)
export HFILES_BIN := $(addsuffix .h,$(subst .,_,$(subst -,_,$(BINFILES))))
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I.
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/$(ATMOSPHERE_LIBRARY_DIR))
.PHONY: clean all check_lib check_exo_program
#---------------------------------------------------------------------------------
all: $(ATMOSPHERE_OUT_DIR) $(ATMOSPHERE_BUILD_DIR) $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/$(ATMOSPHERE_LIBRARY_DIR)/libexosphere.a $(CURRENT_DIRECTORY)/../program/$(ATMOSPHERE_OUT_DIR)/program.lz4
@$(MAKE) __RECURSIVE__=1 OUTPUT=$(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)/$(notdir $(ATMOSPHERE_TOPDIR)) \
DEPSDIR=$(CURDIR)/$(ATMOSPHERE_BUILD_DIR) \
--no-print-directory -C $(ATMOSPHERE_BUILD_DIR) \
-f $(THIS_MAKEFILE)
$(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/$(ATMOSPHERE_LIBRARY_DIR)/libexosphere.a: check_lib
@$(SILENTCMD)echo "Checked library."
$(CURRENT_DIRECTORY)/../program/$(ATMOSPHERE_OUT_DIR)/program.lz4: check_exo_program
@$(SILENTCMD)echo "Checked exosphere program."
ifeq ($(ATMOSPHERE_CHECKED_EXOSPHERE_PROGRAM),1)
check_exo_program:
else
check_exo_program: check_lib
@$(MAKE) --no-print-directory -C $(CURRENT_DIRECTORY)/../program -f $(CURRENT_DIRECTORY)/../program/program.mk ATMOSPHERE_CHECKED_LIBEXOSPHERE=1
endif
ifeq ($(ATMOSPHERE_CHECKED_LIBEXOSPHERE),1)
check_lib:
else
check_lib:
@$(MAKE) --no-print-directory -C $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere -f $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/libexosphere.mk
endif
$(ATMOSPHERE_OUT_DIR) $(ATMOSPHERE_BUILD_DIR):
@[ -d $@ ] || mkdir -p $@
#---------------------------------------------------------------------------------
clean:
@echo clean ...
@rm -fr $(ATMOSPHERE_BUILD_DIR) $(ATMOSPHERE_OUT_DIR)
#---------------------------------------------------------------------------------
else
DEPENDS := $(OFILES:.o=.d)
#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
$(OUTPUT).bin : $(OUTPUT).elf
$(OBJCOPY) -S -O binary --set-section-flags .bss=alloc,load,contents $< $@
@echo built ... $(notdir $@)
$(OUTPUT).elf : $(OFILES)
$(OFILES) : $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/$(ATMOSPHERE_LIBRARY_DIR)/libexosphere.a
secmon_loader_main.o: CXXFLAGS += --embed-dir="$(CURRENT_DIRECTORY)/../program/$(ATMOSPHERE_OUT_DIR)/"
%.elf:
@echo linking $(notdir $@)
$(LD) $(LDFLAGS) $(OFILES) $(LIBPATHS) $(LIBS) -o $@
@$(NM) -CSn $@ > $(notdir $*.lst)
$(OFILES_SRC) : $(OFILES_BIN)
-include $(DEPENDS)
#---------------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------------

View File

@ -1,7 +1,4 @@
%rename link old_link
*link:
%(old_link) -T %:getenv(TOPDIR /loader_stub.ld) --gc-sections --nmagic -nostdlib -nostartfiles
*startfile:
crti%O%s crtbegin%O%s
%(old_link) -T %:getenv(ATMOSPHERE_TOPDIR /loader_stub.ld) --gc-sections --nmagic

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2020 Atmosphère-NX
* Copyright (c) Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@ -18,13 +18,13 @@
namespace ams::diag {
NORETURN void AbortImpl(const char *file, int line, const char *func, const char *expr, u64 value, const char *format, ...) {
AMS_UNUSED(file, line, func, expr, value, format);
NORETURN void AbortImpl(const char *expr, const char *func, const char *file, int line) {
AMS_UNUSED(expr, func, line, file);
ams::secmon::loader::ErrorReboot();
}
NORETURN void AbortImpl(const char *file, int line, const char *func, const char *expr, u64 value) {
AMS_UNUSED(file, line, func, expr, value);
NORETURN void AbortImpl(const char *expr, const char *func, const char *file, int line, const char *format, ...) {
AMS_UNUSED(expr, func, line, file, format);
ams::secmon::loader::ErrorReboot();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2020 Atmosphère-NX
* Copyright (c) Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2020 Atmosphère-NX
* Copyright (c) Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@ -15,21 +15,31 @@
*/
#include <exosphere.hpp>
#include "secmon_loader_uncompress.hpp"
#include "program_lz4.h"
#include "boot_code_lz4.h"
namespace ams::secmon::loader {
namespace {
constexpr const u8 SecmonProgramLz4[] = {
#embed <program.lz4>
};
constexpr const u8 SecmonBootCodeLz4[] = {
#embed <boot_code.lz4>
};
}
NORETURN void UncompressAndExecute() {
/* Uncompress the program image. */
Uncompress(secmon::MemoryRegionPhysicalTzramFullProgramImage.GetPointer(), secmon::MemoryRegionPhysicalTzramFullProgramImage.GetSize(), program_lz4, program_lz4_size);
Uncompress(secmon::MemoryRegionPhysicalTzramFullProgramImage.GetPointer(), secmon::MemoryRegionPhysicalTzramFullProgramImage.GetSize(), SecmonProgramLz4, sizeof(SecmonProgramLz4));
/* Copy the boot image to the end of IRAM */
u8 *relocated_boot_code = secmon::MemoryRegionPhysicalIramBootCodeImage.GetEndPointer<u8>() - boot_code_lz4_size;
std::memcpy(relocated_boot_code, boot_code_lz4, boot_code_lz4_size);
u8 *relocated_boot_code = secmon::MemoryRegionPhysicalIramBootCodeImage.GetEndPointer<u8>() - sizeof(SecmonBootCodeLz4);
std::memcpy(relocated_boot_code, SecmonBootCodeLz4, sizeof(SecmonBootCodeLz4));
/* Uncompress the boot image. */
Uncompress(secmon::MemoryRegionPhysicalIramBootCodeImage.GetPointer(), secmon::MemoryRegionPhysicalIramBootCodeImage.GetSize(), relocated_boot_code, boot_code_lz4_size);
Uncompress(secmon::MemoryRegionPhysicalIramBootCodeImage.GetPointer(), secmon::MemoryRegionPhysicalIramBootCodeImage.GetSize(), relocated_boot_code, sizeof(SecmonBootCodeLz4));
/* Jump to the boot image. */
reinterpret_cast<void (*)()>(secmon::MemoryRegionPhysicalIramBootCodeImage.GetAddress())();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2020 Atmosphère-NX
* Copyright (c) Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@ -22,14 +22,14 @@ namespace ams::secmon::loader {
class Lz4Uncompressor {
private:
const u8 *src;
size_t src_size;
size_t src_offset;
u8 *dst;
size_t dst_size;
size_t dst_offset;
const u8 *m_src;
size_t m_src_size;
size_t m_src_offset;
u8 *m_dst;
size_t m_dst_size;
size_t m_dst_offset;
public:
Lz4Uncompressor(void *dst, size_t dst_size, const void *src, size_t src_size) : src(static_cast<const u8 *>(src)), src_size(src_size), src_offset(0), dst(static_cast<u8 *>(dst)), dst_size(dst_size), dst_offset(0) {
Lz4Uncompressor(void *dst, size_t dst_size, const void *src, size_t src_size) : m_src(static_cast<const u8 *>(src)), m_src_size(src_size), m_src_offset(0), m_dst(static_cast<u8 *>(dst)), m_dst_size(dst_size), m_dst_offset(0) {
/* ... */
}
@ -42,7 +42,7 @@ namespace ams::secmon::loader {
this->Copy(this->GetCopySize(control >> 4));
/* If we've exceeded size, we're done. */
if (this->src_offset >= this->src_size) {
if (m_src_offset >= m_src_size) {
break;
}
@ -55,21 +55,21 @@ namespace ams::secmon::loader {
const size_t wide_copy_size = this->GetCopySize(control & 0xF);
/* Copy bytes. */
const size_t end_offset = this->dst_offset + wide_copy_size + 4;
for (size_t cur_offset = this->dst_offset; cur_offset < end_offset; this->dst_offset = (++cur_offset)) {
const size_t end_offset = m_dst_offset + wide_copy_size + 4;
for (size_t cur_offset = m_dst_offset; cur_offset < end_offset; m_dst_offset = (++cur_offset)) {
AMS_ABORT_UNLESS(wide_offset <= cur_offset);
this->dst[cur_offset] = this->dst[cur_offset - wide_offset];
m_dst[cur_offset] = m_dst[cur_offset - wide_offset];
}
}
}
private:
u8 ReadByte() {
return this->src[this->src_offset++];
return m_src[m_src_offset++];
}
bool CanRead() const {
return this->src_offset < this->src_size;
return m_src_offset < m_src_size;
}
size_t GetCopySize(u8 control) {
@ -87,9 +87,9 @@ namespace ams::secmon::loader {
}
void Copy(size_t size) {
__builtin_memcpy(this->dst + this->dst_offset, this->src + this->src_offset, size);
this->dst_offset += size;
this->src_offset += size;
__builtin_memcpy(m_dst + m_dst_offset, m_src + m_src_offset, size);
m_dst_offset += size;
m_src_offset += size;
}
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2020 Atmosphère-NX
* Copyright (c) Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2020 Atmosphère-NX
* Copyright (c) Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@ -98,8 +98,5 @@ _start:
ldr x20, =0x7C020000
mov sp, x20
/* Call our init array functions. */
bl __libc_init_array
/* Uncompress the program and iram boot code images. */
b _ZN3ams6secmon6loader20UncompressAndExecuteEv

View File

@ -1,141 +1,41 @@
#---------------------------------------------------------------------------------
# Define the atmosphere board and cpu
#---------------------------------------------------------------------------------
export ATMOSPHERE_BOARD := nx-hac-001
export ATMOSPHERE_CPU := arm-cortex-a57
ATMOSPHERE_BUILD_CONFIGS :=
all: nx_release
#---------------------------------------------------------------------------------
# pull in common atmosphere configuration
#---------------------------------------------------------------------------------
THIS_MAKEFILE := $(abspath $(lastword $(MAKEFILE_LIST)))
CURRENT_DIRECTORY := $(abspath $(dir $(THIS_MAKEFILE)))
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/../../libraries/config/templates/exosphere.mk
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(__RECURSIVE__),1)
#---------------------------------------------------------------------------------
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) $(CURDIR)/include \
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
CFILES := $(call FIND_SOURCE_FILES,$(SOURCES),c)
CPPFILES := $(call FIND_SOURCE_FILES,$(SOURCES),cpp)
SFILES := $(call FIND_SOURCE_FILES,$(SOURCES),s)
BINFILES :=
#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
#---------------------------------------------------------------------------------
export LD := $(CC)
#---------------------------------------------------------------------------------
else
#---------------------------------------------------------------------------------
export LD := $(CXX)
#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------
export OFILES_BIN := $(addsuffix .o,$(BINFILES))
export OFILES_SRC := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
export OFILES := $(OFILES_BIN) $(OFILES_SRC)
export HFILES_BIN := $(addsuffix .h,$(subst .,_,$(subst -,_,$(BINFILES))))
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I.
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/$(ATMOSPHERE_LIBRARY_DIR))
export TOPDIR := $(CURRENT_DIRECTORY)
OUTPUT_BASE := $(TOPDIR)/$(notdir $(TOPDIR))
#---------------------------------------------------------------------------------
ATMOSPHERE_BUILD_CONFIGS :=
all: release
define ATMOSPHERE_ADD_TARGET
ATMOSPHERE_BUILD_CONFIGS += $(strip $1)
$(strip $1): check_libexo_$(strip $1) $$(ATMOSPHERE_BUILD_DIR)/$(strip $1)
@$$(MAKE) __RECURSIVE__=1 OUTPUT=$$(OUTPUT_BASE)$(strip $2) $(3) \
DEPSDIR=$$(CURDIR)/$$(ATMOSPHERE_BUILD_DIR)/$(strip $1) \
LIBEXOSPHERE_NAME=exosphere$(strip $2) \
--no-print-directory -C $$(ATMOSPHERE_BUILD_DIR)/$(strip $1) \
-f $$(THIS_MAKEFILE)
check_libexo_$(strip $1):
@$$(MAKE) --no-print-directory -C $$(ATMOSPHERE_LIBRARIES_DIR)/libexosphere $$(ATMOSPHERE_ARCH_NAME)-$(strip $1)
$(strip $1):
@echo "Building $(strip $1)"
@$$(MAKE) -f $(CURRENT_DIRECTORY)/mariko_fatal.mk ATMOSPHERE_MAKEFILE_TARGET="$(strip $1)" ATMOSPHERE_BUILD_NAME="$(strip $2)" ATMOSPHERE_BOARD="$(strip $3)" ATMOSPHERE_CPU="$(strip $4)" $(strip $5)
clean-$(strip $1):
@echo clean $(strip $1) ...
@rm -fr $$(ATMOSPHERE_BUILD_DIR)/$(strip $1) $$(OUTPUT_BASE)$(strip $2).bin $$(OUTPUT_BASE)$(strip $2).elf
@echo "Cleaning $(strip $1)"
@$$(MAKE) -f $(CURRENT_DIRECTORY)/mariko_fatal.mk clean ATMOSPHERE_MAKEFILE_TARGET="$(strip $1)" ATMOSPHERE_BUILD_NAME="$(strip $2)" ATMOSPHERE_BOARD="$(strip $3)" ATMOSPHERE_CPU="$(strip $4)" $(strip $5)
endef
$(eval $(call ATMOSPHERE_ADD_TARGET, release, , \
ATMOSPHERE_BUILD_SETTINGS="-DAMS_FORCE_DISABLE_DETAILED_ASSERTIONS" \
define ATMOSPHERE_ADD_TARGETS
$(eval $(call ATMOSPHERE_ADD_TARGET, $(strip $1)_release, release, $(strip $2), $(strip $3), \
ATMOSPHERE_BUILD_SETTINGS="$(strip $4)" \
))
$(eval $(call ATMOSPHERE_ADD_TARGET, debug, _debug, \
ATMOSPHERE_BUILD_SETTINGS="-DAMS_FORCE_DISABLE_DETAILED_ASSERTIONS -DAMS_BUILD_FOR_DEBUGGING" \
$(eval $(call ATMOSPHERE_ADD_TARGET, $(strip $1)_debug, debug, $(strip $2), $(strip $3), \
ATMOSPHERE_BUILD_SETTINGS="$(strip $4) -DAMS_BUILD_FOR_DEBUGGING" ATMOSPHERE_BUILD_FOR_DEBUGGING=1 \
))
$(eval $(call ATMOSPHERE_ADD_TARGET, audit, _audit, \
ATMOSPHERE_BUILD_SETTINGS="-DAMS_FORCE_DISABLE_DETAILED_ASSERTIONS -DAMS_BUILD_FOR_AUDITING" \
$(eval $(call ATMOSPHERE_ADD_TARGET, $(strip $1)_audit, audit, $(strip $2), $(strip $3), \
ATMOSPHERE_BUILD_SETTINGS="$(strip $4) -DAMS_BUILD_FOR_AUDITING" ATMOSPHERE_BUILD_FOR_DEBUGGING=1 ATMOSPHERE_BUILD_FOR_AUDITING=1 \
))
$(ATMOSPHERE_BUILD_DIR)/%:
@[ -d $@ ] || mkdir -p $@
endef
$(eval $(call ATMOSPHERE_ADD_TARGETS, nx, nx-hac-001, arm-cortex-a57,))
#---------------------------------------------------------------------------------
clean: $(foreach config,$(ATMOSPHERE_BUILD_CONFIGS),clean-$(config))
.PHONY: all clean $(foreach config,$(ATMOSPHERE_BUILD_CONFIGS),$(config) clean-$(config))
#---------------------------------------------------------------------------------
else
DEPENDS := $(OFILES:.o=.d)
#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
$(OUTPUT).bin : $(OUTPUT).elf
$(OBJCOPY) -S -O binary --set-section-flags .bss=alloc,load,contents $< $@
@echo built ... $(notdir $@)
$(OUTPUT).elf : $(OFILES)
$(OFILES) : $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/$(ATMOSPHERE_LIBRARY_DIR)/lib$(LIBEXOSPHERE_NAME).a
%.elf:
@echo linking $(notdir $@)
$(LD) $(LDFLAGS) $(OFILES) $(LIBPATHS) $(LIBS) -o $@
@$(NM) -CSn $@ > $(notdir $*.lst)
diskio.o ff.o: CFLAGS += -Wno-error
$(OFILES_SRC) : $(HFILES_BIN)
#---------------------------------------------------------------------------------
# you need a rule like this for each extension you use as binary data
#---------------------------------------------------------------------------------
%.bin.o %_bin.h: %.bin
#---------------------------------------------------------------------------------
@echo $(notdir $<)
@$(bin2o)
-include $(DEPENDS)
#---------------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------------
.PHONY: all clean $(foreach config,$(ATMOSPHERE_BUILD_CONFIGS), $(config) clean-$(config))

View File

@ -0,0 +1,115 @@
#---------------------------------------------------------------------------------
# pull in common atmosphere configuration
#---------------------------------------------------------------------------------
THIS_MAKEFILE := $(abspath $(lastword $(MAKEFILE_LIST)))
CURRENT_DIRECTORY := $(abspath $(dir $(THIS_MAKEFILE)))
include $(CURRENT_DIRECTORY)/../../libraries/config/templates/exosphere.mk
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(__RECURSIVE__),1)
#---------------------------------------------------------------------------------
export ATMOSPHERE_TOPDIR := $(CURRENT_DIRECTORY)
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) $(CURDIR)/include \
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
CFILES := $(call FIND_SOURCE_FILES,$(SOURCES),c)
CPPFILES := $(call FIND_SOURCE_FILES,$(SOURCES),cpp)
SFILES := $(call FIND_SOURCE_FILES,$(SOURCES),s)
BINFILES :=
#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
#---------------------------------------------------------------------------------
export LD := $(CC)
#---------------------------------------------------------------------------------
else
#---------------------------------------------------------------------------------
export LD := $(CXX)
#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------
export OFILES_BIN := $(addsuffix .o,$(BINFILES))
export OFILES_SRC := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
export OFILES := $(OFILES_BIN) $(OFILES_SRC)
export HFILES_BIN := $(addsuffix .h,$(subst .,_,$(subst -,_,$(BINFILES))))
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I.
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/$(ATMOSPHERE_LIBRARY_DIR))
.PHONY: clean all check_lib
#---------------------------------------------------------------------------------
all: $(ATMOSPHERE_OUT_DIR) $(ATMOSPHERE_BUILD_DIR) $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/$(ATMOSPHERE_LIBRARY_DIR)/libexosphere.a
@$(MAKE) __RECURSIVE__=1 OUTPUT=$(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)/$(notdir $(ATMOSPHERE_TOPDIR)) \
DEPSDIR=$(CURDIR)/$(ATMOSPHERE_BUILD_DIR) \
--no-print-directory -C $(ATMOSPHERE_BUILD_DIR) \
-f $(THIS_MAKEFILE)
$(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/$(ATMOSPHERE_LIBRARY_DIR)/libexosphere.a: check_lib
@$(SILENTCMD)echo "Checked library."
ifeq ($(ATMOSPHERE_CHECKED_LIBEXOSPHERE),1)
check_lib:
else
check_lib:
@$(MAKE) --no-print-directory -C $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere -f $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/libexosphere.mk
endif
$(ATMOSPHERE_OUT_DIR) $(ATMOSPHERE_BUILD_DIR):
@[ -d $@ ] || mkdir -p $@
#---------------------------------------------------------------------------------
clean:
@echo clean ...
@rm -fr $(ATMOSPHERE_BUILD_DIR) $(ATMOSPHERE_OUT_DIR)
#---------------------------------------------------------------------------------
else
DEPENDS := $(OFILES:.o=.d)
#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
$(OUTPUT).bin : $(OUTPUT).elf
$(OBJCOPY) -S -O binary --set-section-flags .bss=alloc,load,contents $< $@
@echo built ... $(notdir $@)
$(OUTPUT).elf : $(OFILES)
$(OFILES) : $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/$(ATMOSPHERE_LIBRARY_DIR)/libexosphere.a
%.elf:
@echo linking $(notdir $@)
$(LD) $(LDFLAGS) $(OFILES) $(LIBPATHS) $(LIBS) -o $@
@$(NM) -CSn $@ > $(notdir $*.lst)
$(OFILES_SRC) : $(HFILES_BIN)
diskio.o ff.o: CFLAGS += -Wno-error -Wno-unused-parameter -Wno-implicit-fallthrough
#---------------------------------------------------------------------------------
# you need a rule like this for each extension you use as binary data
#---------------------------------------------------------------------------------
%.bin.o %_bin.h: %.bin
#---------------------------------------------------------------------------------
@echo $(notdir $<)
@$(bin2o)
-include $(DEPENDS)
#---------------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------------

View File

@ -1,7 +1,4 @@
%rename link old_link
*link:
%(old_link) -T %:getenv(TOPDIR /mariko_fatal.ld) --gc-sections --nmagic -nostdlib -nostartfiles
*startfile:
crti%O%s crtbegin%O%s
%(old_link) -T %:getenv(ATMOSPHERE_TOPDIR /mariko_fatal.ld) --gc-sections --nmagic

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2020 Atmosphère-NX
* Copyright (c) Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@ -17,7 +17,7 @@
namespace ams::diag {
void AbortImpl() {
NORETURN void AbortImpl() {
AMS_SECMON_LOG("AbortImpl was called\n");
AMS_LOG_FLUSH();
reg::Write(0x4, 0xAAAAAAAA);

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