Coder Social home page Coder Social logo

fromthetransistor's Introduction

From the Transistor to the Web Browser

Hiring is hard, a lot of modern CS education is really bad, and it's hard to find people who understand the modern computer stack from first principles.

Now cleaned up and going to be software only. Closer to being real.

Section 1: Intro: Cheating our way past the transistor -- 0.5 weeks

  • So about those transistors -- Course overview. Describe how FPGAs are buildable using transistors, and that ICs are just collections of transistors in a nice reliable package. Understand the LUTs and stuff. Talk briefly about the theory of transistors, but all projects must build on each other so we can’t build one.
  • Emulation -- Building on real hardware limits the reach of this course. Using something like Verilator will allow anyone with a computer to play.

Section 2: Bringup: What language is hardware coded in? -- 0.5 weeks

  • Blinking an LED(Verilog, 10) -- Your first little program! Getting the simulator working. Learning Verilog.
  • Building a UART(Verilog, 100) -- An intro chapter to Verilog, copy a real UART, introducing the concept of MMIO, though the serial port may be semihosting. Serial test echo program and led control.

Section 3: Processor: What is a processor anyway? -- 3 weeks

  • Coding an assembler(Python, 500) -- Straightforward and boring, write in python. Happens in parallel with the CPU building. Teaches you ARM assembly. Initially outputs just binary files, but changed when you write a linker.
  • Building a ARM7 CPU(Verilog, 1500) -- Break this into subchapters. A simple pipeline to start, decode, fetch, execute. How much BRAM do we have? We need at least 1MB, DDR would be hard I think, maybe an SRAM. Simulatable and synthesizable.
  • Coding a bootrom(Assembler, 40) -- This allows code download into RAM over the serial port, and is baked into the FPGA image. Cute test programs run on this.

Section 4: Compiler: A “high” level language -- 3 weeks

  • Building a C compiler(Haskell, 2000) -- A bit more interesting, cover the basics of compiler design. Write in haskell. Write a parser. Break this into subchapters. Outputs ARM assembly.
  • Building a linker(Python, 300) -- If you are clever, this should take a day. Output elf files. Use for testing with QEMU, semihosting.
  • libc + malloc(C, 500) -- The gateway to more complicated programs. libc is only half here, things like memcpy and memset and printf, but no syscall wrappers.
  • Building an ethernet controller(Verilog, 200) -- Talk to a real PHY, consider carefully MMIO design.
  • Writing a bootloader(C, 300) -- Write ethernet program to boot kernel over UDP. First thing written in C. Maybe don’t redownload over serial each time and embed in FPGA image.

Section 5: Operating System: Software we take for granted -- 3 weeks

  • Building an MMU(Verilog, 1000) -- ARM9ish, explain TLBs and other fun things. Maybe also a memory controller, depending on how the FPGA is, then add the init code to your bootloader.
  • Building an operating system(C, 2500) -- UNIXish, only user space threads. (open, read, write, close), (fork, execve, wait, sleep, exit), (mmap, munmap, mprotect). Consider the debug interface you are using, ranging from printf to perhaps a gdbremote stub into kernel. Break into subchapters.
  • Talking to an SD card(Verilog, 150) -- The last hardware you have to do. And a driver
  • FAT(C, 300) -- A real filesystem, I think fat is the simplest
  • init, shell, download, cat, ls, rm(C, 250) -- Your first user space programs.

Section 6: Browser: Coming online -- 1 week

  • Building a TCP stack(C, 500) -- Probably coded in the kernel, integrate the ethernet driver into the kernel. Add support for networking syscalls to kernel. (send, recv, bind, connect)
  • telnetd, the power of being multiprocess(C, 50) -- Written in C, user can connect multiple times with telnet. Really just a bind shell.
  • Space saving dynamic linking(C, 300) -- Because we can, explain how dynamic linker is just a user space program. Changes to linker required.
  • So about that web(C, 500+) -- A “nice” text based web browser, using ANSI and terminal niceness. Dynamically linked and nice, nice as you want.

Section 7: Physical: Running on real hardware -- 1 week

  • Talking to an FPGA(C, 200) -- A little code for the USB MCU to bitbang JTAG.
  • Building an FPGA board -- Board design, FPGA BGA reflow, FPGA flash, a 50mhz clock, a USB JTAG port and flasher(no special hardware, a little cypress usb mcu to do jtag), a few leds, a reset button, a serial port(USB-FTDI) also powering via USB, an sd card, expansion connector(ide cable?), and an ethernet port. Optional, expansion board, host USB port, NTSC TV out, an ISA port, and PS/2 connector on the board to taunt you. We provide a toaster oven and a multimeter thermometer to do reflow.
  • Bringup -- Compiling and downloading the Verilog for the board

fromthetransistor's People

Contributors

geohot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fromthetransistor's Issues

I'd play at home!

This would be a lot of fun. Links to resources / kits would be 🚀.

Oops not an issue, feel free to close :)

Clarification

Hiring is hard, a lot of modern CS education is really bad, and it's so hard to find people who understand the modern computer stack from first principles.

Hiring for what is hard? Building hardware, software or both?

