Get the latest tech news

We ran a Unix-like OS on our home-built CPU with a home-built C compiler (2020)


[Thanks for many comments and votes on Hacker News! ] It’s been two years since I started working as a software engineer. I sometimes tell my colleagues about a student project I did in my junior year of university, and it’s so well-received that I’m writing this post. 1 Now, let me ask you a question. Have you ever designed your own ISA, built a processor of that ISA on FPGA, and built a compiler for it? Furthermore, have you run an operating system on that processor? Actually, we have.

The instructor only asks the students to “take this ray-tracing program written in OCaml and run it on your CPU implemented on an FPGA”, and the class ends. Instead of just commenting boot sequences out, Masayoshi started implementing actual initialization of our CPU, and Shohei rewrote the x86 assembly of Xv6 into our homebrew architecture’s. After delegating the char 32-bit problem to the Ucc team, I wrote the initialization of paging of the first entry stage, and tried to get the interrupts to work properly by trial and error.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Home

Home

Photo of cpu

cpu

Photo of Unix

Unix

Related news:

News photo

I ported pigz from Unix to Windows

News photo

Casinos on the Thai-Cambodian border tell staff to stay home

News photo

CPU-Based Layout Design for Picker-to-Parts Pallet Warehouses