‫Hello and welcome, everybody, in this lecture.
‫We are going to create our very first use the program.
‫This is the program won't really do much.
‫You'll just jump on itself.
‫And that said, it won't print anything.
‫You won't do anything special.
‫However, the important thing is to just write that very simple program so that we have something to
‫load.
‫So as you guys know, we haven't yet created a program.
‫So we have nothing to load, but we have all the functionality to load programs.
‫So we're going to create our very first program in this lecture.
‫So what I wanted to do then is in the root directory where the makefile is, we're going to create a
‫new folder and we're going to call it programs, simple as that.
‫OK, we're going to create a new folder and we're just going to call it blank and blank won't do anything,
‫but essentially it will just jump on itself.
‫Someone's going to fall in their cold, blank, top assume.
‫OK, and just in this file, we're going to go Bettes 32.
‫OK, now we're just going to go Laboe Jump Label.
‫That's our program.
‫Nothing special.
‫And what we now need to do is we need to create a makefile for blank.
‫And we also need to take the link, a script from the kernel here as well.
‫So that's just copy the Lancastrian script first from the source directly Link Helda and we're just
‫going to paste it in the blank directory.
‫So you'll notice this is basically mapped for the kernel really.
‫Now we don't want that.
‫So we might, we might use a program Xeroxed.
‫Four hundred thousand if you remember correctly.
‫That is where we are mapping our programs and that can be confirmed by go into config dot Hajj and the
‫program virtual address.
‫OK, so all programs, no matter how many programs we have running, they all run in this address range
‫because of paging.
‫That's how we're able to do that, as you know.
‫So set that to 400000 hexadecimal.
‫The rest is perfectly fine.
‫We can see the entry symbolist start, so we need to create that.
‫So inside here, just create a new label called START and we're going to export that label like that.
‫OK, we're also going to say Section DIESEM, which will ensure that this code goes into the HSM section
‫specified in Ilinka script here.
‫What are we going to create?
‫A new directory in blank called Build.
‫And this is obviously where I build files will go.
‫We're now going to create a new file called Makefile.
‫Now, inside this makefile, we're going to go all Nazim f f blanc today as that show builds blank thought,
‫oh, now we're going to have a clean label down here, which is simply go remove our F builds blank
‫thought.
‫Now we need to link this object we just created.
‫So we're going to go ie six eight six.
‫Aleksi Dashi Dashty Linker to force us linko ld show job forward slash blank dot elf free-standing.
‫We're going to turn optimization off, no STD lab will create our own STD lab later on, perhaps we're
‫going to put the flag here, debugging symbols on Tashjian and we're going to link the file, build
‫blank data.
‫So that's our little script.
‫OK, very, very simple script.
‫It doesn't do much.
‫So now in our Makefile, in the root directory, we now need to make a label for programs, for building
‫programs.
‫So down here we're just going to go programs, OK?
‫And in this makefile here, we're going to go seed step forward, slash programs, blank ampersand,
‫10 percent.
‫Dollar make all so that'll go into that blank programs directory and run the MAIKOL command.
‫Now guys, remember?
‫We need to use Tab's in these make files, make sure your editor isn't configured to use Space's, because
‫if it is, this file will not will not run well for you.
‫If you're using Visual Studio code and you've installed the Makefile plugin, everything should be fine.
‫Do not use spaces in a makefile.
‫You're asking for problems.
‫I assume most of you have used make files before.
‫OK, so we're now going to go programs clean and then we're going to go see these programs blank ampersand,
‫ampersand, make clean.
‫Pretty simple, right?
‫And now the clean label will depend on the programs clean.
‫So whenever you go make clean, it will call programs clean because we've listed it as a rule here.
‫OK, scroll up to make all and we're also going to make programs a requirement of MAIKOL.
‫So whenever you run this now, it will build the programs as well.
‫And guys, you'll see that I did source programs blank just changed that to programs blank just like
‫that.
‫And if we just go to the terminal and we do make clean bills, LSH.
‫You'll see that it doesn't actually call the programs for some reason, if we go make programs, you
‫see, it says everything's up to date.
‫Now, I think this is some sort of I think there's some sort of conflict of some kind here because it's
‫not detecting it so easily.
‫So just change this to use underscore programs.
‫And we're going to scroll up there and we're just going to change MAIKOL to make all programs, to make
‫all use of programs and now we're going to go make use of programs.
‫Are we going to see that works now.
‫Right.
‫Ignore the error rates because you need to use the build that S.H. because we set up those exports for
‫the GCC compiler.
‫So just go make clean.
‫We're going to go build that S.H. perfective, you know, scroll up, you'll see blank tutto and blank
‫drouth.
‫So we've just made our very first program, Blank Drouth.
‫That's an executable file.
‫This ready to be run, loaded and run.
‫And if we just take a look at the makefile again, we see use of programs that just scroll down and
‫we're going to change this to use the program is clean.
‫So when I was just going to change this clean label by here to rely on user programs clean.
‫Now, if we go make clean.
‫We can see that it enters the programs and clears it good, we do build that, I say we can see it builds
‫it.
‫So once again, I'm going to make clean that there's one thing I need to tell you guys in the Makefile.
‫I have exported that as blanket, that this was a mistake because this is not a nail file.
‫If we look at the landscape of outputting is binary.
‫OK, so that was just a little typo on my part.
‫So we're just going to go to the Makefile and we're going to change it to blank Dobbyn just to represent
‫a binary file.
‫So just blanked.
‫Plankton here are blanked up in OK and we now make plain to delete the old files or we can see that
‫get through the object file.
‫It doesn't get rid of blank.
‫So just delete that manually.
‫OK, uh, we now just go build that S.H..
‫And there we go, we now see blanked up in and if we open up terminal and we go city program city blank
‫and they say a Sam Dash be 32 for 32 bit code and we go blank Dobbyn, we can see that all of this program
‫does is jump on itself.
‫So that's the disassembly.
‫OK, and there's the there's the assembly.
‫So, you know, it's just jumping on itself.
‫OK, so that is actually our program.
‫We don't have our support yet because if we was to set the output format to LTH would have to create
‫an alpha loader, which is a little more complicated.
‫So that's why we are not doing that yet.
‫We will just deal with binary for now at least.
‫So yeah, we've just created your very first user program, so congratulations.
‫And soon we will be actually loading and executing that.