‫Hello and welcome, everybody, in this lecture.
‫We're going to implement the tasks which segment, so the very first thing I want you to do is, is
‫in our source directory, we're going to create a new directory called Task.
‫Old task related items will go in this directory.
‫So once again, it's in the source directory and it's called task.
‫I'm just going to minimize all of these directories because we have quite a lot of them now.
‫So there we go.
‫Source directory, create new directory called Task.
‫OK, inside this directory, we're going to create a new head, a file called DOT.
‫Tasks, which segment, so we're going to go if and if task switch segment, page, define tasks.
‫Which segment page?
‫Hashtag and Jeff and I were going to create a new structure called T.S.A., so we're going to go struct
‫tests and we're going to include Estie in it.
‫So in a dark, guys, OK, I mean, a test structure, we're going to go Unit 32, T link, unit three,
‫Tuti E.S.P zero.
‫And this is the COL stack pointer.
‫And remember, if you don't understand the test, watch the presentation again, because I explain in
‫depth.
‫Essentially when we go back to Col Land, the process will look into the test and it will pull out the
‫Col stack point on the Col Stack segment and so on.
‫So we're not going to go Unit 32 t SS zero and this is the Col Stack segment and we're going to create
‫a lot more variables now, ones that we won't even use.
‫But they need to be there because the process is populating this structure.
‫So we're going to go Unit 32 T ESP one, unit 32 T, ESP two, unit three to T, SS two.
‫Unit 32 T.
‫S three.
‫Unit 30 to IP Unit three, Tutsi flags, Unit 32, T X, unit 32 T X, Unit 32 T IDEX Unit 32 T SBX.
‫Unit 32 T E.S.P.
‫Unit 32 TBP Unit 32 T ISI Unit 32 t eddi.
‫Unit 32 T.
‫S.
‫Unit 32 t c.
‫I mean CSI Unit 32 T SS Unit thirty two t d unit 32 G F's Unit 32 T G.S. Unit 32 T LGT Unit Theta T
‫I OPB.
‫And we're going to pack that guys attribute packed.
‫Perfect.
‫So that's our team structure.
‫We will use this to guide the process in switching the stack back to the correct state when it goes
‫back into Col Land.
‫OK, so let's create a new prototype here.
‫We're going to go void to assess load in its segment and we're going to create a new file in the task
‫directory called Test DOT HSM.
‫We're now going to go S.A.M. Global Test Load and now we're going to go to assess load, push, SBP,
‫Move, PSP, Move X, SBP, plus Ade's.
‫So this is the test segment provided to us and then we're going to go LTA X Pop EBP and finally we're
‫going to go Rets.
‫OK, so essentially this assembly function here just loads in the tasks which segment.
‫So it expects an integer to the test segment.
‫So remember what I said that the S is part.
‫Of this, you see, you have the GDP co GDP data.
‫It's part of the GDP descriptor, essentially.
‫OK, so the test will go somewhere in here and it will also have its own offset.
‫So we passed that offset to the test load.
‫OK, now, obviously, we've changed this to C-code now.
‫So you can see that here we have three segments.
‫OK, so would have the test somewhere here as well.
‫OK, and the GDP real.
‫Once we pass this through the GDP structure to GDP, the GDP will be populated with the real segments.
‫So when we call the.
‫TSA slowed, we pass in the segment offset for the TSA segment, and they offset we're talking about
‫is the offset in this GDP real memory region.
‫OK, so when I was going to go to our makefile, we're going to copy and paste this iodized HSM because
‫we're going to use this and we're going to change the build here to task to yesterday's tomorrow on
‫the source directory will be task tested, I assume.
‫And then obviously we're going to assemble task TSA delays into build tasks, ITSM that I know no TSA
‫stories and other I mean, so it should look like bad guys.
‫And we're going to copy and paste this and we're going to put that in in our bill files at the top here.
‫So you just paste that in there anywhere.
‫Anywhere is fine.
‫And we now need to go to our bill directory and we're going to create a new folder called TASC.
‫I'm going to put a dot, keep it here because I'm using git repository, OK?
‫And.
‫Yes, we're now ready to try and make clean that, so let's open up the terminal.
‫And in our in our directory here, we're going to go make clean bill to the S.H..
‫And there we go, that that compiles perfectly fine.
‫So, OK, back to that, see, then we're going to define a user data segment.
‫I use a code segment.
‫So first thing we do is put the comma here because we're making a new record in here.
‫I want to go up a six zero zero dot limit equals zero x f f f f f and we're going to go dot type equals
‫zero x, f eight.
‫And put your comma here because we're going to put the data segment in the second.
‫And this is the user code segment.
‫And you'll notice here we map the entire address region, uh, even though the kernel also occupies
‫this reason region because these are physical addresses.
‫But that's absolutely fine because we're using the paging memory module.
‫So all sorts of memory limitation will be done on paging.
‫So here we're going to go to space equals zero zero dot limit equals zero x f f f f f dot type equals
‫zero except two.
‫And this will be the user
‫data segment.
‫And put your comma here because now we have to define the tests.
‫So we're going to create a new one here.
‫We're going to go to space equals and we're going to cast this because I haven't done it yet.
‫You added 32 t ampersand to assess the address of the test variable, which we haven't created yet.
‫And I we're going to go dot limits equals size of Texas.
‫And we're going to go, Dotti equals zero x e nine, and this is the 26th segment.
‫And if you're really curious about these these these bits that where we're sitting here, just look
‫up the reference because there's not much point to explain them.
‫Just know that it describes how this segment deals with the memory and the sorts of rights that it has
‫and so on.
‫If we just quickly go back to the DSM, uh.
‫You can see, you know, the axis bites and stuff like that, right?
‫So it just determines how this segment should manage that memory and what sort of rules should apply
‫to it.
‫So when are we going to create the test variable?
‫Because we haven't created that yet.
‫So simply put, just above GDP real, we're going to go struct success and we're going to scroll up
‫and we're just going to include task test.
‫OK, now that resolves that dependency and now just have to eject in it.
‫Then we're going to load the tests.
‫So the first thing we do is we set up the tests and we can create a new function for this later maybe.
‫And we're just going to go said tests, zero zero zero size of tests.
‫So that that'll just set the whole test to zero for us to make sure there's no initialize memory there.
‫And I was just going to go to E.S.P.
‫Zero equals zero six and we're going to have five zeros.
‫One, two, three, four, five.
‫So this is the kernel stack, OK?
‫This is where the kernel stack is located.
‫So whenever we go from user use the land back to kernel and the stack point will be changed to this.
‫OK, and I we're going to go to SAS dot SS zero equals Peatross data selector and we haven't created
‫that yet.
‫And now just down here, we're going to go load the tests and we're going to go to SAS load zero x twenty
‫eight.
‫And the reason we use the X 28 is because that would be the offset in the GDP, in the GDP real once
‫we pass this structure through the function.
‫OK, so X and we're going to implement this in the conflict.
‫Now.
‫Oh, what do we know?
‫We've actually already done it, we've just called the kernel data selector, so no worries.
‫Copy that.
‫And we're just going to paste that over.
‫Pekoe, as stated, Selecta, a perfect let's now make clean bill that S.H..
‫And we can see there's a slight problem here, so we're going to take a quick look at what that is.
‫Scroll up.
‫And yes, it's clear what the problems is the U.S. total GDP segments of three, but we now need to
‫change it to one, two, three, four, five, six.
‫So just change that to six.
‫OK, and if we make clean again, so PTW total GDP segments needs to be changed to six guys, OK.
‫And if you control left, click in Visual Studio on that definition.
‫We will take you straight to the file.
‫So we're going to go build that S.H. again and we see that works fine.
‫We're going to go Sidibé and we're going to run Kumu and we can see everything works as normal.
‫So we've now implemented the tasks which segment.
‫So we are now ready to enter, use the land.
‫Congratulations.