Compare commits

13 Commits
v1.0 ... main

Author SHA1 Message Date
Rhitayu Chattopadhyay
dcb60beef2 Add iommu definitions. 2026-05-08 13:18:05 +02:00
Andy Nguyen
9f1d4f683d Update readme. 2026-05-06 22:41:28 +02:00
Andy Nguyen
235ad43eb5 Update readme. 2026-05-05 22:17:13 +02:00
Andy Nguyen
9d0bfe00b9 Update readme. 2026-05-04 07:55:50 +02:00
Andy Nguyen
b9e4b36688 Update readme. 2026-05-02 20:34:54 +02:00
Mateico
5ae9c4de79 cleanup 2026-05-02 18:44:17 +02:00
Andy Nguyen
aedd5e3b38 Merge pull request #4 from kirathenotebook/patch-1
Update README.md
2026-05-01 00:28:09 +02:00
kirathenotebook
b45045217f Update README.md
Thanks to petewins for the suggestion to remove the video=DP-1: line
2026-05-01 00:25:02 +02:00
c0w-ar
c602ff8063 Merge pull request #3 from buzzer-re/fix-linux-arm64
Add direct "x86_64-linux-gnu-*" if running on ARM64 Linux machines
2026-04-30 20:20:16 +02:00
Mateico
65961996d7 cleanup of warnings 2026-04-30 10:09:35 +02:00
Mateico
354e996485 move 04.03 code cave to support devkit 2026-04-30 08:29:46 +02:00
buzzer-re
6ac9bab944 Add direct "x86_64-linux-gnu-*" if running on ARM64 Linux machines 2026-04-29 23:53:05 -03:00
Andy Nguyen
2497034be9 Add some clarifications. 2026-04-29 01:21:47 +02:00
10 changed files with 90 additions and 66 deletions

View File

