Rob Finch wrote:
It's an interesting idea. A lot of work to find out if it's practical or not.
Quote:
So I've just thought of the craziest idea... what if you programmed an os entirely in vhdl? Obviously it could only ever run one os since it would be directly programmed in hardware but that single os would experience a huge improvement in speed since it wouldn't be to be "translated" into c and then assembly and the microcode and then micro ops. Thoughts?
The following maybe based more on a gut feel than actual factual evidence (one would actually have to build a hardware OS and test it to known for sure), But,
I looked briefly at implementing some parts of an OS in hardware. I took part of a simple OS and implemented several routines in Verilog. For instance task scheduling. Operating list insertions and deletions. There might be some performance gains for a really simple OS as things can be done in parallel that have to be done serially with software. Some of the code in my implementation replaced dozens of lines of software with single cycle execution in hardware. But the operating system shouldn't be a big consumer of CPU cycles. So making it in hardware likely wouldn't increase performance very much if at all. Putting a modern operating system in hardware probably isn't practical. There are many components to an operating system and the hardware required to implement it would be large and therefore slow down the clock cycle time. It would likely slow everything down while improving the OS performance only marginally.
Dude, that is
awesome. I'm not interested in porting Linux or windows to vhdl lol... but what about the l4 microkernel? The
sel4 microkernel is the os I want to use, and it only takes up 10.2 kloc. It is also
literally bug-free .
It is also completely written in C, with only 500 loc in x86/arm assembly. So I could just use, theoretically, a c-to-vhdl/verilog translator and get the necessary Verilog or vhdl in ten lines of shell scripts.
And considering that there are verilog designs that take up far more than just 10-15 kloc, it seems that it is completely possible to make a real os in Verilog or vhdl.