It generally seems people/teams are more productive operating at higher levels of abstraction. IE: Why write something in C when you can finish it 3x faster in python? Given how hardware continues to follow the historical trend of becoming faster and cheaper, from one perspective it makes sense CS programs are focusing less on the lower level because even if the code is not the most efficient, hardware is cheaper than developer time and for most modern development the end user won't notice.

Given your time constraints, perhaps doing a writeup on how you learned these first principles would be very helpful for others looking to learn, as the resources are out there it's really the learning process that could be a force multiplier.

Is this real?

Will this become anything?

This is the education I have been looking for.

When?

Hey Geohot, when are you going to start, at least?

Implementations of this?

I'm looking forward to see someone who knows better than me giving advice: are there any working implementations of this curriculum assembly?

I'd be happy to participate. I'm into IT/CS/Programming since 2012 approximately, I think something like this would really cement my knowledge and understanding. If everything were tailored for beginners, I would still go through it, just in case if I'm missing something.

I'm always looking for the next big thing to learn, but there's just so many. I'm thinking of chasing a PHd in applied maths or electrical engineering, both for the sake of actually going deeper with computer science as an interdisciplinary field. But something like this could be a real gamechanger since it is more focused towards my interests.

Don't let this die.

@geohot If you are able to make an actual course/give resources for each part of this outline, I genuinely believe it will be better than basically any college out there. Your first-principles approach is something I've been looking for and what's lacking in most colleges. You seem to have been mostly "self-taught" and as someone who's relatively new to the computer world and has learned mostly on their own, I'm inspired. Please, make it happen! <3 (obviously not an issue.)

This or Nand2Tetris?

I did week 1 of this and then got completely stuck on just trying to get anything running with Verilator. I looked into this course to see if there are any existing resources online for it and a lot of people seem to agree to do Nand2Tetris instead, which I think is a good idea. I want to do this because I am a huge fan of George but this just seems way too advanced, time consuming and complicated for me right now.

Is it a good idea to do Nand2Tetris, and then come back to this?

Project Oberon

https://people.inf.ethz.ch/wirth/ProjectOberon/index.html

This book presents the results of Project Oberon, namely an entire software environment for a modern workstation. The project was undertaken by the authors in the years 1986-89, and its primary goal was to design and implement an entire system from scratch, and to structure it in such a way that it can be described, explained, and understood as a whole. In order to become confronted with all aspects, problems, design decisions and details, the authors not only conceived but also programmed the entire system described in this book, and more.

Stream

Did he make this project on stream? if so, can i get a archive link of it?

Do nand2tetris

I opened a issue a couple of months ago asking if I should do this or nand2tetris. I started nand2tetris and said I would talk about my progress here, first off I think nand2tetris was and is the best option between the two. It is completely free, teaches the theory in very minimal details first and then gives you a project to do next. You have 12 projects to build a modern computer capable of running Tetris or any other equivelant program.

There is a lot of content on nand2tetris, including a book, the website, a Q&A forum that is active and you can also get additional support on platforms like Stack Overflow and Reddit. I would seriously recommend doing nand2tetris, becasue Hotz is never going to do anything further with this. In the YouTube stream where this course was created, he does not mention any plans to develop it further. The whole point is to struggle yourself, and that is why I think nand2tetris is the better option. It has much more structure, has support online if you get stuck, teaches you more than this course since you go down even lower into logic gates and build your way up. If you heart is set on doing this course, then I would recommend doing this course after nand2tetris, since this course is so insanely huge and each week (apart from week 1) could be broken down into their own respective courses.

I also think its worth noting that Hotz himself did not self teach all of this, in his first apperance on the Lex Frideman podcast, he talks about how he learnt about how to build an OS in Haskell at univeristy, the same with compilers etc. Just keep that in mind if you want to do this course without any prior experience or knowledge.

Here is nand2tetris. I am having a great time with it and already feel like I have learnt a lot, also the nand2tetris HDL is so similar to Verilog that you can just do the implementations in Verilog anyway.

How realistic it is?

Do you really this that one could make hardware (CPU, controllers) -> OS kernel and drivers -> assembler, compiler and maybe complete toolchain -> TCP stack -> web browser, and all that in 12 weeks?

Software and hardware projects are known for underestimates when it comes to time required to complete them. When bugs start to crawl out, from poorly constructed foundations (hardware, OS kernel), made in hurry, it will be next to impossible to make web browser on top of those foundations in that time, IMHO.

FPGA Board

What FPGA board would be sufficient to do this course?

How did you learn?

I have a 10 years old son who is strong in math and likes physic. If I want to explain him how computer works, he starts to get sleepy. If I want to teach him how to program, he quickly gets bored. So my question is, how did you get motivated to learn the computer basics when you were young? Is your father an engineer, do you have friends who like to program or something?

My son is capable to learn computer science, but something is missing that stimulates him to get hungry for knowledge.
I found out he likes to build something that works. Maybe I'll have to build an electronic kit with him and than explain how it works. Or build a computer from pieces of RAM, MOB, HDD and so on, assemble them and make it work.

Sorry it's not an issue, well, it's in issue to me :P

Resources/Links?

Hey, sorry..not an actual issue, obviously.
This looks cool and was just wondering if there are any kind of resources/links for these that you'd recommend?
Thanks. :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.