﻿1
00:00:00,150 --> 00:00:02,520
‫Hello and welcome, everybody, in this lecture.

2
00:00:02,550 --> 00:00:08,520
‫We're going to implement the tasks which segment, so the very first thing I want you to do is, is

3
00:00:08,520 --> 00:00:12,090
‫in our source directory, we're going to create a new directory called Task.

4
00:00:12,810 --> 00:00:16,360
‫Old task related items will go in this directory.

5
00:00:16,860 --> 00:00:21,450
‫So once again, it's in the source directory and it's called task.

6
00:00:22,150 --> 00:00:26,250
‫I'm just going to minimize all of these directories because we have quite a lot of them now.

7
00:00:26,260 --> 00:00:26,940
‫So there we go.

8
00:00:27,540 --> 00:00:30,060
‫Source directory, create new directory called Task.

9
00:00:30,250 --> 00:00:35,550
‫OK, inside this directory, we're going to create a new head, a file called DOT.

10
00:00:36,980 --> 00:00:45,110
‫Tasks, which segment, so we're going to go if and if task switch segment, page, define tasks.

11
00:00:45,110 --> 00:00:46,760
‫Which segment page?

12
00:00:50,010 --> 00:00:57,300
‫Hashtag and Jeff and I were going to create a new structure called T.S.A., so we're going to go struct

13
00:00:57,300 --> 00:01:03,030
‫tests and we're going to include Estie in it.

14
00:01:04,270 --> 00:01:12,030
‫So in a dark, guys, OK, I mean, a test structure, we're going to go Unit 32, T link, unit three,

15
00:01:12,030 --> 00:01:13,640
‫Tuti E.S.P zero.

16
00:01:14,370 --> 00:01:17,650
‫And this is the COL stack pointer.

17
00:01:18,390 --> 00:01:23,460
‫And remember, if you don't understand the test, watch the presentation again, because I explain in

18
00:01:23,460 --> 00:01:23,960
‫depth.

19
00:01:24,870 --> 00:01:32,370
‫Essentially when we go back to Col Land, the process will look into the test and it will pull out the

20
00:01:32,370 --> 00:01:36,340
‫Col stack point on the Col Stack segment and so on.

21
00:01:36,960 --> 00:01:45,930
‫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

22
00:01:45,930 --> 00:01:48,960
‫a lot more variables now, ones that we won't even use.

23
00:01:48,960 --> 00:01:53,660
‫But they need to be there because the process is populating this structure.

24
00:01:54,120 --> 00:02:03,060
‫So we're going to go Unit 32 T ESP one, unit 32 T, ESP two, unit three to T, SS two.

25
00:02:03,390 --> 00:02:04,830
‫Unit 32 T.

26
00:02:04,860 --> 00:02:06,030
‫S three.

27
00:02:07,600 --> 00:02:27,310
‫Unit 30 to IP Unit three, Tutsi flags, Unit 32, T X, unit 32 T X, Unit 32 T IDEX Unit 32 T SBX.

28
00:02:27,310 --> 00:02:29,530
‫Unit 32 T E.S.P.

29
00:02:30,040 --> 00:02:39,100
‫Unit 32 TBP Unit 32 T ISI Unit 32 t eddi.

30
00:02:39,880 --> 00:02:41,260
‫Unit 32 T.

31
00:02:41,270 --> 00:02:42,010
‫S.

32
00:02:42,010 --> 00:02:44,170
‫Unit 32 t c.

33
00:02:44,200 --> 00:03:02,620
‫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

34
00:03:02,620 --> 00:03:03,760
‫I OPB.

35
00:03:04,240 --> 00:03:08,890
‫And we're going to pack that guys attribute packed.

36
00:03:10,540 --> 00:03:11,110
‫Perfect.

37
00:03:11,110 --> 00:03:13,180
‫So that's our team structure.

38
00:03:13,480 --> 00:03:20,800
‫We will use this to guide the process in switching the stack back to the correct state when it goes

39
00:03:20,800 --> 00:03:22,050
‫back into Col Land.

40
00:03:22,630 --> 00:03:24,730
‫OK, so let's create a new prototype here.

41
00:03:24,730 --> 00:03:32,620
‫We're going to go void to assess load in its segment and we're going to create a new file in the task

42
00:03:32,620 --> 00:03:35,710
‫directory called Test DOT HSM.

43
00:03:36,940 --> 00:03:46,600
‫We're now going to go S.A.M. Global Test Load and now we're going to go to assess load, push, SBP,

44
00:03:47,230 --> 00:03:53,950
‫Move, PSP, Move X, SBP, plus Ade's.

45
00:03:54,730 --> 00:04:05,320
‫So this is the test segment provided to us and then we're going to go LTA X Pop EBP and finally we're

46
00:04:05,320 --> 00:04:06,310
‫going to go Rets.

47
00:04:07,300 --> 00:04:13,120
‫OK, so essentially this assembly function here just loads in the tasks which segment.

48
00:04:13,630 --> 00:04:16,870
‫So it expects an integer to the test segment.

