Write Your Own Virtual Machine (2022)
jmeiners.com
Write Your Own Virtual Machine (2022)
1–10 of 102 posts
Re: Write Your Own Virtual Machine (2022)
#2Most people who want to learn a bit about how their machines work would be better served by taking an operating systems course. Same goes here: if you only have time for a short tutorial, I recommend "Writing my own bootloader" instead. [1]
(This is not meant to say that the Write your own VM tutorial is a bad tutorial; only that, in my experience, most people who'd do it would be best served by a different subject)
Re: Write Your Own Virtual Machine (2022)
#3Alas, educational architectures like the Brookshear Machine and Little Computer look nothing like real ones, making them worse than useless: in my experience students who take courses using these often end up with a more distorted understanding of computers than those who take no classes at all. Most people who want to learn a bit about how their machines work would be better served by taking an operating systems cou…
Can you please elaborate why it is bad to use LC-3 for studying computer architecture? I do understand it is completely different from real hardware, and too simplified. But from the perspective of writing CPU emulators, is it bad for me?
Re: Write Your Own Virtual Machine (2022)
#4Alas, educational architectures like the Brookshear Machine and Little Computer look nothing like real ones, making them worse than useless: in my experience students who take courses using these often end up with a more distorted understanding of computers than those who take no classes at all. Most people who want to learn a bit about how their machines work would be better served by taking an operating systems cou…
Re: Write Your Own Virtual Machine (2022)
#5I feel like one could learn every level of computing this way- from designing a real cpu for a FPGA, to writing a simple OS and programs that run on it. This stuff is all shockingly simple if you just want it to work and don’t need all of the extra performance and security modern computing needs.
Re: Write Your Own Virtual Machine (2022)
#6As a teenager I took an intro CS class at a community college, and the instructor had us design a simple cpu instruction set, and write our own VM and assembler that worked and let me write and run assembly programs. It was shockingly easy, and it was amazing how much is demystified computers for me. I feel like one could learn every level of computing this way- from designing a real cpu for a FPGA, to writing a simp…
Re: Write Your Own Virtual Machine (2022)
#7As a teenager I took an intro CS class at a community college, and the instructor had us design a simple cpu instruction set, and write our own VM and assembler that worked and let me write and run assembly programs. It was shockingly easy, and it was amazing how much is demystified computers for me. I feel like one could learn every level of computing this way- from designing a real cpu for a FPGA, to writing a simp…
Re: Write Your Own Virtual Machine (2022)
#8As a teenager I took an intro CS class at a community college, and the instructor had us design a simple cpu instruction set, and write our own VM and assembler that worked and let me write and run assembly programs. It was shockingly easy, and it was amazing how much is demystified computers for me. I feel like one could learn every level of computing this way- from designing a real cpu for a FPGA, to writing a simp…
Re: Write Your Own Virtual Machine (2022)
#9As a teenager I took an intro CS class at a community college, and the instructor had us design a simple cpu instruction set, and write our own VM and assembler that worked and let me write and run assembly programs. It was shockingly easy, and it was amazing how much is demystified computers for me. I feel like one could learn every level of computing this way- from designing a real cpu for a FPGA, to writing a simp…
I think once you move from early fantasy CPUs to early CPUs in production such as 80286, the complexity immediately moves up drastically. IIRC it involves at least memory segmentation, protected mode (MMU).
if you look at this from the riscv angle, moving from "u-mode only vm that doesn't use paging under the hood" to "u+s-mode vm with sv39" isn't an enormous jump in complexity imo
i think i might teach it starting as like, "sv21" (page tables aren't nested), then pose real sv39 and the tree structure as the solution to making a sparse mapping over 512GiB
then moving on to the idea of having a TLB is simple, especially if students have already been introduced to hashtables
Re: Write Your Own Virtual Machine (2022)
#10As a teenager I took an intro CS class at a community college, and the instructor had us design a simple cpu instruction set, and write our own VM and assembler that worked and let me write and run assembly programs. It was shockingly easy, and it was amazing how much is demystified computers for me. I feel like one could learn every level of computing this way- from designing a real cpu for a FPGA, to writing a simp…
I think once you move from early fantasy CPUs to early CPUs in production such as 80286, the complexity immediately moves up drastically. IIRC it involves at least memory segmentation, protected mode (MMU).
I often feel like those who haven’t done the exercise of understanding the ISA of a “fantasy cpu” have a really hard time understanding those more advanced features.
I guess all I am saying is that learning the “fantasy cpu” still has value even if everything else in the real world is more complex.
Walking before running and all that.