7 ms·
PlayStation 4 System Compiler Support Landing in LLVM
- pantalaimon 12y agoIf the PS4 really runs FreeBSD, wouldn't it be possible to provide a compatible userspace on real FreeBSD/maybe even Linux and run PS4 binaries on a PC?
- sitharus 12y agoYou'd need to reverse-engineer the PS4 libraries. I have no idea what libraries Sony provide for the PS4, but I'd assume the UI, audio and graphics libraries are all custom. There's also probably some sort of DRM library required to load games off disk.
- sigjuice 12y agoSome of these custom libraries are mentioned here. https://en.wikipedia.org/wiki/PlayStation_4_system_software https://en.wikipedia.org/wiki/PlayStation_4_system_software The PlayStation 4 features two graphics APIs, a low level API named GNM and a high level API named GNMX. Sony's own PlayStation Shader Language (PSSL) was introduced on the PlayStation 4
- Igglyboo 12y ago>There's also probably some sort of DRM library required to load games off disk. Download only games have existed since the PS3/360 days.
- eropple 12y agoUnlikely. Game developers make assumptions based on the consistent hardware; it's a lot of why they can eke competitive performance out of old hardware. You might eventually, with much work and thrashing, get something to start, but that doesn't mean that all of the little tweaks and tricks based on the PS4's hardware itself are going work on your PC. "It's all x86" doesn't take into account the unified memory architecture between CPU and GPU, for example.
- sliverstorm 12y agoWe're getting HUMA soon (or we already have it, I forget) on PCs. But there are still going to be important differences vs. the consoles. We use DDR3, the PS4 uses GDDR5 (yes, for system memory). The Xbox One SoC has eDRAM. Edit: looks like hUMA is out in the PC wild http://arstechnica.com/information-technology/2013/04/amds-heterogeneous-uniform-memory-access-coming-this-year-in-kaveri/ http://arstechnica.com/information-technology/2013/04/amds-h...
- eropple 12y agoInteresting, didn't realize hUMA was coming to PCs. Thanks. The GDDR5 behavior is a much bigger hurdle than I think most people realize.
- danudey 12y agoIt doesn't run on FreeBSD, its kernel is based off FreeBSD. Really it just saves them having to re-implement TCP/IP, VFS, etc. The userland is all entirely different. It also uses different (custom) hardware and makes assumptions about it; no OpenGL/DirectX layer of abstraction, for example, since the hardware is fixed for the next 10 years your API call doesn't have to do different things on different hardware. You'd have to provide abstractions for all of that. Likewise for the CPU; it's possible there are CPU/GPU extensions in the PS4 that don't exist in standard commercial hardware. On top of all that, the binaries are all signed/encrypted, so without the ability to decrypt them it doesn't do us much good.
- danudey 12y agoIt doesn't run on FreeBSD, its kernel is based off FreeBSD. Really it just saves them having to re-implement TCP/IP, VFS, etc. The userland is all entirely different. It also uses different (custom) hardware and makes assumptions about it; no OpenGL/DirectX layer of abstraction, for example, since the hardware is fixed for the next 10 years your API call doesn't have to do different things on different hardware. You'd have to provide abstractions for all of that. Likewise for the CPU; it's possible there are CPU/GPU extensions in the PS4 that don't exist in standard commercial hardware. On top of all that, the binaries are all signed/encrypted, so without the ability to decrypt them it doesn't do us much good.
- deleted 12y ago[deleted]
- jason_slack 12y agoWith the PS4 running FreeBSD and using LLVM/Clang. What would be the best way to simulate hardware and software to make life easier while developing but before obtaining the actual hardware? Edit: to clarify, say for Xbox One, Devs might start out just using a Windows PC, Direct-X, Visual Studio (just as an example) and get far enough in the game and perhaps secure a dev kit later.
- forgottenpass 12y agoIs there anything interesting about this? It's not like end users will get any utility from this, do development studios? Or is this just a way to ease Sony's maintenance burden? Yeah, it's probably a good idea in the grand scheme of things to get their patches back upstream. But is it worth reporting on? Worth posting/upvoting on social media? It doesn't actually mean anything does it?
- nocut12 12y agoIt could possibly lead to PS4 support from some more (especially open source) game engines. That would be a pretty big deal.
- Sanddancer 12y agoIt could potentially be interesting if they worked on the Fusion platform code generation much. The little AMD SoCs are pretty awesome, and if Sony has a few tricks up their sleeve for making things like OpenCL nicer, we could see some use elsewhere. Dev studios will get the advantage that because the Sony code's not in llvm mainline, it's a lot easier for Sony to give them more recent, faster compilers.
- krschultz 12y agoPeople upvote what they find interesting. I don't own a PS4 and I'm never going to write code for it. I find this interesting because it is a good example of the value of upstreaming patches. The next time I give a talk about open source, maybe this is one of the examples I cite because the PS4 is something everyone knows.
- nickknw 12y agoWell this is pretty exciting. This opens up the door for PS4 games to be written in any language that uses LLVM as a backend, right? So in the future, PS4 games could be written in D, Rust, Ada, ActionScript... Especially with the indie focus Sony has had, this could make it much much easier for people used to creating games with ActionScript to get their game on a console. Is there something I'm missing? This seems too good.
- Narishma 12y agoYou could already do that. LLVM has been the PS4 compiler since day 1. You still can't do anything with it if you aren't a licensed developer.
- nickknw 12y agoOh I see - you just needed to be a licensed developer to get their version of it before, is that it? > You still can't do anything with it if you aren't a licensed developer. Not sure I follow - what is stopping non-licensed developers from developing and testing games on their own PS4s now that this has happened?
- Narishma 12y agoRetail consoles only run code signed by Sony. When you become a licensed developer you get special consoles called devkits that can (among other things) run unsigned code.
- nickknw 12y agoWell that's a bit disappointing, although probably pretty important to their business model. Will make the news of a jailbreak for PS4 that much more exciting at least :)
- jeremiep 12y agoNot only that but devkits also come with the SDKs and tools and access to the developer network. Plus they cost thousands of dollars. They also usually have double the specs of the retail console to run debug code and tools. Even USB connectivity and plugins for VS to debug code running on the devkit remotely. Also on our Vita devkits there is no battery to make space for the extra ram. Even with the open sourced compiler you're still missing most of the toolchain.
- scoopr 12y agoWhile this is exciting, so far technically this seems fairly straightforward stuff, some defines and defaults (enable avx, disable exceptions) set for the ps4. I bet the biggest upside is that sony has easier time keeping up with the current llvm, and so devs get recent compiler versions.