@@ -45,6 +45,17 @@ To run *ps5-linux*, you need some required and optional hardwares:
#### Linux/macOS:
Install docker:
```bash
sudo apt update
sudo apt install docker.io -y
sudo service docker start
sudo usermod -aG docker $USER
```
Restart the terminal.
```bash
git clone https://github.com/ps5-linux/ps5-linux-image
cd ps5-linux-image
@@ -99,36 +110,7 @@ sudo dd if=output/ps5-ubuntu2604.img of=/dev/sdX bs=4M status=progress conv=fsyn
#### Windows (Balena Etcher):
Download Balena Etcher, select the .img file, select your USB drive, click Flash.
#### Windows (WSL2 + usbipd):
Install usbipd in PowerShell as administrator:
```bash
winget install usbipd
```
Plug in your USB drive, list devices and find the busid of your drive:
```bash
usbipd list
```
Bind and attach it to WSL (replace 5-3 with your busid):
```bash
usbipd bind --busid 5-3
usbipd attach --busid 5-3 --wsl
```
Then flash from WSL:
```bash
lsblk # confirm the drive appeared, e.g. /dev/sdb
sudo wipefs -a /dev/sdX
sudo dd if=output/ps5-ubuntu2604.img of=/dev/sdX bs=4M status=progress
```
Download [Balena Etcher](https://etcher.balena.io/), select the .img file, select your USB drive, click Flash.
### 3. Plug the USB drive into your PS5
@@ -156,6 +138,13 @@ git clone https://github.com/ps5-linux/ps5-linux-loader
cd ps5-linux-loader
make
```
## Compiling on ARM64 Linux
Install the x86-64 cross-compilation tools before:
```bash
sudo apt install gcc-x86-64-linux-gnu binutils-x86-64-linux-gnu
```
Find your PS5 IP at `Settings → Network → View Connection Status`.
@@ -167,11 +156,13 @@ If all is successful, the payload will automatically go into rest mode. Wait unt
If the LED is white, but you still have a blackscreen then:
- Try removing `video=DP-1:1920x1080@60` line in cmdline.txt.
- Try different monitors or capture cards, ideally with different resolutions. Currently, some monitors have issues.
- Try setting `amdgpu.force_1080p=1` in `cmdline.txt` in the FAT32 partition of the USB drive.
If none of this helps, please report the issue in our [Discord server](https://discord.gg/PeMGVB7BAm) and provide your EDID information.
## First Boot
Configure your system and memorize your login password.
@@ -180,37 +171,50 @@ Then, there are certain settings and commands we recommend doing:
1. Disable screen saver, as it is currently buggy.
2. Install Firefox:
2. Possibly, you have to disable and reenable your Wired/WLAN connection to get internet connection.
3. Hold packages to prevent updating the kernel when doing `apt upgrade`:
```bash
sudo apt-mark hold linux-generic linux-generic-hwe-24.04 linux-generic-hwe-26.04 linux-image-generic linux-image-generic-hwe-24.04 linux-image-generic-hwe-26.04 linux-headers-generic linux-headers-generic-hwe-24.04 linux-headers-generic-hwe-26.04
```
4. Install Firefox:
```bash
sudo snap install firefox
```
5. Update mesa:
```bash
snap install firefox
sudo snap refresh mesa-2404 --channel=latest/edge
```
3. Clone our [ps5-linux-tools](https://github.com/ps5-linux/ps5-linux-tools):
6. Clone our [ps5-linux-tools](https://github.com/ps5-linux/ps5-linux-tools):
```bash
sudo apt install zlib1g-dev
git clone https://github.com/ps5-linux/ps5-linux-tools
cd ps5-linux-tools
make
```
## M.2 installation
You can use a M.2 SSD exclusively for Linux (which means you cannot use it for PS5 game storage).
1. Attach the M.SSD and boot Linux on your PS5.
2. Run these commands to initialize your M.2:
1. Attach the M.2 SSD by following the [official guide](https://www.playstation.com/en-us/support/hardware/ps5-install-m2-ssd).
2. **VERY IMPORTANT**: If you used the M2. SSD for games before, reformat it on the PS5 under `Settings` → `Storage` → `M.2 SSD Storage`.
3. Boot Linux on your PS5 and run these commands to initialize your M.2:
```bash
sudo apt install zlib1g-dev
cd ps5-linux-tools
gcc -o m2_init m2_init.c -lz
sudo ./m2_init
```
3. Reboot via `sudo reboot`. If your PS5 asks you to format your M.2 again, please report this issue to us in our [Discord server](https://discord.gg/PeMGVB7BAm) and provide your M.2 model and storage size.
4. Relaunch Linux on your PS5.
5. Copy the `ps5-ubuntu2604.img` image that you built during installation or rebuild it on your PS5. Then, install it onto your M.2:
4. Reboot via `sudo reboot`. If your PS5 asks you to format your M.2 again, please report this issue to us in our [Discord server](https://discord.gg/PeMGVB7BAm) and provide your M.2 model and storage size.
5. Relaunch Linux on your PS5.
6. Copy the `ps5-ubuntu2604.img` image that you built during installation or rebuild it on your PS5. Then, install it onto your M.2:
```bash
cd ps5-linux-tools
@@ -226,6 +230,8 @@ chmod +x ./m2_exec.sh
sudo ./m2_exec.sh
```
Then follow the same instructions again as the previous section.
In order to always boot Linux from your M.2, you can edit the label at `/boot/efi/cmdline.txt` from `root=LABEL=ubuntu2604` to `root=LABEL=ubuntu2604-m2`.
## Fan & boost control
@@ -234,7 +240,6 @@ We provide a simple tool that allows you to boost your CPU to 3500Mhz and GPU to
```bash
cd ps5-linux-tools
gcc -o ps5_control ps5_control.c
sudo ./ps5_control --fan on
sudo ./ps5_control --boost on
```
@@ -247,7 +252,6 @@ Always turn on fan when your turn on boost, as this is what the official PS5 OS
- A: No, this is a soft-mod. You need to re-run the exploit in order to boot into Linux.
- Q: Can I put Linux into standby and resume?
- A: No, this is not supported. We may however add a shutdown feature that puts your PS5 into rest-mode allowing you to relaunch Linux when powering up again.
- Q: Can I continue using my PS5 if I install Linux?
- A: Yes, the internal SSD is not modified
- Q: Can I use the PS5's NIC/WLAN module in Linux?
@@ -257,14 +261,18 @@ Always turn on fan when your turn on boost, as this is what the official PS5 OS
- Q: Does the DualSense controller work?
- A: Via a Bluetooth dongle. Built-in Bluetooth is not yet supported.
- Q: What resolutions and refresh rates are supported?
- A: So far only 1080p, 1440p and 2160p at 60Hz. 120Hz or 30Hz may be added in the future.
- A: 1080p, 1440p and 2160p at 60Hz are broadly supported. 1440p@120Hz has been the only confirmed working on the DELL S3225QC yet. 120Hz or 30Hz may be added in the future.
## Tips and tricks
- If you see graphical issues in your games, add the environment variable `RADV_DEBUG=nohiz` as [recommended for BC250](https://elektricm.github.io/amd-bc250-docs/drivers/environment/#critical-environment-variables) as well.
- You can adjust the kernel cmdline in `cmdline.txt` in the FAT32 partition.
- You can adjust the VRAM size in `vram.txt` in the FAT32 partition. By default, it uses 512MB (0x20000000) which enables [Dynamic VRAM allocation](https://elektricm.github.io/amd-bc250-docs/bios/flashing/#why-flash-the-bios).
- Monitor hotswap may work, but it will not change resolution automatically.
- Some monitors have a black screen if a video=DP-1: parameter is set in `cmdline.txt`. Confirmed working without `video=DP-1:1920x1080@60` on:
- MSI MAG274Q QD E2, DELL S2721DGF, DELL U2515H (1440p@60Hz)
- Possibly also: LG 27GL850, Lenovo Legion Y27q, ViewSonic Elite XG270QG
Many configurations, tips and tricks from the [AMD BC250 Documentation](https://elektricm.github.io/amd-bc250-docs/) also apply to PS5.

View File

@@ -1,10 +1,10 @@
#include "utils.h"
#include <stdint.h>
static uint64_t alloc_page(void);
static void install_page(uintptr_t pml4, vm_offset_t va, vm_paddr_t pa,
uint64_t alloc_page(void);
void install_page(uintptr_t pml4, vm_offset_t va, vm_paddr_t pa,
int bits);
void pte_store(uintptr_t ptep, uint64_t pte);
static int read_file(const char *path, void *buf, size_t bufsize);
static void trim_newline(char *s);
int read_file(const char *path, void *buf, size_t bufsize);
void trim_newline(char *s);
int fetch_linux(struct linux_info *info);

View File

@@ -3,9 +3,16 @@ ifndef PS5_PAYLOAD_SDK
endif
# 1. Variables
ifeq ($(shell uname -m),aarch64)
CC = x86_64-linux-gnu-gcc
LD = x86_64-linux-gnu-ld
OBJCOPY = x86_64-linux-gnu-objcopy
else
CC = gcc
LD = ld
CFLAGS = -O2 -fno-stack-protector -ffreestanding -nostdlib -fcf-protection=none -I$(PS5_PAYLOAD_SDK)/target/include
OBJCOPY = objcopy
endif
CFLAGS = -O2 -fno-stack-protector -ffreestanding -nostdlib -fcf-protection=none -m64 -I$(PS5_PAYLOAD_SDK)/target/include
LDFLAGS = -T linker.ld
TARGET = shellcode_hypervisor.elf
TEXT_BIN = shellcode_hypervisor.bin
@@ -23,7 +30,7 @@ $(TARGET): $(OBJ)
$(CC) $(CFLAGS) -c $< -o $@
$(TEXT_BIN): $(TARGET)
objcopy -O binary -j .shell_code $(TARGET) $(TEXT_BIN)
$(OBJCOPY) -O binary -j .shell_code $(TARGET) $(TEXT_BIN)
clean:
rm -f $(OBJ) $(TARGET) $(TEXT_BIN) $(dump)

View File

@@ -159,7 +159,7 @@ void entry(void) {
}
// Disable IOMMU.
*(volatile uint64_t *)0xfdd80018 &= ~1;
*(volatile uint64_t *)(AMDIOMMU_MMIO_BASE + AMDIOMMU_CTRL) &= ~1;
memcpy(&info, (void *)(cave_linux_info), sizeof(struct linux_info));

View File

@@ -37,7 +37,10 @@
#define DCHUBBUB_WHITELIST_BASE_ADDR_0 0x24878
#define DCHUBBUB_WHITELIST_TOP_ADDR_0 0x2487c
#define AMDIOMMU_MMIO_BASE 0xfdd80000
#define AMDIOMMU_CTRL 0x18
#define MAXCPU 16
void entry(void);
void boot_linux(void);
void boot_linux(void);

View File

@@ -3,9 +3,16 @@ ifndef PS5_PAYLOAD_SDK
endif
ifeq ($(shell uname -m),aarch64)
CC = x86_64-linux-gnu-gcc
LD = x86_64-linux-gnu-ld
OBJCOPY = x86_64-linux-gnu-objcopy
else
CC = gcc
LD = ld
CFLAGS = -O2 -fno-stack-protector -ffreestanding -nostdlib -I$(PS5_PAYLOAD_SDK)/target/include
OBJCOPY = objcopy
endif
CFLAGS = -O2 -fno-stack-protector -ffreestanding -nostdlib -m64 -I$(PS5_PAYLOAD_SDK)/target/include
LDFLAGS = -T linker.ld
TARGET = shellcode_kernel.elf
TEXT_BIN = shellcode_text.bin
@@ -24,7 +31,7 @@ $(TARGET): $(OBJ)
$(CC) $(CFLAGS) -c $< -o $@
$(TEXT_BIN): $(TARGET)
objcopy -O binary -j .text $(TARGET) $(TEXT_BIN)
$(OBJCOPY) -O binary -j .text $(TARGET) $(TEXT_BIN)
clean:
rm -f $(OBJ) $(TARGET) $(TEXT_BIN) $(dump)

View File

@@ -217,10 +217,9 @@ int stage4_force_vmcb_reload(void) {
int stage5_remove_xotext(void) {
DEBUG_PRINT("\nHV-Defeat [stage5] xotext removal\n");
uint64_t start =
ktext - 0xF0000; // Include first pages where fun stuff is located
uint64_t start = ktext;
uint64_t end = kdata;
int n = 0;
int n __attribute__((unused)) = 0;
for (uint64_t a = start; a < end; a += 0x1000) {
page_chain_set_rw(a);

View File

@@ -19,7 +19,7 @@
#define MINI_SYSCORE_PID 1
static uint64_t alloc_page(void) {
uint64_t alloc_page(void) {
void *page = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_ANONYMOUS, -1, 0);
@@ -30,7 +30,7 @@ static uint64_t alloc_page(void) {
return va_to_pa_user((uintptr_t)page);
}
static void install_page(uintptr_t pml4, vm_offset_t va, vm_paddr_t pa,
void install_page(uintptr_t pml4, vm_offset_t va, vm_paddr_t pa,
int bits) {
uint64_t entry;
@@ -100,7 +100,7 @@ long find_and_get_size_of_file(const char *filename, char *found_path) {
return -1;
}
static int find_and_read_file(const char *filename, void *buf, size_t bufsize) {
int find_and_read_file(const char *filename, void *buf, size_t bufsize) {
char full_path[256];
struct stat st;
@@ -119,7 +119,7 @@ static int find_and_read_file(const char *filename, void *buf, size_t bufsize) {
return -1;
}
static int read_file(const char *path, void *buf, size_t bufsize) {
int read_file(const char *path, void *buf, size_t bufsize) {
int fd = open(path, O_RDONLY);
if (fd < 0)
return fd;
@@ -128,7 +128,7 @@ static int read_file(const char *path, void *buf, size_t bufsize) {
return r;
}
static void trim_newline(char *s) {
void trim_newline(char *s) {
while (*s != '\0') {
if (*s == '\r' || *s == '\n') {
*s = '\0';

View File

@@ -197,7 +197,7 @@ offset_list off_0403 = {
.HV_VCPU_ARRAY_OFF = 0x5D0,
.HV_VCPU_STRIDE = 0x320,
.HV_VCPU_VMCB_PTR = 0x08,
.KERNEL_CODE_CAVE = 0x0043000,
.KERNEL_CODE_CAVE = 0x500,
.KERNEL_DATA_CAVE = 0x0043000 + 0xBBE300,
.IOMMU_SOFTC = 0x33C7680,
.VMSPACE_VM_VMID = 0x1E4,

View File

@@ -225,8 +225,8 @@ void notify(const char *fmt, ...) {
vsnprintf(buffer, sizeof(buffer), fmt, args);
va_end(args);
notify_internal(buffer);
printf(buffer);
notify_internal((uint8_t *)buffer);
printf("%s", buffer);
}
void notify_internal(uint8_t *msg) {
@@ -236,7 +236,7 @@ void notify_internal(uint8_t *msg) {
} req;
bzero(&req, sizeof(req));
uint64_t len =
strlen(msg) < (sizeof(req.msg) - 1) ? strlen(msg) : (sizeof(req.msg) - 1);
strlen((const char *)msg) < (sizeof(req.msg) - 1) ? strlen((const char *)msg) : (sizeof(req.msg) - 1);
memcpy(req.msg, msg, len);
sceKernelSendNotificationRequest(0, &req, sizeof(req), 0);
}