diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a58a88e..f60546c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,13 @@ jobs: needs: clang-format steps: - uses: actions/checkout@v3 + - name: create version.h + run: | + git_hash=$(git rev-parse --short "$GITHUB_SHA") + cat < ./source/version.h + #pragma once + #define MODULE_VERSION_EXTRA " (nightly-$git_hash)" + EOF - name: build binary run: | docker build . -t builder diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 7df40f9..70a440d 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -15,6 +15,13 @@ jobs: needs: clang-format steps: - uses: actions/checkout@v3 + - name: create version.h + run: | + git_hash=$(git rev-parse --short "$GITHUB_SHA") + cat < ./source/version.h + #pragma once + #define MODULE_VERSION_EXTRA " (nightly-$git_hash)" + EOF - name: build binary run: | docker build . -t builder diff --git a/source/main.cpp b/source/main.cpp index e7d8abf..4d50659 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -1,19 +1,22 @@ +#include "version.h" +#include #include #include #include - -#include #include WUMS_MODULE_EXPORT_NAME("homebrew_kernel"); WUMS_MODULE_SKIP_INIT_FINI(); WUMS_MODULE_INIT_BEFORE_RELOCATION_DONE_HOOK(); -#define KERN_SYSCALL_TBL1 0xFFE84C70 //Unknown -#define KERN_SYSCALL_TBL2 0xFFE85070 //Games -#define KERN_SYSCALL_TBL3 0xFFE85470 //Loader -#define KERN_SYSCALL_TBL4 0xFFEAAA60 //Home menu -#define KERN_SYSCALL_TBL5 0xFFEAAE60 //Browser +#define MODULE_VERSION "v0.2" +#define MODULE_VERSION_FULL MODULE_VERSION MODULE_VERSION_EXTRA + +#define KERN_SYSCALL_TBL1 0xFFE84C70 //Unknown +#define KERN_SYSCALL_TBL2 0xFFE85070 //Games +#define KERN_SYSCALL_TBL3 0xFFE85470 //Loader +#define KERN_SYSCALL_TBL4 0xFFEAAA60 //Home menu +#define KERN_SYSCALL_TBL5 0xFFEAAE60 //Browser typedef struct sr_table_t { uint32_t value[16]; @@ -215,6 +218,10 @@ WUMS_INITIALIZE(myargs) { kernelInitialize(); } +WUMS_APPLICATION_STARTS() { + OSReport("Running KernelModule " MODULE_VERSION_FULL "\n"); +} + WUMS_EXPORT_FUNCTION(KernelCopyData); WUMS_EXPORT_FUNCTION(KernelWriteSRs); WUMS_EXPORT_FUNCTION(KernelReadSRs); diff --git a/source/version.h b/source/version.h new file mode 100644 index 0000000..78433de --- /dev/null +++ b/source/version.h @@ -0,0 +1,2 @@ +#pragma once +#define MODULE_VERSION_EXTRA "" \ No newline at end of file