Conversation
* Temporary build script for library * Syscalls now can be done in rust with the script too, requires exporting from lib though (I think). * Futex ops in progress * Use std::atomic and libnx SVCs * Move typedefs and structs to .h * Import SVCs from libnx * Respond to PR comments * Re-add .vscode to .gitignore * Add license and respond to remaining PR comments * Move include to .cpp from .h --------- Co-authored-by: Michael Chalupiak <mikec@mchalupiak.com>
* Added code for malloc * Added code for abort
lwbuchanan
left a comment
There was a problem hiding this comment.
Make sure you also reenable the compialation stuff and test it with everything working together. We have the example mod getting built now so try it with that. Check with Andrew if have trouble building the example mod. You will probobly need to use the latest version of the build tool from main.
| // } | ||
| my_compdb.save(); | ||
|
|
||
| let template_str = include_str!("npdm_template.json"); |
There was a problem hiding this comment.
This should probobly be stored in the library, not in the sources. I'd put it with link.ld and grab the path through the btartifacts struct (maybe merge/rebase from main so you have the latest changes).
| my_compdb.save(); | ||
|
|
||
| let template_str = include_str!("npdm_template.json"); | ||
| let npdm: Value = serde_json::from_str(template_str) |
There was a problem hiding this comment.
try to use the cu json implementation, see the compdb.cache implementation in compile.rs for an example
| cu::fs::make_dir(module_dir) | ||
| .expect("failed to create module output directory"); | ||
|
|
||
| let npdm_path = module_dir.join("npdm.json"); |
There was a problem hiding this comment.
We can also get this path from the BTArtifacts struct.
|
|
||
| let npdm_path = module_dir.join("npdm.json"); | ||
|
|
||
| cu::fs::write( |
There was a problem hiding this comment.
This doesn't actually populate the json file with the data you need. You will need to set the titleid and run the npdmtool command.
Heres a snippet from the old build tool. Maybe give that a look
fn create_npdm(
target: PathBuf,
npdmtool: PathBuf,
title_id: String,
m_time: FileTime,
) -> ResultIn<(), NpdmContext> {
verboseln!("creating main.npdm");
let mut npdm_data: Value = serde_json::from_str(include_str!("template/main.npdm.json"))?;
npdm_data["title_id"] = json!(format!("0x{}", title_id));
let npdm_data = serde_json::to_string_pretty(&npdm_data)?;
let npdm_json = target.join("main.npdm.json");
system::write_file(&npdm_json, &npdm_data)?;
system::set_mtime(&npdm_json, m_time)?;
let main_npdm = target.join("main.npdm");
// not piping output because it always displays some warning/error
Command::new(npdmtool)
.args(args![&npdm_json, &main_npdm])
.silent()
.spawn()?
.wait()?
.check()?;
infoln!("Created", "main.npdm");
Ok(())
}
No description provided.