29 ms·
Raspberry Pi 4 OpenBSD based home computer/gaming console
When I started programming as a kid, I had a Commodore 64 and later an amiga 500. Those machines came with very simple software and expected you to write some, rather than giving you thousands of pre-made packages to learn and play with.
A lot of existing software was video games. They were much simpler than those people play nowadays but they were still a lot of fun. Part of the fun was low latency.
I started working on a gaming console based on the raspberry pi that would have the kind of low latency that older home computers and gaming consoles had, and found a way to do that.
At some point, I realised that users would want to use a keyboard, read and write files, connect to the internet, stuff that is taken for granted with computers today.
So I wanted not to run on bare metal anymore, I needed an OS. Writing one from scratch would take me years and it probably would not be as good as an existing one.
But existing desktop operating systems tend not to be good for games, as they introduce latency and are able to stop a game at any time to do some other task, which can result in stuttering that the game developers cannot fully control or avoid.
I modified the OpenBSD kernel for the raspberry pi with gaming related extensions, in such a way that when the game runs there is no latency and no stuttering.
A game on my own fork of OpenBSD has the same performance of the bare metal code that I have written previously. And it can do file I/O, connect to the net and all that kind of stuff.
And when you quit the game it's just like normal OpenBSD so you can program it and make games yourself, browse the web and do all sort of stuff.
I am thinking that other people may want to have something like that, both for nostalgic reasons and for learning programming, so I thought of asking around and, if enough people like the idea, turn this into a product.
- penguinlinux 5y agothis could be a great project. also the raspberry pi is very affordable. However, i think the best raspberry pi would be the raspberry pi 3 as the raspberry pi 4 requires a different ac adapter with usbc c and also a special hdmi cable so that increases the price of entry. Even writing a game system for the raspberry pi zero w would be amazing.
- alehyze 5y agoTrue. The fact is that the zero does not have the computing power I want. The 3 does not have USB3 and that is a big issue for another reason. It has to be the raspberry pi 4 :-)
- stuaxo 5y agoBetter to aim for the 4, as I assume it'll take some time to get everything done, the price will come down later on anyway.
- alehyze 5y agoAt the moment there is no "price", as there is nothing to sell :-) I am only looking for people's opinions now
- vizzah 5y agoYou should turn it into the project. I miss that mojo of old simple games. Never thought latency on modern OSes could be a barrier.
- alehyze 5y agoLatency is a huge barrier, and it does not come only from OSes. For example, modern television sets have a "gaming" mode because in normal mode they somehow process the video frames to make them look better, in a way that introduces latency. Someone who works on audio software told me that audio over bluetooth has a very high latency too. There are several bits that can introduce latency in a system. The OS is the part that software developers can adjust and improve.
- Lewisssss 5y agoI would be interesting only for performance reasons.
- alehyze 5y agoCan you elaborate? What do you mean by "performance" ?
- deleted 5y ago[deleted]
- notaplumber 5y ago> I modified the OpenBSD kernel for the raspberry pi with gaming related extensions, in such a way that when the game runs there is no latency and no stuttering. What does that even mean? What "gaming related extensions"?-- could you elaborate? OpenBSD doesn't have any accelerated drivers for the GPU on the RPi, so I'm curious what your "no latency/no stuttering" modifications would even be, beyond perhaps maybe recompiling the kernel with HZ=1000 or something else..
- alehyze 5y agoWithout going into the details: I have read the linux drivers and understood how HDMI audio and hardware sprites (planes) work amongst other details. Then implemented that myself in C and assembly with no OS. Then modified the OpenBSD kernel in a way that it can use that stuff and do even more sophisticated stuff. This is not just recompiling the kernel with some different options. It's writing substantial code. I modified 6.8 because 6.9 was not even out when I started, so it's been a couple of months of very hard work on the kernel only, not counting all the time I spent on it before when I was working bare metal. And it's not finished yet :-)
- notaplumber 5y agoThis is HN, I'm sure people would appreciate hearing the details. Like how does this integrate with OpenBSD's existing audio/graphics stacks, do you plan to upstream your work? With it being OpenBSD, are there security implications?
- dr_zoidberg 5y agoWell, he did say he wants to turn that into a product, so I understand he won't release details as they are a form of trade secret for his idea.
- alehyze 5y agoI just released the "big picture". I am sure that the OpenBSD kernel devs can redo what I did ten times quicker (in terms of development time) and a million times better (in terms of clean integration with the kernel and security) if they want to. They know all of the details of the kernel :-) That said yes, I would like to be able to turn this into a product.
- gbrown_ 5y agoFor those intertested OP's blog and prior submission [1][2]. > I am thinking that other people may want to have something like that, both for nostalgic reasons and for learning programming, so I thought of asking around and, if enough people like the idea, turn this into a product. Is a HN post the place for this? [1] https://raspberrypi4gameconsole.blogspot.com/ https://raspberrypi4gameconsole.blogspot.com/ [2] https://news.ycombinator.com/item?id=26544635 https://news.ycombinator.com/item?id=26544635
- alehyze 5y agoI am sorry if people feel like this is not the right place for this post. If the admins feel like that, please remove the offending post(s). Or ask me to amend them. I have made something that I think is cool and with the hope that others liked it, but if it's out of place I can only apologise.
- detaro 5y agoNot an admin, but this seems totally appropriate (resubmitting your blogpost would have been the more "correct" way, since HN generally prefers links over text submissions, but doesn't really matter) Cool project!
- onurcel 5y agoOn my TO-DO project list, there is "BASIC compiler/interpreter for raspberry(-like) computers". I am nostalgic of Commodore64 too. The thing that made many of us go down the rabbit hole was the immediacy of the interpreter, begging you to enter some commands 2 seconds after turning on your computer. The perceived small gap between the commands you enter in a programming language and the games you could play with the machine contributed largely to the curiosity and willing to learn more. On a modern computer, building the right interpreter is challenging. There is a trade-off between the simplicity of the language and what you can achieve with it. You won't impress today's kids if it allows you to only print text on a scrolling page. But I think one can build something really great. There could be an integrated sprite editor (with a graphic UI) and the interpreter can use them right away with something like: Sprite1.visible Sprite1.x = 10 emphasising again the immediacy. Those "sprites" could be 3d objects as well.
- sleepybrett 5y agoYeah there is something really special about essentially booting into a basic prompt/interpreter. You get some of that from booting into a bash/zsh/sh/ksh/blah shell, but it's not quite the same.
- alehyze 5y agoAs mentioned in another comment, I am planning to add a C/C++ interpreter and I have put GNUstep in there, so that people can easily build their sprite editors and other game dev tools :-)
- 0-_-0 5y agoSomething to look at if you want to encourage simple game development is supporting PICO-8 [0], or the compiled Nim version Nico [1]. [0]: https://www.lexaloffle.com/pico-8.php?page=faq https://www.lexaloffle.com/pico-8.php?page=faq [1]: https://github.com/ftsf/nico https://github.com/ftsf/nico
- alehyze 5y agoThanks :-) I like especially the pico-8, as it's fairly easy to write an emulator for that, as far as I understand.
- OldHand2018 5y agoWhat you’ve written is interesting and I hope you are successful. That said, I can already buy a Raspberry Pi at MSRP (sometimes even less). If I do that, I get access to a lot of software at no cost to me. Low latency is great, but not a reason to pay more than MSRP. You’ll need to show me why it makes a difference and why it is worth paying the extra money. Also, I already have a Raspberry Pi 4 - can your “product” be added on to the one I already have?
- alehyze 5y agoThank you for your reply :-) First of all, consider that I am just a guy who usually programs for a living and has been in a personal situation where he could not work. For some time I had an idea in my mind about this stuff and instead of getting depressed about not being able to work I went for it and started making it. I am not asking for money at present, I am only asking for opinions. My "product" is not a product yet, it's a prototype, there is no cost at the moment. I clearly said in another reply that I am not even against open sourcing it, if that is what has to happen. Or maybe people will not be interested enough and forget about it. Who knows. What I am saying is that I have spent quite some time working on this stuff and at the end of the day I have to pay my bills too, so it would be nice if I could make some people happy and get something back. What worries me is that I genuinely believe that this is an interesting approach to "an operating system for games and game development" and I may not be able to sustain its development for much longer. In its current form it can be added to a raspberry pi 4, yes, as this is what I have done myself. Now for the question about why would you be interested. If low latency gaming is not interesting to you, then it would not be the product for you. You are right, there is lots of great software out there that can be obtained at no cost. That is true for everything. For example I don't watch much television so I don't use paid tv services.
- OldHand2018 5y ago> Now for the question about why would you be interested. If low latency gaming is not interesting to you, then it would not be the product for you. That was meant to be constructive :) I enjoy typing and drawing on my iPad Pro, and one of the reasons it is enjoyable is that the iPad Pro has very low input latency. The "low latency" thing is a bullet point on a spec sheet. What sells me is the enjoyable experience. Your interesting approach is not what people are going to buy. They're going to buy what happens because of it. That's what you've got to sell if you want to sustain the development!