I dont have much knowledge about designing os but i saw in many sites that C language is used in developing os. I was wondering is it possible to use cuda C to develop a simple 32 bit OS. with less features say os exclusively to play audio files like chromium os for browsing.
not possible currently. come back in 10 years.
not possible currently. come back in 10 years.
Well, it would be POSSIBLE, but it would not use any of the GPU’s strengths, so it’d just be a funky hack.
At the very simplest, you could make a machine-level emulator of an x86 chip (or 6502 or Z80 or ARM) and run with just one GPU thread doing the emulation of a given instruction stream. (losing almost all the GPU’s parallelism, but hey, it’s just a hack…) Then you could run anything you like, even Windows 7, very very similar to Bochs.
Admittedly this would be useless, it would be painfully slow, but very cool just to see.
An interesting question is just what performance you’d see. Probably something like 1/300 native CPU speeds. I guess this because such emulators run at about 1/100 speed when run on the CPU, and the simple one-thread implementation GPU hack is roughly like a 1GHz processor. The GPU’s longer pipelines, and lack of speculation and prefetch would make it less efficient clock for clock than a CPU for this kind of 1 thread hack.
Is this the only way to make an OS run on the GPU? No, but it’s an interesting thing to brainstorm.
Well, it would be POSSIBLE, but it would not use any of the GPU’s strengths, so it’d just be a funky hack.
At the very simplest, you could make a machine-level emulator of an x86 chip (or 6502 or Z80 or ARM) and run with just one GPU thread doing the emulation of a given instruction stream. (losing almost all the GPU’s parallelism, but hey, it’s just a hack…) Then you could run anything you like, even Windows 7, very very similar to Bochs.
Admittedly this would be useless, it would be painfully slow, but very cool just to see.
An interesting question is just what performance you’d see. Probably something like 1/300 native CPU speeds. I guess this because such emulators run at about 1/100 speed when run on the CPU, and the simple one-thread implementation GPU hack is roughly like a 1GHz processor. The GPU’s longer pipelines, and lack of speculation and prefetch would make it less efficient clock for clock than a CPU for this kind of 1 thread hack.
Is this the only way to make an OS run on the GPU? No, but it’s an interesting thing to brainstorm.
Thorough and informative, thank you. i am not gonna attempt this experiment, i am actually looking for cuda projects for my college, could u please give me any advice.
Thorough and informative, thank you. i am not gonna attempt this experiment, i am actually looking for cuda projects for my college, could u please give me any advice.
Program a giant cellular automaton, such as Conway’s Game of Life. In theory these things are turing complete, so it should be possible to run any operating system with them ;-)
Program a giant cellular automaton, such as Conway’s Game of Life. In theory these things are turing complete, so it should be possible to run any operating system with them ;-)
It’s now 13 years later. Where are we with this? I have a design in mind if anyone wants to bounce some ideas around and see what’s feasible. GPUs are insanely fast right now and have tons of RAM and compute cores. How much performance can we get out of this?
You could implement your ideas, then upload the working code to a public repository and optionally publish your findings. Creating a simple OS is feasible for a single person, as evidenced by the creation of Linux whose initial version comprised fewer than 9 KLOC. According to this answer on Retrocomputing Stackexchange, the first version of Unix comprised fewer than 5 KLOC.
Thanks but I implemented a hobby OS in highschool. Excellent contraceptive btw. I had just shy of 3KLOCs with a full x86 real mode, MMU, PIC, AT keyboard, VESA modeswitch, PIT and PC speaker drivers, CMOS RTC, random number generator, floppy disk code and the begining of a filesystem. Since then, I’ve done enough systems programming so my question is not “can I write an OS?” I have that answer. My question is, can a GPU with CUDA compute capabilities emulate a computer truly such that it can run code orignally written for said platform. Say, Gameboy or Macintosh or something of the sort.
Back in school one of my professors used to say “With enough thrust you can get a barn door to fly.”
I am not aware of any project that has explored whether the GPU thrust is sufficient to get the OS door to fly. There seems to be no wide-spread interest in that kind of GPU use.
But given that you have prior OS implementation experience and interesting ideas, here is your chance to become a pioneer in this field. I am not being facetious: someone has to be the first to put in the exploratory work, otherwise it will always remain in the realm of ideas only.
The way I prefer to go about such situations is to work out an implementation by myself first, then perform a thorough search of the literature to find out what other people have done. The reason I do it in that order is that I found that performing the literature search first tends to influence, even constrain, my thinking along lines established by others. I acknowledge that this might be a personal rather than a universal problem. In a not insignificant number of cases, I found that my own ideas turned out to be superior in various aspects to known approaches, in many others I found that combining my ideas with known approaches from the literature delivered superior results.
That’s very well said! Thanks!
A possible approach would be to run a gate simulation of a multi core CPU, possibly with emulation of some surrounding hardware on the GPU. Say, an ARM or a RISC V chip. Then run an existing OS on it. However FPGAs are better suited for this purpose and these use less power as well.