49
00:04:17,560 --> 00:04:23,320
‫So remember what I said that the S is part.

50
00:04:24,660 --> 00:04:29,080
‫Of this, you see, you have the GDP co GDP data.

51
00:04:29,730 --> 00:04:32,320
‫It's part of the GDP descriptor, essentially.

52
00:04:32,340 --> 00:04:39,350
‫OK, so the test will go somewhere in here and it will also have its own offset.

53
00:04:39,780 --> 00:04:43,960
‫So we passed that offset to the test load.

54
00:04:44,100 --> 00:04:46,920
‫OK, now, obviously, we've changed this to C-code now.

55
00:04:46,920 --> 00:04:51,830
‫So you can see that here we have three segments.

56
00:04:51,840 --> 00:04:54,420
‫OK, so would have the test somewhere here as well.

57
00:04:54,450 --> 00:04:56,670
‫OK, and the GDP real.

58
00:04:56,670 --> 00:05:04,510
‫Once we pass this through the GDP structure to GDP, the GDP will be populated with the real segments.

59
00:05:04,950 --> 00:05:06,930
‫So when we call the.

60
00:05:07,950 --> 00:05:15,360
‫TSA slowed, we pass in the segment offset for the TSA segment, and they offset we're talking about

61
00:05:15,360 --> 00:05:19,750
‫is the offset in this GDP real memory region.

62
00:05:20,400 --> 00:05:26,250
‫OK, so when I was going to go to our makefile, we're going to copy and paste this iodized HSM because

63
00:05:26,250 --> 00:05:32,880
‫we're going to use this and we're going to change the build here to task to yesterday's tomorrow on

64
00:05:32,880 --> 00:05:37,010
‫the source directory will be task tested, I assume.

65
00:05:37,020 --> 00:05:46,910
‫And then obviously we're going to assemble task TSA delays into build tasks, ITSM that I know no TSA

66
00:05:46,920 --> 00:05:50,790
‫stories and other I mean, so it should look like bad guys.

67
00:05:53,440 --> 00:05:59,750
‫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.

68
00:06:00,730 --> 00:06:03,090
‫So you just paste that in there anywhere.

69
00:06:03,100 --> 00:06:04,090
‫Anywhere is fine.

70
00:06:04,880 --> 00:06:09,580
‫And we now need to go to our bill directory and we're going to create a new folder called TASC.

71
00:06:10,450 --> 00:06:14,490
‫I'm going to put a dot, keep it here because I'm using git repository, OK?

72
00:06:15,280 --> 00:06:16,210
‫And.

73
00:06:17,480 --> 00:06:22,100
‫Yes, we're now ready to try and make clean that, so let's open up the terminal.

74
00:06:25,360 --> 00:06:31,020
‫And in our in our directory here, we're going to go make clean bill to the S.H..

75
00:06:33,040 --> 00:06:36,440
‫And there we go, that that compiles perfectly fine.

76
00:06:37,390 --> 00:06:42,120
‫So, OK, back to that, see, then we're going to define a user data segment.

77
00:06:42,130 --> 00:06:43,340
‫I use a code segment.

78
00:06:43,360 --> 00:06:46,940
‫So first thing we do is put the comma here because we're making a new record in here.

79
00:06:47,260 --> 00:06:58,570
‫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

80
00:06:59,200 --> 00:07:00,820
‫zero x, f eight.

81
00:07:01,300 --> 00:07:04,570
‫And put your comma here because we're going to put the data segment in the second.

82
00:07:04,570 --> 00:07:07,750
‫And this is the user code segment.

83
00:07:08,560 --> 00:07:15,970
‫And you'll notice here we map the entire address region, uh, even though the kernel also occupies

84
00:07:15,970 --> 00:07:18,850
‫this reason region because these are physical addresses.

85
00:07:19,150 --> 00:07:23,680
‫But that's absolutely fine because we're using the paging memory module.

86
00:07:23,950 --> 00:07:27,860
‫So all sorts of memory limitation will be done on paging.

87
00:07:28,300 --> 00:07:38,080
‫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

88
00:07:38,410 --> 00:07:39,610
‫zero except two.

89
00:07:40,420 --> 00:07:43,600
‫And this will be the user

90
00:07:47,170 --> 00:07:48,340
‫data segment.

91
00:07:49,180 --> 00:07:54,640
‫And put your comma here because now we have to define the tests.

92
00:07:55,690 --> 00:07:57,220
‫So we're going to create a new one here.

93
00:07:57,220 --> 00:08:04,540
‫We're going to go to space equals and we're going to cast this because I haven't done it yet.

94
00:08:04,540 --> 00:08:11,020
‫You added 32 t ampersand to assess the address of the test variable, which we haven't created yet.

95
00:08:11,260 --> 00:08:16,060
‫And I we're going to go dot limits equals size of Texas.

96
00:08:17,770 --> 00:08:26,810
‫And we're going to go, Dotti equals zero x e nine, and this is the 26th segment.

97
00:08:27,400 --> 00:08:34,330
‫And if you're really curious about these these these bits that where we're sitting here, just look

98
00:08:34,330 --> 00:08:37,510
‫up the reference because there's not much point to explain them.

99
00:08:38,020 --> 00:08:44,470
‫Just know that it describes how this segment deals with the memory and the sorts of rights that it has

100
00:08:44,470 --> 00:08:45,130
‫and so on.

101
00:08:45,490 --> 00:08:49,850
‫If we just quickly go back to the DSM, uh.

102
00:08:51,790 --> 00:08:54,640
‫You can see, you know, the axis bites and stuff like that, right?

103
00:08:55,120 --> 00:09:02,500
‫So it just determines how this segment should manage that memory and what sort of rules should apply

104
00:09:02,500 --> 00:09:02,800
‫to it.

105
00:09:03,370 --> 00:09:07,380
‫So when are we going to create the test variable?

106
00:09:07,720 --> 00:09:09,050
‫Because we haven't created that yet.

107
00:09:09,940 --> 00:09:16,570
‫So simply put, just above GDP real, we're going to go struct success and we're going to scroll up

108
00:09:16,570 --> 00:09:20,470
‫and we're just going to include task test.

109
00:09:22,240 --> 00:09:27,100
‫OK, now that resolves that dependency and now just have to eject in it.

110
00:09:27,100 --> 00:09:29,870
‫Then we're going to load the tests.

111
00:09:29,890 --> 00:09:35,650
‫So the first thing we do is we set up the tests and we can create a new function for this later maybe.

112
00:09:35,950 --> 00:09:41,110
‫And we're just going to go said tests, zero zero zero size of tests.

113
00:09:41,110 --> 00:09:47,700
‫So that that'll just set the whole test to zero for us to make sure there's no initialize memory there.

114
00:09:48,340 --> 00:09:50,860
‫And I was just going to go to E.S.P.

115
00:09:52,390 --> 00:09:56,980
‫Zero equals zero six and we're going to have five zeros.

116
00:09:56,980 --> 00:09:58,370
‫One, two, three, four, five.

117
00:09:58,660 --> 00:10:00,520
‫So this is the kernel stack, OK?

118
00:10:00,910 --> 00:10:02,930
‫This is where the kernel stack is located.

119
00:10:03,280 --> 00:10:09,520
‫So whenever we go from user use the land back to kernel and the stack point will be changed to this.

120
00:10:09,580 --> 00:10:19,870
‫OK, and I we're going to go to SAS dot SS zero equals Peatross data selector and we haven't created

121
00:10:19,870 --> 00:10:20,460
‫that yet.

122
00:10:21,580 --> 00:10:30,400
‫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

123
00:10:30,400 --> 00:10:30,800
‫eight.

124
00:10:31,960 --> 00:10:38,200
‫And the reason we use the X 28 is because that would be the offset in the GDP, in the GDP real once

125
00:10:38,200 --> 00:10:40,810
‫we pass this structure through the function.

126
00:10:41,800 --> 00:10:47,270
‫OK, so X and we're going to implement this in the conflict.

127
00:10:47,920 --> 00:10:48,250
‫Now.

128
00:10:50,400 --> 00:10:51,340
‫Oh, what do we know?

129
00:10:51,360 --> 00:10:56,110
‫We've actually already done it, we've just called the kernel data selector, so no worries.

130
00:10:56,130 --> 00:10:56,840
‫Copy that.

131
00:10:57,000 --> 00:10:59,250
‫And we're just going to paste that over.

132
00:10:59,250 --> 00:11:07,530
‫Pekoe, as stated, Selecta, a perfect let's now make clean bill that S.H..

133
00:11:09,300 --> 00:11:14,100
‫And we can see there's a slight problem here, so we're going to take a quick look at what that is.

134
00:11:14,100 --> 00:11:14,790
‫Scroll up.

135
00:11:16,430 --> 00:11:22,790
‫And yes, it's clear what the problems is the U.S. total GDP segments of three, but we now need to

136
00:11:22,790 --> 00:11:27,260
‫change it to one, two, three, four, five, six.

137
00:11:27,770 --> 00:11:29,570
‫So just change that to six.

138
00:11:30,230 --> 00:11:36,860
‫OK, and if we make clean again, so PTW total GDP segments needs to be changed to six guys, OK.

139
00:11:37,070 --> 00:11:40,580
‫And if you control left, click in Visual Studio on that definition.

140
00:11:40,580 --> 00:11:41,920
‫We will take you straight to the file.

141
00:11:42,350 --> 00:11:45,940
‫So we're going to go build that S.H. again and we see that works fine.

142
00:11:45,950 --> 00:11:50,430
‫We're going to go Sidibé and we're going to run Kumu and we can see everything works as normal.

143
00:11:50,870 --> 00:11:53,060
‫So we've now implemented the tasks which segment.

144
00:11:53,060 --> 00:11:55,470
‫So we are now ready to enter, use the land.

145
00:11:56,720 --> 00:11:57,920
‫Congratulations.

