Tác giả giữ toàn bộ bản quyền (All Rights Reserved) — không phải giấy phép mở. Bạn vẫn xem và học miễn phí trên OpenER; muốn tái sử dụng cần xin phép tác giả.
[MUSIC PLAYING] BORA NIKOLIC: Hello there.
Welcome back to our new module in 61C in which we are going to cover the basics of operating systems and understand how does the virtual memory work.
Okay, so let's get into it and orient ourselves.
In the three shown picture of machine structures, we have been dealing with the instruction set architecture, and we approach it with both sides, from the software side and from the hardware side.
Most recently, we understood how does the processor work and how does it work with the on-chip cache.
What we are going to do now, we are going to add some more stuff around it. First, we are going to add the operating system.
We will see basic functions that are needed to run Linux or Mac OS or Windows and then, talk about the input and output to our computer.
And then, we are going to extend that to cover how do we work with the memory, especially, how does the main memory work together with the storage.
Okay, so if you take a look into our picture of New-School Machine Structures, we are now dealing with the way how we would support parallel threads in our computers, as well as with the topics that are related to the main memory.
And also, very importantly, now we are revealing the complete picture of the locality and memory hierarchy. So, we see the whole pyramid now. So, we're going to fill it in.
We looked in our caches. And now we are going to really understand how does the physical memory, in this case, DRAM, work with SSDs and the magnetic disks to implement the virtual memory.
When we are done with that, we'll have this complete illusion of infinitely fast and infinitely large memory. So, let's recap one more time where we are so far.
In 61C, so far, we started with C. And in Project 1, we built a relatively small, but fun and effective, C program.
Then, in Project 2 in this course, we started RISC-V assembly, and we built another project.
In there, in Project 2, we built our RISC-V assembly, a functionalities V assembly program. Then, in Project 3, we built the data path for our RISC-V processor.
And now, conceivably, pretty much any of the C programs that we have written or the assembly programs can run on this data path.
We have extended that to add the cache, to improve the performance, and be able to run fairly complex programs on our data path. And then, we conceptually introduced memory.
But we didn't really go in depth of the memory. That's what we are going to do now.
But we have built a lot of really cool components, but we really haven't built a computer. Let's take a look at a real computer like a laptop.
How is a laptop different than what we have built so far? Well, the laptop surely does have a processor and has memory and has cache.
But it has a few other things that makes it a lot easier to run a C program, to enter a C program and to see the results.
Well, namely, it does have a screen display where it can output the results such that we can conveniently view them.
It has a keyboard that enables us to enter things, to input things into our computer. And it has storage. It has disks inside. In more modern computers, it is typically a solid state drive.
In some more older ones, we will typically encounter magnetic hard disk drives. So, what we need to do in this module are a few steps.
The most importantly, we are going to take a picture that we are reasonably familiar with now, and we need to add input/output first to that.
So, we are going to study, relatively briefly, but hopefully effectively, how do we add input/output devices to our computer.
And that will provide a uniform way to hook up our screens, keyboards, and storage. So, that's what is going to happen here.
We are going to see how does the memory DRAM work. And then, how do we add storage and how do we work with the I/O.
Besides full-fledged laptops, there are many other, simpler computers that are around us. There is a number of them that are called single board computers.
And one of them that is particularly popular, that really opened up this space of single board computers, is the Raspberry Pi. So, you can buy a Raspberry Pi.
I have very many of them. Here is a Raspberry Pi 4 that you can buy for $35.
This one has a little bit more DRAM on it, so it's a little bit more expensive, 40-something dollars. And you'll start noticing familiar things on it.
There is a processor on it. And I'll click here. Processor is the silver thing in the middle. There is a DRAM chip next to it.
And I put some thermal glue on it because I was using this one. This black chip is the DRAM. And that's our main memory, that rectangle that we have been showing so far.
That's our memory. We are going to see how do we work with that. Then our storage is going to be a flash card here.
We don't really have a solid state drive, although we could hook up a solid state drive to it.
But the main memory here is a flash card like the one that we use in cameras or music players and so on.
Then it's called a secure digital card or SD card in this case. It's based on a so-called flash memory. We'll talk a little bit more about that.
Then there is a screen I/O. We can hook up screens to these two HDMI ports. We can add I/O in the form of a serial bus.
There are four serial I/Os in your universal serial bus type. We can add wired ethernet to it. This thing supports wired ethernet.
And finally the, silver chip is essentially Wi-Fi. So, we have Wi-Fi and Bluetooth connectivity as other types of I/Os.
So, we're going to take a look into the ways how these things actually do hook up to our processor. And the picture is going to be fairly straightforward, hopefully, and uniform.
But when we do that, when we add our I/O to this fairly simple single board computer, we have a real computer.
I mean you can actually run this class, learn this class just by using a Raspberry Pi.
In this setup, what we have, we have a Raspberry Pi with two screens, a keyboard, and mouse connected to it.
And it runs Linux, a form of Linux and a whole bunch of applications that go with that.
Even more than that, you can actually learn computer architecture by examining things and running all the labs, or many of the labs, on Raspberry Pi.
There is actually a really good textbook that I really like that goes slightly below the level of what we cover in 61C. This is the book that is Learning Computer Architecture with Raspberry Pi.
And by the way, you can, if you're a Cal student, you can download it for free from this address. We are subscribed. Our library has infinite numbers of online copies of that book.
So, feel free to take a look at it and browse through it. We are not using it in this class, because again, conceptually it's a bit lower level.
And it is ARM based, so it's not as open as we would like it to be. It's a little bit harder to build ARM type of processors.
Our labs would have been a lot more complicated, would not have been able to accomplish as much. But it has a really good treatment.
The book has really good treatment of how do you deal with these I/Os and memories and so on.
And how do you see the computer from the application's point of view, OS's point of view, and how do you run things? How do you hook up these input and output devices?
And there is a number of cool, simple experiments that are in there.
One day, when the single board computers that are based on RISC V are more affordable and more widespread — There are some, but they are a bit expensive if they're in this class.
Or if there are a lower class, they don't just support exactly what we need beyond what we are doing in this class.
When these become a little bit more widespread, I am sure we are going to see labs that are based on that. So, check it out for now.
So, there's another glitch here, another quirk that we didn't quite cover.
What we have done so far, it's not really quite the same with what we are seeing on the Raspberry Pi computer or any other computer.
The screen in Raspberry Pi looks a lot different than what we get out of our VENUS. In VENUS, we just ran relatively short programs. But we always ran a single program.
We could make it a lot bigger, a lot more complicated, but it was always just one computer. But our computer runs many programs at a time.
A real computer runs many programs at a time.
And what we'll do to try to convince you that changes to the hardware are minimal to be able to do this, this whole thing is just software.
Hardware is pretty much there, a few minor things that need to be added a bit here and there. And that magical software that does that is the operating system.
So, we're going to get into the functions of the operating system just after a quick break. See you then.
Đăng nhập để đánh giá học liệu này.
Đăng nhập để bình luận — chưa ai bình luận về học liệu này.
Không có khóa học liên quan.