You know, structure where we implement our function to actually function is especially important for
us because it means that we can build a program in the host system and a call to our system runs a program
just admitted into operating systems like Windows or Linux.
How do you see in order to run a program in our system, we first focal process.
And a red after we are in the process, we ask you to function to launch a specific program, to ask
you to function, we will search the program with the help of the system on inculpate its instructions
and a data to the USERSPACE.
If we can find the program in the image.
And at this point, the new process, we will be running just as we launched a specific program.
All right, we start off with the user one program.
As you can see, this is a user program in the last way to support we are currently returning from the
work function as a new process.
We're [REMOVED], so we enter if statement instead of printing message.
What we are going to do is we are going to ask you to file.
So we can function as good.
And at this fire will be loaded into your airspace, which means all the code and data here will be
replaced with the instructions and a data of the program, we will ask.
It has not been in this case.
As for the process which started the for cooperation, when it returns from the colonel, it will return
to the part and wait for the new process to allow it.
So here we change the message test process and that after we return from the wavefunction.
So the general structure of the fork and weight operations are still the same as we talked about in
the last structure.
OK, the other part is done.
Next, we move to a torn apart.
So ask you to function is implemented in the process modu.
Here you can see we do ask you to function, which takes two parameters, the current process and the
filename, because we want to load the file in the memory and execute.
We need to open the file on a rate data from it.
So we define larible file, descriptor and size.
Then they open fire on a check.
The reason why do if they open fired, we do nothing.
But as it is a process, otherwise, we initialize the user page with zero because we will copy the
data of a new file to the user space another week as a file size after we get the file size where rates
of our data to the buffer.
Four hundred thousand.
Remember the system.
This is a big surprise of the user space.
If the return value of the rate of file is a maximum value, the operation failed and we simply added
out.
OK, at this point, the data in the U.S.
Space is replaced with this file.
Also, don't forget to close the file.
Since this is not the first time we run the process, we have the user data in the frame when we enter
the Kermode.
What do we want to do in this case is clear the trap frame and studied it, the default state, so we
clear the trap frame and asset to our IP, our ISP, etc. to justify values.
OK, after it is done, when we return to the other mode where we will get to the start of the program
just as we launch the process for the first time.
OK, that's it for the process.
Montreal.
In the sitcom Modu.
We ask obscure function on a function such as cute.
We retrieved the car and process, then we ask it to function and arguments are the process and the
filename we passed from user program.
Changes to checks in the system called function, and we are done to nothing.
We are going to do is we are going to add to obscure function interlibrary.
So interlibrary foder.
We add actual function intercepts commodity.
What defines Adobo as cute?
Since it takes one parameter, we allocate eight by space on a stack, so we subtract out.
So index for the obscure function is 11, so Waymouth, IEX 11.
Then we cop his argument on a stack.
On the move already, I have one indication that we have one argument that we save the price of the
argument in register I sign.
OK, we're into it.
After we return from the colonel, we add our associate to restart Stack and then we simply return.
Global obscure function on the Cisco module is done.
Interlibrary had high profile, we had function as acute.
OK, that's great syllabary file in the terminal.
We go to Laborie Folger, Anderson Poultices Modu.
Then they added in the lab of Rafael.
We copies elaborate a file on the high profile.
To the test folder.
And the use of one, Fauja.
Now, let's create a test that's been filed since, where we'll build a test to use a program, we need
files such as library file to file the start up file Terlingua script and build a script.
So we just copy them from user and product.
In the immediacy of the Transport Act.
But just Pariente test process starts.
And it's up your script.
We specify that the name of the to file is test not being.
OK, all the files all prepared.
That's both a test product, use a product on a product.
OK, let's move to offset the image.
Copies of test being file.
So, Colonel, meanwhile.
And a user tarping file.
With this month's deportation.
On the rent, a postscript.
As you can see, test process starts on a test process access.
You'll see it's a test process is running great.
We are running the program in our operating system.