[Script Info] Title: [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,>> ASHLEY WILLIAMS: All right there's some small tech work we need to do here here.\NStart the screen recording as well. Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,Computers.\NHow do they work.\NThere we G.\Nhi.\NMy name is Ashley.\NYou may know me as GW dubs from twitter and I'm coming you to you from not exactly the Rust community, but I work at this little company called NPM, which is keened of like the cargo for no JS, which is a runtime for this language that everybody loves to him but I really love Java scrip.\NDo I quite a bit television if node.\NI used to be a Ruby developer and I've even dabbled in Erlang, which is a super cool language as well. Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,I really love programming languages.\NPart of the reason I love programming languages, I really like to think about thinking.\NIn particular, the type of thinking that what happens people write code and this is personally, because my background is as a teacher this. Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,Kind of led me to influential called intermesos.\NI'm going to continue to say we, because it's a collaborative project.\NBut it's a teaching operating system.\NSo intermesos is a teaching operating system.\NFocused on introducing systems, programming concepts to experienced developers from other areas of programming.\NWe anticipate that you have probably programmed in something.\NBut it really doesn't matter away. Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,And in particular, the program of intermesos is for people whom system program suggest terribly not friendly.\NProbably the best way to say it is, do you know Java script?\NWhy don't we write an operating system together? Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,, Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,The origin of this project is because somebody, who will go unnamed but who looks exactly like their twitter "Avatar" accident asked me this one night.\NThey said, do you want to stay in and put on some comfy pants and do a neat Colonel tutorial.\NCircle yes or no.\NOh, heck yes I do, that's awesome want is like, let's get close to the metal.\NThat's what the real programmers D.\Nside bar.\NReal program suggest not a thing.\NSo definitely don't say that. Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,But I was ready to get close.\NThis is something, and I had this immediately, I thought oh, no.\NAn operating system.\NLike can I write an operating system and should I write an operating system.\NA question we don't often ask ourselves.\NAnd part of the reason I had this feeling is best tembest demonstrate by the this amazing website.\NOSDev.org.\NHas anyone been to this website?\NFull disclosure.\NThing website is horrible horrible.\NThis is the worse website.\NOne of the worse pieces of Internet I've seep and there are terrible things remember and the reason I'm so mad, this is the required knowledge page for OSDev.\NLet's take a look at some of things they state.\NSo basic computer science.\NYou need to be intimately familiar with hexahexades mal.\NWe'll see how much you know.\NSo no.\NWhat intimately you know.\NProgramming experience.\NLearning about program withing an OS problems is considered a bad idea.\NI feel like this term considered a bad idea or considered harmful is done and I'm done with as well. Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,But last but not least, fail tower comply will make you look silly. Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,, Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,[Laughter] Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,, Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,Okay.\NNow, I'm really take theming seriously.\NDefinitely, not.\NSo enter this tutorial that we happened upon on the Internet.\NWriting an OS in Rusts.\NAnd it's a series of Blog posts that take you from absolutely nothing, into an operating system that you are able Tex tend, however you'd like in Rusts.\NWhich is super cool.\NWhat's important is that it's the exact opposite of OS Dev.org.\NHey, you're not stupid because you don't know this. Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,We are not going to continue to refer to you read books that we don't actually list on the website.\NNo.\NWe're just going to be like air, this is what this thing S.\Nwhy don't do you.\NSo the real title of this Doc is I can operate a system and so can you.\NAll right.\NSo this is the treat I got when I got my operating system working.\NThis is my hello world from Rusts in my very, very small operating system.\NAnd what is an operating system near you telling me this thing with this tiny blue thing here, hello, world San operating system.\NYes.\NYes.\NActually, this is an operate system.\NIt is extremely small but it is indeed one.\NSo the question here is what is operate system and it's actually kind of a complicated thing, potentially, but the way I like to define it is, an operating system say program that provide ace platform for other programs.\NIt provides two things to these programs.\NAbstractions, and isolation.\NSo what do we mean by abstractions in I can get pretty come byia and go continental deep.\NAnd G everything is a distraction upon but we can talk about that at party.\NFor now, what I'm going to say is when you're thinking about the types of instruction that an operating system does.\NThat program runs on hardware A.\NThat's all fine and good until it turns out that we have hardware B.\NSo originally, a program is officially written for just hardware A.\NYou're not going to be able to support something like hardware B and the way you're able to support these sustick an abstraction in the middle here.\NSo that you can z operation system A is what we have the program for and praying A is what we're epiabled to distract.\NWe see other types of distraction when is we bring up the idea of a VM.\NSay into the write a program, but I don't want to write the program for any specific operating system.\NI want to be able to support multiple operating systems.\NIn this sense, we can write the program for a VM and that VM extracts the way the boundary between the program and the operators system, allowing you to support both, in a very similar pattern to the way operating system abstracts over that boundary with the hardware.\NNow, we have got to have a Patter here, it's abstractions all the way down, but we'll sit with these, I guess.\NThe Pat certain this. Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,I have A.\NA is written explicitly for X, but I want to support X and Y.\NSo I put an abstraction in the middle.\NNow, you could say this this is what we're doing in allotypes of programming.\NIn particular, this is what we're doing in operating systems programming.\NNow, the other thing that I said the operating system provide system icelation.\NSo isolation is a little bit more difficult to talk about, particularly, because it's very closely tied with extraction.\NI stepped to think abstraction and isolation are two sides of the piece of paper.\NI think the nice way to talk about T bring into the idea of intermesos title.\NConveniently, ending in an OS, intermeso meanness a light dramatic musical or other performance inserted between the angs of the play. Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,, Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,So as we saw before with abstraction, sort of should go in between, allowed us to be able to generalize over a lot things but additionally, it allowed us to separate things.\NSo these abstractions and isolations, come hand and hand in hand.\NThat's what we're doing when we're writing an operating system.\NSo the next question I have, is operating system much everybody's talking about a Colonel.\NWhat the heck say Colonel.\NAnd it turns out this. Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,Comes into the question of okay.\NWhat kind of operating system are we talk B.\Nso the definition I'm going to use for now is Colonel, is just the core component of an OS.\NAnd we can show that forever, but again, it is outside the scope of this talk.\NAs I said, there is this question.\NLet's write an operating system.\NWhat kind of operating system?\NThere's tons.\NI know if I mentiond to my parents, Oh, I'm running an operating system.\NThey'd be like, windows or Mac.\NAnd I'd be like, noo.\NNeither.\NNot anywhere close.\NBut it turns out when we're think going doing operating systems development as the thing to learn with, it really doesn't matter what kind of operating system.\NIn fact, this question is irrelevant and this is Y.\Nwe could waste a lot of time trying to design our perfect OS.\NAs people who only use operating systems, I'm sure we have things we'd really like it to have.\NSo we can sit down and dream in the clouds any any type ofs system we'd want.\NIf we did this, the chances are, we would never actually build it.\NWith intermesos and coding in gym, the goal here is to leadership, not to make the best OS that ever exited.\NThe type of operating system we're making right now does not super matter.\NAll right.\NSo let's talk about intermesos.\NWe're actually going to dig into a little bit of the code.\NSo for starters, there's a few prerequisites.\NAnd that's going to be some virtualization, so long as you're basically not using Linux.\NAnd a couple lip you can coincidies and a couple option that is make peering when you're peering into an operates system, easier. Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,, Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,While program and operating system is within your grasp much debugging is very hard on and I find building that operating system feels like coding in the dark.\NSo for virtualization, I started to build an operating system on a chrome book pixel, so this was a somewhat hostile environment for trying to build an operating system, and I very quickly found out, I was going need some sort virtualization.\NInteresting enough, nearly quell equally difficult was the Mac OS.\NOSX, Macro S.\NDon't quote me.\NIt's actually easiest to do this work on a Linux machine.\NBut what I use for doing the virtual situation is Vagran, development environment manager, which uses virtual box to virtualize machine and experts to forward graphics, which was one of the biggest problems, particularly when I was trying to do some of the chrome book pixel.\NSo this is, maybe I thought what was really amazing.\NOriginal Philadelphia inoperative tutorial, he had written it exclusively for Linux.\NMy name is now in the tutorial for being like, hey, if you're stuck in one of these environments, use this lady's vagrant file because you can be running up in a second.\NI'm like oh, my gosh, I'm in the big leagues, this is so neat. Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,, Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,Once have I an environment that's virtualized, you're going to need Linux dependencies, these are very new for me.\NBut Nasm is what we use as the assembler.\NTook the assemble ler and put it into binary and L.D.\Nwhich was a linker, made by the other files.\NThen we had grub.\NWhich we'll talk a little more later.\NBut that's the bootable ISO.\NAnd I don't know how to pronounce that one.\NChorizo.\NThat's not right, but I'm going to call it that now.\NFinally, you have Kimu, which I do know how to pronounce.\NI call it a fake computer emulator.\NWhich is pretty much exactly what it does.\NAll right.\NThen finally, we had a couple utilities.\NYou don't need these but they are super nice for viewing the generated code.\NIt's difficult to peer into some of these things, especially after assembled and compiled.\NI was excite that would I'm not the first person to mention [indiscernible] today.\NDid not anticipate that would come up in another talk.\NWe have hexadump and Ovs dump, which will allow you to view some of the code you're generating.\NAll right.\NSo one of the things I found the most tricky when think going develop ang operating system is like, I don't really, really know where to start.\NI need to ask myself the question.\NOkay.\NWhat are the tasks that the operating system needs to do?\NSo it turns out, I really needed to answer this question .\Nwhat happen when you say turn on your computer.\NAnd so I'm a huge fan of having a generalized journey, like, description.\NTo understand what's going on. Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,So in my mind, the way the things happen are, the hardware loads bio, which stands for your bisque input/output service.\NAnd bios loves grub.\NGrand unified boot leader.\NAnd I million a weird cater-P-type worm with a crown on it.\NThat's Grub for me and finally, Grub is going to be what loads our kernel. Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,, Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,One of the big things was linking and that is that L.D.\Nutility I mentioned earlier.\NWhat the linker does, is figures out how the sections of the input file should be matched in the output and should really the memory layout of the output file.\NIn intimacies on right now, the only thing you need tonight with linking is you have two things and you really need to make sure that one comes first.\NSo linking, just make sure the header inno no is up at the top.\NAnd we'll show that code in a second.\NSo speaking of show the code, now, it's time to do the temO.\Nthis is where I hope you all show me your hexadecimal skills.\NI'm ready and excited for that. Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,So let's pop this open.\NSo I already have this.\NHow are we doing on slides for that?\NCan everybody see?\NPretty good.\NOkay.\NFantastic.\NSo right now, I'm here in vagrant and we have mellow -- oh.\NI'm turning that off.\NThat's horrible.\NAll right.\NSo here are the file that is we have.\NSo just to talk quickly about what we have in here, the first file is multiheader.asn.\NIt's going to say, hey, I am something you can load with multi food.\NSo this is the thing that Grub needs to see to see it knows how to note T.\Nsecond thing that's important is this boot.asm.\NThis is going to say, okay, grub, you know I'm the best thing can you use with multi boot.\NWhat are you going to do once I get booted?\NAnd here, we have the linker.LD file.\NThat's saying in there just make surety header comes first.\NIf Grub doesn't know what I am.\NWe're already in trouble.\NSo what I want to point out here, let's take a look at the boot file.\NSo here is some very lovely assembly here.\NAnd so what we can see is we have all of these move word statements.\NSo let's break down what these mean.\NSo move is going to be the instruction.\NWord is the size and then it is next thing that comes is the pointer to where we are going to put it in memory.\NThen we have this little concoction right here.\NWhat happens here is the first two characters are going to describe the foreground and background color that we would like to display on our screen.\NThen the next is going to be the character that we're showing.\NSo just to show you what this ends up looking like.\NTurn that off.\NI am so sorry.\NIt says off.\NCan't account for T.\Nso what we can do here, we can say make run.\NAnd this is going to pop this up.\NAnd here, in the Corner, we can see that it says hello world.\NThis is an operating system.\NYay! This is really cool. Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,, Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,Now, let's go to where we can get it to say, hello RustFest. Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,Does anyone know off the top of their head what capital R is?\NAn ASCII.\NOh, want that's Borg.\NWow.\NTough crowd.\NI would just like to point out that nobody is jumping to say what this character S.\Nso your deep knowledge of hexadesimal is make me sad.\NI have this baked in my important secret speaker notes.\NSo these letter vs.\NChanged.\NBut let's just take a look and see what this ends up saying.\NWe can say run.\NSo it says, hello rest fian ...\Nwhich is almost close little but it turns out writing all of this assembly, isn't, you know, I mean, it's cool.\NYou can wake around and say, ah, writing assembly and everyone's going to be like, I don't know what that is.\NBut I bet it's awesome.\NBut nobody really want a program like this. Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,And here's the deal want the level of fail I can have much I can have this cheat sheet if I type out some numbers the it'll be a mess and turns out the error immensely aren't error manies, it would just not work or it would print something random and it would be really hard to debug.\NWhat happened was relatively complicated and we had a pretty fine grade control over what we were doing.\NSo we had the bioload that boot loader grub.\NFrom the virtual hardware and boot loader read and found that multi boot header.\NAll right.\NI can do this.\NThen it copied the boot and text sections that were inside much that, to some of course specific memory addresses and it jumps to this industry point and that's when our Colonel prints the message, this is pretty cool.\NNow, in order to go from this, to Rust.\NHave you to do this tricky thing which is called jumping into long mode.\NWhat we were just writing we were in 32 bit.\NWithout having to do quite a bit of hoop jumping, you're going to want to be in 64 bit mode.\NTo actual how to jump into long mode would be way to long to show next year.\NNext year F someone wants to show, how to jump into long mode, thwack be a 30-minute talk.\NIt's not that it's hard.\NIt's really tedious.\NYou have to create this table and shifting a bunch of things over.\NIt's like reorganizing.\NBut I do think what could be interesting is to take that assembly and refactor it, using Rust so we could now have a hello world from our rust program.\NAnd so we can jump back in and I'll click this.\NAnd I'll go into hello Rust.\NSo sorry.\NAnd similarly, we have like, well, I'll clear this here.\NWe have something that looks relatively similar to what we had before.\NWe do have a bunch of stuff that jumps us into long mode, which we haven't extracted away. Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,But what we can see is if we hop into our lib do the s.\NThis is printing hello world for us.\NSo let's walk through what this code is actually doing.\NI should put some numbers in there for us.\NI have my K name.\NInside what, I'm able to do, I'm able to grab the characters as bites by putting the B before hello world.\NSo this is the many I'm going to be printing right here and then I define the color I want to use here, using 1 and F.\NThere's actually a whole bunch of different colors can you use.\NThat I can quickly show.\NThese are the color option that is we have.\NActually, a pretty good set.\NSo we can play with those in a second.\NBut then what I do, I create a mutable array, and I just automatically fill that entire array with what I want the color to be.\NAnd the length of that array needs to be double the size of my message because for each letter what I need to say is the foreground color, the background color, and the two-character code for what the letter S.\Nonce I create that array, then what I do, Iityer 8 through it, and for every other in that array, I replace the color code with the character code that I would like.\NThen finally, I create a buffer pointer, and I set that to the message.\NAnd that many is an array with alternating color and character codes.\NThat is unsafe because we are just writing to something in memory.\NAnd that's extremely dangerous.\NDon't recommend doing it.\NThe computer doesn't know how to break at this point.\NBut it's definitely not something it would let you do.\NIf it knew, it would tell you, definitely don't do this. Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,, Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,Finally at the end, we have this loop here.\NWe don't want it to just immediately shut off.\NWe want it to stay up.\NAnd so F we take a look here.\NMake run and we can see tait says hello world here employed now, we can change this significantly easier in the Rusts code.\NI don't need a cheat sheet ton what the characters are.\NInstead, I can go to my passage and change it to say hello RustFest.\NWhoever thought I would be doing something -- I feel like I'm doing a little CSS in Rust, which is pretty strange.\NAnd I'm actually a big fan of the bright blue color.\NIt looks more like the logo.\NSo I am going to set that instead.\NSo then I can shave that.\NHop in here.\NAnd oh.\Nthe demo gods are not a fan of me.\NLet's take a look what the heck happened.\NDidn't I actual about the errors you get in doing this?\NIt's very fun.\NAll right.\NOh.\Nright.\NExcellent.\NI love teaching want it's like pair withing 200 people.\NBecause that's always fun.\NSo the character, so what's interesting is that if you make the array too big T prints like these cute triangle bus turns out F.\Nmake the array too small T transfers a lot horrible text in your editor, when you're giving a talk in front of a whole bunch of people.\NSo since you're all paying so much attention.\NWhat should the length with. Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,, Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,So we need it to be double.\NDouble the length here.\NWith we'll check do you want say, 42.\NWe'll say make run.\NThere we go.\NYay.\NOoh. Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,, Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,[Laughter] Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,, Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,That's fun.\NThis actually plays perfectly into the whole point.\NDoing this is just something that's like, a fun exploration, not cute triangles this time, we have got some F's.\NThat's cool.\NYay.\NAll right.\NSo what just happened is this a lot things, include something whole area code mistakes.\NFundamentally, what I was doing is creating this big array and filling it up with colors, and ultimately, I would put letters in there and I put that as a piece of data, and I assigned it to the pointer and that's what made it print to the screen.\NNow, something I would love to do is in that room where I'm keeping everything open, that's no reason I can't gist print tons of different things to different parts of the screen, you could have annex plosion of RustFest all over screen.\NYou can crash your computer doing that, but it might be really fun any way.\NI was told this was way too complicated of a way of trying to do this.\NIf I really wanted to demonstrate T instead of doing this whole loop shenanigans, I should just have written it out one by one the way I did it in the assemble least I don't really care.\NIt's like, super fun to write and joy I felt whennic get N incredibly, at least what I believed, complicated set of build tools to finally print some tiny word to the screen.\NI was like, okay.\NThis is really, really fun. Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,, Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,So I kind of want to leave you all with this many which is that this is from Leslie Lamp owe rt.\NHe wrote a presentation called "Writing for Programmers" and this cartoons, "writing nature's way of letting you know how sloppy your thinking is." and I've been in my talks before, kind of reappropriating this, to teaching is nature's way of letting you know how sloppy your understanding is.\NAnd if anyone here has ever been a teacher, teachers in the room, not enough.\NLet that be the lesson if anything.\NIf you ever want to know how little you know about something, try and explain thank you to somebody.\NAnd you'll be surprised.\NBeginners ask extremely difficult questions that are very hard to answer sometimes.\NSo what I want to say is go write some irresponsible code.\NWrite a tiny operating system that does something it is or could have and he go teach somebody else to do the same thing.\NYou're probably going to end up learn seeing much more, just from that exploration and teaching experience alone, than following any sort of terribly structured tutorial.\NAnd even though the RustFest tutorial are good, you should stray from that and do some super goofy things.\NIntermesos has gotten you out of this kind of how to get started part.\NSo intermesos is ready for people tow take a look at this, and extend it to Rust Bridge.\NIt's already started for you to have RustFest connect to T.\Nit's only nine months old, which is an awkward amount of time.\NBut any way, it's interesting.\NWe have 12 contributors.\N233 commits and 444 GitHub stars for those who care about GitHub stars.\NThere's only 12 contributors but there should be more.\NIt's a very extensible thing.\NCan you build out your own little things on it and they can all work together. Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,, Dialogue: 0,9:59:59.99,9:59:59.99,Default,,0000,0000,0000,,I also want to centers the fact you don't have to contribute code to contribute to intermesosF.\Ntake a look at the book, which is the comp pannian to the Colonel's code base, we have 47 contributors with around the same number of commits.\NNot as many GitHub stars.\NBut that's because GitHub fan boys are not really into books.\NWe want to contribute into intermesos and doesn't matter who you are.\NWe think you're really great and there's a very good chance have you something to contribute.\NIf you failed to comply with what the general people think a real OS developer should be, yeah, you will look silly but that's like a super good thing, I think.\NSo I can operate a system and so can you.\NThanks so much.