There we go.
You'll see those numbers here.
Great.
So let's go ahead. I want to start recording and we can go and get started here.
Okay. Good morning everyone.
So today I am going to talk about the midterm.
Because now all of you should have your grades. And frankly, I wasn't that happy with how you all did you guys didn't do that great.
And I will, I want to try figure exactly why and doing some things But the big thing to realize, first of all, is. So I'm not going to curve the grades of the midterm.
I don't curve individual grades if necessary. I adjust grades at the end of the semester, I have.
I've only had to do that by like a point in the past that most basically jelly to make keep people make sure people are kind of like falling on the right side of the line.
But, um, but yeah because that is why I look at things at the end of the semester, but remember the final exam replaces the midterm so if you messed up on this your greatest not at all trash.
The most important thing to do is to use this as a diagnostic to figure out what the heck went wrong.
And that's really what I want to do today because, again, things are cumulative the concepts from first half semester going to be are definitely in the second semester.
So we're.
So we're going to go through that so, so, so the average,
which is.
Yes, so the average is 52 format.
This is as a percent.
Yeah so yeah the.
Yeah, 52% is the is the average, and we're going to go through now each question I want to show you what everyone got on the particular questions, so you understand, like, well I'm I'm trying to figure out what concepts are you all missing.
And so we can try
fixing that I also think more than the concepts from what I can tell by I great question 10.
So we're at lecture 15 okay so
1516 lecture 15,
was that I think some of you are really approaching the material here sometimes in a, in an unwise way.
Now, I will say that some of a
broker.
So, so he ran out of time okay that can make.
Okay so time factors okay that's good to know that time. No rush it's easy a mystery questions. Okay so potentially this was a okay length I may have messed up on.
So, what happened.
Okay.
Okay, that's, that's fair enough.
Oh you know I'm going to be putting more interview slots up I just, I wanted to get I get the first ones done, and I'm definitely gonna open up more for next week and I will make sure I keep having interview slots until everyone I've talked to everybody
wants to.
But I got a space them out of it. Show.
So okay so so that one is too long, but what let's see I think there's some other things going on.
So anyway, let's talk about let's let's start with question one.
So the question was can you make a regular file that consistently behave the same as death. No, no.
So, so one thing to know is that each question was marked. So, each question was marked by a particular TA.
So, typically a TA had two questions.
And I marked one of them because there's and there are seven that he has a great so that's how it worked out. Um, so grading for any given question should be consistent.
And if it turns out that there was some systematic problem in the grading of a question, we can go back and update the scores and I can upload no fix everyone's like I said get no go reread your question update the scores and update everyone's.
But, but let's see it so so basically you cannot make a, so I swear you make one like you can make one like dev No, but the key thing is can you make a regular file that consistently behaves the same as death No, make a special file that behaves like
death No, because it can then be a character device have the same type and then it would be basically identical in functionality dev know but it will not be a regular file.
A link to dev not assembling is not a regular file.
But again, if you send one of these other things that you explained it properly should have potentially gotten credit. Now, if we look at what we know here is basically the distribution here is hundred and 16 people got it, got full marks nine people
got one mark, and then everyone else got zero marks.
So, okay, so there was a question of, I thought so if you're asking to recreate death no up, if you got to recruit if you said you can recreate Devon Well again, it's like, we've been talking about regular files versus special files, especially you can
create it but you.
So I specify that you can create it, but you can't create normally.
Okay misunderstood the question so.
So I mean misunderstand the question.
This is one reason why I have many questions but it's like can you make. So, one of the key things you should parse these questions, word by word because I tried to be very careful with how I work things.
So you can make a file that acts like death no but you can't make a regular file, all those other ones are special files, not regular files.
So, so yeah so I'm not saying they're open if there's potentially ambiguity, we can actually update them I'm not saying, I'm not saying these questions are perfect, but I'm record you find what I did for the midterm.
If you look at, so you can't look under the feedback for the thing because I can't upload feedback. Instead, there are separate grade columns.
You know, there are there are several great columns in there there's actually a feedback one and a feedback to because it's a 50 character limit on text fields and bright space, so you should see exactly what you got for each question their
progress great yeah
i thought was saying can you make a regular file into one that behaves like dev No, well you can't make a regular file because a regular file. If you write to it, it's going to store the data.
You know, it won't disappear.
If you read from it, you'll get the data that's the ideas, that's the special about dev knows you write to anything you right. You read from it, you won't see it reframing you always get nothing.
It's not under feedback, it's under look under your grades.
Yes, it's a interfere just numbers, it's the the format of it is the question number, colon, your mark. I had to do it in a very compressed way because again 50 characters
is the way to see the answers I have the midterm. Um, I don't know if you can see the files that you upload but you should have a copy of it, and
if if you can't.
If not, I could probably send it to you later I've actually asked you to Yea, if you don't have your midterm and you want it back then you ask them for, but
that dev know is a node.
I don't know where you read that it's a node dev knows a special file, which wiki.
If it was under my wiki is like.
So,
I certainly, I mean, if there are certain questions that are clearly too hard or something, it's like, over half of you got it right so anyway let's go into question two.
What does the statement or declaration that cook during the falling assembly code. Most of you, we bless you. Let's see how did you all do here.
Okay. Yes, that's right. So, so if you're asking what's the dirty a special file and a regular file.
We're going to be talking. We've talked a bit about this, but the key thing is a special file is a file. So, let's, so there's a question here what's the 30 a special file so a regular file is, if I go to my desktop.
And I do an ls here, anything that's a regular file has a dash for the first column.
And then there's directories Brancusi called directory directories, but then otherwise.
Special files is everything else character devices. So, I'm
okay so anyway so going on to question two.
Yeah. So, Yeah.
So explain how to utilize California C code yes you're supposed to give a declaration, and then show that.
Yes, it's just it's just there so here you can see that 90 of you got zero.
Almost 100 of you got, you know, you know, got full marks, and then a lot of you got some not a partial marks, half a point 1.1 point five points.
So,
I didn't question to how did the code, except one.
Well, you're supposed to give this and explain it but again it's so here's a key thing up.
The answers on of the questions are not going to be exactly the same as the answer so the here are not going to be exactly the same as the assignment.
So too long.
So this is.
So what distinguish one from a two for this question. Oh, it's all about Did you explain it, probably, I can ask the team, you know, things but again look look at it and see if it seems like, you know, it's not there I mean I happy to talk to you about
it.
Yeah, so, like if you took what we were a string is an array of characters Yes.
So the trick here is to understand. So how would you, how would you answer this. How did you know. So the idea is that here we had this is a string, which corresponds to a string literal in C, but then you have this quad, which were which refers to the
same symbol. That's a pointer.
So that's what I expect you to you I've seen like you did this in the assignment, you looked at the assembly code and things.
Yeah.
So, again, fan exactly what the Marx's mean the th tried to be generous but you know they're trying to also be consistent.
Anyway, now 123.
I'll have definitely I'll have one for next week, I'm not sure I might be able to do more later this week for interview times.
So, so labels. So the label in, so when it's happening here with assembly, the label here is the, the basically this is the address where this is going to be stored.
And so what this is saying that this is you're going to have a pointer, that's going to have the value of this address.
Because like if I had quad and I had had zero means okay that's going to be, you know, four bytes that's gonna be set to zero but no the second you said to the value of this address well quads actually sorry 60.
It's such a bite 64 bit value, but.
So, These are things like.
These are the things you should be asking when you're looking at the assembly language.
And
what what I was expecting you do when you look the assembly or it's not like okay let me learn enough to be able to answer this question, more it's like, what the heck is going on here.
And if you ask, what the heck is going on here and try to understand a little bit of it you go like, Oh, this is what's going on and doesn't really answer the question.
The file is going to be cumulative.
Okay. So, last question. So, so part of it. One of the things also this question if you ran us time, I remember every question is worth the same amount.
So you had to divide up your time mean there's 15 questions, and you had, you know, 80 minutes.
So you had five minutes for each question. So you had time to think about each question, some of them you should build answer quickly ideally and go through them but if you spend huge amounts of time to solve them.
Yeah, you're definitely run out of time on the others.
Yeah.
So okay so the problem is I don't know what I don't know I mean,
you look at you saw stuff like this in the assembly, and then you saw the C code. So it's like trying to figure out like okay what's there like yeah so okay so anyway so question three list, I haven't heard of answer the question three.
Okay so this one.
I was looking for a different answer than most of you gay, most of you did not give this sort of answer a lot of you said things like, well they're,
they're really worth it was a great question. So question three.
Yeah, it's all kind of spread out.
I still need a good chunk of you got the full marks.
But a lot of you like got half marks. And it's really about, you know like, if there was something about you saying that okay they're not going to, you know, they could, in principle, because they're moving together, but there are some mechanism to prevent
that, but we haven't talked about any mechanisms that would prevent them from running into each other. So what I was hoping for you all to realize is if you, you saw the addresses of those and realize those are really big numbers.
So,
the exam is on the eyes of the exam is on the exam schedule I have, it's funny I finals December 16 I think 7pm I posted to the wiki.
Yeah, if you had to recruit also an infinite recursion stack. Yeah, but you would have to consume your problem would have to consume 32 terabytes of memory.
So if you're trying to consume 32 terabytes of memory your computer would have probably run out of space, long before they ran into each other.
Yes. So, in print Yes, so basically it yes, it could happen but it's very unlikely and giving some reasonable thing of work you're likely so
what up bunch of empty variables, if you caught So could we could you run.
If even if they're empty variables, if you're storing explicitly to memory.
If you're causing the system to have to allocate memory not going to say oh it's all zeros. Well, if it's zeros then yeah but if you're actually using that space.
It's sometimes there's some tricks you can do if it's zero allocated memory, but if you're allocating, I mean, you're gonna run out of space.
Half point so if you feel like you're halfway was essentially the right answer.
there are mechanisms to prevent them from running into each other. Yes.
Um, if you gave a more complete answer of like what actually happens with guard pages and stuff like that and you should get full marks.
Um,
But yeah, anyway.
Swap memory. A.
Do you have 32 terabytes of swap.
Anyway, I'm described the data structure that holds the command line arguments, is it as simple array.
Be precise, you know, so here. So question for.
So question for its interest interesting to see like some of the questions that I felt that now Cindy more ambiguous versus the questions that I thought were pretty straightforward.
If I look at the way the marks go.
There's variation but there isn't as much as I'd expect. So question for it's really explaining that, you know, it says it's supposed to be precise using the seat type definitely explain what it means, really saying is, okay command line arguments catch
your car pointer are the, this is an array of pointer to character arrays, you know.
So, if I put a carrot with, you know, and then, And then really know I really want to hear was that each array character is told the know character with your children no character.
Because the data structure isn't just the type.
The data structure is also how it is and one of the key features of it is that there are all these nodes, yes there's no other strings. If you didn't have that setup because that standard see string thing, but the know at the end of the array of pointers
is kind of weird
questions, so for question three I was not expecting you to talk about mechanisms. I was expecting you to so sad. I wasn't paying attention mechanism.
And in fact, my answer doesn't say anything about mechanisms. What is expecting you to have looked at is the addresses and to realize they're really far apart.
To really big numbers
on the final exam will be exactly the same style.
Yes, the final says, No, I'm.
That's what I was expected to go like, wow, the stack is over here, the heap is over here. Look at how big of a different IP address that is that would be huge.
So, you know so far should be there so five. Okay, so.
So question five.
What did I expect you to know for question five.
So question five was.
You looked at care and Environment Variables environment so you had code in the tutorials, specifically, I think, in 3000 shell with this. So ya know that this one does the amendments so I think that's true.
Not that this one does the amendments so I think that's true. So, in 3000 shell.
There is this entire thing function here going through the environment variables and walking through the environment variables, whereas you're seeing what sort of thing is, and the thing to note is you're doing a linear search through that, because it's
a bunch of. It's a character strings with an equal sign in the middle of them. So you have to parse every character string and then look at it and then go through it linear so for much space complexity, you could argue that it was.
I expect you to know time versus space complexity so when I talk about efficiently.
It's like, well, depends what you mean space wise yeah it's pretty efficient it's very tight time wise crap.
So, for question five, I think you should mention memory and runtime complexity and the question. The whole point of question five is your friend says this, so your friend is inevitably saying something that is imprecise.
So, what your job is, is to say it in a precise way.
So what is basically what I'm asking us what is the environment variables. You know how are they stored and give me some sort of efficiency analysis of it.
space and time.
That's what I'm asking for informally.
Again I pre record of this classes data structures, I assume you understand data structures.
This is a pretty darn simple data structure.
I said he was right at say a key value pair but it was not an efficient.
Okay.
So, if so efficient saying that it was a key value pair but it was inefficient I thought efficient manner how useful it is.
I'm information computer science we never talked about efficiency as practicality again you know that's something that's covered very heavily in the, in the curriculum.
You know, whatever it says someone.
If you're talking about efficiency in computer science, it's always about space and time.
Some of these can be sufficient space some things to be efficient and time again I assume at this point is a 30 year course you've had data structures, you've analyzed things, so you can talk about these things.
So I really always looking for. Explain me the data structure.
Is there a faster way to do it.
There's a million faster ways, a tree a hash table. I mean, there's all kinds of key value stores.
The thought, that's an argument you make decides and very unfurls is not large, typically, but there's no fixed limit on how many environment variables you have when the reason why Unix uses it this way because yeah, most of the time we don't care about
time efficiency because it's so small, But from a strictly, you know, it's space efficient and time efficient,
More if I got too much of it okay right yeah
okay so yes sir.
You don't worry about the inefficiency yourself.
So, again, what's your, your friend said in our inefficiently store key value store so basically when this phrase that made you think data structure data structure analysis because we're always talking about efficiency and data structures and.
So, talk about it.
So
one of the things that I'm
what the thing is it actually is efficient. So, one of the things to understand our data structures, is if your end is like less than 100.
m.
Linear searches actually probably you're better option that doing anything more sophisticated. If you're doing like you know linear search for days about endings 100 is probably better than doing any sort of tree or hash table layout because it's so small
you might as well go through it you just, it's, it's just not worth it, or the Anything you'd improve is not worth the space you'd lose to try to do a more complex data starts with the account pointers all over the place and everything it's just not worth
it.
So, but again this is part of trade offs.
So, Christopher, um, basically that you know you're, how much you should get is, you're supposed to give a full explanation that you showed this and so how the th gave partial marks.
They tried to be consistent. It's hard for me to figure out exactly a rubric for what you get, because I'd have to look at all your answers before. So that's why I have to say is great, individual questions completely so they can do it fairly.
But again, I can look at your answer. And, you know, decided, but so six. Let's look at the distribution was it so is it easy for a program to change the value in its art VOA, is it solely easy to add elements the RV right, So here again this is a question
of what the heck is that data structure here.
And again we have a lot of people getting, you know, well, third of the class getting like full marks a lot of people giving zero.
But then, several people know.
So, you know, is it so. So the idea here, it's easy to change because it's an array of pointers, but always just change the pointer of habit point to something else that's all you know your overwrite the variables, but if you want it to grow it, it's
the same problem as all see data structures, it's an array growing it means basically you've got to reallocate it so it's a pain in the butt. So again, this is something I expect you to understand from 24 one real I'm taking apply your knowledge of See,
combined with what you've seen and telling me something about this
question seven
questions seven here. So question seven most of you missed this one did not go well. But again, so there are questions here that I expect all of you to get, you know, if you've been paying attention in class, like, up through one through six.
You know what one okay it's a little hard but it just like thinking about like, Whoa, you know, Deb no behave does not behave like a regular file, just in a very naive way like you right to it and when you read from it, you get nothing
and no here, we looked at assembly language so I expect you to back a little bit of knowledge of some language here. It's a, I expect you to look at the addresses and look at the numbers and so we are wanted you to draw an inference from the numbers that
you saw, and think a bit about it, you know, but again you know this is a little harder. This is applying your knowledge, as I would say as you So, but then here, described the data structure that holds travelogue rates, four, and five, four, This is
just described the data structure, five.
Okay, a bit more application but like partial Mark should be know this full mark you really had to understand it.
Six, this is basic see just what is the RV array.
You know, seven.
Know seven. This is harder. This is one that gets you too thick.
So this was a hard know so this is not a question to Google.
So, you can of course progress. Yeah.
so.
So again, if you there can be great in yours. This is why you know talk to me or something or if it's just one question, you can send a message and say this is my answer.
There's other things but if you want a golden more things by separate interview.
But this question. So what white space here is that I showed 3000 memory layout is randomized every time a problem is fun. So you saw this, And then we can disable this using set arch.
This also see.
So you did this, you did this. You do know here what you do with astronauts X ray shows you the system calls that it's done. I'm now showing us system called that I did not specifically discuss, but it's clearly a system called because it was output by
Asterix I've told you that here.
So what I was expecting you to tell me is that we did a system call to randomize memory. So, it must be the colonel, that is randomizing the memory lane.
Yeah.
Okay, so if you so.
So if you I'm not thinking so it might have gotten so, you know, if I said if the list crow control, live pro control process memory.
So I guess I have to look at your answer to see what's going on so.
So, again, I'm so I'm the one who's doing greatest news right now for the midterm, and that's what the interview process is for. And again, I'm happy to do, I'm going to do more interviews to kind of do things.
If it turns out that you just have like one or two questions that you want to like, what was going on with this, you can send me, you know, a message or an email with like, Okay, this is what I answered and this is the Mark I got, and I can potentially
do that but for more than one question. Let's just talk about
the personality part of the colonel i'm not sure i guess if I look here at so so up, let's go into question it so you're running a program on a new version of Linux as a new system called faster libraries have not been updated sport faster, can you make
stands compliant see programs like fast recall. So here was expected but we've talked about, I've talked about multiple times I know he's that and we've seen the assembly of system calls which is function calls, is that you can't make system calls for
regular See, that's not standards compliance, you got to do some weird thing either inline assembler some special platform specific directive in order to generate that special instruction that does the system call.
That's all I was expecting you to answer this so I thought this should have been pretty straightforward. and for 899 of you got zero.
So, I don't quite understand why they're
so
this mid term was not designed for you to be doing searches.
If you try doing so.
I'll add this two things.
I think this is a key thing that got a lot of you wrong when you saw a term that you didn't know the first thing you did was do a search.
And I'm not saying doing the search is completely wrong but this is a test, you have limited time, I was, I basically wrote this as if this was a closed book cast.
The reason in fact that's why I would normally do it the fact that I'm not prospering it mean it's open book because, well, it's there and, in, certainly, well there's a few questions where I said you should probably look at the code but I'm expecting
you basically use the knowledge that you had.
And if you start doing searches and reading stuff you first of all you burn time.
And second of all, you're not really reading the question.
Is there a C function system. There is not a standard c functions is called because that's inherently platform dependent, because it depends upon every platform.
Okay, so if you search, if you have if you search for everything.
Yeah, that you're, you're doing it wrong, you should not need to search these if you did the assignments. And you did the tutorials diligently.
You should not need to search for these things.
If you have to search all of them. Yeah, you definitely didn't have enough time.
Yeah.
For Question, A Do we have an example that you so, so, so, so question.
So question eight. So, question, eight is not question eight we had, there's multiple things talking about for question eight about how system calls are not regular See, I have said that many times, and that's in there and I've shown you how they're not
the same, because you compile C code breaker c functions you get these call instructions. Yet somehow system called short with assist call instruction.
How do you generate this this call instruction.
So, but again that says called function was not a thing. And again, that's this call function, if you did a man, this call was okay so let's do that so
indirect system called description.
So as architecture specific requirements. Each architecture, he has his own records on some concerns about the colonel. So, this is, you know, so you go through and read this all
you know this is, I mean, this is all architecture x86, you know is talking about how some architectures do this and I mean, this is standard see.
I mean, this is basically talking about assembly language.
This is.
Ah.
So, so I said this many times I was expecting you for this question to basically, you know, for this question to essentially just repeat what I said and lecture.
That's what I was expecting because that's what's basically saying you can't write you know it's not standard see.
It's weird stuff. That's how you get the assembly code that does those weird things up now.
Yeah.
Yeah. So anyway, that's.
I that was, that was that was supposed to be easy and that clearly wasn't so anyway. Well, we can try and talk about it more but
if you're killing our secret is not standard see.
Okay.
So I assumed in 24 one learned about what was the language see.
Yes. First of all, it's a library calls libraries are not part of the see standard. The only standard libraries that are part of the see standard are the things that start with standard standard lib standard IO
know, those are the standard libraries maybe math or something. Everything else is like weird architecture rear operating system Unix see things
here.
So,
you know, because there's basically that's what you know there's a C
standard Iowa's, but so I get that well.
But I talked about I mean I didn't didn't require you just remember things will pray for one it was like I said this multiple times.
No, that doesn't mean that point many times that because I got I showed it to you because like, look at the assembly. How the heck did you get a Cisco instruction and your assembly.
That doesn't correspond to anything and see how would you structure that did that.
Let's, let's go on,
which is bigger so this question.
This is specifically designed this to take.
I it puts out an attack Alex for you to think about it. And so this requires you to do some problem solving and thinking about this because what you can do is very simply, look at the size.
If you look at the size of a static Lee compiled binary.
It's bigger than a dynamically compiled binary, but it's smaller than the C library.
So, this is so like if I do
like find.
Okay.
My Hello World program.
So.
So that's Hello, hello stock is clearly bigger.
Is this.
So note the difference here.
So note.
Static is 800 K.
That's all that memories there, but Hello was 16 K. But note. The library is 1.9 megabytes. So this entire library is being loaded.
And this this this taking up more process memory.
But it's only 10, but this is only taking you know this, this takes up less space, you know, this is less on disk, this plus this is bigger than this.
So, this is a tricky question.
This question. Again, I have a few questions on here that are tricky, the personality one. I didn't think would be that tricky. This one was meant to be tricky.
Hence the metallics.
You know, in process memory.
Is there a way to see process memory of a currently running process.
Yeah, your h top. Yeah, you can. Yeah, you can. Yeah, you could run h top your top you can see how much, how much memory is there but again this is.
We all this had to do is like the process of I think is like what you load, when you load a stack of the binary you just load the binary. What do you load with a dynamic link binary you load the you know you load the actual program, and the libraries,
so if you just look at the size on disk of the library of the libraries, plus the binary. It's bigger than the stack link binary.
That's all. I mean, I expected this be tricky but again you have all the information you needed to answer this. It just is a question of thinking a bit about it.
Process memory is basically what's running in RAM thought process, the address space.
Definition of process memory. So,
What would process memory be
know the dynamically like live but binary does not include the library. That's exactly true on disk, but to run it you need that code.
And that's it loaded at runtime and you saw all the system calls of dynamic linking, what is it doing its opening the library and loaded into memory.
We haven't talked about the exact process of that.
But that's clearly what it has to do.
Because it's not just ignoring it the static one included it
right but that's
now turns out that there's all these efficiency tricks that it only loads from disk what it actually needs at runtime, but it's still technically, all in memory in the process.
Yes, so. So notice. So notice the theme.
Notice the theme of my questions.
If you had a good mental model of what's going on.
you can answer these questions easily.
If you pattern matched on the words and try to look for something we did and just kind of said oh this seems similar.
You're not going to get it because you're not actually demonstrating understanding.
And this is actually designed to my midterms of my exams are always designed that after you do it. If you've done it properly, you've learned something because you thought about questions you haven't thought about before.
Assemble knowledge together, and then go like, Oh, yes, of course.
So you don't find this information online.
Yeah, it's.
I'm expecting you to problem solve.
So, isn't the library, including the stock library to yet but but you see this.
So the okay so flash proc that now actually you know that that certainly could work, but just look simple program which you did met this many times, you know, dynamically compiled starkly compile.
Okay, this one's smaller This one's bigger.
But we also looked at this LED, this is what's getting loaded. How big are those files,
those files are loaded at know we talked about when you dynamically link it loads the libraries. When the program runs.
How big are those files. Look at those files, they're much bigger than the stack leave static binary.
Can we get prep question next time we can practice I saw they helped more than just the assignment course notes.
We. Yeah.
So you're not
practice questions on the assignment questions.
But again, you should, so.
So, this is Stacy satellite is 1.9 megabytes.
And hello static is 827 kilobytes.
So I'm happy to do. No, that's what the review section, I'm happy to do questions.
Yeah, so this with people asking first question is like I given you the assignments in tutorials. If you answer them right, you would have learned the concepts, but I think if you just are relying too much on Google just to say, Oh, I found this answer
I've looked it up, and I put it there.
You haven't built up your conceptual model of how things work.
Okay, anyway let's let's talk about 10.
So 10 Let's see how did everyone do on 10 or 10 people that badly.
I agree this 147 zeros.
My lot of this was because of blanks. A lot of you didn't even try this one I'm guessing made because you ran out of time because you're busy searching answers for the rest.
So 10, don't make a lot of stock calls with every command was a maximum of calls will make it give us as well xk command.
This is what I what I was literally expecting you to do is, you know, for you to understand what 3000 shell was doing.
For every command enter, so every client entered is making a call, where is that happening. Okay, so let's look at 3000 show. Let's look for a stat.
Okay, there's a stat return but that's not a stock call, there's the stat call, whereas the stat calc. It's in find binary.
Okay, what's fine binary doing.
I would expect to you travel look through the program because you had to take this function apply it in a different one. That was on the assignment, like, oh, what the heck is this function doing it's searching through the path.
So how many times this loop go through.
Nice, you know this is all incremental through each element of the path, and it's an array of, you know, path variables. So, this is, this requires you to understand how it was going through the path, because the path of rate is one big string.
But get to understand how it was going through and finding that, you know, finding the colons and basically replacing the colons with nose and do it so you had to understand how this loop worked.
But again.
Okay.
Okay, so let's go on through question 11, so I didn't expect tend to be hard, but again, 10.
So this is another thing I think that's happening is you're not taking the time to understand the code. I really expect you.
Yeah, I saw Mr. Issa Yasser.
Okay, 11
system calls and much more expensive than function calls at a high level, how to see library minimize the number of things.
This I was just talking about buffering, remember we saw the F flush there to, you know, to empty it, so that's all I was looking for it was you talked about the C library buffers things before writing them out and you can force it by calling a flush
command, that was straight from the assignment.
It will probably more weighted towards the final exam probably more wait for the second half of the class but normally it's at least 30 to 40%. On the first half.
So question 11 again.
59 Have you got 118 God zero.
I'm guessing a lot of you just, you know,
saying about wrapping.
You work harder tutorials.
Okay.
Yeah, No.
Yeah, no, not, not harder tutorials. So, um,
so let's talk about 11 years so system calls are much more expensive than function calls at a high level, how it does they'll see library minimize the number of right system calls it makes by default.
So it's all it's all explained buffering see of that so when so 12.
So here.
So, okay, so there's a question of why don't I do tutorials. Okay.
I find if I can see the answer I can work my way back better.
Can you see the answer, and you work your way backwards, you missed all the searching that was all the thinking that was required on the different things in order to it's not like if you do a math problem.
And I just give you the answer.
And then you work backwards of how you get the answer from that to the question. That doesn't mean you can solve a new question, problem solving.
So, so if so if you're wondering, is something in a tutorial a girl like I don't understand it asked me asking the office hours, post a message to a forum, you know, asking the lecture, please if you don't understand something in the tutorial that's mysterious.
Ask. There are many forums for asking.
That's what the tutorials are for is to provide mysteries that you have to solve in order to build up your mental model, and you build a mental models, not by me just giving you a little things but by going through the process of figuring things out,
Reading the manuals great reading manuals great that is that the manuals, have huge amounts of information read the textbook has huge amounts of information, but notice here it's really about problem solving as much as about memorizing things
banker.
anchor. So, so the reason why I don't, but again, that's what the assignments are for the assignments, have right and wrong answers, and we give you grades and we give you solutions to show, whether you're on the wrong right track or not.
That's why the assignment to their.
Well, they'll make sure that you're on the wrong journey. That's what the assignment make sure if you do the assignments correctly, you've got the right place.
Yet when you get me again, it's, it's not as you should use the man page is much more than just searching for answers.
So if you're going in the right direction you would get the answers right on the assignments, but think that member This is actually based on the assignments.
Not the tutorial but the tutorial, the assignments are basically tutorial so it's all connected.
But it's really based on the concepts more from the assignments
that SATs are still a thing.
You still can do that. Also know.
So let's do a little thing here.
So let's assume you got the class average.
And let's say you did that the same thing on the final exam.
So that's 60%.
Because most of you are doing quite well on the rest of it.
c plus.
So,
so, so this is the thing to understand No.
I designed my grading scheme. So that if you put in the time. If you put in the effort into doing things.
And, you know, I basically have this built in boost of your grade, that if you're diligent in the lectures, and you're diligent in the tutorials and assignments, get a 90% quite straightforward for that 40% of the class.
And then, you know, 60% is the exams, you know if you at least pass me if you get at least over 50%.
You know you're in the C plus b minus territory really easily.
piston younger.
I haven't looked at the cloud.
So, but anyway, so this is a bit harder than there but it's not.
it's not a lot harder than I typically do.
Okay.
So if you're getting confused in the market for your assignments.
That's, that's a problem. So.
So what is this, I'm
just going through this So where are we at through oh so 12. So the idea here for 12 is to understand print half here, this is you know print FF print off like those are things you do in normal.
You know, no normal 24 one s print app that's kind of thing. Those are all satellite this D print F is using a file descriptor a file descriptor is a very unique see thing.
Well, again, but that's Unix not there so
was ready to say it's like s print off that should be portable print F, that should be gone portable FF. So it's really this, what's the difference between this file stream vs this file descriptor.
And if you look at F print F is part of the C standard library. I mean actually the way you look at it.
Okay so okay so
well.
Is that all in standard I Oh,
maybe I might need your me My answer is wrong for that. Because this is very unique See, but my man page is saying that's in standard less standardized Oh.
So, this all stuff you should do it.
And this is true. The whole purpose of fee files can abstract IO way
me to give your points on this one.
Put a built in.
Let's see what it gets that so this is 12. Okay, well I'll talk, I'll figure out how to grade 12
standard library function is used to associate the signal signal handle again. SIG auction. You saw this a lot.
Notice the difficulty is not necessarily easiest the beginning hardest at the end, kind of, it also depends on what your perspective I sometimes not quite sure exactly which ones you can find hard and easy but, you know, does this like function actually
called a single handle this is. Did you understand what how to make out what signal handlers.
How do you know how do you know it doesn't call the signal handler, you're defining the whole point is a single handle is called when the signal comes in.
We didn't cover the signal is it is a standard library function for defining it
it technically is right if you mentioned signal, you potentially have points but honestly we did never use signal in class.
We use SIG action because I can I can take a look at that but that meant that was not the.
Where did we cover sick action, only you signal.
What, what are we talking about here.
I'm
sick action
right here.
This is safe option right here.
This is the only way we define signals.
I said it called the signal hand with a single SOC by the process.
Yes.
Yes, exactly. It calls single end up seeing as us, but what it does is it associates as he lost the signal handler. It doesn't call it.
So again, I'm not going to look at me. If it potentially it got Miss graded. I mean this is one thing when the interviews I can go through it and I can then go tell da that things got these things.
I'm
sorry,
one second here. I'm just going to, I have to go for one second here.
Oh. Okay, there we go. Sorry about that.
So, 14 and so.
So this is a guy especially you know the code from their tools. So one question to have you saying you didn't have enough time for 14 and 15.
Again, part of test taking is realizing that you have to allocate your time.
So, every question is, um.
Okay so anyway so going back to hear DPF trace and so was wanting to be a can't do with pictures with a key restriction so here I was just looking for 14 is this.
You can see all the processes, and you have to run it as root.
Your to run that. That's all I was looking for me So have you had some other things, is the PDF sites right there to fix that.
So 14 should have been pretty straightforward.
Um, and then.
Let's see how did you all do on 14. Yeah, not great, but 15.
At least love you got partial marks and 15.
What system calls us to send a signal can signals be sent without using the system call the kill system cost me you send signals.
This I expect you to say, Well, you know, prophecies get a signal when they hit on allocated memory. They said fault.
And so they divide by zero so they get toward for just sick child sick child you get it without anyone sending the signal was a process just exiting so there's lots of examples of signals that are sent without kill
control. See ya.
Remember as racism card st okay.
It's under, under the under the announcement channel there's a tab at the top for a things I'm.
Oh, I'm not gonna make any promises about the final, but, um, but we'll see. So, so one of the things I know it's like so first of all I think some of you ran out of time.
Every question is,
the final been based more on the second half of the course but.
But yeah, it's um
it's based more on the second half of the course but still it's me a lot in the first half, because of course, these concepts I'll carry through me a lot of this will be kind of taking things that we've learned the first half and elaborating on them.
But if I look at to see what a lot of what really seems to be happening is.
Okay, so.
So, first off, do a search online only after looking at the man.
After you try to figure it out, like that's what you do last not first.
working with others can help those, those are the two things. There will be more interview slot, I mentioned that I just haven't
assignment three will be posted within the next day.
So I think my, um,
the mid, the final exam will probably be a bit easier than the midterm.
Um, What I am concerned about is a.
I think a lot of you aren't
aren't trying to problem solve and are not building up detailed mental models of how things are working.
And just in terms of learning objectives.
One of the learning objectives of this course is for you to learn Unix.
But another one is how to understand how complex software systems work and how to navigate in them and how to deal with it, and how to figure things out.
Using experimental approaches.
So you what you should be doing is trying to take this thing go like, what the heck is this doing and I'm showing you all these tools, and all these techniques for going, what is this thing doing, and you can find out by doing tests and seeing what the
heck is, is there.
That's the point of the tutorials.
And why don't want you them to be. I'll have them explicitly great except as a participant, because that's your time to explore. If you've done the exploration, you go to the assignment, and it should be quite straightforward.
If your assignments are hard.
You spend lots of time on the assignments.
That means you didn't learn the right things from the tutorials.
So right now you have two tutorials the assignment will come out of soon take them seriously.
And I'm saying is, but don't approach them by trying to search the every answer because you can spend a lot of time searching for the answers and go like, and just going to it's like that won't help you understand what's going on.
And that's in fact what the final exam with the midterm exam showed you is how incomplete your knowledge is when you do the searches, as your first mode, as opposed to trying to problem solve, treat these like math questions.
Not a scavenger hunt.
Yeah.
Yes, yeah took the experiment with new heart based understanding was like, how do you acquire the base knowledge, the base knowledge is.
Well first of all, read the textbook. We all the textbook has lots of things. if you feel like you're missing certain key things, you know, look up any term I talked about, it's all there.
But it all depends on where you come from previously but you shouldn't be able to by doing the things I show you. I got all the information there.
It's all, you know, putting the pieces together but you have to put the pieces together. That's the trick. You have to have that mental, what is going on when I run a command.
What is exactly he doing what is for what is the signal.
The should be concepts in your head. At this point, that are all connected together and if they're not connected together. I can't connect them for you.
I can show you 10 strategies for how to build up that mental model but it's not something I can just put in your head.
That's the nature of mental models.
They have to be assembled on your own, and reading a book can give you some of it. Doing experience and give you something but ultimately it's a synthesis process.
And you're responsible for doing that. Just like when you go to a co op, or go to a real job and they put you in front of a multi million line program and saying you got to fix bugs.
You're going to sit there and go like, what the heck is this program doing.
You can't do Google searches because they're the searches will tell you crap. You're gonna have to sit there and problem solve and go like, what is this thing and you have to use tools to do experiments to see what is, what behaviors and maybe you can
ask some questions and people will sit there and give you some high level explanation, and maybe they'll send you some documentation which will be incomplete.
But you're going to have to sit there and put together enough of a mental model to understand the task at hand, but inevitably that mental model will be incomplete.
So, realize if you did, if you did well on the assignments and tutorials, you did badly on the midterm. What that means is your strategy for learning this material is flawed, and in particular, it's flawed in a way that will cause you major problems when
you leave University.
So
is the midterm, the final exam will replace the mentor.
Yeah, the final exam will replace the middle mid term. Yeah, so.
Yeah, it's going to be doing the 19th.
So you have you'll have at least a week, again I'm playing I'm having it putting up tomorrow but, again, the real learning for that if you do tutorial five and six.
It will be straightforward.
So again, if you're thinking of list of topics,
go back and look at each question.
I can give you a map, you know.
Yeah.
The classes over. I will be in office hours I'm happy to talk to you individually, but, um, and I will be putting up more interview slots I want to at least go through some of them to decide, like, how many there are, because I might be able to reduce
the number of interviews that are needed and they go, of correct some grades and we'll, we'll see that.
Anyway,