PS4 programming - how custom is the x86

exdeath

Lifer
Jan 29, 2004
13,679
10
81
Wondering if anyone knows if the x86 core in the PS4 CPU is a standard x86.

By that I mean is it a custom build that boots in native long mode with legacy circuitry removed and a fixed memory map or is it a standard backward compatible x86 that you still have to boot in real mode, set up segment descriptors, enable protected mode in CPL0, check for long mode, set up page tables, etc, etc, etc.

And to that end, is it know what level of setup the boot ROM is doing? Are we in real mode, protected mode, long mode, CPL0, CPL3, etc when the boot ROM is done and reset vector is called or when the boot sector is loaded from the HDD?

I've been out of the scene for quite some time and getting a bit nostalgic over some good old x86 hacking. Yeah... never thought I'd miss x86.

I've attempted to check on a few PSx hacking and homebrew sites but I'm getting impatient with waiting for registration emails...

Yeah I know, modern consoles have SDKs and operating systems, but I'm a low level junkie and need my fix. I had a blast on the PS2 bare metal with no SDKs or OS and the official Sony register level hardware documentation was the best I've ever seen for such a complex proprietary system.
 
Last edited:

Hi-Fi Man

Senior member
Oct 19, 2013
601
120
106
Wondering if anyone knows if the x86 core in the PS4 CPU is a standard x86.

By that I mean is it a custom build that boots in native long mode with legacy circuitry removed and a fixed memory map or is it a standard backward compatible x86 that you still have to boot in real mode, set up segment descriptors, enable protected mode in CPL0, check for long mode, set up page tables, etc, etc, etc.

And to that end, is it know what level of setup the boot ROM is doing? Are we in real mode, protected mode, long mode, CPL0, CPL3, etc when the boot ROM is done and reset vector is called or when the boot sector is loaded from the HDD?

It probably just uses regular UEFI based firmware just like everything else x86 nowadays. If I recall correctly UEFI based firmware boots in long mode from the start (if it's x86-64 that is). Not sure about the rest of that low level crap though :p.
 

exdeath

Lifer
Jan 29, 2004
13,679
10
81
It probably just uses regular UEFI based firmware just like everything else x86 nowadays. If I recall correctly UEFI based firmware boots in long mode from the start (if it's x86-64 that is). Not sure about the rest of that low level crap though :p.

If it's a standard x86 the x86 itself still powers on in real mode and you can't enable long mode until you are in protected mode. It would require a custom x86 build for the hardware to power on in long mode.

That's not to say a UEFI BIOS couldn't obfuscate the process and hand over control to the boot loader already in long mode.

Even real mode BIOS goes into protected mode temporarily for the RAM test, but it leaves everything back in real mode when it jumps to the bootloader.
 

Hi-Fi Man

Senior member
Oct 19, 2013
601
120
106
Yes you are correct, my bad! You enter long mode once the firmware passes control off to the UEFI. With that said, I see no reason for the PS4's Jaguar CPU to be any different in that regard. I hear it also runs a BSD based OS.
 

exdeath

Lifer
Jan 29, 2004
13,679
10
81
That's PS3. PS2 and PS3 had official Sony support and encouragement for Linux.
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
That's PS3. PS2 and PS3 had official Sony support and encouragement for Linux.

Until they just removed the functionality from the PS3 with an update....

Couldn't really do much on it though, the lack of drivers made any sort of performance out of the question.