Okay, so i'll start recording now
Here we go. so good morning, everyone. But so first off I have to warn you. at some point in this lecture.
I may need to pause and go away for a couple of minutes.
I'm not out of just show you it's easier to show you rather than okay.
Share my screen, share.
This is a window I currently have up on my desktop.
So at some point. If this changes, I may have to take a couple of minutes to deal with this.
This is for my daughter. She wants tickets. So so. so, just so.
Yeah, They've got 3 shows set up for I will be going, I mean, I will.
I I might enjoy it actually. but no I think yeah yeah they're they're my youngest is 14, and she's going to go with her friends, and it's gonna be quite something, and we'll find ticket some other way assuming this will work out but it was supposed to
go on sale at 11 Eastern and ticket masters having issues.
So i'm guessing i'm gonna be able to just kind of keep going here.
Yeah. And yeah, exactly. How How do you see assignment?
Feedback. if you look in the assignment chat there's something things about finite feedback, and for the midterm.
It's all on no like it's all on what do you call it?
It's under progress class progress so make sure you you check that sorry for
So. But let's so all of you now you should see your midterm.
So terms a 2 are graded
Did you all get notifications for the feedback? Okay.
Good. Yeah. so good that. So look at your notifications.
You should see it there. Yeah. 2 apps. Yeah. exactly like I.
I have to split. You know why I have split into 2 fields, because the maximum length of a text field in bright spaces, 50 characters I have to make it fit, you know.
So I have to expand that I could upload feedback files.
But then I can't upload the grade also and it's just yeah.
So let me annotate it it's just like this is all better with little anyway.
But moving on one of these days i'm just gonna probably just use a separate complete web app for and just ditch bright space.
But
It shouldn't so the the wave the things are it should you should see It's the question number and then a colon, and the number of points
There's another way to do assigned feel that let's do more detail.
Yes, there definitely is another place, but you can't fill in that field offline.
You can't upload the that field you can upload files. and so I I I may play with at some point trying to attached files. but it's all just so, yeah and you know and and do it it's
just we're doing the great guy I wanna do anyway, but so all your things there.
If if you can't find it let me know I can walk you through it in office hours also so
Oh!
Sorry.
Oh, okay. Okay. So this afternoon
Sorry about the dog in the background there. well, we bring Rosie up here in a little bit at least, that regarding
So i'll be so i'm gonna i'm hoping to interview around 2025 of you.
I will at least at least at least 20 randomly picked.
So i'm going to send out messages for that and so we'll be doing a couple of weeks, so basically, you know.
Do it before the end of the term. so. But remember the Okay.
So, anyway. so please sign if you
So if you want to discuss your midterm grade please just sign up for an interview, and then we can go through it.
You can't come to my office hours and get you know try doing it.
But I this way. I can just give you, you know, individual attention and not have anyone else waiting to talk to me.
The interviews. they're currently if you look at this it's a
So if you look there, there's a spreadsheet now
So there's a tab there if you look under there, and it's basically they're currently you know they're currently slots for tomorrow and Friday, maybe 11 to one and you know one to 3 on Friday
but so so take up take a look i'll be adding more times as a slots fill are there.
So otherwise what I want is so, rather than spending my time going over the midterm, one thing I will note is
I do want to note that the average for the midterm was around 67%, which is you know pretty good.
But
Hold on. if you want to volunteer so if you come to my office hours, I may just tell you to sign up for an interview, because i'm gonna have to talk to other people about other things.
So please sign up for a slot if you want to talk about your midterm.
Yup. The average is 16%. Yeah, which is c plus which isn't bad for a class of 200 a lot of people did very, you know, a lot of people did very well. a lot of people didn't hold on a second
i'm gonna get the dog awesome come on
Oh, yeah. So
Medium was about the same so it's it's a it's a bell curve, but it's very flat, so I think the
From my experience, people who are generally doing not so well haven't spent enough time that you tutorials I probably tried.
Okay, Yes, yeah, you can see the yeah it's it's there, you can see where you know where you are so for those of you who did. Well, good job those you haven't done.
Well, now I will tell you that
So just week
It's left skewed have to look at the distribution.
I think. is there a solution seat for the mid Charter?
Yes, there is. I posted that under teams and and if you look here, you'll notice right here this links right there.
The solutions click on that link you'll see the solutions
Good the substitution is automatic you don't choose how it substitute.
Basically, I calculate different grading schemes, and I give you the best great of all the grading schemes. So my idea is that if you really show that you learn things by the final exam, I want that to bring your grade
up. but most people end up having their best grade.
You using the default trading scheme because I, 20% is tutorials, you know.
80% of the tutorials showing up 4% as lectures just showing up.
And you know, so that's 22% of your grade that you there's no reason you can't get a 100% that
And then the 8 times, you know, 18%. you could just have to put your time in.
Okay, I will say, Simon, 2 number you didn't do so well, let's see if there's some systematic grading issues or something.
But I have a that's a good thing to talk to you about yeah. So yeah, exactly. so.
Things are automatically substitute. So is our chess game.
Repeated questions the final Not do. Possibly I have done that before.
But certainly a lot of overlap. so same concepts.
So the the final exam is cumulative memorizing memorizing.
The midterm probably won't help you much but understanding everything in the midterm.
We'll definitely help you
If I haven't enabled the assignment market to do averages message me and i'll post a message to things i'll enable that I may just have to flip a switch Yeah, but i'm happy
to to enable that Okay, let's move on
So where we are now, there's tutorial 7 hopefully.
All has spent some time on. these are fun tools, I mean.
I I can spend some time later, kind of showing you these things and their stuff.
But that's actually not what I want to focus on today today.
Is that? Yes, today is the drop deadline. So
If you want to drop. Okay. But this is why I wanted to let you know.
It is possible to bring your grade up but the course doesn't get easier.
So make your decision
Yeah, Well, we'll we can check on you know showing the great distribution stuff.
I can do that on teams later. what i'm now going to focus on is right.
I explicitly know I enable for midterm.
I may not enable the assignments, so I just have to change the setting rather than talk about this.
But I really want to talk about is moving on to 2 or 8, because now we really need to start talking about the current at all internal modules.
Okay. So
Tutorial 5 and 2 tutorial 6 are what are due.
So. So we're talking about deadlines so We are right now. So assignment.
2 you know 3 is, Do the 20 first we're now sitting at you know it, says the fifteenth, so they do.
Monday night. you can actually, I think, submit it till just before lecture on Tuesday.
But So but that's tutorial 5 and 6 that I do, because that's what's relevant. Now the assignment. there's nothing about ebpf stuff on this on this assignment.
That you know
Yeah, well let's talk about
For the final. You should look at Concept basically 3 assignment, 3 assignment for the midterm.
But the midterm is, I could go back to assignment one and 2.
But i'll basically probably go make the questions up from the term and assignment 3 and 4.
Yes.
Right.
There we go!
Now i'm on, and my vm. here. Oh, when you see that message, what you should do?
Oh, you should do the updates and reboot.
Actually I should do when you see this message with the stuff we are doing now.
You should definitely reboot, because what when you see this message that says system, reboot
So what you should do, really here is
Oh, wow! the colors are all messed up with my terminal
Oh, I should talk, I I should oh, that's fine is assignment 3 safe to run assignment 3 is potentially dangerous.
You should back up your Vm. before doing it the the standard script is safe to run. but as you make changes you may mess things up.
So there's a question about going through assignment 3 assignment.
3 is actually, i've already gone through it for one command. So if you go and look through assignment I believe you went through it in the last lecture.
There should be a recording of it. Yeah. why I went through is I went through assignment 3 from 2021 assignment 3 from this year is very similar, except for one command, which I do not believe I've discussed and so
the old version. the old old version, Grand So how did you change route arm and then change route here?
I've got this unshare command this unshared command basically is like change route, but it does a couple of other things.
It mounts proc in there it does a fork of it.
It isolates the pitspace and and it changes the route directory.
So this it it does a few other things and So what kind of you You should look to see how that compares to change route that's potentially interesting.
But otherwise, what's it? The old change through command look like None. Look at the assigned Look at assignment 3 from last year, ?
It basically looks It's just change root got is simon street on the main class page, like the old plan.
So what specifically unshare does that's part of what you should look at?
Yeah, yeah, a target of your commit. Yeah, if you
So if you and by and by default it'll just run bash change group.
So unshares and unshare, runs bash as well by default.
But what this is doing is specifically unsharing aspects of this one.
The rest of the system instead. So we're getting some dot complete container semantics, but partial ones and certainly enough to.
If you look, do a Ps. It looks really interesting with this.
So i've already gone through assignment 3 for last year.
It's based it's very very similar instead of like basically this is this: this change, this one other change in the script?
I'll let you find the other change but otherwise and and I definitely suggest you look at last year's solutions as part of doing this.
That is, I kind of expect you. to do. that and in fact, it will make if you don't do that certain questions will definitely harder than I was planning on.
So yeah, so. but like going back let's see So here we are. okay.
Are we done yet here? No, not yet
So when you So first thing when you're doing the 2 tutorial 8 9, make sure your system is running the current kernel, which means that if there's a message that your Vm.
Needs to be rebooted reboot it but before doing that I'd go ahead and run this to just get your get your Vm.
All the way up to date that because version skew between the kernel that is installed on your system. The kernel that you are running can lead to lots of personal problems.
Then let's but now let's look at tutorial 8 really shows you
So? Yeah. So yes, do this. This is all these questions and stuff, last simple module.
So there's a couple of kernel modules here, first of all, walk through the simple module and
Then we'll walk through the other ones so first let's do. We'll see what that term will come back up.
Yes, okay. So it's so that's removing packages also because we're moving an old version of the kernel and
I type reset because the colors of my terminal were messed up so So because I I should run this into black and white, so I do shut down desert R.
Now, because I always see the shutdown command so now that's what he booting.
So notice. I am doing this tutorial i've done most of the work for this class on my local machine, because it's running a bunch of basically the same version.
I am specifically not doing these tutorials on my own machine.
I am doing them on the Vm. because that is much safer
Okay, now, here. So i'm gonna first go here and just hit download that.
And so oh, wait! that's not gonna be very useful I just really like download my local machine.
Okay.
Okay, Okay.
Okay, So here's first offset and simple and we have simple and then we have this code here.
Very simply, we type make
I know
Oh, right I don't install it because installing would be very stupid.
So if you notice we do the here. And so it should say, where is yeah symbols at the top?
So what simple is loaded? So now nothing has happened. The system seems to be working.
How do I How do I know that i've loaded the module
Oh, you're not asking kirby I I was gonna say, look at your look at the long.
So here you'll notice these are the messages that we get.
I was kind of saying you could cat proc modules, cap. what?
Well, if you look at K. I. are Ls. Maud, and looking at proc modules, basically gives you the same information.
So either can work. but the But what I was wondering is so.
If you look at this code in here just seeing it says, Hello, Kernel world!
Where are you gonna see that message and where you see that message is here?
Come on.
Come on version
Here's Mr. Roshi you do locate a Roche.
So Roshi i'm sure other people in the house left.
I would bet money that he went and ate the yeah.
It should eat my captain Grocery? Yeah, you probably did, anyway.
So for tutorial 8. yeah. So tutorial.
8 junior.
So you download the code, using W gap Now, once you download it, no
Oh, there are therapy dog Oh, that's that's awesome.
The therapy dogs so so we're looking now at there now, will we look at these modules?
You'll see a couple you'll see a couple of things here, now, let me
Now this is a question I would like to see. if any of you know about this.
What are these other 2 modules talking about? So you know what these are talking about Here
What these.
Yeah, So it's not so so
So when you load a kernel module, you are loading code into the kernel, just like if you incorporate an object, file a library into a process that code becomes part of the process.
And if it wanted to, it could mess with any part of memory in your in your process. same thing.
We're loading a kernel module into the kernel.
It can mess with any part of the kernel. it can do whatever it wants, and so if it, if you make mistakes, it could, you know, crash the car, you know it. could you know cause it oops which just shows the kernel notice you did any valid memory
exception access, which might mean that things are corrupt in terms of data structures.
Or if the kernel really noses something bad, it will panic, and thus halt your system
There would be cats or yeah my cats they have a mind of their own.
They're off doing their own thing what was that so that's
So in order to in order for the kernel for this not to be tated, it has to be signed by a key that the kernel trusts by default like I'm on a bunch of system so it's
trusting the signature of the up to, you know just you know Kernel, you know developers.
You know what the people who build the going to kernel package, I think, are just made of, but i'm not sure exactly how the signing works there, but any case the kernel has been signed and all the
modules. the image of the they've all been signed by a trusted key, and that's it's looking for that signature.
So if you're gonna want this to be so what does it mean in practice.
Basically it's not that's the kind of thing it's not signed by the vendor exactly.
Now here's a little funny thing that's so this there's this concept of
So this is hard system of trusted boot. The idea is that to have all you know as an application code come from an authorized source.
One
So this these mechanisms for ensuring trusted boot.
The good side is to make sure that root kits. and other malware are running on your system, because they haven't been appropriately signed by a trust in source. The bad side.
This is also proved, is part of the thing that enforces drm.
Basically to prevent unauthorized copying of copyrighted works.
So so trusted or Well, It's it's now in Linux.
The Drm. thing doesn't come up guys most Linux systems, don't you know, if it hasn't user windows that definitely comes up.
But
So we'll talk about having an unlocked bootloader What they're really saying is that bootloader that will allow an Os to be booted that hasn't been signed by a
dozenated trusted source, ie. one not blessed by the vendor
Turns out, Pcs have exactly the same mechanisms, but what they
Yeah. So yeah, modify kernels. We need to try to really solve those lately.
So i'll get so default say like I trust a bootloader.
See if this
So here's a funny little thing in order to run a linux distribution on a default Pc.
And not going to the bios and change a lot of settings.
Linux distributions have their bootloaders signed by Microsoft back in the day.
That was a pretty big deal, because Microsoft and Linux were not very cozy.
Fact right many years. Look! they were our sworn enemies.
No, no watch. which I must admit it's kind of a weird thing still for me being a long time, linux user.
But yeah, yeah, yeah. So but yeah so basically you're Martin.
So you used all Linux on a windows machine without messing with, you know, enrolling keys and stuff.
Because, Mike, if Mike, if you, running a distribution that has Microsoft Microsoft has signed the bootloader, but
It's all Yeah, So yes, exactly Well, it's it's a mix of hardware.
I'm not gonna explain exactly how it all works because it's out of rather complicated not have to you know.
Go company. but There's hardware and there's software mix So it's really there's a Uefi that's the software.
It's replacement for bios that loads when you first boot your computer.
It's rather sophisticated and can do a lot of things.
But in order to all this, trusted boot stuff it's integrating with what's known as a tpm a trusted pop or module that's the thing that actually holds the secrets of the Pc L it vouch
for things, and also, and it stores the public keys of the one other things that are trusted.
It's a whole complicated number and I wouldn't worry about it too much.
But it's good to know what's there and when you need to.
You can learn more about it to figure out how everything works
So anyway. So But just back here when you saw those messages here that's what you're seeing here this out of tree module training, kernel module verification that's the whole trusted boot system basically going this
is tainted, so the kernel might be corrupted.
Now what we can do now in order to get the so so let's go to the code.
So here's the code for the for the simple module it's really simple, and and this tells you what you know.
First off there's some there's some macros here you know first of you know it's C.
Code What is that there's Oh, meets no i'll show you on my desktop here
Always nice to look at tone. What is syntax highlighting?
So you want to create a kernel module that Apis for doing so. Exactly.
This is. this is what it is you want to make a kernel module.
This is what you gotta do First off you may it's in C. Yes, there's a rust tool chain thing that's
Yeah.
For Nbc. at the same time,
Jason. Yeah, come in my office hours you want to talk about such things.
I'd be happy to discuss so the you have to do some includes just like you include standard I o dot H.
But here we're including things from the linux kernel, one thing to note
So first off. One thing you should note is,
This is a very important fact. The c library is not available in the kernel.
You can't actually use it there
Which includes Yeah, So there's lots so there are demonstrates So all those module, everything here is necessary.
Well, actually, I take it back i'm not sure if these module license, authors description.
This is all defining metadata and I think you can leave it out, but it's kind of rude.
So so this is the licenses i the license.
It might actually enforce it, because you have to say well license your code is under 11.
It's under the Gpl. or something else because it turns out the last Colonel has issues with what code is linkedin and license compatibility and stuff.
That's a whole lot of discussion no you cannot load in unison
Yeah, you can't call c libraries and
So the the real thing I understand why can't you use the C. library is not because it's a C.
Library. it's because the c library uses lots of system calls and you can't use those system calls in the kernel.
Why can't you
So remember, kernel code runs in supervisor mode on the Cpu regular rate.
Regular processes are running in user mode. The C library is designed to run a user mode, and when it needs to access certain functionality, you make a system call which causes the cpu to switch to so supervisor mode and run
the kernel code to take care of it once got things done.
It comes back to user mode when you're in the kernel. you don't wanna be that doesn't make sense.
Do, because you're already in supervisor mode
So when you're in the kernel you'll make a system, call you just call the function that you want to make, but it's not so easy
So this is a thing to get your minds like you.
You can call system call code, while you're in the kernel.
You can call those functions. but when you call them, they assume they're doing the work on behalf of a process, So there's a lot of assumptions about that, and so if you do it inside the kernel thing
is, can get messy? I ask the question. yeah.
So when installing the module, it will run and and it function whatever you set it to be.
What if the Internet function fails? for some reason? Does it still install the module?
Does it? No. So that you have to return 0 if you don't return 0.
That's going to consider the module not installed Okay, Now, of course, your code, however, is responsible for cleaning up.
So if you did a bunch of things to initialize things, and things went badly.
If you don't clean up you messed up the kernel and nobody else can fix it.
The only way it gets fix is by rebooting, cause I was gonna ask, what if simple exit failed, what would happen?
You're potentially screwed well you can't do exit.
There is no exit in the kernel it's not a process.
You return from a function like doesn't simple exit run when you remove the module. Oh, this Oh, this exit! Yeah, this does.
But there's not an exit system call yeah I I know that. Yeah.
So this? So this function? So notice that the declar so.
So what what makes you we're jumping you're getting me jump ahead!
Here hold on a second. So what's in a kernel module here.
So at least check these things here. Okay.
Okay. Oh, Okay.
System. Ctl is not a colonel module? now? So going back here?
What what's so what's the module so so no thanks you have
So you always have to have them anit an exit function which you designate by the module and module exit which I think are actually Macros
So in it can probably fail, for you know, compile success.
Exit
So the to unload the module that's assumed to always work, although I do know that sometimes can fail I'll have to check that. There's definitely a return value on in on the init exits.
Sometimes you can't remove modules by month exactly how that yeah modules can fail to return.
But this declaration is void didn't think about that forward.
We'll check the other ones, but so but that's all you really need to make a module.
So you you create the you know it and exit and then you can have
The these are just
I forget what all the with all the types of log messages are. But there's different levels of severity that you can do when you When you do a log message, This Pr info means that the info level there is no
yeah.
So conceptually notice that why don't you have a main in a kernel?
Module is because it's not in charge that's not what you're doing when you install a kernel module, you're basically adding functionality to the kernel, and when you oh.
I got a message from about the Taylor Sift concert.
Eventually the start of the presale is delayed i'm not supposed to close my browser window.
So there it is. I think they had some Major it issues that's just funny.
Do you have man pages for Colonel Stuff as well?
Not as much. There is not new not really there there's a few man pages, but not nearly as much for so
I I do like Taylor Swift some. but my daughter is a super fan.
So Okay. Yeah. anyway. there is no main function in the kernel module, because it's not running continuously.
Now in order. let's so let's let's start looking at the other modules on the account.
So first off, let's let's try on you know so there are in Mod simple
That's I I don't actually want I do it the wrong window.
There we go!
So I removed the module
And you see, now we get Hello! hello, Kernel world!
Goodbye, Colonel World. So then we can do it again.
And then we get that and notice we didn't get the tainting thing again, because it already says we've changed the kernel.
Now we'll do that again, and then we can
Sorry I have to send a picture here
Okay, So So. And then, when we now look the messages, it says goodbye currently.
So let's not do something get tired yeah i'm just great guys.
Yeah, it's. Yeah. So i'm just looking at the end of the tail is just a tail gives you the end of a text file head gives you the beginning of a text file very useful.
Gaussian use less. but these files tend to be big.
So a log file is often good to tailor there's also a command, Tail dash F, which lets you follow it continuously.
Actually I will do that.
Let's let's do this so you can actually run 2 windows and watch it as an asset happens.
But now let's let's switch to something better let's go to let's look at another module.
So before we try running it let's let's look at the one.
So this one's module i'll i'll demonstrate the ones module, and then we can talk about how works.
So this is what is this? Now, this is
So now we've got the ones module you were made one thing in general.
Remove the old
So the Now we got the module built we're gonna do against
Okay, and then we
So the ones module is loaded, as we expect
Now we're looking there Now we get this one com 3,000 one's device registered using major 236.
So what happened?
That's what happened. So let's say what's the easiest way to access a device like this you can try to leave doing less and stuff.
But Dd. is actually probably the right way
And now let's that's what it does and we can do that again.
Let's do this we'll we'll do 1 0 24.
I've got a megabyte Now
I have a megabyte of ones that's what this device does.
I've created. So if I go into slash dam i've created like i'm in these devices.
You all these list here there is now one in here called where's ones.
Yeah, ones is right here. and if I do in
It ain't there
So you see now. so these are the messages that you get ones device registered.
One's device closed one's device closed unloading one's module.
So this is where we Now this is the messages coming from the ones module as we access the module.
Yeah, I go. So opposite does 0. Yeah, exactly any questions. One device closed twice A.
Yes, because I accessed it twice. I did. ran 2 Dd.
Commands, and so that's why, they got the message close to us.
Now I thought I had a
I'm gonna i'm gonna bring up the code here for the ones module here
So here's the code
So it has. This is what the code is. so module in.
It is ones in it. module exit is one's exit here's the metadata it's the bottom actually, to most mostly put it bottom here is the headers get notice they all say linux except for
Asm. so that's what we have here Well, let's look to see what our actually works.
Yeah, So no logarithm yeah so let's look at the ones ones read.
One's release, says one size close but once open has no messages, so we could add one.
And then you should get a message every time it opens Well, let's i'll see how this actually works here.
So first off there's this the work Here knows one's in it is now non trivial.
But what it's doing at a high level is pretty straightforward. it's doing the things to create a new device.
We are a module can do whatever it wants. it just has a knit and exit.
But this particular module is creating a device driver it's creating a virtual device.
It's not connected to a physical device, but you're getting a device and slash down, and as part of this we have to register a character device.
Remember there's 2 types of devices on a unix system.
It's either a block device or a character device block devices are for Disks and Ssds and stuff and other than that, and and otherwise it's a character device, character device, or access character by character or block devices are blocked by block but the real
difference is block devices are cached character devices aren't So we're accessing a block device.
You might say I might access block you know blind bomb multiple times like you're reading from a disc.
But does that make sense? If you're talking to I remember old values when you're reading from a mouse, or you know, or read from a keyboard, or stuff that doesn't make sense. So those are character devices so again we
have the ones in it. What is it doing here is it's registering a character device, and then it has to specify this One's.
F. Ops i'm gonna talk about that in a second and then class create.
And then, you know, vice creating is like we go like How the heck did you figure out how to write this code?
You look at how other character devices are created in the Kernel, you don't just make the stuff up because you have to find it with Api.
Look at man pages no you don't look at man pages that won't work very well
Let's see if I can find those cross reference
Let's see if I don't know if it works in this browser.
We'll try
The loop actors i've talked about i'll look back devices before I can talk about the minute.
But that is some we can internal more let's see?
Does this? Okay, this is gross in this kernel. I will.
They have to switch
This is a website that shows you the let's look 6, 4, 8,
Yeah, i'll have to show you this in a real browser
Start sure
Sure the screen. So this, if you want to learn about the Linux kernel, you need to look at the source.
Oh, man, my browser really has some weirdness with icons.
I really need to figure out why these are supposed to be nice little icons here, but I've been getting these removed from my browser.
I have to see why it's like a fog issue or something.
Anyway? What was I? chat window back so
So when you look through this, like there is like file system here.
I will go through this more, but, like you, wanna go here.
Lockd here's the code here, and then if you want to go to like you wondering where is this function called you?
Click on it, and it tells you oh, it's defined in one as a function.
It's reference here, but like you're wondering Oh, where is
You know, this is the file system thing. So there is gonna understand how read and write system calls are implemented or open.
Here we go. Fs open, and here is the code for and look!
Oh, look, it defines system calls this break let's see Fs config.
So here's a system call here which is fs pick pick a super block.
Oh, well, this file system open that's not what I want I want open I'm.
Not expecting You to understand this yet. i'm just more showing that. Oh, look, here is a definition of the system call F Truncate.
Here's a definition of let's see there should be a definition here for open i'll define access changed, or access here, and you'll use these different defined numbers that is defined How many arguments it
takes change. Your takes one argument. Access takes 2 arguments sure route. Here's how change route works fch mod
Okay, i've chosen do I get my open entry open.
Yeah.
There's file file open name file the open here we go This is called Define.
3 open. This is the definition here. What does all the things do, Sis?
Open. Where does this open? Well, I don't know what this is open there.
I can just click on it. Do this open defined here and there it is.
Do you, Sis opens here zoom open. How build open house, do, sis? Open a T.
2. Okay, let's go there here's that file what's the point of all this.
Well, i'm really the point of this is
Okay, What are the differences? You, the embedded Linux? The lecture does.
We'll talk about embedded linux
We'll talk about embedded linux linux is Linux.
It's the same kernel, same system call interface basically the same functionality.
If you look at the size of the Linux kernel, the Core Linux kernel is not that big?
You. There are things you can do to make it even smaller.
But the actual cordless curl is that big the modules are what added all the functionality, all the different drivers, for all the hardware the Linux kernel supports.
But you know there's some options and things you can build it with
If you look up how to build the linux kernel, which I won't go through this class, but I can show you this so like on my
You look in boot. There is always so there's the actual kernel image.
There's the system map, which is basically the symbol table? So it just basically saying, where are the functions are located in there?
There's this initial ram disk which I haven't we'll explain some point, and then there's these guys.
This kind of config file tells you how this particular kernel was configured, and it tells you exactly what it's. so, whether the feature and there's all these things, and there are so many feature to be
enabled or disabled so if there's an m it's been built as a module.
If it's an end it's a no it wasn't built.
It was disabled, was it? Yes, it was enabled, and that code was included in the main kernel image, mostly Ucms.
There are a few parameters that maybe have some other settings, like some parameters like numbers thing, but mostly it's just.
Do you enable this functionality or not there's a lot there's a lot here
Yeah, the the module modules are built at the same time.
The kernel is, and our interlocking set, and you can build them out of tree as we just did.
But basically the modules are tied to the specific kernel version and change kernel versions.
You have to change the modules you have and that's Why, and that's why if you look at you know, Slash Boot, it has these things here But Then you look at live modules.
That's where the actual modules are there are different directories for the different kernels.
Now I actually only have 2 kernels here. These are old ones that I probably should delete full version of the car.
But if I go into you know.
There's all these going to kernel go to you know Fs.
Here's all these Now we expat there's a module there's just if I just do a generic
That's all the modules kind of sitting there that I could load for this kernel.
But this is all the modules that are loaded on my system.
Currently a small fraction of all those modules there, but those are the modules that are needed to have my system work with the hardware.
I have
Code for a kernel module. so
Oh, no, no, no! no that's no look when you see crypto Here it's the real crypto as a new cryptography, as in enabling cryptocurrency in secure communication anything
that's pretending to be a currency or a commodity.
That's Yeah, that's just no there's lots of cryptography in the kernel.
Remember all the things i'm talking about with digital signatures and trusted boot and stuff that's all cryptography.
So what has to have the code support that? Yeah. So yeah, Yeah.
Okay.
So inside the Linux kernel it's a bunch of code that constantly changes all the time.
There is no stable Api. Things change all the time.
This is why, if you look online, say, how do I make a Linux kernel Module?
You very likely will get out of date information, because the inside internals of the kernel change all the time.
The only stable interface he's the one given to user land, ie.
The system call interface. that is stable that doesn't change into fact.
If you mess with it, you get in trouble with Linus Dormalls you have.
That stays the same. But internally it changes all the time, which is why, if you really are doing anything to install from a module, you're probably looking at the kernel source in one form, or another and in fact.
you're gonna do that in this tutorial a little bit little bit. Yeah. Yeah.
So in this future, we're just about out of time.
What was I thinking
What was I thinking? so so? Oh, oh! one other thing I wanted to mention was
Well, this is the last thing I want to mention is that a module is just a among module, and when you saw a custom device with a module, a device is just a file that has custom up file operations, I it means instead of getting
data from things. it's just Oh, when you want to read run this read function. We want to do a right run this right function.
And if you look at the code that's what it defines
So, anyway. i'll
It depends on the part of the internal interface that change it, I mean.
Sometimes it changed a little bit, but some times they change there, loop back block devices.
We'll talk we'll we'll talk about that next week.
I've talked about that in previous lecture but i'm happy to mention that again.
Anyway. I I will stop here, and we will continue talking about the kernel on Thursday.