mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2025-02-05 06:52:50 +00:00
Compare commits
6 commits
d920f25cbc
...
042b9b4dd7
Author | SHA1 | Date | |
---|---|---|---|
|
042b9b4dd7 | ||
|
009f581721 | ||
|
cd6d129540 | ||
|
700d811cb7 | ||
|
37a910802f | ||
|
0d4377b43b |
8 changed files with 167 additions and 117 deletions
58
.github/ISSUE_TEMPLATE/bug_report.md
vendored
58
.github/ISSUE_TEMPLATE/bug_report.md
vendored
|
@ -1,58 +0,0 @@
|
||||||
---
|
|
||||||
name: Bug Report
|
|
||||||
about: Something doesn't work correctly in Atmosphère.
|
|
||||||
#assignees:
|
|
||||||
---
|
|
||||||
|
|
||||||
## Bug Report
|
|
||||||
|
|
||||||
[ If any section does not apply, replace its contents with "N/A". ]</br>
|
|
||||||
[ Lines between [ ] (square brackets) should be removed before posting. ]</br>
|
|
||||||
|
|
||||||
[ * ]</br>
|
|
||||||
[ Note: If the bug or crash you encountered is related to; ]</br>
|
|
||||||
[ - software used to make "backups", ]</br>
|
|
||||||
[ - software explicitly distributed for piracy, etc ]</br>
|
|
||||||
[ then contributors will not provide support for your issue and your issue will be closed. ]</br>
|
|
||||||
|
|
||||||
### What's the issue you encountered?
|
|
||||||
|
|
||||||
[ Describe the issue in detail and what you were doing beforehand. ]</br>
|
|
||||||
[ Did you make any changes related to Atmosphère itself? ]</br>
|
|
||||||
[ If so, make sure to include details relating to what exactly you changed. ]</br>
|
|
||||||
|
|
||||||
### How can the issue be reproduced?
|
|
||||||
|
|
||||||
[ * ]</br>
|
|
||||||
[ Include a detailed step by step process for recreating your issue. ]</br>
|
|
||||||
|
|
||||||
### Crash Report
|
|
||||||
|
|
||||||
[ Crash reports can be found under ``/atmosphere/crash_reports``. ]</br>
|
|
||||||
[ If your issue caused Atmosphère to crash, include the crash report(s) by creating a [gist](https://gist.github.com/) and pasting the link here. ]</br>
|
|
||||||
[ If you don't include a crash report in instances of crash related issues, we will ask you one to provide one. ]</br>
|
|
||||||
|
|
||||||
### System Firmware Version
|
|
||||||
|
|
||||||
X.X.X</br>
|
|
||||||
[ Replace X's with system firmware version at time of crash. ]</br>
|
|
||||||
[ You can find your firmware version in the Settings -> System, under "System Update". ]</br>
|
|
||||||
[ If it says "Update Pending", you can clear the pending update by rebooting to Maintenance Mode. ]</br>
|
|
||||||
|
|
||||||
### Environment?
|
|
||||||
|
|
||||||
- What bootloader (fusèe, hekate, etc) was Atmosphère launched by:
|
|
||||||
- Official release or unofficial build:
|
|
||||||
- [ Official release version x.x.x (or) unofficial build ]
|
|
||||||
- [ If using an unofficial build, include details on where/how you acquired the build. ]
|
|
||||||
- [ Ex: Self-compilation ]
|
|
||||||
- [ 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?
|
|
||||||
|
|
||||||
- Additional info about your environment:
|
|
||||||
- [ Any other information relevant to your issue. ]
|
|
67
.github/ISSUE_TEMPLATE/bug_report.yaml
vendored
Normal file
67
.github/ISSUE_TEMPLATE/bug_report.yaml
vendored
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
name: Bug Report
|
||||||
|
description: Something doesn't work correctly in Atmosphère.
|
||||||
|
title: "[BUG] "
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
Note: If the bug or crash you encountered is related to
|
||||||
|
- software used to make "backups"
|
||||||
|
- software explicitly distributed for piracy, etc.
|
||||||
|
|
||||||
|
then contributors will not provide support for your issue and your issue will be closed.
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: What's the issue you encountered?
|
||||||
|
description: |
|
||||||
|
Describe the issue in detail and what you were doing beforehand.
|
||||||
|
Did you make any changes related to Atmosphère itself?
|
||||||
|
If so, make sure to include details relating to what exactly you changed.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: How can the issue be reproduced?
|
||||||
|
description: Include a detailed step by step process for recreating your issue.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Crash Report
|
||||||
|
description: |
|
||||||
|
Crash reports can be found under ``/atmosphere/crash_reports``.
|
||||||
|
- If your issue caused Atmosphère to crash, include the crash report(s) by creating a [gist](https://gist.github.com/) and pasting the link here.
|
||||||
|
- If you don't include a crash report in instances of crash related issues, we will ask you one to provide one.
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: System Firmware Version
|
||||||
|
description: |
|
||||||
|
Replace X's with system firmware version at time of crash.
|
||||||
|
You can find your firmware version in the Settings -> System, under "System Update".
|
||||||
|
If it says "Update Pending", you can clear the pending update by rebooting to Maintenance Mode.
|
||||||
|
placeholder: X.X.X
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Environment?
|
||||||
|
value: |
|
||||||
|
- What bootloader (fusée, hekate, etc) was Atmosphère launched by:
|
||||||
|
- Official release or unofficial build:
|
||||||
|
- If using an unofficial build, include details on where/how you acquired the build:
|
||||||
|
- Do you have additional kips or sysmodules you're loading:
|
||||||
|
- Homebrew software installed:
|
||||||
|
- EmuMMC or SysMMC:
|
||||||
|
- If using an EmuMMC, include whether it's partition-based or file-based:
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Additional context?
|
||||||
|
value: |
|
||||||
|
- Additional info about your environment:
|
||||||
|
- Any other information relevant to your issue:
|
||||||
|
validations:
|
||||||
|
required: false
|
48
.github/ISSUE_TEMPLATE/feature_request.md
vendored
48
.github/ISSUE_TEMPLATE/feature_request.md
vendored
|
@ -1,48 +0,0 @@
|
||||||
---
|
|
||||||
name: Feature Request
|
|
||||||
about: Suggest a new feature for Atmosphère.
|
|
||||||
#assignees:
|
|
||||||
---
|
|
||||||
|
|
||||||
## Feature Request
|
|
||||||
|
|
||||||
[ If any section does not apply, replace its contents with "N/A". ]</br>
|
|
||||||
[ If you do not have the information needed for a section, replace its contents with "Unknown". ]</br>
|
|
||||||
[ Lines between [ ] (square brackets) are to be removed before posting. ]
|
|
||||||
|
|
||||||
[ Please search for existing [feature requests](https://github.com/Atmosphere-NX/Atmosphere/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22features%2Ffeature-request%22) before you make your own request. ]</br>
|
|
||||||
[ Duplicate requests will be marked as such and you will be referred to the original request. ]
|
|
||||||
|
|
||||||
### What feature are you suggesting?
|
|
||||||
#### Overview:
|
|
||||||
- [ Include the basic, high-level concepts for this feature here. ]</br>
|
|
||||||
|
|
||||||
#### Smaller Details:
|
|
||||||
- [ These may include specific methods of implementation etc. ]</br>
|
|
||||||
|
|
||||||
#### Nature of Request:
|
|
||||||
[ Remove all that do not apply to your request. ]
|
|
||||||
- Addition
|
|
||||||
- [ Ex: Addition of certain original features or features from other community projects. ]
|
|
||||||
- [ If you are suggesting porting features or including features from other projects, include what license they are distributed under and what, if any libraries those project use. ]
|
|
||||||
- Change
|
|
||||||
- Removal
|
|
||||||
- [Ex: Removal of certain features or implementation due to a specific issue/bug or because of low quality code, etc.]
|
|
||||||
|
|
||||||
### What component do you feel this would best fit within?
|
|
||||||
- [Fusée](https://github.com/Atmosphere-NX/Atmosphere#components)</br>
|
|
||||||
- Atmosphère's custom bootloader.</br>
|
|
||||||
- [Exosphère](https://github.com/Atmosphere-NX/Atmosphere#components)</br>
|
|
||||||
- Fully-featured custom secure monitor.</br>
|
|
||||||
- [Stratosphère](https://github.com/Atmosphere-NX/Atmosphere#components)</br>
|
|
||||||
- Custom system modules.</br>
|
|
||||||
- [**Thermosphère**](https://github.com/Atmosphere-NX/Atmosphere#components)</br>
|
|
||||||
- Atmosphère's emuNAND implementation.</br>
|
|
||||||
- [**Troposphère**](https://github.com/Atmosphere-NX/Atmosphere#components)</br>
|
|
||||||
- Application-level patches to the Horizon OS.</br>
|
|
||||||
|
|
||||||
[ Note: **Bolded components are not implemented** or are still at the prototyping phase. ]
|
|
||||||
|
|
||||||
### Why would this feature be useful?
|
|
||||||
[ If this is a feature for an end-user, how does it benefit the end-user? ]</br>
|
|
||||||
[ If this feature is for developers, what does it add to Atmosphère that did not already exist? ]</br>
|
|
44
.github/ISSUE_TEMPLATE/feature_request.yaml
vendored
Normal file
44
.github/ISSUE_TEMPLATE/feature_request.yaml
vendored
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
name: Feature Request
|
||||||
|
description: Suggest a new feature for Atmosphère.
|
||||||
|
title: "[FEATURE REQUEST] "
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
Please search for [existing feature requests](https://github.com/Atmosphere-NX/Atmosphere/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22features%2Ffeature-request%22) before you make your own request.
|
||||||
|
Duplicate requests will be marked as such, and you will be referred to the original request.
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: What feature are you suggesting?
|
||||||
|
description: Include the basic concepts for this feature here.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Smaller details
|
||||||
|
description: These may include specific methods of implementation, etc.
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Nature of the request
|
||||||
|
description: |
|
||||||
|
Is this request an addition, a change, or a removal?
|
||||||
|
|
||||||
|
If you are suggesting porting features or including features from other projects, include what license they are distributed under, and what (if any) libraries those projects use.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: What component do you feel this would best fit within?
|
||||||
|
description: See [here](https://github.com/Atmosphere-NX/Atmosphere#components) for more information.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Why would this feature be useful?
|
||||||
|
description: |
|
||||||
|
- If this is a feature for an end-user, how does it benefit the end-user?
|
||||||
|
- If this feature is for developers, what does it add to Atmosphère that did not already exist?
|
||||||
|
validations:
|
||||||
|
required: true
|
|
@ -26,6 +26,8 @@ namespace ams::creport {
|
||||||
static_assert(DyingMessageAddressOffset == AMS_OFFSETOF(ams::svc::aarch64::ProcessLocalRegion, dying_message_region_address));
|
static_assert(DyingMessageAddressOffset == AMS_OFFSETOF(ams::svc::aarch64::ProcessLocalRegion, dying_message_region_address));
|
||||||
static_assert(DyingMessageAddressOffset == AMS_OFFSETOF(ams::svc::aarch32::ProcessLocalRegion, dying_message_region_address));
|
static_assert(DyingMessageAddressOffset == AMS_OFFSETOF(ams::svc::aarch32::ProcessLocalRegion, dying_message_region_address));
|
||||||
|
|
||||||
|
constexpr size_t CrashReportDataCacheSize = 256_KB;
|
||||||
|
|
||||||
/* Helper functions. */
|
/* Helper functions. */
|
||||||
bool TryGetCurrentTimestamp(u64 *out) {
|
bool TryGetCurrentTimestamp(u64 *out) {
|
||||||
/* Clear output. */
|
/* Clear output. */
|
||||||
|
@ -307,7 +309,15 @@ namespace ams::creport {
|
||||||
/* Save crash report. */
|
/* Save crash report. */
|
||||||
util::SNPrintf(file_path, sizeof(file_path), "sdmc:/atmosphere/crash_reports/%011lu_%016lx.log", timestamp, m_process_info.program_id);
|
util::SNPrintf(file_path, sizeof(file_path), "sdmc:/atmosphere/crash_reports/%011lu_%016lx.log", timestamp, m_process_info.program_id);
|
||||||
{
|
{
|
||||||
ScopedFile file(file_path);
|
/* Try to allocate data cache. */
|
||||||
|
void * const data_cache = lmem::AllocateFromExpHeap(m_heap_handle, CrashReportDataCacheSize + os::MemoryPageSize);
|
||||||
|
ON_SCOPE_EXIT { if (data_cache != nullptr) { lmem::FreeToExpHeap(m_heap_handle, data_cache); } };
|
||||||
|
|
||||||
|
/* Align up the data cache. This is safe because null will align up to null. */
|
||||||
|
void * const aligned_cache = reinterpret_cast<void *>(util::AlignUp(reinterpret_cast<uintptr_t>(data_cache), os::MemoryPageSize));
|
||||||
|
|
||||||
|
/* Open and save the file using the cache. */
|
||||||
|
ScopedFile file(file_path, aligned_cache, aligned_cache != nullptr ? CrashReportDataCacheSize : 0);
|
||||||
if (file.IsOpen()) {
|
if (file.IsOpen()) {
|
||||||
this->SaveToFile(file);
|
this->SaveToFile(file);
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ namespace ams::creport {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModuleList::SaveToFile(ScopedFile &file) {
|
void ModuleList::SaveToFile(ScopedFile &file) {
|
||||||
file.WriteFormat(" Number of Modules: %zu\n", m_num_modules);
|
file.WriteFormat(" Number of Modules: %02zu\n", m_num_modules);
|
||||||
for (size_t i = 0; i < m_num_modules; i++) {
|
for (size_t i = 0; i < m_num_modules; i++) {
|
||||||
const auto& module = m_modules[i];
|
const auto& module = m_modules[i];
|
||||||
file.WriteFormat(" Module %02zu:\n", i);
|
file.WriteFormat(" Module %02zu:\n", i);
|
||||||
|
|
|
@ -60,22 +60,24 @@ namespace ams::creport {
|
||||||
|
|
||||||
/* Print the line prefix. */
|
/* Print the line prefix. */
|
||||||
if (first) {
|
if (first) {
|
||||||
this->WriteFormat("%s", prefix);
|
this->Write(prefix, prefix_len);
|
||||||
first = false;
|
first = false;
|
||||||
} else {
|
} else {
|
||||||
this->WriteFormat("%*s", prefix_len, "");
|
std::memset(g_format_buffer, ' ', prefix_len);
|
||||||
|
this->Write(g_format_buffer, prefix_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Dump up to 0x20 of hex memory. */
|
/* Dump up to 0x20 of hex memory. */
|
||||||
{
|
{
|
||||||
char hex[MaximumLineLength * 2 + 2] = {};
|
char hex[MaximumLineLength * 2 + 2] = {};
|
||||||
for (size_t i = 0; i < cur_size; i++) {
|
for (size_t i = 0; i < cur_size; i++) {
|
||||||
util::SNPrintf(hex + i * 2, 3, "%02X", data_u8[data_ofs++]);
|
hex[i * 2 + 0] = "0123456789ABCDEF"[data_u8[data_ofs] >> 4];
|
||||||
|
hex[i * 2 + 1] = "0123456789ABCDEF"[data_u8[data_ofs] & 0xF];
|
||||||
|
++data_ofs;
|
||||||
}
|
}
|
||||||
hex[cur_size * 2 + 0] = '\n';
|
hex[cur_size * 2 + 0] = '\n';
|
||||||
hex[cur_size * 2 + 1] = '\x00';
|
|
||||||
|
|
||||||
this->WriteString(hex);
|
this->Write(hex, cur_size * 2 + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Continue. */
|
/* Continue. */
|
||||||
|
@ -83,16 +85,40 @@ namespace ams::creport {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ScopedFile::Write(const void *data, size_t size) {
|
void ScopedFile::Write(const void *data, size_t size) {
|
||||||
/* If we're not open, we can't write. */
|
/* If we're not open, we can't write. */
|
||||||
if (!this->IsOpen()) {
|
if (!this->IsOpen()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Advance, if we write successfully. */
|
/* If we have a cache, write to it. */
|
||||||
if (R_SUCCEEDED(fs::WriteFile(m_file, m_offset, data, size, fs::WriteOption::Flush))) {
|
if (m_cache != nullptr) {
|
||||||
m_offset += size;
|
/* Write into the cache, if we can. */
|
||||||
|
if (m_cache_size - m_cache_offset >= size || R_SUCCEEDED(this->TryWriteCache())) {
|
||||||
|
std::memcpy(m_cache + m_cache_offset, data, size);
|
||||||
|
m_cache_offset += size;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* Advance, if we write successfully. */
|
||||||
|
if (R_SUCCEEDED(fs::WriteFile(m_file, m_offset, data, size, fs::WriteOption::None))) {
|
||||||
|
m_offset += size;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result ScopedFile::TryWriteCache() {
|
||||||
|
/* If there's no cached data, there's nothing to do. */
|
||||||
|
R_SUCCEED_IF(m_cache_offset == 0);
|
||||||
|
|
||||||
|
/* Try to write any cached data. */
|
||||||
|
R_TRY(fs::WriteFile(m_file, m_offset, m_cache, m_cache_offset, fs::WriteOption::None));
|
||||||
|
|
||||||
|
/* Update our extents. */
|
||||||
|
m_offset += m_cache_offset;
|
||||||
|
m_cache_offset = 0;
|
||||||
|
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -25,8 +25,11 @@ namespace ams::creport {
|
||||||
fs::FileHandle m_file;
|
fs::FileHandle m_file;
|
||||||
s64 m_offset;
|
s64 m_offset;
|
||||||
bool m_opened;
|
bool m_opened;
|
||||||
|
u8 *m_cache;
|
||||||
|
const size_t m_cache_size;
|
||||||
|
s64 m_cache_offset;
|
||||||
public:
|
public:
|
||||||
ScopedFile(const char *path) : m_file(), m_offset(), m_opened(false) {
|
ScopedFile(const char *path, void *cache = nullptr, size_t cache_size = 0) : m_file(), m_offset(), m_opened(false), m_cache(static_cast<u8*>(cache)), m_cache_size(cache_size), m_cache_offset(0) {
|
||||||
if (R_SUCCEEDED(fs::CreateFile(path, 0))) {
|
if (R_SUCCEEDED(fs::CreateFile(path, 0))) {
|
||||||
m_opened = R_SUCCEEDED(fs::OpenFile(std::addressof(m_file), path, fs::OpenMode_Write | fs::OpenMode_AllowAppend));
|
m_opened = R_SUCCEEDED(fs::OpenFile(std::addressof(m_file), path, fs::OpenMode_Write | fs::OpenMode_AllowAppend));
|
||||||
}
|
}
|
||||||
|
@ -34,6 +37,10 @@ namespace ams::creport {
|
||||||
|
|
||||||
~ScopedFile() {
|
~ScopedFile() {
|
||||||
if (m_opened) {
|
if (m_opened) {
|
||||||
|
if (m_cache != nullptr) {
|
||||||
|
this->TryWriteCache();
|
||||||
|
}
|
||||||
|
fs::FlushFile(m_file);
|
||||||
fs::CloseFile(m_file);
|
fs::CloseFile(m_file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,6 +54,8 @@ namespace ams::creport {
|
||||||
void DumpMemory(const char *prefix, const void *data, size_t size);
|
void DumpMemory(const char *prefix, const void *data, size_t size);
|
||||||
|
|
||||||
void Write(const void *data, size_t size);
|
void Write(const void *data, size_t size);
|
||||||
|
private:
|
||||||
|
Result TryWriteCache();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue