Jump to content
  • Advertisement
Sign in to follow this  
Lukas Orlov

How would you go about developing a game console OS?

This topic is 980 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've just recently heard that there a group of people who are writing to Sega about creating a new Dreamcast or whatever. Later that day, I came up with a crazy idea to develop a prototype OS for the 'new Dreamcast'.

 

The OS would be based on FreeBSD (similar to PS4's operating system) and would only have one specific set of hardware it would operate on (though I'm not sure how I would be able to program for that). It would also have recovery options also built in if the software was corrupted and also verification software just to check if the system was not tampered with.

 

Here are my questions to you guys (basically the things I just said above and some more, but in a question format)

 

 

What tips & tutorials are good for starting with FreeBSD? (also would appreciate some programming guides as well)

 

How would you make a video (similar to those of the Xbox, Playstation startups and whatnot) play whilst at high definition at startup?

 

How would you be able to implement a verification system or software to check that the system has not been tampered with and also to do something when the event actually occurs?

 

How would you be able to create a bootloader which boots directly into the operating system, checks if the specific hardware is also valid for the OS to run on, and have a special key set which, when pressed sends you into another recovery menu (which does not need to do anything for now)

 

I understand this may sound very, VERY ambitious, but it will help me to consolidate my understanding of FreeBSD and other Unix-like OSes in general, and thank you for reading

Edited by g8terg8

Share this post


Link to post
Share on other sites
Advertisement

You're more or less talking about spinning a whole new FreeBSD distribution, which is complicated but clearly has been done by many parties. The scope of that discussion is far too large to be had here.

 

Now, without being unduly discouraging, your questions worry me because you seem to be concentrating on superficial elements of this would-be operating system. How to play a video during startup, tamper checking, one specific boot-loader operation. These might seem like trivial and or fundamental questions, but by the time you can display a video and sound you'll have already had to have booted enough of an operating system to give you near-complete functionality anyways -- You'll need at least a basic sort of kernel, capable of initializing memory and IO, talking to a filesystem, can load a driver module (or contain built-in drivers) for video and audio, handles input -- probably another driver, and is capable of fast interrupt handling for being able to fill/move those audio buffers with super-low latency if you want to avoid popping and other audio artifacts (because our ears are so sensitive to aberrations, latency is even more important in audio playback than in video).

 

And that's just to get something to boot -- not something optimized for running games. I'm certain that Sony's FreeBSD-based Orbis OS is highly streamlined for gaming workloads and has a unique interface to graphics and audio that, I would guess, minimizes dependence on the kernel and on "traditional" drivers as such. Without such care and attention, whatever you might produce from a collection of standard *BSD components will be just that, a slightly slimmer BSD that performs in no significantly different way.

Share this post


Link to post
Share on other sites

I don't know about tutorials... it's not a wide spread thing for people to go around making their own operating systems. The FreeBSD project's source was intended for advanced programmers that already know their specifications ahead of time.

Now... I seriously would not recommend building an OS specific to -your- hardware. It's an utterly nasty topic, as it requires you to build the machine, the machine code specifications, the assembly format, and if need be compilers for it. You would honestly be better off using regular desktop or server parts, and then build a game system based off that.

 

Free BSD -should- handle pipelining, memory, etc for you. You'll need to make some heavy modifications to it however to give it some good performance with games. But then comes to the issue of drivers. Annnnd they are monsters.

Share this post


Link to post
Share on other sites

You're more or less talking about spinning a whole new FreeBSD distribution, which is complicated but clearly has been done by many parties. The scope of that discussion is far too large to be had here.

 

Now, without being unduly discouraging, your questions worry me because you seem to be concentrating on superficial elements of this would-be operating system. How to play a video during startup, tamper checking, one specific boot-loader operation. These might seem like trivial and or fundamental questions, but by the time you can display a video and sound you'll have already had to have booted enough of an operating system to give you near-complete functionality anyways -- You'll need at least a basic sort of kernel, capable of initializing memory and IO, talking to a filesystem, can load a driver module (or contain built-in drivers) for video and audio, handles input -- probably another driver, and is capable of fast interrupt handling for being able to fill/move those audio buffers with super-low latency if you want to avoid popping and other audio artifacts (because our ears are so sensitive to aberrations, latency is even more important in audio playback than in video).

 

And that's just to get something to boot -- not something optimized for running games. I'm certain that Sony's FreeBSD-based Orbis OS is highly streamlined for gaming workloads and has a unique interface to graphics and audio that, I would guess, minimizes dependence on the kernel and on "traditional" drivers as such. Without such care and attention, whatever you might produce from a collection of standard *BSD components will be just that, a slightly slimmer BSD that performs in no significantly different way.

Alright, I understand. I guess my priorities lie within actually making the system run properly during game play etc, and not just to look 'nice'. Thank you very much.

Share this post


Link to post
Share on other sites

What tips & tutorials are good for starting with FreeBSD? (also would appreciate some programming guides as well)


Start working with FreeBSD and derivatives like DragonflyBSD. If you're not already a BSD developer, its probably not a good idea to jump in and try to make a new BSD OS.

That said, the official FreeBSD Developers Handbook is probably a good place to start: https://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/
 

How would you make a video (similar to those of the Xbox, Playstation startups and whatnot) play whilst at high definition at startup?


Start the core system as fast as possible and then run whatever video player you want during your late-stage init process. Remember, most of the time that a computer spends starting up is actually probing for hardware and configuration. You need none of that on a console. You can tune a stock Linux distro to boot in under a second if you disable most of the kernel modules and hardware probing features for hardware you don't have. Likewise, custom UEFI images can disable their hardware detection and thus load the bootloader instantly. And your bootloader can be configured to load the kernel instantly.
 

How would you be able to implement a verification system or software to check that the system has not been tampered with and also to do something when the event actually occurs?


On a modern system, you'd use something like TPM (Trusted Platform Module) to sign and verify your UEFI and bootloader, which itself verifies your signed kernel images, which then only loads signed binaries. It can also then trigger a restore operation if it detects signatures that don't match rather than just bricking itself, or allow a developer mode, or whatever specific behavior you have in mind.
 

How would you be able to create a bootloader which boots directly into the operating system, checks if the specific hardware is also valid for the OS to run on, and have a special key set which, when pressed sends you into another recovery menu (which does not need to do anything for now)


Many bootloaders today can do most of all that already. It's just a configuration file to list the OSes and fallbacks. Note that if a kernel starts to load and fails, the bootloader has no way to receover, as the bootloader is no longer running (once it hands over the kernel, the bootloader is dead). You'd instead need to use a hypervisor that loads up containerized OS images. This is e.g. what the XBone does - it has up to 3 (iirc) OS images that it loads for different purposes. This has several advantages beyond just failover: your OS images can constrain what apps have which features (e.g. the OS image that can load unsigned "apps" might not have full GPU support, giving you an XBox-like development model where AAA games need licensing and signing from Microsoft while hobby app development is open and free), as well as allowing perf-sensitive domains a better teardown experience (rebooting the whole OS image for each game means that not even the kernel is able to fragment memory).
 

I understand this may sound very, VERY ambitious, but it will help me to consolidate my understanding of FreeBSD and other Unix-like OSes in general, and thank you for reading


Most of these question have nothing to do with BSD or UNIX, fwiw. :)

Your biggest problem for a custom OS is really just going to be video hardware support. The UNIXes still all have crap video drivers. Building your OS around Vulkan will help but you'll still either be dependent upon proprietary drivers that may or may not work with your kernel choice, or be forced to use the FOSS drivers (which for Vulkan currently just means Intel GPUs and nothing else).

Your biggest problem developing a new console is going to be the development kit. Game developers do not work on UNIX or BSD. You need to offer a high-quality devkit experience that interacts well with Visual Studio and Windows-based tools for debugging and deploying apps to the console. You'll need the remote GDB/LLDB support, the devkit app signing process, debug disk drive support, net debugging, etc. all without requiring neckbeard grognard BSD userspace knowledge.

Your biggest problem developing a new game platform is going to be all the related services and infrastructure. User accounts, a game download store, cloud save storage, party chat, friends and social features, achievements, etc.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!