From 7305380694864f405d21cc01c09fc189331b33e7 Mon Sep 17 00:00:00 2001
From: illusiony <37698908+illusionyy@users.noreply.github.com>
Date: Sat, 6 Jun 2026 08:10:34 +0000
Subject: [PATCH 1/2] samples: add sdk_ver
---
.github/workflows/macos-latest.yml | 1 +
.github/workflows/ubuntu-latest.yml | 1 +
samples/sdk_ver/.gitignore | 4 +++
samples/sdk_ver/Makefile | 48 +++++++++++++++++++++++++++++
samples/sdk_ver/main.c | 40 ++++++++++++++++++++++++
5 files changed, 94 insertions(+)
create mode 100644 samples/sdk_ver/.gitignore
create mode 100644 samples/sdk_ver/Makefile
create mode 100644 samples/sdk_ver/main.c
diff --git a/.github/workflows/macos-latest.yml b/.github/workflows/macos-latest.yml
index d73c8f16..39dad059 100644
--- a/.github/workflows/macos-latest.yml
+++ b/.github/workflows/macos-latest.yml
@@ -51,6 +51,7 @@ jobs:
$MAKE -C samples/notify
$MAKE -C samples/notify_debug
$MAKE -C samples/ps
+ $MAKE -C samples/sdk_ver
$CMAKE -S samples/hello_cmake -B samples/hello_cmake/build
$CMAKE --build samples/hello_cmake/build
$MESON setup samples/hello_meson samples/hello_meson/build
diff --git a/.github/workflows/ubuntu-latest.yml b/.github/workflows/ubuntu-latest.yml
index 50e1cbdf..0d0a7d93 100644
--- a/.github/workflows/ubuntu-latest.yml
+++ b/.github/workflows/ubuntu-latest.yml
@@ -61,6 +61,7 @@ jobs:
$MAKE -C samples/notify
$MAKE -C samples/notify_debug
$MAKE -C samples/ps
+ $MAKE -C samples/sdk_ver
$CMAKE -S samples/hello_cmake -B samples/hello_cmake/build
$CMAKE --build samples/hello_cmake/build
$MESON setup samples/hello_meson samples/hello_meson/build
diff --git a/samples/sdk_ver/.gitignore b/samples/sdk_ver/.gitignore
new file mode 100644
index 00000000..beefd669
--- /dev/null
+++ b/samples/sdk_ver/.gitignore
@@ -0,0 +1,4 @@
+*.elf
+*.o
+*~
+
diff --git a/samples/sdk_ver/Makefile b/samples/sdk_ver/Makefile
new file mode 100644
index 00000000..37f9bc42
--- /dev/null
+++ b/samples/sdk_ver/Makefile
@@ -0,0 +1,48 @@
+# Copyright (C) 2023 John Törnblom
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that 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; see the file COPYING. If not see
+# .
+
+PS5_HOST ?= ps5
+PS5_PORT ?= 9021
+
+ifdef PS5_PAYLOAD_SDK
+ include $(PS5_PAYLOAD_SDK)/toolchain/prospero.mk
+else
+ $(error PS5_PAYLOAD_SDK is undefined)
+endif
+
+ELF := sdk_ver.elf
+
+CFLAGS := -Wall -Werror -g
+
+all: $(ELF)
+
+$(ELF): main.c
+ $(CC) $(CFLAGS) -o $@ $^
+
+clean:
+ rm -f $(ELF)
+
+test: $(ELF)
+ $(PS5_DEPLOY) -h $(PS5_HOST) -p $(PS5_PORT) $^
+
+debug: $(ELF)
+ gdb-multiarch \
+ -ex "set architecture i386:x86-64" \
+ -ex "target extended-remote $(PS5_HOST):2159" \
+ -ex "file $(ELF)" \
+ -ex "remote put $(ELF) /data/$(ELF)" \
+ -ex "set remote exec-file /data/$(ELF)" \
+ -ex "start"
diff --git a/samples/sdk_ver/main.c b/samples/sdk_ver/main.c
new file mode 100644
index 00000000..c885b16c
--- /dev/null
+++ b/samples/sdk_ver/main.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 2023 John Törnblom
+
+This program is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3, or (at your option) any
+later version.
+
+This program is distributed in the hope that 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; see the file COPYING. If not, see
+. */
+
+#include
+#include
+#include
+
+// exclude null terminator
+#define sizeof_1(a) (sizeof(a) - 1)
+
+typedef struct notify_request {
+ char useless1[45];
+ char message[1024];
+ char useless2[2051];
+} notify_request_t;
+
+int sceKernelSendNotificationRequest(int, notify_request_t*, size_t, int);
+
+int
+main() {
+ notify_request_t req;
+ bzero(&req, sizeof(req));
+ const uint32_t sdk = kernel_get_fw_version();
+ snprintf(req.message, sizeof_1(req.message), "SDK Version: 0x%08x", sdk);
+
+ return sceKernelSendNotificationRequest(0, &req, sizeof req, 0);
+}
From 090153d8e9d0c222bf10ac0bae59faaf304400da Mon Sep 17 00:00:00 2001
From: illusiony <37698908+illusionyy@users.noreply.github.com>
Date: Sat, 6 Jun 2026 08:14:47 +0000
Subject: [PATCH 2/2] ci: upload samples
---
.github/workflows/ubuntu-latest.yml | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/.github/workflows/ubuntu-latest.yml b/.github/workflows/ubuntu-latest.yml
index 0d0a7d93..74ba6db0 100644
--- a/.github/workflows/ubuntu-latest.yml
+++ b/.github/workflows/ubuntu-latest.yml
@@ -77,6 +77,13 @@ jobs:
path: ./ps5-payload-sdk.zip
if-no-files-found: error
+ - name: Upload Samples
+ uses: actions/upload-artifact@v4
+ with:
+ name: Samples
+ include-hidden-files: true
+ path: ./samples
+
release:
needs: build
permissions: