Okay, think i've enabled our transcription we can go and get started
Good morning, everyone. So just to review where we are right now So we're at November, 20 ninth lecture 20.
We have lectures. Oh, I really should update the final exam here.
The final exam is, I believe, the 20 first at like 7 Pm.
If so I will update that one
How people long night
The participation marks. Yeah, I mean, I I calculate that by going through the logs for zoom and and doing some analysis of them so I will.
I'll try to post i'll definitely post them before the before the exams.
You all know. Oh, nice sounds p no no no I don't do it manually.
I write script, I have scripts to analyze it.
So yeah, definitely, I don't yeah we use programs to solve our problems?
Don't we, anyway? so the big thing you free all now is So you've got tutorial 9, which i'm going to talk about today
So participation is a yeah participation is not based on you attending every class.
I do a mix of participating in most classes plus talking.
I do it based on what others have I mean. I look at the distribution of people who are participating.
So it's. Yeah. So it it takes me a little bit of time to do all the analysis.
But I can't see exactly what the criteria. is I kind of look at it based on overall thing.
But the idea is that if you've been keeping up with the class and actually participating, you're gonna get at least an A. you're just showing up, and kind of things you probably get more like a B or something anyway.
So assignment 3 solutions are posted.
I can I can't go through the I don't wanna go through them yet.
I'm probably gonna do that more next week we'll kind of can start with reviewing stuff, but I've got a bit more material.
I want to cover but first I want to talk about assignment 4, which is based on tutorial 9, which i'm going to talk about today.
But there's a couple of little bits of c that I want to talk about in terms of techniques.
So these are 2 little things that you should know how to do.
In you know, and see in order to be able to do assignment for I just wanna talk about them a little bit of.
So first let's talk about returning multiple values in C awesome.
So ,
So first off, if you're returning multiple values just past it, a structural array, and then have it updated.
And then the this is the easiest way to do it there's other ways like with
This is the big reason you do. It is
You pass in a struct or an array into a function, because that way the caller is handling the memory management, because otherwise you can allocate stuff
So I mean, the basic idea is, you can easily allocate a local, variable
Have the caller allocate as a local variable on, you know, which will be on the stack, and then you can pass it.
You know, pass a reference to that into another function, and then it returns it, and that way.
That other function doesn't have to do any sort of you know in another language, in most of the languages you would just allocate stuff on the heap.
The heap would be there it's just like some object or something, and then you return that object, and then you're fine, and that object will eventually get garbage collected.
If you're working in c depending on the system you can do that, if you're in the kernel in particular, you don't want to do that.
I mean you can do dynamic memory. allocation in the kernel, and in fact, in the example we do, it does do some dynamic memory, allocation.
But it's you really had to be very careful how you manage that.
So this is a better way of doing it. Yeah. So you have multiple words.
Yeah. yeah. So little languages hand, you know, handle, you know, multiple returns.
No, no, you cannot return. Ab. No, no, no, definitely not
Could it crop the Vm. if you were careful?
Well, but you start if you're in the kernel if you do when you're doing assignment for you will do things that generate memory errors.
They shouldn't corrupt things mostly because the Colonel has a lot of infrastructure for detecting it, and it just generates a Colonel Oops, which is essentially the you know, the equivalent of a seg fault.
But it all. you get all this output. of like this is what Reg? what the registers were is the code that was running It's a big mess in the logs.
But it doesn't just like corrupt things but it is possible toing on how put put you too.
But yeah, do it. The way i'm
So one thing if you're
Yeah. So first, if you are, if you have problems insuring a module, first make sure that you know other class modules are removed.
They can conflict with each other, and then if that doesn't work reboot, and then try again.
Return
We're trying to point it struck that exactly declared yeah Yeah, Yeah, you don't don't play around with static structures because a big reason is
So if you use static functions, think about. If you have concurrency, if you have 2 calls to the same functions that are using the same static data, the tool will interfere with each other.
Very bad. You must allocate the data structures when you enter the function in order for it to be used.
That's why using local variables. Then passing it along. Are you is your best thing?
Yeah, you only just only one time I think it's because of the classes that I think there's a way to make it so that you, the modules are creating the class, Claire comp 3,000 and I think
if you there's a way to make it so that you can add to an existing class.
But right now try creating it. I think that's what the interference is, I have not ever tried really debugging it to figure out I can get it to work together.
You certainly is possible, but I haven't powered but also I kind of like.
It's like you should be aware of what's loading what is an inv also.
See these kind of So okay? So So that first of all, yeah, this is how you pass data, and then
Yeah, a a a Jason. exactly that's exactly what a static, is It's like a global which means that there's only one copy of it.
There's not me local variables that allocate every time you call the function.
So if you call a function 10 times there's logically 10 copies of its local variables.
But there's only ever one global so if you're using globals to pass data around.
Yeah, okay, statics, what's limited in scope. but still there's only one copy of the variable.
So now, if you have multiple calls to the same function they're going to interact via the shared data structures that you've now created.
So very bad. Now, talking about yeah for for this for us, and print out, let me just talk about
That's not all I need okay so
Okay, So i'm just making a little simple c program here
Relatively newish to c plus one i'm by this
Oh, oh, yeah, are you talking about the multiple returns yeah you you You can't.
I mean that if we're this the kernel is pure see you don't do multiple returns and see
I noticed that you're returning a reference returning Var.
If you return to roughness, if you return a reference to something, if you return a reference, a local variable.
So this question here is what happens if you return a reference to a local variable.
I think that's the question if you return a reference to a local variable.
It might be there for a while, but the stacks gonna get overwritten.
So you're actually rotting to memory that isn't allocated to you.
So it's gonna be who knows what's gonna happen to it? Yeah, you want to say it won't necessarily Seg: fault because it's on the stack and the stack is a legendary what's going
to happen, is It's just gonna get corrupted
Yeah, is there? what multiple difference? Yeah. undefined yet?
So so you don't want to Do yeah why does c not support multiple retails normally is because I mean it's designed as a portable assembler.
It's designed to be simple when you start having to deal with multiple returns, You think?
Well, where are we gonna allocate these we're gonna put it makes the calling convention very a bit different, although actually, I mean it's in principle wouldn't be that hard to do because actually, what you the return value gets allocated, on the
stock. So you just you know, allocate that at the beginning with a function enters.
And then, yeah, that's this in principle no reason why you can't have multiple returns just the same as one return.
But she doesn't have it traditionally the kernel definitely doesn't, depend on it, don't do that, Colonel Programming, please don't, anyway.
Sn print off. so let's say if I do
Okay, First, let's just do this little simple program let's see if I got this right
Okay.
Yeah, don't return structs
Yeah, yeah, I mean I I would have to. I mean it probably depends.
I mean returning multiple values would work the same way as returning a single value in a function.
So once you understand that you can just allocate there.
But stacks not the big it's just don't do it, anyway.
We've got this little program here, we've got this program that does you know it does a little countdown so simple enough.
But I want you to notice something which is
So if we go here and we look at this system calls for this program, you'll notice that you know.
Okay. So this stuff, you know, adjusting the stack and stuff, and then we have a bunch of right system calls right now.
If I actually had a pause between these I this is actually a bad example.
Blast off implies as a countdown and pausing and stuff.
But
So. if you go through this and you look at it we're doing all these system calls what if I want to just put all the output into one string that would be returned, and so would just be in one buffer so what we could
do here if we wanted to output all at once, Is
We'll just give a big now you don't want this by the way.
The stock in the kernel is very small. so you do not allocate big things.
On the the stack couple of 100 Byte sure really don't do more than that.
Yeah, I guess you can get a stock overflow Yeah, exactly yeah, that's definitely exactly what you get.
So we have a so you have a buffer here and then what we're going to do is we're going to say
County goes 0, and then we're going to say yes, and print off rough
Call
Okay. Good: Yep:
Actually in general, printf returns an int which includes the number of So the description on that string search number of characters printed excluding the null bite, used to end the output to strings so it turns out not just
sn printf, but they all do this. So so you just out this, and I put this
And then we can just do it right. one, you know.
Okay, So right right off.
Let's see, do I need to add the null bytes. The null byte is provided by sn printerf, because it actually puts it.
Always note terminates the things it does but the count that it returns doesn't include the null bite
Yeah. So each call is overriding at them. Yes, exactly.
So
So? Oh, okay, what are you doing here
Oh, right! I forgot
I forgot my essential that was wrong so sn printf requires the links like the string, and the size s printf doesn't require the signs.
But Sn printed. Oh, that's yeah s n kenta!
There we go, send printf buff when they're 24, awesome
Put the counts in cause that cause that way. It tells it how many bytes it can write
Yes, i'm returning the we're we're ignoring the return value of right.
I don't care it's great now
Okay, my code is wrong. What am I doing here no that's not the problem.
Blast off is Oh, no, you know what I forgot to do.
You just bought my bug
I have to move over as I print I just don't print the I've I've reduced the the size of the buffer here.
By how much it is. Yeah, like that would be the size.
But I have to move over the right number of characters in order to write next
So so we're running the gcc function and that's fine there we go
Oh, interesting! oh, right, actually
No, my Max, by isn't one too long actually it turns out when I do this.
If I did.
So it's not my one by 2 long remember oh.
Change it, or for yeah, right. how I know how many bytes you use on the stack behind the perk number byices on the stack?
Well, i'll you don't push it you use as little as possible. if you're just using a so like, come integers like a couple of numbers and stuff that's perfectly fine don't put buffers on there right so so
this. So that was so. Do this for building up a string.
So. The reason why I mentioned this is, if we
Alright.
So here's the code from the assignment the reason why I showed you all this.
Is because in order to return the message we're doing an sn printf here and in order to do the assignment, you're actually gonna have to put multiple things in the buffer And So you should use the technique.
that I was talking with I mean there's other ways of doing it. but i'd suggest the easiest way to do it is do multiple sm princess, where you keep track of the number of bytes that have been written by keeping track of
the return value and then doing it multiple times.
Yeah. So yeah, plus, and not yet. The bytes are using a exactly exactly.
So what's important
So when you do a
Awesome. Just realizing this.
I was working about this being Null terminated but you actually don't need to make it no terminated because you're returning the exact number of Mike
Oh, funny, but that's. Oh, but if you're counting it you do want that right, anyway.
I'll i'll i'll think a little bit about that.
But I want to show you that you do this ascent prints off here.
And so you're really have a message so I you know use that
But now let's let's go on to tutorial 9 before I start. because tutorial 9 is this code right here is just taking directly from 2 tutorial 9 You'd be playing with that there But let's
talk about it in the form of trolley, could have some other features in it.
Unless people have other specific questions. I just want to talk in general about virtual memory.
Talk about what this program does, and what you should be getting from it.
Okay, i'm great
Okay, i'm great to switch no that's fine
No i'm going to switch
Okay.
Okay, i'm up here
So can you all see this. Okay, so what i'm good so, Browser up here.
Let's go tutorial 9
I already done it here
Play with that. So i'm moving that way and see 3,000 physical view.
Here it is
So if you install it using something like this. So what is this?
What is this? Oh, if you you know this is very much similar to the mem view that we saw previously.
Which to trial was that that was like tutorial 2 or something.
But this is yeah, yeah, 2 or 3 here. Yeah, the big difference here is this is essentially the same thing, except it shows this column, which is the physical address.
So now one thing to note is so when we look at Buffs.
So this is one buffer. Here we buff one buff, 2.
What is, you know? Notice we have this nice set of nice contiguous.
So what what is what's awful
So here is the program. What is this program doing? here? Is the Boxer.
So buff buffer size
So notice. First off buffer is a buffer up it's a array of pointers to strings, and what we're doing here now is each string you know each one is We're doing a separate
malloc of 4 K. and so then we're just saying where the addresses.
So all these are doing separate, Malloc. And why this matters is, you know. So these are all, you know, 30 different, you know, 3 different mallocs, and they all seem to be kind of in yeah memory kind of moves along and no relatively
sequential ways, right. But look over here, they're all over the place they're like almost random.
They're nothing at all close, even though here they are essentially right beside each other.
And this is the thing you have to get in your head about.
What virtual memory and physical memory is virtual memory is a nicely organized memory map for a program to put all its code and data in and nice organized chunks, and it's completely private It's just there for the
program. It has everything's later, like cause like you know like Oh, Rg.
V is at the top of memory, and then below it is our you know, global variables, and this stack, and then here's our heap.
And you know here is you know here's where our code from Maine is Here's what put you know here's where this library function is.
You know like that's all it's all nicely organized.
But you get to physical memory auto chaos other chaos.
It's just everywhere it's just pages everywhere
No, so remember this is not the the this is not showing you the addresses of the individual.
Buffer entries. you can change and actually that's something I encourage you to do.
If you think something is not what you think it should be.
Modify mem View 2, and add in Some things to show you other addresses.
That's the point of this program don't just look at its output.
Modify it, and ask questions to see what's going on and then see if you're right or wrong.
Now you're right exactly. Now the entries in buff if I just show the like.
The starting, You know what's the what's the physical you know address corresponding to the of the buffer array itself.
That would all be in sequential memory but here i'm talking about the the buffers that have been malloc That's the addresses that we're getting
Yeah, what was Why, the arrows, the arrows is just to make it.
Yeah, it's it's just for making you try to make it clear
Buff 0 is not equal to it's not your address of Buff 0.
So what let's actually let's go ahead and let's address this
So what? So the question is, is, what about
So I equals this
Just reporting Buff. Oh, that's not what I wanna do well just copy this little
Yeah. got that
Are you very allocated.
Houses.
So this should show us the addresses corresponding to this.
I think
So my spacing is a little off I guess that you know so you'll notice here. this is still the same.
But now I just added this in here, and this is reporting notice.
These are all nice and sequential. So this is the virtual address.
This is the physical address, the physical addresses correspond to exactly what we'd expect.
They just go up, and, in fact, if we look at this we'll notice that the see what is it e one e 1 7 cool.
So yeah, the 4 last 4
The last 3 last 12 days. Yeah, 1, 7, C, 1 7 B.
The last 3 are the same between the 2, as we go through this but this part is mapped to this part that's the virtual page number, and say the physical page number and the last 3 octets, so that's each each
character represents 4 bits. This is 12 bits, so these are.
There may be 13 bits here i'd have to work it out, but it's at least a 4 K.
Page might be an eightk page. Yes, the last 3 digits so that's not a fourk page There might be one bit that's fitting into this e versus c i'm not sure so.
It could be more it's not it definitely not
Yeah, it's it's at least 4 k I mean if you had another bit.
If you had another 4 that'd be 16 bits yeah, but definitely not 16 bits, but i'm i'd have to check and sign it. but it's at least 4 k pages.
I think they're actually ak pages but yeah it's 12 bits, if it's a 4 K.
Page it's 13 bits of it's an 8 K.
Page I forget what the page sizes on here i'll have to check
So? Why is that so
The last 3 digits are the same on purpose because we'll switch over here.
Let's go back too high
I'll just i'll put in the examples all the space what we got here
Here Google class on all on the one side. high school on second here, because it's Oh, the the W.
Why is the last 3 digits? there here's the output from there?
So if we look at this output you'll notice essentially always the last 3 digits are the same
What charity up, or what try to lower, but which are the upper?
Which of the lower bits upper upper bits of the high bits so left side and the lower bits of the right side.
But it's just generally the last few bits the offset is the last.
You if you look at the if you look consistently at these it's the last 3 characters that are copied the same.
Between these, all of these is the rest, that variance
So the page of the frame of the same size not necessarily it's, I mean in general, up
So the page number, basically, you say the page number is mapped to the frame number.
And so that's that's basically what you're doing you know
It's the page of framework so the page in frame are not necessarily the same size, because we don't we only need to have the frame be as big as needed in order to hold memory.
And in fact, there is in general, cpus, have to be changed in order to accommodate more addressing.
This is one of the things that's happened over time is this has gotten bigger there was I posted something to teams regarding which is actually worthwhile for you all to look at let's see if I
can pull up that link here i'm just gonna log in here
Sorry i'm just trying to
For I I forgot to enter. See you next
I would share my screen a second here. but let's okay
Okay, random. So I'm going to the random channel on teams and bring up the link for elderly i'm not net.
So Lwn Dot has a work website. that's worth looking at is Linux Weekly News.
It has lots of great resources for learning about linux i'd say a lot of the workings that over the years on how to
Okay. So
I know that's not what I wanted
You don't post that
Oh, oh, I did! Post office assignments call
This is what I was looking for. 5 level page tables.
So if you look here, this is what's talking about how things get mapped And as was talking about near the beginning of 2,005, the merchant, the 4 little page tables, you know disallowed the c 3 level page
tables were what were used before to have 30 two-bit addresses, which allowed for 4 gigs of memory.
So we needed to add more bits, because 32 bits was enough, because 4 gigs ain't that much nowadays.
And so you know, you know. So this is what they all so turn the linear range with sparse tree representing the address.
Space also sign this. So you notice we ignore the upper bits, because we don't need those those are basically considered
It's considered gonna be 0 because or or whatever and then it's like if you just so here's the offset at the bottom.
That's just copied over the page table entry basically is pointing here.
How do we get to the page table entries? We have a tree going up another parts.
If we just have we don't page table entry offset and 2 levels.
Yeah, you know, one level. Well, actually one level plus this was there that's basically 32 bits right there the Pmd.
The pt that's 32 bits then you add in another.
I think these are all 10 and 10 bits so 10 bits here, and then another 10 min, and then we have another 10 bits, and the we add another 10 min, so that's 1020, 30, 40, 52,
bits. Is that right? Only the lower 48 pets?
Oh, no, these are 9 bits each, not on. Oh, yeah, use 9 bits, Right?
So this is 9 9 bits, 9 bits, 9 bits.
So 9 times 4 is 36, plus 12 bits is 48, exactly last 3 digits.
Yeah. last 3 digits are there. So
I just realized they did it in a backwards compatible way.
Other platforms use eightk pages X, 86, because it had fourk pages, has stayed with fourk pages to make everything the same.
And so, in order to have an entry, if you have 9 bits, that means you have 512 entries, so 512
So so what do we have in order to have an address?
We basically have to have a. We have one page. So just look at how this tree works.
We have this tree where we start with one page of data.
This one page has 512 entries in it.
512 entries, which is 512 pointers.
And so we have an in. we have a We take 10 bits from the address, and that tells us which entry you want from here.
That points to one of 512 at this level.
Then here we take the next 10 bits and we index into another 512, you know.
No that's 9 bits and and i'm in a 512.
We do the same thing for another 512, until we finally get to these, which again, another 512, which gets us to the actual page with our data
Use it terminology. So that is the
So that's that's one to
Ptd
Okay.
Okay, I think we got process right there so that that's what you're doing here.
It's just
Okay, So just why am I talking about all this why that's all this resolution here?
Because we can see this in the code
If you look at the code here for this, what is this?
Get physical function, doing what it's doing is it's doing the process Ex: Exactly what I just specified getting the offset for each by taking the address.
And if you look at what is this? You know this is the basically the page with you.
512 entry array. and the address is here.
And this basically uses this Pgd offset uses the right bits from the address.
In order to index into this to get us a value and That's what getting us here at Pgd, and we keep doing this at the successive levels.
You should have this p 40 offset pmd offset pt the offset it's just taking those and do there.
Oh, I didn't have the ford offset so i'll i'll
But you see this is what's how how we're moving back and forth, and then at the end, you know this is the index of here.
And so the actual physical address. We shift this over by the page shift, obviously to get it to the right bits here.
And then we add in the address modulo, the page size.
So we get rid of all the high-level bits, except for whatever is there for the page size.
So this is a bit shift. This is masking off the bottom bits.
This is how we get our physical it, our actual physical address
You're seeing the address resolution process right here you are walking the page table right here.
If you want to look at me again, I don't expect you to understand this code, in fact, full detail is, you know.
But you can go to the kernel source and look up these Macros and try to see how they were.
But what more matters is, you know this must be a 5 level page table.
You were the 5 levels
So what is this line right here? So this is the most important line to understand.
Here. So the value for page shift here i'm basically certain is 3, because that's the number of bits that are there.
And the reason I know this is because you know the so so be.
This gives us essentially the number of are physical. so P.
Appn is physical frame number. So this is the frame in physical memory which is saying, the number of the place in member we call pages are generally referred to as virtual memory and frames or physical memory.
But the same size. You know the ideas that you put up page into a frame, and then it all lines up.
You go through memory from the top you just count down, and you know, to count these frames.
You just count memory in the page size. So your this is then okay, Chunks: So we when we shift this.
But this is just doing as a number. We shift it over by 3 bits, and then we never have.
Well sorry, with 12 bits, 12 bits and then the remaining 12 bits right here.
Is it 3 hexa decimal characters? Each hex.
A decimal character represents 4 bits but let me check that.
Let's let's actually check that here stop sharing just go to
So notice that page shift is defined for every processor that the that we support.
So we're now going to select x 86 well That's Kvm.
Yes, X. 86 I think everything's under x 86 So here, page shift 12 bits page size.
It Just this is one shifted up by that number of events.
So in other words, 2 to the 12, which is 4,096.
This is So that sounds how all this is defined.
Now if we go to other architectures, so we go to say like S.
3 90. What you know that's a mainframe Oh, they also use 4 k pages.
I think like alpha is used. Who else used?
I 64? Okay, that had different size pages.
Page size fourk page size Ak page size 16 K.
Page size 64 k page of the actual kernel page side.
So you could do that different
So yeah. So the question is, is, does this part of the
Does this code right here, you know, looking at this, you know what does.
Well, what is this right here? This is modular arithmetic.
So page size is 4,096. So if you take the address and you divide a basically you divide it by 4,096, and keep the remainder.
What are you doing? You're basically getting rid of all the high bits, and and the remainder is the lower 12 bits.
That's what you guys the lower 12 bits we've shifted this up so we get everything into the top things there, and then by adding them together, you basically have join them together
This is the you know. I again all these details. and stuff I'm not gonna quiz you on like understanding the But it's worth spending some time in looking through this going. What the heck is this doing now.
You might want to say, what is pt there is for Pfn
This is all these Macros here again they're per processor, because the page table is a per processor thing.
Now No, I 64 is for itanium that's a prostitute isn't support anymore.
But the place costs support for it. Where we are is X.
86, and where is X? 86 was functions always defined as a function.
Got it, and so exhale so here are the functions that define all the things we're talking about. Pt.
Pfn you know, pmd pfn like it's the value of the pmd value pmd right like, where is that, you know?
Or is that defined here is defying. And again, you know, I want to go to here
Colleen, you know I was like I notice here. Why, we got here we've got in line assembly.
So again, if you start going down the rabbit hole of trying to understand exactly how this stuff works. it'll get complicated.
Don't worry about it, but I do want you to see like you know, when we talk about walking a page table.
This is what we're talking about. walking a page table and there is the important little thing to notice when you'd is this tutorial knowing.
Yeah, this is tutorial. 9 is like this in a site and assignment 4.
And you look at its code you'll notice we have the same lookup code.
But when we use it we have this call, and then we have this little line right here.
One of the questions in the assignment is what happens if you take that line out.
What happens to the program. You know what happens to. Now I will tell you that it this is necessary.
This line is very necessary if you take this line out this code does not work, but by any same measure like the wrong way you look at this.
It's like i'm looking i'm writing so rebuff. but i'm gonna right over that same bite right here.
So why do I have it here?
Yeah. yes.
So so So why do you think this is here well i'll just give you a hand?
You should demonstrate this in your code. but I will tell you that without this line this breaks this doesn't actually work.
And, in fact, what you should look at is the kernel logs.
When you run this, if you remove this line here
And you do this, you should see something in the kernel logs, and what you get here will be invalid.
Think a bit about that that that's actually a very interesting rule feature about why that's not there.
But it has to come down to page tables. Okay, for looking at these, you know.
If looking at the mapping here
Nice ,
Okay, What was the address here?
Bye, sharing
Go back here.
Okay, So we got this back here, so if you're
If you're looking at these at this tree, what is this tree, this is a tree that is very sparse, because if you fully populate this tree with all of its entries, what you get is something that can occupy the
maximum ram on the system. most processes will not want a fully populated page, because that literally could mean, you know.
Oh, i've got a terabyte of ram most most most computers won't even have enough ram to fully populate the page table that they support.
So this is normally a sparse arrays, which means that each of these little entries, each of these pages, the array of 512 entries at it.
Many of them will be 0. Many of those will refer to nothing
So when does it get populated? How does it get filled in?
Turns out highly dynamically. This is not this is only populated as you need when you're doing so literally what you're doing when you go to
So a lot of the features that we talk about with memory management we'll talk about this more next time.
Is, Why do I care about you seeing this code I don't really care about your understanding exactly how this works?
But what I do care about is you having enough of a conceptual model under from this to be able to understand other things like.
For example, if you, you know, if I if I do
When I write, when I run, and i'm sitting here, and you know. looking at this, I have these columns where it says virtual resident shared.
What do those actually mean? What it's referring to is virtual is basically the size of the virtual address space, which means virtually, is how much of the page table is outocated?
So if you Look at no it's of the whole address space for that process, how much of this valid that's how much that means.
Essentially That's how much space the page table for that process have to take care of.
Resident is saying how much of this whole thing is actually in ram, which means of the page table, How much of those course I actually referring to pages that are in physical, because you could have page table where it says, Okay, this part of memory is
valid. but it doesn't have a corresponding physical page just says these address ranges are valid, and maybe, and we said, Well, why would the Colonel leverage that?
Well, if you allocate a 1 GB array of pages, and just a memory as a buffer, the Colonel won't allocate all that to you it will allocate it to you
you'll allocate the page table and Say here you go you can access.
This is all legal. but then, as you access that only then will it allocate it, because maybe you you allocated a gig of ram.
But you only use couple of megabytes
Oh, yeah, oh, yeah, i'm out of town so so we'll talk about this much more next time.
The implications of virtual memory, and how you can see that in the system
Good luck with the assignment. I will see you Thursday