OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 7:44 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: A kernel in hardware (making a very CISC architecture)
PostPosted: Tue Mar 14, 2023 4:17 pm 
Offline
Member
Member
User avatar

Joined: Mon Jun 05, 2006 11:00 pm
Posts: 2293
Location: USA (and Australia)
Not a serious product proposal, but just a thought. I've seen CPUs written in HDLs running on FPGAs, I've seen Doom run CPU-less on FPGAs. Would it be possible to build an OS in, say VHDL or Verilog?

Building drivers and a window manager in a HDL seems a little overkill (more power to you though, if you can) mostly because any update or new device would require reprogramming the FPGA. Instead, I was thinking it might be more practical to implement a CISC architecture where the are microkernel-like instructions, with the CPU running all drivers, services, user programs in isolated address spaces and system calls are basically CPU instructions.

_________________
My OS is Perception.


Top
 Profile  
 
 Post subject: Re: A kernel in hardware (making a very CISC architecture)
PostPosted: Tue Mar 14, 2023 9:22 pm 
Offline
Member
Member

Joined: Sat Jul 27, 2019 9:41 am
Posts: 25
I'm not familiar with it, but I heard that Mill CPU architecture was like this.


Top
 Profile  
 
 Post subject: Re: A kernel in hardware (making a very CISC architecture)
PostPosted: Wed Mar 15, 2023 12:39 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
Why? What advantage would it have?

It sounds like a mini HiFi system as opposed to a high-quality separates audio system. You’re stuck with the designer’s original concept and you can’t easily update it without throwing everything away.

Apart from which, I don’t think any FGPA would have the capacity to host a useful OS.

But it depends upon what you mean by an operating system. This already happens, to a certain extent, in SOCs used in specialist applications. I presume you mean a general purpose OS.

So, why would it be a good idea?


Top
 Profile  
 
 Post subject: Re: A kernel in hardware (making a very CISC architecture)
PostPosted: Wed Mar 15, 2023 1:44 am 
Offline
Member
Member

Joined: Wed Oct 01, 2008 1:55 pm
Posts: 3191
I think the main obstacle is that Verilog and HDLs build highly specialized parallel hardware that can be extremely powerful, while CPU cores are serial and so are the programming languages used to build OSes. A CPU core on a FPGA is not very effective and takes a lot of resources. I think the integration of a multicore CPU and an FPGA would be more useful.


Top
 Profile  
 
 Post subject: Re: A kernel in hardware (making a very CISC architecture)
PostPosted: Tue May 16, 2023 4:18 am 
Offline
Member
Member

Joined: Wed Mar 09, 2011 3:55 am
Posts: 509
AndrewAPrice wrote:
Not a serious product proposal, but just a thought. I've seen CPUs written in HDLs running on FPGAs, I've seen Doom run CPU-less on FPGAs. Would it be possible to build an OS in, say VHDL or Verilog?

Building drivers and a window manager in a HDL seems a little overkill (more power to you though, if you can) mostly because any update or new device would require reprogramming the FPGA. Instead, I was thinking it might be more practical to implement a CISC architecture where the are microkernel-like instructions, with the CPU running all drivers, services, user programs in isolated address spaces and system calls are basically CPU instructions.


From a strict mathematical standpoint, any Turing-complete language/device/system can be used to implement any other Turing complete system.

And from the perspective of a userspace program, system calls already do look very much like single CPU instructions. The program has no more visibility as to what goes on in kernel space than it does as to what the CPU microcode is doing. Indeed, the opposite approach to what you're proposing can be, and has been, used to implement cheap, low-performance versions of an architecture: simply don't implement the most expensive instructions in the architecture (in terms of silicon area and microcode space), and then have the OS catch the illegal instruction trap and emulate the instruction. This effectively turns an instruction into a system call.

It's really considerations of flexibility (might people want more than one implementation of this?) and resources (can the needed algorithms be implemented in hardware in the space available) that determine what services are provided by the CPU vs. the OS, and, as illustrated above, the resource part can vary between different implementations of the same architecture. I doubt a full CPU-OS will be practical in the foreseeable future: system calls differ widely in their complexity, and Moore's law seems to be running out of steam, so you might move some low-hanging fruit into an ISA, but the heavier system calls will likely remain prohibitively expensive to implement in hardware. And considerations of flexibility may prevent many things that could be moved into an ISA from actually being implemented in hardware. For example: If you're putting together an new OS API for your ISA, then that will limit the portability of software written for that API to other ISAs. If you're using an existing API (Windows, POSIX), then that will complicate porting software for other operating systems than the chosen system to your ISA.


Top
 Profile  
 
 Post subject: Re: A kernel in hardware (making a very CISC architecture)
PostPosted: Tue May 16, 2023 7:07 am 
Offline
Member
Member

Joined: Wed Oct 01, 2008 1:55 pm
Posts: 3191
Why complicate things? Put the FPGA on the PCI bus with many lanes & high speed, and you will have a very effective device that cannot be implemented using any number of CPU cores available today, and then you build a driver for your OS that interfaces it with your application software.

The fact is that parallel Verilog on a modern FPGA can achieve performance that cannot be realized with normal CPU cores, and it doesn't cost more than an ordinary motherboard. Of course, the FPGA program will be highly specialized, and can only do that specific function you designed it to do, but it does it much faster. For instance, many FPGAs come with hundreds of DSP cores that each can do one multiply & add operation per clock cycle. Even if you had a computer with 100s of CPU cores, your application would not be likely to use them all.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group