-
Notifications
You must be signed in to change notification settings - Fork 11
Add support for passing Exit Return code from Target to Host #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Thank you, thank you, THANK YOU!!!! This was the last major missing piece in writing more testable, more easily automatable examples and test apps. This is what I've always wanted and needed for CI, and hopefully we can now go back and do a better job error checking in some of the examples and return error status codes upon failure, which can all become automated. :) |
|
Two things:
|
ljsebald
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to make sure that this change doesn't break when used with an older dcload-serial cd, it should really use a new command byte for the communication between the two parts. Please assign a new command code (it looks like 22 is the next free one) to the new exit syscall that has an argument, and update the code accordingly, while retaining the old behavior for command 0.
The target need not support sending code 0 after these changes, but keeping it in the host code will ensure that older dcload-serial discs do not break with a new dc-tool.
The return code passed to exit() on the target will be transfered to the host and used as the exit code for the host application.
Sometimes the tool would return a success code when an error had occured. This change makes it so that invalid flags and other errors return -1 to indicate failure.
Leave command 0 as the legacy exit for legacy dcload-serial discs, but use command 22 for newer dcload-serial discs supporting return codes
As the new return code feature has been introduced altering the behavior of the dcload-serial disc, we update the version number
|
Adds support for receiving the return code passed to the exit() syscall that was added to KOS in KallistiOS/KallistiOS@596f2bc. The value will be passed back over the serial connection to the host program which will use it as its return code when exiting.
I also changed some other exit codes to help determine when a failure has actually occurred in order to avoid false positives when using this change to detect passing or failing of software on the target.