8 ms·
Hi! I'm Lexi, I wrote this article/mini-book. There's a classic question of "what happens when you load a website?", but I've always been more interested in "w
by archmaster 3y ago
Hi! I'm Lexi, I wrote this article/mini-book.
There's a classic question of "what happens when you load a website?", but I've always been more interested in "what happens when you run a program?". About 3 months ago, I was really annoyed at myself for not knowing how to answer that question so I decided to teach myself.
I taught myself everything else I know in programming, so this should be easy, right? NOPE! Apparently everything online about how operating systems and CPUs work is terrible. There are, like, no resources. Everything sucks. So while I was teaching myself I realized, hey, I should make a really good resource myself. So I started taking notes on what I was learning, and ended up with a 60-page Google Doc. And then I started writing.
And while I was writing, it turned out that most of the stuff in that giant doc was wrong. And I had to do more research. And I iterated and iterated and iterated and the internet resources continued to be terrible so I needed to make the article better. Then I realized it needed diagrams and drawings, but I didn't know how to do art, so I just pulled out Figma and started experimenting. I had a Wacom tablet lying around that I won at some hackathon, so I used that to draw some things.
Now, about 3 months later, I have something I'm really proud of! I'm happy to finally share the final version of Putting the "You" in CPU, terrible illustrations and all. I built this as part of Hack Club (https://hackclub.com https://hackclub.com), which is a community of other high schoolers who love computers.
It was cool seeing some (accidental) reception on HN a couple weeks ago while this was still a WIP, I really appreciated the feedback I got. I took some time to substantially clean it up and I'm finally happy to share with the world myself.
The website is a static HTML/CSS project, I wrote everything from scratch (I'm especially proud of the navigation components).
I hope you enjoy, and I hope that this becomes a resource that anyone can use to learn!
- iancmceachern 3y agoThis attitude and ability to execute on your vision will serve you well. Excellent work, stay awesome
- amelius 3y agoIt's a bit dated but perhaps you should check out Structured Computer Organization by Andrew Tanenbaum.
- archmaster 3y agoOh, thank you for the suggestion! I of course know of Tanenbaum by reputation but I've never read the book.
- freedomben 3y agoI've read a couple of Tanenbaum's text books, and they are fantastic! My biggest regret is not playing along with the minix examples, but I didn't have a computer while I was reading the book.
- mgaunard 3y agoI haven't done the research, but I can't believe most of the information could be that hard to find or wrong, at least if you know where to look. These sorts of topics are usually well-covered in the matching undergraduate-level computer science courses (computer architecture and operating systems, which, these days, are mostly optional since out of fashion). Several universities have free courses available, and some of the professors in the field have also written books. You'll also find pretty informative presentations in the relevant tech conferences if you'd rather stay closer to the state of the art. Still, teaching is an art that is undervalued, and making the information more available or more fun to interact with is certainly very valuable.
- archmaster 3y ago"Wrong" is perhaps not the most accurate word. I most often found information to be either extremely oversimplified such as to be unhelpful, or outdated and no longer relevant for current systems. Although, yes, some things were just wrong. There are courses and presentations and books, but there aren't many websites or articles — and that's the learning style that works best for me. Undergrad programs will teach a lot of what I covered (though certainly not all, and it really depends on the program) but I believe that knowledge should not be gatekept on going to college.
- assbuttbuttass 3y agoUltimately, diving deeper with only websites and articles can be quite challenging. I experienced this myself trying to learn more about the continuation passing style transformation in a compiler. No online websites or articles discussed the topic with any kind of depth. Ultimately I read the classic book "Compiling with Continuations", and it basically cleared up all my confusions. All of this is to say, don't discount books and courses. They will almost always be more in depth and correct than what you will find written up on a website.
- archmaster 3y agoI think you are very correct, and I don't like it. There should be more "online books" that are in depth and correct!
- kriro 3y agoI only browsed this but it seems like a pretty cool primer. Loving the style as well. It's also a very good idea to write these types of resources when you teach yourself something new because it clarifies your thought process and helps you identify parts that are still unclear even though you initially thought you understadn them etc. I also liked this at the end: """ I talked to GPT-3.5 and GPT-4 a decent amount while writing this article. While they lied to me a lot and most of the information was useless, they were sometimes very helpful for working through problems. LLM assistance can be net positive if you’re aware of their limitations and are extremely skeptical of everything they say. That said, they’re terrible at writing. Don’t let them write for you. """ Congrats, cool project.
- archmaster 3y agoI'm glad you enjoyed it! > It's also a very good idea to write these types of resources when you teach yourself something new because it clarifies your thought process and helps you identify parts that are still unclear even though you initially thought you understadn them etc. I found this to be very much the case. As I wrote the article, I discovered so many things that I didn't properly understand. It partially took so long because I ended up going down mini rabbit holes every step of the way. And now I understand stuff a lot better!
- II2II 3y agoExcellent work. I have run across so many resources where it is clear that they author was both a learner and had little interest in going back to improve their work for clarity and accuracy. Your work is clearly several leaps beyond that. It is clear and the portions I have read are accurate. It leaves me wanting to go back to read more and I am confident you won't disappoint. Thank you for your contributions and I wish you the best in your future endeavours.
- Projectiboga 3y agoSubmit this with any College applications and for any computer work while in school.
- simonw 3y agoI haven't read the whole thing yet, but initial impressions are that this looks GREAT. Being able to communicate concepts like this well in writing is a rare skill, it will serve you very well in your future career.
- archmaster 3y agoThank you + I hope you enjoy! I would really appreciate your feedback if you finish.
- cxr 3y ago[removed] 1. <https://manybutfinite.com/category/internals https://manybutfinite.com/category/internals>
- archmaster 3y agore Figma: that's a good idea, I can definitely include SVGs I'll check out Gustavo Duarte's posts!
- phillipcarter 3y agoThis is a great website! Really enjoyed reading it this morning. I wish I had something like this to supplement the really dry textbook I had to read in Operating Systems class in college. Reminds me a bit of Learn You a Haskell for Great Good, which was similarly an excellent supplement to the dry textbook: http://www.learnyouahaskell.com/ http://www.learnyouahaskell.com/
- archmaster 3y agoI am a big fan of Learn You a Haskell! Was absolutely lovely when I was learning FP.
- linhns 3y agoFor those who haven’t bookmarked this, do it immediately. I actually did not like it at first but as time goes by I just realized it is awesome. And it’s free!
- halosghost 3y agoOthers have already mentioned how high-quality this is, but I feel the need to reinforce it. The content is excellent, the framing is smooth, the presentation is accessible, and gorgeous. And beyond all that, you also ensured that the generated PDF is high-quality. I'm incredibly impressed. Keep up the great work, but most importantly, hold on to your passion and care! All the best, -HG
- archmaster 3y agoGlad you like the PDF! Fun fact: it's actually the print stylesheet output of the one-pager edition. Hit Ctrl-P on https://cpu.land/editions/one-pager https://cpu.land/editions/one-pager (pref. in Chrome)
- lostlogin 3y agoThat one-pager button is great.
- corbet 3y agoI can't resist pointing out that LWN (https://lwn.net/ https://lwn.net/) has been dedicated, for many years, to the production of operating-system information that is not terrible. Have a look, and perhaps consider joining us :)
- archmaster 3y agoLWN is one of my favorite websites. I learned more from LWN articles (probably mostly yours lol) than most other resources on the internet when researching for my article. I actually quoted you from 19 years ago! https://cpu.land/epilogue#bonus-tidbits https://cpu.land/epilogue#bonus-tidbits
- cbsmith 3y agoSame.
- dudus 3y agoOP should reach out to LWN. This content would be a great addition.
- replwoacause 3y agoThis is beautiful work. You have a very bright future ahead.
- EGreg 3y agoI love it! And also the natural humor that comes with writing as a 17-year-old. When I was your age I wrote this column of articles on FlipCode, about game development: https://www.flipcode.com/tpractice/ https://www.flipcode.com/tpractice/ (If you check it out, I’d love to know your opinions). Also, I wonder what are your local state laws about hiring a 17-year-old to work on open source stuff as an intern. I checked out your github and think you might enjoy part-time discovering what we build. Here is the codebase: https://github.com/Qbix/Platform https://github.com/Qbix/Platform
- EGreg 3y agoApparently the URL needed updating: https://www.flipcode.com/archives/Theory_Practice-Issue_00_Introduction.shtml https://www.flipcode.com/archives/Theory_Practice-Issue_00_I...
- fhools 3y agoHey great work you did there. I'd also like to recommend nand2tetris and its companion book Elements of Computing Systems. If you'd like to dig deep into how a cpu is actually elemented via HDL.
- skeeter2020 3y agoI agree this would be a great addition. If I had a minor complaint about the work presented here, it's that it starts "in the middle"; pushing down to CPU OpCodes without describing how the ML codes are actually defined. It's typically easier to understand if you start at either the very top (like how does "Hello, World!" actually get executed?) or very bottom (though I'd argue you could stay above the physics of semi-conductors, at the chip level).
- jonhohle 3y agoIf you haven’t looked, older game consoles (Genesis, Game Boy, etc.) can provide a very good introduction to how systems are built - how devices are mapped to memory addresses, how CPUs initialize and get different entry points for the program, interrupt handlers, etc.
- xivusr 3y agoYou've found your calling! Keep up the amazing work.
- hansoolo 3y agoHi Lexi, pretty cool project you finished there! Congrats! I was a little confused about how you only talked about the sources on the internet are kinda poor. But I didn't see any comments about books for research... Did you use any? Can you recommend some on this topic?
- 89vision 3y agoYour github is really interesting. It seems like you have a bright future ahead of you. Do great things.
- rolph 3y agojealousy, thievery, exploitation, are all things that throw themselves at young talent. be warned, here,there be dragons!
- __MatrixMan__ 3y agoI like that you pointed out the "research posture" in your first image. A tip from somebody who is not 17: it's good to have many different research postures. Staying in one of them for too long will give you trouble later on. Took me way too long to figure this out.
- findalex 3y agoI saw how straight the stick figure's back was and laughed out loud to myself.
- kylehotchkiss 3y agoHi Lexi. I love seeing 17 year olds taking a deep dive into tech. You chose a great field and have a great career ahead! Keep up the good work - stay curious, work on personal projects. It gets a little harder to find the time as you get older and you'll look back on the things you're doing now and feel satisfaction for it.
- SilasX 3y agoOh wow I think I found my intellectual doppelganger! I run into this problem a lot, where I try to learn something simple but it quickly balloons to the point where the answer is in a hundred pieces due to missing context and bad assumptions about the reader. I went through this same process but for Bitcoin, culminating in writing the Understanding Bitcoin book[1]. I also saw this dynamic in the cryptopals challenges, where I thought the hardest problems were "look up this off-the-shelf cryptosystem and implement it", not "find a flaw in that system you reimplemented with only a few hints.[2] Like others, I recommend nand2tetris as having answered a lot of the questions I had. It has you implement the hardware of a computer that can execute the program loaded in its memory, from the logic gates and flip-flops up. Then, you implement a compiler that can translate high-level Java-like code into binary. (First to a virtual machine, then assembly, then binary.) Of course, even then it leaves caps: it's a deliberately toy system, it can't handle programs longer than its memory, the machine does only one-shot programs (and thus can't handle a programmer creating a program live and having it be executed). But it answered a lot of my questions, like how to make memory work, and how function call/return work. [1] http://understandingbitcoin.us http://understandingbitcoin.us. [2] Previous comment about it: https://news.ycombinator.com/item?id=36398627 https://news.ycombinator.com/item?id=36398627
- minton 3y agoIt makes me happy to see the future generations refusing to accept the magic of it all and instead pulling back the curtain. Excellent work! As a side note, once OpenAI slurps up your work, the next ChatGPT might not have to lie so much.
- linhns 3y agoI haven’t gone through everything but this is looking much better than anything universities can produce. First time I feel that I can go through all of these content and want more. What a brilliant job you’re doing here. Keep it up and you’ll have a wonderful career.
- munificent 3y agoThis is very, very well written. Congratulations on making (and finishing!) such a good resource!
- RamblingCTO 3y agoI just read the first chapter and it reads very very nice! Wish I had that back in Uni haha. Well done, keep on going! Computers are indeed simple and complicated at the same time. /e: this was also a trip down memory lane to my time at Uni and why I fell in love with compsci. It's so inherently beautiful and clever, every teeny tiny bit of it. I also had a great book when starting out: "Einführung in die Informatik" from Gumm/Sommer (my professors), written in German. They explain round about everything on a basic level in round about 900 pages. Think about how far we've come in the last 15 years, wow! I feel very sentimental now haha
- zahllos 3y agoI've only skim-read your articles so far, but it looks excellent. Congratulations and please keep doing work like this. I previously worked as a research engineer (a fancy name for a software engineer working in a university lab, in my case doing computer security research) so believe me when I say there are graduate students who don't have your grasp of operating systems (see the comments elsewhere on OS courses being optional). > Apparently everything online about how operating systems and CPUs work is terrible. Unfortunately finding good information is not easy, but it is out there - you've proven it by synthesizing some of that hard to find information into a better form. My degree is in mathematics, but my computing knowledge is self taught. Knowing how to learn in this way and to be able to communicate highly technical information in an approachable manner are incredibly important skills and not to be underestimated. I have two links to share - I limited myself to two because we could be here a long time otherwise: 1. https://git.lain.faith/sys64738/airs-notes.git https://git.lain.faith/sys64738/airs-notes.git (TOC for linker part here: https://lwn.net/Articles/276782/ https://lwn.net/Articles/276782/) - you've scratched the surface of ELFs and linking. This is a 20-article blog series by Ian Lance Taylor plus miscellaneous extra topics containing everything you ever wanted to know about ELFs and quite a bit that will likely make you wonder how any of your commands are actually even working! There's even a brief mention of ELF's companion, DWARF, which amongst other things is a virtual machine used every time a C++ exception is triggered. 2. Have you seen this excellent project? https://0xax.gitbooks.io/linux-insides/content/ https://0xax.gitbooks.io/linux-insides/content/ - essentially a human-readable walkthrough of how the Linux kernel does stuff. Has almost certainly been shared on HN before.
- mananaysiempre 3y ago> https://git.lain.faith/sys64738/airs-notes.git https://git.lain.faith/sys64738/airs-notes.git Oh, that’s awesome, it even has some things transcribed from Fengrui Song’s blog (https://maskray.me/ https://maskray.me/) as well—I sometimes feel like it’s the only place where some particulars of binutils(-compatible) behaviour are documented (I don’t come there for the generalities, though, like GP is seeking). I only wish there were more of these transcriptions :)
- trogdor 3y agoHaving read the first couple of pages, my only feedback is a strong suggestion to drop the cutesy language. >The central processing unit (CPU) of a computer is in charge of all computation. It’s the big cheese. The shazam alakablam. It starts chugging as soon as you start your computer, executing instruction after instruction after instruction. Given the context, that would read much better as: >The central processing unit (CPU) of a computer is in charge of all computation. It starts chugging as soon as you start your computer, executing instruction after instruction after instruction. I’m not super-technical, but I do get paid to write. Your work here is great. Keep it up!
- cbozeman 3y agoShe's a 17 year old girl. I'd be more worried if the language wasn't "cutesy". Lexi, don't change a thing. This document you've created encompasses who you are right now and more importantly, where you are in your technical journey and understanding. The tone is just fine the way it is. If you're compelled to "fix" something, just correct errors and call it a day.
- depressedpanda 3y agoYou both have a point. "Cutesy" language may act as a distraction to the reader, and -- like anything when overdone -- can be detrimental to the text. Kill your darlings and all that. _However_, if something isn't supposed to be a terse reference manual, it will convey a lighter tone and seem more approachable to most people, if used judiciously. I don't think anyone has enough experience at 17 to know where to strike the right balance, so overdoing it (and being called out for it) is just part of the journey of becoming a better writer while finding your own personal style and tone.
- deleted 3y ago[deleted]
- trogdor 3y agoI commented on this because I had to stop and sound out the word "alakablam." Simple writing wins every time. Better to learn that as a teenager than as an adult.
- patrickscoleman 3y agoHi Lexi, this is Patrick. I remember you from the replit community when I was working there a couple years ago. This is amazing work. So cool to see you continuing to chase your passion. Wherever it takes you, I’ll be rooting for you. Happy coding :)
- c_s_guy 3y agoIs there an equivalent article for "what happens when you load a website?"? If it's written anything like this one, it'd be super helpful and I'd love to read it!
- AndrewKemendo 3y agoWe Will Watch Your Career With Great Interest
- astroalex 3y agoYou have a gift for writing and teaching technical concepts. I think you could make a serious impact on computer science education if you pursued that as a career. Congratulations on finishing this mini-book!
- thiht 3y agoImpressive work. I usually don’t comment on « I’m xxx years old and did yyy » because I’m not interested in material that would be « good/great for an xxx years old ». In this case, this is great work, period. Adding « for an xxx years old » would be insulting. Some sections remind me of the material of my college courses, which were quite extensive as my degree historically had a dual electronics/software specialization. > Apparently everything online about how operating systems and CPUs work is terrible. Agree with that! As a pro tip, when online resources are scarce for a subject, try adding keywords to find college degree resources (slides, websites, homework, etc.). The material is usually badly referenced on Google, but can be pretty good depending on what you find.
- Zild 3y agoI browsed through it shortly but it is impressive. When it comes to existing resources, the boring university classes can actually be navigated online. For this topic CS-152 from Berkeley could be a nice followup (https://inst.eecs.berkeley.edu/~cs152/sp23/ https://inst.eecs.berkeley.edu/~cs152/sp23/) and there's a CPU design project in CS-61C that should cover everything you learned if you want to apply the knowledge to a concrete design.
- loveiswork 3y agoLexi, this is amazing! I am 33 and I still don't know ANYTHING about how a CPU runs a program. Appreciate you injecting your own style into the writing. After a decade in the industry I'm sick of soulless reference materials.
- city_guy_1 3y agoWell done! It reminds me of my OS textbooks. The ending graphic with the bird yelling about E gave me a good belly laugh
- WentFullRetard 3y ago[dead]
- jcarrano 3y agoFirst if all, congrats. > Apparently everything online about how operating systems and CPUs work is terrible Then it is time to head for the books. Most of the stuff in the web is not organized and coherent. In particular, the "basics" (whether is CPUs, machine learning, etc) are seldom explained.
- kirse 3y agoThere are, like, no resources. Everything sucks. Before Web 3.7+ us self-taught hackers often had to learn out of books, in the dark ages these were basically compilations of actual printed paper and not even a single TikTok video in sight. No likes or subscribes to the authors either, you had to go to a place that freely stored all these books and find the authors using a catalog of paper index cards. Check this one out sometime: https://www.amazon.com/But-How-Know-Principles-Computers/dp/0615303765 https://www.amazon.com/But-How-Know-Principles-Computers/dp/... Exceptionally well done though, keep up the great work.