Page 1 of 2
I want to design a CPU and create my own computer emulator to create my own OS. someone please help me please
Posted: Sun Jan 12, 2025 3:50 am
by nora23169
I want to design a CPU and create my own computer emulator to create my own OS. someone please help me please
Re: I want to design a CPU and create my own computer emulator to create my own OS. someone please help me please
Posted: Sun Jan 12, 2025 9:36 am
by iansjack
That’s rather a general question. What aspect of your project are you having problems with?
Re: I want to design a CPU and create my own computer emulator to create my own OS. someone please help me please
Posted: Sun Jan 12, 2025 1:47 pm
by Thomas
Hi nora23169,
This coursera course might interest you.
Build a Modern Computer from First Principles: From Nand to Tetris (Project-Centered Course)
https://www.coursera.org/learn/build-a-computer
Build a Modern Computer from First Principles: Nand to Tetris Part II (project-centered course)
https://www.coursera.org/learn/nand2tetris2
--Thomas
Re: I want to design a CPU and create my own computer emulator to create my own OS. someone please help me please
Posted: Mon Jan 13, 2025 2:40 am
by nora23169
The reason I tried to make my own emulator and then my own OS was because I was frustrated with x86 and RISC-V. I'm sorry, but I appreciate your help.
Re: I want to design a CPU and create my own computer emulator to create my own OS. someone please help me please
Posted: Mon Jan 13, 2025 4:18 am
by iansjack
That's a great ambition, but it's still not clear what help you are seeking. What have you done so far towards your aim? For example, have you specified the architecture of your cpu and the instructions that it supports?
Re: I want to design a CPU and create my own computer emulator to create my own OS. someone please help me please
Posted: Mon Jan 13, 2025 6:59 am
by nora23169
The instruction set has not yet been determined. I started this project because of the interesting story of how UNIX was born when the only available language was assembler, then the C language was born, and when software assets began to circulate rapidly, UNIX was born from nothing. That's because. . I feel a sense of admiration and romance, so I appreciate your support.
Re: I want to design a CPU and create my own computer emulator to create my own OS. someone please help me please
Posted: Mon Jan 13, 2025 10:42 am
by iansjack
Designing a CPU is a quite difficult process; you should approach it systematically. First determine what the architecture is, I.e. the register set, the addressing modes, any additional features such as memory management. Once you have done that you need to decide on the instruction set - whether it will be CISC, RISC, or somewhere in between. It’s advisable to get this all down in writing before going further.
Then you have the very important decision of mapping those instructions, and addressing modes, to opcodes. Important decision here - fixed-length opcodes or variable length. The latter probably makes your mapping easier but implementation harder.
I gather that you are looking at an emulated CPU rather than hardware (although FOGAs make the latter relatively easy). Only when you have got your mind clear and documented all your decisions should you start coding. Then you can write your emulator, an assembler for your instruction set, and start thinking about an operating system. That is then a whole lot of other decisions. But you might want to think about this, in general terms, at the same time as designing the CPU; decisions made for one will influence the other.
This is not a trivial project, but will be very satisfying, and educational, if you can meet your aims.
Re: I want to design a CPU and create my own computer emulator to create my own OS. someone please help me please
Posted: Mon Jan 13, 2025 2:17 pm
by rdos
Today I would implement such a project with a FPGA development kit. However, even if using Verilog and a FPGA is considerably easier than designing your hardware from scratch with basic hardware components (NANDs and FFs), there is still a rather steep learning curve involved.
With this approach, you can typically debug the hardware with the developmental tools included with the FPGA development kit, so writing an emulator is not super-important.
Re: I want to design a CPU and create my own computer emulator to create my own OS. someone please help me please
Posted: Mon Jan 13, 2025 3:09 pm
by iansjack
I agree. You can get a development board suitable for this purpose for about £25 (euros, dollars, whichever applies), or a more complete second-hand board from eBay for around £100.
But a hardware design is an order of magnitude harder than an emulator.
Re: I want to design a CPU and create my own computer emulator to create my own OS. someone please help me please
Posted: Tue Jan 14, 2025 1:03 am
by Thomas
My assumption was that the posters main interest is education. Almost all of the modern systems has teams of engineers behind them. I am a firmware developer for the past ~10 years and had various other software jobs in the past. Firmware is only a tiny part of the whole ecosystem and I only know fraction of the entire code base.
--Thomas
Re: I want to design a CPU and create my own computer emulator to create my own OS. someone please help me please
Posted: Tue Jan 14, 2025 4:55 am
by rdos
iansjack wrote: ↑Mon Jan 13, 2025 3:09 pm
I agree. You can get a development board suitable for this purpose for about £25 (euros, dollars, whichever applies), or a more complete second-hand board from eBay for around £100.
I use a more competent FPGA, which costs considerably more ($2748):
https://www.xilinx.com/products/boards- ... 705-g.html. This board has 1GB DDR3 RAM, Pci, a gigabit network card, a high speed ADC interface, and a lot more, so is suitable for CPU designs, including testing the design. Actually, Xilinx (now AMD) has a CPU IP (design module) for this FPGA, but you don't want to use that when you design your own CPU & OS.
Re: I want to design a CPU and create my own computer emulator to create my own OS. someone please help me please
Posted: Tue Jan 14, 2025 5:53 am
by iansjack
$2784 is rather a lot to spend - compared to less than $100 - on something that one is just trying out for fun. Even the cheaper boards have enough RAM and interfaces to learn the basics of processor design. The £25 board that I mentioned is capable of supporting a simple RISC-V processor, which is probably more complicated than the design a beginner will be targeting.
Re: I want to design a CPU and create my own computer emulator to create my own OS. someone please help me please
Posted: Tue Jan 14, 2025 7:02 am
by rdos
I didn't even link this even more competent evaluation board:
https://www.xilinx.com/products/boards- ... cu118.html. It supports Pci 3 x16, has 6840 DSP slices, several million logic cells, and can interface ADCs operating at several GHz through FMC+. It only costs about $15000. I'd like one of those, but they are out of my budget.
Re: I want to design a CPU and create my own computer emulator to create my own OS. someone please help me please
Posted: Tue Jan 14, 2025 5:32 pm
by JackScott
Seeing as nobody has mentioned it yet, I'll chime in with a suggestion to watch Ben Eater's breadboard CPU YouTube videos:
https://www.youtube.com/playlist?list=P ... 5dvjafglHU. You might not want to ever build something like that, but if you're starting from nothing in terms of CPU design or digital electronics, it's a good (entertaining) educational resource.
Re: I want to design a CPU and create my own computer emulator to create my own OS. someone please help me please
Posted: Wed Jan 15, 2025 4:47 am
by nora23169
sorry. This project was too ambitious, so I'm debating whether to give up or continue, but if you do, I'd appreciate your continued support, and if not, I'm very sorry. After that, I would like to contribute to your OSdev by creating my own Unix-like OS using x86 and risc-v. thank you.