Okay.
Okay. Good morning, everyone. I'm still morning.
We're going to read a lot of things to talk about today.
So.
so assignment one is based on, you know, as do on September 28.
We talked a little about the format of the, of the assignment, it's a little bit funny,
in the sense of so here's the assignment here. Now the thing to note is that what I so if you look at the model here the questions. There's this browser to the show.
This is a B and A B C D. But, So there's nine questions some with multiple parts.
I don't want to submit your answers, what I want you to do is fill out this template.
This is what the template looks like. So you should put in your name here, put your student number in here, very important you put your student number in into the template because I actually use that for.
And then in the collaborators and then what I want you to do is once you filled it out.
What, why want you to do
that I want you to go to this validator page and upload your file, and hopefully and it should, if you have done everything right, it shouldn't say past, and if it doesn't then you've done something wrong I try to put error messages that help without
but go and validate and the reason I want you to do this.
So, the key idea here is that you're making this text file.
And I'm going to run it through a program, and it's going to split it up by question, and that way the TA is when they grade it though great all a question one all question, seven be.
So the grading is consistent also all your questions identified by student ID number. So that way, there is no any bias we don't know who did which question.
And then I merged them back together in order to generate your grade, so please follow the template. Now, in terms of collaborators, the collaborative should go at the top.
That way if we see any similarity between, between things we look at the collaboration that we know who to talk to and go like you know your things are too similar you're not doing your workout, or we just know okay there's some similarity it's fine they
work together, any references that you use.
Ok so now.
Okay.
Can you hear me OK now.
Yeah, y'all hear me fine I'm just
so oh yeah by mountain noise yeah yeah i sorry my my words when I'm when I'm typing. Okay.
Okay, so I'm just checking here on the questions here so.
Okay.
Okay, so.
Yeah.
So we lit up the web pages we listed with the current research weapons we listened with the questions so
that's, again, we want to see that. And the big reason you want to include the resources, is that, if for some reason you give a bizarre or wrong answer.
But you did it because you use some legitimate seeming resource, then we can give you, you know, at least partial credit or something for that. So, and also it helps us know what you know what's going on with your, your thinking and where people are finding
stuff like oh don't use those resources.
Now, on the know regarding the tutorials.
So, I don't,
I don't give out solutions for them because if you do them right
in this class, you should be able to see if your answer is correct because it all fits together it makes sense that if it doesn't, that means you probably need to do more experiments wasn't until you feel confident enough in your answer because remember,
my goal here is not for you to.
It's not just.
You should be able to answer questions that come up with, and that means you should be able to know how to use the resource go like, oh, and how have the ability to go out yes I have the right answer because this is consistent with this is is consistent
all makes sense. And so I am confident my answer.
some chairs up so you can use any online resources this this whole class, including the midterm and final is open book.
Open Internet. It doesn't really mean it only helps you to a degree.
And in fact, that's why I want to encourage you to realize that searching.
Adam, the tutorials, the day on there is the date the tutorials come out.
All for tutorials, you know, so, so all for tutorials, you know for before the midterm already posted the website, when they're Do you know tutorials one and two are do.
So the last time you can do turn in tutorial one and two, is you know before you submit assignment one.
So make sure you communication with your TA and the reason why that is is very simple, is because the assignments based on the tutorial so if you could jump to the tutorial and skip to the assignment and skip the tutorial you're like making your life
much harder for yourself. So I don't want people do the tutorials.
Then do the assignment.
Um, do I care if you work ahead on tutorials.
There will be very strange free to post them online if I cared about you say, here they are posted but don't look at them.
You really should look at them, even though I posted them.
So,
the deadlines the tutorials are already posted that the deadlines with the corresponding assignments.
Yeah.
Yeah, that's it.
Thank you.
By the way, asking questions that just like. Ask, ask. Good question. Don't just ask question to get participation marks that because you don't need to.
And that just makes things are going for what else but I mean it's a legit question please do ask but.
But what councils or resources or.
Man, I wouldn't don't bother with man pages, man pages don't mean, I assume that you.
Oh.
okay.
When I was doing tutorials I found multiple answers for a single question, the tutorial questions are open ended by design.
Yeah, GCC is huge. Yeah, well actually you want what for GCC what you want to be actually going to.
This is where you want to be using info, new info and there's, I should be an info command in the phone. Yes, there is. So you can just type the info command, it's also built into Emacs.
And if you whatever documentation is installed on the system will come up here and
there's just there. There's a lot of this is the man pages but there's for good new in particular, there's more detailed documentation here. So if you find the man page is more is not enough.
Let's see, do I have GCC me. There's all this stuff is called my personal machines with a lot of, lot of stuff here.
She says, I've installed GCC doc so it's not here, but
yeah well if you go to info it's a menu command.
Yeah.
Yeah. There's no menu command.
See this gives you a menu here like when you info
info.
There's an info browser built into Emacs but there's also a command line one.
So you can, so you can use both those, I don't. In general, I wouldn't the info pages are probably more detailed than you need for most things. That's why I don't really use them so much.
Here.
Yeah.
Okay, Anyway. Oh.
So, so this is enough administrative stuff. Please work on your assignments. Oh, what I want to talk about today is some system call related stuff, and also talking about library calls also looking at assembly basically talking about things related to
tutorial to, but integrating with some other things.
So some of you saw the saw the code I was typing in before class, so.
So first off, I just made this little program here, get p ID test. See, now you might be going like, okay, so get p ID.
Here's the man manual page, I'm looking at man pages and Max because you can.
And this tells you, so this. This is how a process can find out it's process ID or its parents process ID remember there's the PS command. We've already seen that for looking out for getting that and so PS is PS is actually using a different interface
to get process IDs and stuff we will see that later.
If you're curious what that interfaces, you can try is tracing PS, and you'll be able to see where it's getting his info.
But if you're a pro in a program itself, you can ask to find out what is my process ID or what is my parrot process ID so that's the one that created me by fork.
And these are system calls.
But, And so, but they're also see library calls.
So here you see that it's just a simple, you know, how do I know how to use get the ID. Notice the man page it always tells you what are the include files needed for you forget pi, get for anything you want to include in the sea man pages.
They're here. And so I need to have these to include in order to use it properly. And so I've included those also put standard diode at age, 11 do a print off.
And so I said, you know, my co main RV. I've declared my PhD is PIDT, probably an int, but good to use the type they say to us. I see get my PhD is get PhD, and I do I print out my PhD is percent D and I do my PhD, and there
are all Cisco's rumble through see. So not every system call has a standard see interface, but the ones you would want to use generally do
it again then they just become part of the.
So if I go to my shell here, so we'll just do anything here. Anyway, up.
if we just type.
So you run it we do this, get my PhD is this.
Now let's try looking at the.
Okay now.
So I had previously done a disassembly using object dump dash D means as Dora that command but what I'm doing right now is I'm going to
pass.
So now I can look up.
So, here we now we see the sea. And here we see the assembly.
I get so get p it works with just the first import the what we're just with us today. Ah, that's what you need but CES type stuff age is used for a p ID underscore te am pretty sure, otherwise Thank you have to use it.
So why do we need to get the P ID. Um,
well you'll see some for now just say what is my PhD, but there are, but there are many times you want to know your identifier.
What, so I use dash Oh without a default. So there's different levels of optimization.
There's dash Oh dash oh two.
Yeah, it's not too important I really, I sometimes I used to, I found actually dash Oh gives a little cleaner assembly for us but by default, there's no optimization, and the assembly code we use no optimization actually looks really strange because it's
put together my machine and doesn't make much sense and you optimize it actually is clearer. So that's why I do it.
Yeah, so, yeah, we're gonna, we're going to talk proc directory is selling we will talk about soon.
For those who don't look at home but for now I'm not talking about this last part.
Anyway, so we have this year we have this code. And now let's look at the assembly and see if we can follow along with what it's doing at least roughly.
We see there's a call to the get p ID function. There's a call to print half with some check some version of prints out there.
get p ID is stored.
So move. They move the EAX from edX and then it copies.
So this I think is, this is storing it lC lC zero is
00 Yes, here's the address of LC zero that's the string, the constant string here. And so this is loading the central registers so that we can print off and then there's some other arguments are brought in for the arguments to print f check.
It's called.
So,
I think I think pplt is like that. Yeah, I think that's the procedural liquid yeah this is based on that and by the way, if you're looking at the references like this with a percent.
Whenever you see percent rip. That means that this.
This allows it to access LC zero, even if the problem gets moved in memory. This is a technique for position, independent code.
And so that's why you'll see any symbol you'll typically see it in preset preset IPOs r i P stands for the is the register of the stores the instruction pointer, which is the red, the address of the instruction that's currently running.
So, where we are now, we can calculate the offset to this relative to where it is currently in the code that way when you move the code memory, it'll still be there, older code didn't use this we now, typically do things in a position independent way
for security reasons, and I can, I will explain the security reasons later but we're not there yet.
dot LLC zero is just a label and specifically this LC zero label refers to.
Was it yeah yes right here, this is also zero right here, which is basically the.
It's the string, which was a constant in
this constant right here.
I was checking to see our IP the next instruction point. Okay.
Thank you.
So, what I want to point out here is the call to print f check and get the ID or they're both call instructions.
So since they are call instructions. They are calling c functions, and I've been talking all this thing about system calls or a different interface. So whereas the system calls.
Where does the lF before when it falls Minnesota else easier. These are all just labels.
These things and they're auto generated labels. And if you look at the code elsewhere, it should, but may not reference them but these are just labels that are automatically been generated by the compiler, and that they are often rough reference but sometimes
I put in there they're not referenced.
But going back here, so we've got this.
You know this program my PhD is just local variable here, PIDT is the type of process IDs. It's basically an end.
But on some systems that could be different so if the compiler change, you know, the colonel changed it. This would be nothing can just change that type.
But we've got really here to see function so where are the system calls.
So this is what I want to show you is, um.
Let's find out.
So this is the disassembly of it. After I've compiled it static Lee. So this is important if I compiled it dynamically we wouldn't see all this we would just see the disassembly for that little bit of code.
So would be hardly anything but since I compiled a static Lee I get all the code. And as you can see, there's a lot of code.
But what I can do here is I can search for get p ID.
And so here we can see a call, so this is main calling get p ID.
Here's some other call to get the ID.
But gnosis underscore underscore get p it is the thing that actually does it. That's what we're actually looking for. And there it is.
And there's some other instructions here but notice it moves this number into the x.
And then it does the system call.
So, so this is, this is where we're actually doing the system call. And notice how we did this is we loaded the number in cx and you go like, what is know why 27.
So, if we
look at.
So, user clued.
Our x86 64
bits.
No, it's not that's not it.
I said it was.
So if you look here you missed it, 3264 so what a 64 bit system. We load this up. This is the numbering of the system calls.
So this just for your references and user include x86 64 Linux GNU SM.
So this is coming from the Linux kernel itself. This is the numbering of all the system calls. So now if we look for. Now this is all a decimal, but we look forget p ID is 39.
And so, 39.
So this is bc so obeys 16 to output base up I put in 39.
We get 27.
So that's so 39 is 27 and hexadecimal.
No, where's the game the 27 from the 27 I was talking about was here.
This is, this is 27. This is the number of the system call.
So you see we store it we put the value 27 in this register yeah yeah x. And then we do a system call it's like why do I know what number to do. These are the numbers, we just tend to put these in hexadecimal, this is decimal.
So convert between the two or you could just put dollar sign me if you were typing this in here you could just say dollar sign 39, instead of dollar sign 27.
And in fact, we can
process. So, so now let's. So now we're going to do something a little different.
There's no reason we actually have to make a library call for this.
So here is this, let's let's go and, you know, here's the code here we go the shell here.
So, but now I'm going to do is it's that
we're doing some fun get PHP test pass. So here's the assembly here.
Let's go back to the.
So here is this code here.
And here is this code here.
Why do I have to call get big here.
Why don't I just do a move.
And we'll do $1 39 right.
units did underscore 64 dot h that you're not normally supposed to mess around at this level so getting this is kind of, you know, there but so, so get p it is 39.
So we're now we're going to change this to be, move, move 39 to
do a move on and move out.
39 to px.
And then you can just do this call.
And we will delete this.
So,
So, I'm
Jason, I'll talk about your question asked me your question a little bit but so.
So now I've replaced this move long, you know, this, so I've eliminated the call to get PID test and then I can go to the show. And now.
so.
So, this is the same.
Okay.
So now let's compare these two.
Oh, crap.
I messed it up. Okay.
Let's do this again.
Okay. No, no, I can do this.
Okay, good. So now I can bring up
tonight at the system calls for both of the modified version I change the assembly level.
And so here's get p ID, you see here is get p ID.
Basically seems exactly the same. At the system call level.
But
let's try.
So,
so you'll know here the URL trace. We have a call to get p ID, and we have a call to print off check that all is as we expect.
So, I just want to show you the proof that we got we don't have the library call in the with the library called that's in the original he's no longer present in the modified version, I have eliminated it by modifying the assembly code.
And it's just doing it, but the system call.
I'm still making the right system call I bypassed the library.
Okay, so.
Okay so questions I just looked at doing the chapter a lot so let me talk about call.
You may want to review this later if it's unclear. You know the different advice did demonstrated during the library and system calls.
So, The C library concludes wrappers around
for commonly system call so basically they're just, it's a simple function that you can call that will then make the actual system call now.
Okay, this isn't coursework.
Sorry, so we make calls the library first which in turn make the intended system calls. Exactly. And sometimes you call a library function means also make a library function.
It's not a one to one mapping.
So, some things are directly, you know, like there's some lobby functions that make no system calls me think of anything.
Like, if you're doing saying that converts numbers to strings or something like that. There's no need to do a system call for that
meal, and then some it you know, and then some may make many system calls I mean, there are some very complex library functions than others are
okay so.
So there is a there is a C library function called Cisco, but it's just a generic wrapper around Cisco so you would use this.
So if we can make some calls me to see our friends, why do we have you modify assembly code.
Is it cause are certain Cisco, no, no. The reason I did, I modified the assembly code here is simply as a demonstration, you normally do not do this.
Um, this is not what you would normally go around modifying the assembly to stick in the system. This is called instruction. I'm just showing at some point.
Somebody's got to do it.
That that is actually what's happening.
Because it's not just functions, there is this different mechanism. And this rapper, I find tends to confuse people. So I just want to make sure I try to make that very clear now.
But let's talk a little bit about.
So what is a call instruction.
A call is actually.
No, I'm sure that that's.
I'm not sure if you can actually push the instruction pointer directly.
Think you can not sure. I think so, but
so but but it's a push, and then a jump.
So.
so.
so this, the sources, the references I give for assembly language, you don't have to go through them but it's a question of how much you want to understand.
It's all about filling out your conceptual model.
What.
So tell me what is the stock.
As a data structure.
Yeah.
It's not a FIFO, it's a file, its first in last out.
Yes.
Push pop.
So first in last out. So,
so.
So, similar to have. I'm saying the functions, so.
we're trying to stay local variables, and.
so every yeah so every thread has its own stock Yes, but we ever talked about threads. Yeah, but I'm.
We have not discussed pipeline and do not think about pipeline in a pipeline is a level of abstraction below where we're talking about.
So, if you're in a structured pipeline that term, look up processor architecture, it's a very cool thing it's a way for CPUs to execute instructions in parallel, but from a programmer perspective, we don't see that that is literally an optimization that
occurs at a level below it so.
So you can button that but. So, but for every, every stack has every, every thread, but say every process for now we're going to talk about threads later.
But you're executing one instruction after the at a time.
And then you have an area of memory where you store the stack.
And then you have an area of memory where you store the stock, and you'll see all these operations where you do pushes onto the stock and pops from the stack and you see in assembly, and you also see these things that are they playing the frame pointer
and other things like they're all referencing the status structure in various ways to nor to access local variables, and in particular to access return it so when we.
to either push push them on the stock we just put them in the right register.
Then you.
So then you call, which is just calling and you give the address of the start of the function.
And this.
Okay.
So it's catching up here.
So, this is called get yes and basically put the memory address of our current location in memory onto the stack, and then jump to wherever the function defined nor to carry out instructions.
Exactly. Alex you've got it exactly.
So,
so we say process versus threads. Um,
I'm not going to talk about this yet but I'll just say, Yeah, I will talk about process verse threads. For now, ignore threads. We're just considering single threaded proxies IE one instruction after the other.
Well, so the reason why I, we do not have a course going through the whole thing of assembly is because you don't really need to learn assembly nowadays I mean, if that's the assembly isn't an interesting thing to learn and you are learn compilers and
do all that but it's just, we do not program in assembly.
And I mean it's it's a specialized skill, it's good to know the level, it's sometimes interesting to look at it but you don't, no one develops coldness except for small amounts, and if you happen to need yourself to learn assembly.
You can learn assembly, it's not hard. As you can see me it's, it's painful, but it's not conceptually hard, it's just meticulous point here is for you to know what the what the level of assembly is why it's there.
And so, if you need. If you need to, you know, you should go figure that out.
Okay.
So, anyway, so this is
process engineer so so this is how your basic and you know the basic call stack and so whenever you're looking at assembly code.
When you're looking at this, you notice we have like, so these moves are all accessing moving things to registers. This is manipulating the stock pointer.
This is adding something to the stock pointer we're doing this because we have a local variable which is the, the local variable which is, you know, the my P ID, which we're using here so there's all these references in there knows we don't have labels
for all the variables we have the references to our variables, often get turned into these references to parts of the stack so it's not so easy to follow here.
If you're a programming and assembly manually you would add in labels to make it saner to you.
What's the stock overflow thing is about process versus threads I'll be thread safe.
Again, I have. Okay. If people want to look up that that's fine I that's certainly something we're going to talk about I'm just trying to try to keep the scope a little focused here.
Actually no, I take that back.
That does make sense to explain this year. So, when you
implicitly in here. There are references to memory and those references to registers.
Like we say things like EAXUX. These are the name the storage that the processor provides and they're special because well they're super fast.
In terms of storage, but they're also, the things we can actually do computation with, we can add we can try, we can compare we can do. That's what you can do with registers.
So.
so fundamentally that's what a modern CPU is.
So we talked about.
Ram.
Ram is the storage, you know, that we access, and it's a basically a giant array of bytes.
That's all it is. And we index into it by memory address when we refer to a memory address we're talking about that so.
So, a pointer and see is just a memory address in assembly.
So, so people often talk about.
So,
So.
So, these are.
So, again, another. So I mentioned pipe lining.
This is another concept from processor architecture this notion of caches. And all these different levels of cash, which basically serve as higher speed memory between slow RAM, and very fast registers, you know, so there.
So if you're on top, older computers, older computers did not have caches. They just had the CPU and they had RAM and CPU would load data from RAM and and store it, but dinette DRAM is relatively slow.
Yeah, Ram is crucial for random access memory, using this he's liking it. Right, exactly. that's what RAM is, it's just random access memory.
So, so.
So
caches aren't ya caches are, like, I mean, it's faster than ram but it's slower than registers.
So, there are.
I am simplifying things there are ways to invalidate caches.
Yeah, there are ways to do things but you can't you can't store data in a cash. You can't directly say I want to put something into the cash.
So, so you don't have to think about, you basically you don't have to think about the caches unless you can care about performance, then you might say, wait.
Wouldn't it be good to expose to the programmer, the caches and let them directly control them because they know this is faster ram So should I use this faster ram versus slow RAM and I put certain things here and some things there.
Turns out, while you can do that in practice, in principle, when people have done it.
It has made programmers heads explode.
If you look back in history at game consoles and you look up things like the, the ps3 and it's cell architecture.
The PlayStation three was a pain to program because it had effectively what what the cell architecture to effect a direct access to cache memory. I mean, it wasn't quite called that but effectively that was what it was you had lots of little bits of cache
memory that was super faster than name number, and you had to manage it explicitly the CPU didn't manage it for you. And it was very hard to program.
So we go through that.
And in fact, you'll notice that
assembly language and machine language used to be the lowest level of programming by us.
So,
is this why we got back a compiler for the PSP but we do for the PS to.
Yes.
Yes, because the ps4 is basically a PC and PS two also had a really weird architecture, but they've you know it's old enough that they can do various ways to translate but the ps3 do is how did its own thing.
Yeah, so you're.
Yes you record the same dies it surrounds you can video. Yes, that that is that's exactly so yeah no registers exactly registers are fascinating cast effect, you know, then registers are fascinating cast and fasten your Carson's got it right there.
So, so in general, we're talking about is this thing called the memory card.
So in general, and if you want things to go fast. You have to manage.
The ps3 was power PC based but it also have the cell architecture thing, it's a it's a.
It was its own weird architecture, it's worth looking up. It's very cool.
And yes program.
So, we taught this so what is the memory hierarchy so you know the top is your registers.
Actually, you also have something called.
Oh, God. I'll remember that there's something else on top and goes a little faster but we can ignore that for now. Yeah registers.
Then you have.
So here
you have.
So, I'd say this is kind of the classic, kind of,
it is. Yeah, so.
So, when we say refresh memory again, like, I'm not going to talk about the exact circuitry but.
So DRAM has these periodic refreshes that have to happen in order to in order to keep the patterns in the circuits static RAM doesn't require that periodic refresh it just so happens.
So why don't we.
if you really want to learn about all this stuff. There's a book I can recommend to you.
Okay. So, computer architecture is a very cool field. It's worth understanding and getting some background, even if you're a software person, understanding more about what's happening under the hood can help you be a better programmer because you understand
the trade offs and you know a particular regarding performance.
Yeah, So
you are more open to things more I want to have
a computer. Yeah, there's a great.
There's a great online course I think from Tetris know, from a you know gates to Tetris.
Yeah, if you're in Atlanta Tetris thanks yeah nanjie talk to us, if you want to, like, understand like how everything works that's, that's great to work, you know look at really in some sense where we're starting is going above that.
But it's important to at least have some idea of the stuff but just because you understand the low level doesn't mean you understand the upper levels and that's the nature of, of, of computer science is we live at these abstractions, and really to do
well.
You don't know everything, which you know is you know the abstractions and then you kind of know what's on the other side of the spectrum so you know when you have to go past them and go like, Oh, This abstraction isn't so it's kind of leaky there's something
else going on over there I have to open up the covers and see what's going on there.
That is that is really what you want and that's part of my approach here with this course is I'm not telling you everything about every level.
And in fact, I'm purposely throwing you into things, which is like, Whoa, there's all this stuff here and I don't know most of it should I learn all of it.
No, you shouldn't.
That's not the point.
You can if you want to, intellectual curiosity you know is a good thing but that's not what I'm going to ask you about.
And in fact, if you just do that you may in fact spend time learning about things that, you know, and not learn the things that you do need to know. And this is just like anytime you're going to get thrown into these complex systems like wow I want to
learn anything about it. I mean, These code bases maybe millions of lines of code.
And if they are.
You cannot understand all that.
So you have to have an approach, which lets you learn what you need to do in order to solve the tasks in front of you and understand that. Oh, I may need to learn something about that other part of the system because I'm seeing that.
Oh I thought I had followed this contract and it actually isn't so I have to go see how it works.
That's, That's life in deal with modern software.
Oh.
So how I've structured this course is to try to get you to think in that way.
I don't want you to just go and like, learn about everything. I want you to learn enough, then go like, Okay, I know something there I don't need to know about the now I'm going to go learn about this.
Some of you I know what to learn everything wants to know everything in detail and just have it all clearly laid out.
But if you go into the real world with that kind of attitude you'll get eaten alive.
So, I don't do it that way.
So, so this is the memory hierarchy, this is what's actually there, but the operating system.
I am killing me Why not remembering this one thing but anyway.
So, operating says abstract memory resources to allow multiple programs to run concurrently. So, specifically.
So, this is though, if this doesn't quite make sense, that's okay because this is a big concept that we're going to talk about much more extensively later.
But right now I just need you to understand is that when you're looking at this assembly, you know here implicitly here, there is, we're storing things in RAM, and these things on the left these labels are references to addresses.
And when you do the object dump.
You actually can see it has addresses in there and as part of the loading binary it's going to put those in particular places in RAM, but when it puts them in RAM, in a process.
They're using virtual addresses every process has its own view of memory.
Ah, did assembly deal with physical addresses at some point.
Yes, it did. And in fact.
So, originally, there was just RAM, and there was the CPU, and you ran your program, so.
really, the process obstruction to a first approximation lets us pretend that we're working in the 1980s or earlier, depending on you kidding and say the 1960s, you're talking about mainframes or something personal computers work this way like computers
I grew up on had only physical memory, there was no virtual memory. They only ran one program at a time.
But, newer computers, you know, as we got more and more resources. We want to run more, you know programs at once. And, you know, we had little things like networking come into play and so instead of having to reprogram or have to manage all this, we
have the operating system manage all this complexity and the programmers provided a much simpler view of the world.
So, the, the boot loader and Colonel basically have. Yes, exactly. William You're right, it's basically when the when the computer starts up the initial boot loader needs.
We'll talk about that later but yeah The, The. Oh yes, and that's the so.
So one thing to understand about modern kernels, is they are big programs on their own.
They're very complex. And so, because they're complex programmers want to make their lives easier so they have lots of abstractions inside of them. So, the kernel as a whole, does manage the virtual to physical address mappings.
And we will discuss what those are, if there's this little thing called page tables that's the actual data structure that's used for for doing this, but I'm
the kernel itself doesn't want to deal in physical addresses most of the time, because it's just this completely scattershot view of memory where this program is over here in this program here and it's all, everything is mixed up, it's very painful to
work at that level so in fact the kernel itself programs is works in virtual addresses and just has parts where it deals with physical addresses, as needed.
So, yeah, so the registered everything now.
So everything is in there somewhere in a system on a chip. It's, um,
depends on the ship, typically well.
And the reason why DRAM is typically separate is because it's in order to get the high density of DRAM you actually need there's a different kind of chip, producing process, as compared to that from making logic.
And so, They like if you look at an iPhone and iPhone.
It's, it's all there in one physical package. If you open it up inside there there will be RAM, and then they'll be the chip that has everything else, but they'll be sandwiched together with these very complex interconnect between them.
In order to minimize in order to minimize the distance and maximize performance.
So, I see the hardware lies.
All end on this. You know, we say things like, Oh, we've got this register EAX.
That implies there's one memory location that is as well what is one thing on the champion pointed oh that's the ax on older ships that was the case.
Newer chips know there's actually a whole but registers, there's not one copy the registers. There's many copies of the registers that are used at different times in different contexts.
If not one thing, it's a mess.
Why this is again look our computer architecture, but essentially everything at the assembly language thing you think this is here this is store their stuff.
That's not how it actually works.
And we can mostly ignore that.
But it's good to know you're being told lies.
Anyway, I will stop here we're out of time, and we will start talking about tutorial.
Three on Wednesday, which will actually start bringing back stuff from tutorial one, because we're going to start talking about shells in real depth and talking about forking Exactly.