Skip to main content
Loading Explore guides…
Operating System Structures · Acedra
Home
Explore
Other
Operating System Structures
Sign in to save
Chat
If YouTube asks you to sign in, open the video on YouTube.
Watch on YouTube
Reload player
Transcript
435 segments
Copy
Hide video
0:03
Of things that you want to ask if you don't want them recorded. Don't ask the question just now. Ask when they're callings.
0:24
OK, so I think we're recording now. Yeah. So the callings on and it's transcribed as you know I have.
0:34
I uploaded this to YouTube and that's simply to make it easier. You can get access to them via teams, but I know some people find that.
0:42
I clunky.
0:46
So if you haven't yet found it.
0:53
You haven't yet found it. The YouTube channel is linked from.
0:58
You materials.
1:01
And if you haven't yet phoned them.
1:09
The material.
1:11
Now my computer, so my camera stopping.
1:21
So in the module materials.
1:25
You will feigned. He says as he waits for it to load properly.
1:31
The quicker do not want this one, wouldn't it? And the module materials you'll find.
1:38
Both recordings. So there's last weeks lecture recording.
1:44
And also a link to.
1:47
YouTube channel. Was there?
1:51
And I have been recalled and these for a couple of years. So you can watch last year's if you think that may need help.
1:57
And if that has managed to load in the background. You'll also find links to that on teams, so as a direct link to the YouTube channel on teams. Ohh you got access to the nuclear and I'll do the same like.
2:16
Once again we are following.
2:19
The syllabus, so hopefully you're keeping an eye on the syllabus and what we're doing and the syllabus. Has pretty much. No, the syllabus as.
2:30
It reflected in the one note chapters that we have here. So we're just going through it chapter attain.
2:37
Usually they're small chapters, so we do a couple in a week, but you can see which chapter we're doing and what data is. And I know that I said this last week. I'm saying that again because I know that some people are new to the class. They only just managed to enroll.
2:51
You can find all this stuff here which tells you that this is the week of the 19th. I know this is the 23rd, but I knew it from the start of the week, so Monday was the 19th.
3:01
So in the week of the 19th we are doing system structures which is chapter 2. But we are not doing all the all of chapter two from the book. We are excluding these sections. So now that you've got your book.
3:16
You have got your book, haven't you? It's been a week. I'm sure you've ordered it and it's come in. Good. I'm getting some nods.
3:22
You know which sections were not covered.
3:26
But it should be fairly clear anyway. So as usual we have sections for all the chapters and it will depend how your one notes laid out. Sometimes it's sections are along the top, sometimes we'll do the side. I've got them on both just so that I can show you that sometimes at the top and sometimes at the side. And then you have lists of pages. Sometimes there are left, sometimes that they're right, but I'm sure you'll figure out your second your computing students.
3:54
So all the stuff is here for the presentations. And actually once we've done the presentation, I want to talk. Specifically about and some other stuff, I want you to do in the declared today.
4:06
So let's get started. First of all, with today's presentations, so today's chapter.
4:18
And it's about system structures.
4:31
So we're going to cover again quite a lot in this. And again for them to missed it last week and we have two versions of the presentations on OneNote, one is the original set. Because of just said we don't do some of the sections I've cut down the amount that we do, so I've also cut down the presentation. So there's however version. So this is the stuff you need to know is the stuff that I will assess you on.
4:54
What hopefully you're interested in general, so you can go and look at the other stuff as well.
4:59
So what we're going to do is have a look at all these things and try and understand how an operating system works in general.
5:09
Because remember what we said last week, the operating system sets between the meat. It's working it and the hardware underneath.
5:22
Usually, to allow the people that are using it to do something.
5:27
And we might. As you're doing just now, because you're on teams and I know that there's no command line interface for teams, you've got a graphical user interface, so it's got.
5:40
A mouse moving about.
5:44
I can click buttons which make things happen.
5:48
That's the button. There it goes back. I can click a key and it goes forward. So I've got graphics and I've got a mouse and I've got menus and buttons and that kind of stuff.
6:01
Alternatively, we might have a command line interface.
6:07
Anybody who's not played with it should look up something called command prompt, and I'm just gonna assume your own windows just now. I know you're not. There are some more things for other operating systems.
6:20
But if you're on Windows, feel free to go and have a play with the Windows Command prompt. Or I can type in commands like DIR. Which gives me a list of files in that directory.
6:37
Depending on what operating system you have though, it's different. I commands some of you are doing some. You know the LS.
6:48
But also. But that's not recognized in Windows and it gets upset and tells me that's the wrong command. That's one of the issues we have with. Command line interfaces they are.
7:00
Very fast and want to know how to use them. They're great.
7:05
But you need to learn them.
7:07
Graphical interfaces are easy to to pick up and use, but take a lot of the systems resources, so that's a choice that's quite often made.
7:17
In fact, sometimes you'll see a few walk into a network center. You'll see the people that run the network sitting with a a graphical user interface. On their machine. But what it's doing is around a whole bunch of command line interfaces into the boxes that they are running.
7:36
Because remember, when we were talking about an operating system.
7:40
I don't know about you, but my mind says ohh Windows or Mac or whatever. An operating system can be anything. It can be a phone, it can be a car.
7:51
It can be a network switch that has its own operating system in there as well.
7:57
So quite often we will have links into those to allow us to do things, and the batch interface Edit command line interface. Gives us a a quick but difficult to understand we end.
8:12
We also have a differentiation between things that happen right now. I press a button, my slide changes.
8:22
On things that happen under what we call batch system. So things are scheduled to happen. So if you are the Bank of Scotland and you have to run all your Bank of Scotland transactions for Asda and Tesco and Sainsbury's and all the other supermarkets. You've got the choice. You either run them during the day when everyone else is using the computer, or you wait till overnight and you run them all as a batch.
8:49
You're on a job that says run all the Tesco's transactions, run all the Asda transactions, run all the whatever it is.
8:57
And they tend to do that. And quite often you'll see if you have online banking that things happen overnight and that's why they do these things overnight when the computer system is otherwise quieter. So they make use of those resources.
9:12
So we run things, there's a user interface to run things that runs a program. And usually that means that we need to interface with the program itself. We have input and output. My input is this mouse and pointer to click this button and the output is a different display.
9:34
So I have done some input to create some output. Internally, there's been some processing done. Stuff has happened.
9:44
We've got a whole. Queen of other things that happen or the operating system provides to happen. So file system you don't want every program having to figure out how to open a file, save a file so that the operating system does that and it provides ways of doing that, provides ways to organize it and it provides ways to not care whether you're saving it to a hard disk or an SSD or USB disk is safe.
10:12
We also need to be able to communicate between different things. If you're copying from a USB drive to the hard disk, you need to communicate from one machine to another.
10:22
You may also need to communicate from one program to another. When I was showing you the syllabus earlier on one wit. That's an embedded Excel file. So one note is talking to Excel to show that Excel spreadsheet within one note so that programs have to communicate.
10:42
And the operating system will provide.
10:45
Facilities to do that. Not all operating systems. It would depend on the purpose of the operating system.
10:53
Another hand, all operating systems will provide error detection. Any of you that that programming last year will know things like divide by 0 / 0 is impossible, so the operating system will.
11:06
Catch things like that and so you're trying to do something that's not allowed. Stop it.
11:14
Sometimes it goes so far in the in the error is so bad that the machine just stops and some of you will have seen a blue screen of death and quite sure.
11:25
If you haven't seen a blue screen of death.
11:30
Well, nice week video about places that occurs.
11:44
Operating system will also decide who gets resources if you're running.
11:50
What an excel and you want to print them both.
11:53
I'll print it from them both. The operating system has to decide who goes in first. There's no point in Word printing the line in Excel. Print the line wordprint the Line Excel printer line you want the Word document. Then you want the Excel document. So at some point the operating system has to say OK, Excel. Hang on. I've given the printer to words so it prints it and then we will words done with it. It lets the operating system known. It says right? OK. Excel your turn now.
12:19
And it does that for all the facilities about having the computer, whether it's the amount of CPU time. And again, if you haven't explored it.
12:28
And do things like run task manager and again that's a Windows thing. If you haven't come across task manager, it shows you all the processes that are running on your system.
12:40
And there's all the processes that are running on me now. What am I running? I'm running teams. I'm running PowerPoint and I'm running one note and I'm running Firefox.
12:53
But I have.
12:56
A lot more process is running.
13:00
I've got all of these processes all running in the background. Ohh doing things.
13:10
My process for running audio is running in the background.
13:16
OK, C++ application development process running. Why?
13:22
Because teams was written in C, so that's a support package for that runs in the background.
13:29
Not surprisingly, but Microsoft Office run antivirus running in the background, I have got a whole bunch of things all to give me the four programs that I'm actually running.
13:47
So no wonder my CPU's getting upset. No wonder my memory is maxing out. I've got so much stuff happening here.
13:54
And it's up to the operating system to divide that up. It's up to the operating system to decide how much CPU time you get, how much memory you're allowed.
14:06
I.
14:08
Whether you get failed storage. And you know, if you have for example, your student account. That has a finite amount of space. And if you go above that, you don't get to store files anymore.
14:21
Do creating system sorts that out.
14:27
That's called accounting.
14:30
Not allowing you to use more resources over the computer than you're allowed. So that's an easy one. You're not allowed to store more files, not loading more storage than you you were allocated, but for other systems, say a big banking system, again there might be other accounting done.
14:47
So they make count the number of CPU cycles so that you use so that if HR on a pure grammar accounts run a program or dispatch run a program or whoever it is. They can charge back all these programs to the different departments in the same way as they might charge back hiring a room. Your child's back, hiring the computer to run your software.
15:14
The operating system will also do all your protection and security. You're only in here because you managed to log in with your name and your password.
15:26
To. All the stuff is controlled.
15:30
And now you are all locked in.
15:33
I can't see your files and you can't see my files. Unless I explicitly give you access. So I've got lots and lots of files on my OneDrive. That you can't see. But I've also got. A massive one note document on my OneDrive that you can see.
15:56
Because I've given you a link and you can just about see there.
16:01
But this is on Tony's OneDrive.
16:05
So that shared space. The I have access to all of it, but you've only got access to bits of it.
16:13
So the operating system does the protection and the security.
16:19
So there's a lot going on in the background.
16:22
Sometimes when you're computer stops, you think I'm not doing anything. We'll just think of all the stuff that you operating systems having to cope with in the background.
16:32
It's not the reason we give you less course, because sometimes we kind of think of what we are doing as just what we are doing, but we're doing that within an environment where other things are going on.
16:43
Or we are processes have been put in place to support what you want to do, and it's important to understand what they are and how it affects what you're doing.
16:55
So in the end we end up with something like this. So that's from top to bottom so.
17:15
I've got we spending view too many people say he's running in the background.
17:19
Now go back.
17:28
So. We've got a an operating system and we.
17:37
All right, yeah.
17:46
We have access to our own user stuff.
17:50
And we get to that by using a GUI. Or a command line, or by setting up a batch fail to run at some other place. So there are all the user interfaces that we have, and those user interfaces will call functions of the operating system to run a program. To get a failed.
18:13
To send something to another computer.
18:18
To grab some. I I'll drive space.
18:23
To remember how much hard drive space you've taken and make sure you're not taking too much.
18:29
So all of these other things fit together. As part of the operating system. So that's the stuff in blue.
18:36
And at no point at all.
18:40
But we get access to the underlying hardware. Can you tell that's on Microchip? My drawing skills are remains. As you can see.
18:51
OK. So we don't get access to this. It has thank you for the thumbs that I'm much appreciated. And we don't get access to that. We have to get access to that via the operating system. So it can do all of these things that we just spoke about.
19:09
No, we're different ones. Command line interpreters that I just showed you one example of. And. You type in a command, it executes.
19:19
Sometimes it's a command for the operating system, so DIR was built into the operating system to give you a list of files, but I could have run a program at that point.
19:30
I could have. Little bit of a point where it doesn't work.
19:35
I could have taped one Python.
19:40
And there's me in my Python interpreter.
19:45
Where I can run Python commands.
19:53
And have them run on the command line.
19:59
So the stuff that we type in can be.
20:02
Operating system.
20:06
Months or it can be other programs have been written and made available.
20:14
And depending on what came the system you have, you'll see a different type of command. In fact Unix.
20:20
Highs the option of which command line interpreter to use. So those AC H for the shell. Those BA, SH or bash for the Bourne again shell. There are literally too many to do, not even because one of the things you can do with something like. Unix is rate yourself a command line interface and run it.
20:44
So that it has the things that you like.
20:49
Here we're looking at the Bourne again shell. Written by a guy called Born who liked as we puns spawn again. Do you get it? It's a new shell. Ohh, had them rolling in the hills. It did.
21:03
And you can see that you can run commands.
21:07
And these are the commands. There's a command line name, the computer, and then you're on a command. The W says what's happening.
21:15
I will. I will start what's happening with him. The output, there's that. LS that I spoke about before giving you the list of files and directories. Those pass print Working directory which gives you where you are. You can ping other computers so there's lots of things you can do from a command line.
21:37
OK, spent too long in a graphical user interface because I think you all know pretty much and how to use one of those and what the features are. The one thing I'll remind you is. What happens if it's in blue?
21:53
Then the assessment.
21:55
Intentionally assessable, yes, so it's just sort of stuff you definitely want to remember.
22:02
Who's complaining about my 19 Firefox tabs? That's called preparation Morris. I've got all these things ready to go.
22:15
And. You didn't know you could run Python from the command line interface. What idiot thought you Python? That's what I want to know. They never told you that here.
22:28
So we have different command. Lines, but we've also got different flavours for different command lines, and similarly similarly different flavours for graphical interfaces O.
22:44
Windows looks different to Mac OS owned by the way Mac OS. Unix, despite what they think, it's just a nice Mac. Graphical interface on a Unix subsystem.
23:01
Similarly things like.
23:04
Android take bets from Unix.
23:07
Eyes does I OS? I OS uses icons but instead of using your mouse and buttons you just woke.
23:16
Or, if you're like my mother-in-law, you punk.
23:21
To make things work.
23:26
So you'll see similarities and differences if you're used to windows, the micro. Line is at the top rather than the bottom.
23:39
The are slightly different buttons and the top left instead of the top right. Stuff like that.
23:53
OK, everyone happy so far.
24:02
The tabs shouldn't slow down because it does. It is supposed to put them to sleep in the background so they don't use system resources, but I'm not convinced that they do.
24:12
Right. So how does all this happen? How how do we get a mouse pointer? On the screen, how do we get PowerPoint to understand that when I click the mouse button, I want to do something?
24:27
We hope operating systems are something called an API, an application program interface.
24:35
So if we want a mouse pointer.
24:39
We say give us a mouse if we want the mouse pointer to be a red dot with a big yellow background on it, so you can see it easily. We can program that if you want the red dot to get big when I click the button so you can see it's been clicked. You can do that too.
24:57
And if you want certain things to happen when you click a button, like move around. Within the slides you can see OK if you had a particular part of the screen.
25:10
Trigger an action.
25:13
All of these happened with system calls. Now for the next we bit, there's a lot of programming stuff in here and I don't want you to get worried about it. You won't be assessed on the programming stuff, OK, it's just to give you an idea of what's happening. And. Under the hood.
25:32
OK.
25:35
But I won't be expecting you to write and you operating system or be calling the operating system and we'll stick to the LMC in the very simple LMC for that. So I want to give you an idea of how they do it, but I'm not going to ask you to do it. And if you're not following the the programming stuff because I know that those people in this class from different programs where you might not have. Taking programming as part of it, you're not following it.
26:01
Don't worry about it. I'm just trying to give you the background and it's not about programming.
26:10
So. The application program interface has a whole bunch of system calls, so if we want to copy a file. So if you've got. Umm. If you get what seed eyes? In essence, that's copy a file.
26:27
So if you get Fred, don't text and you want to rename it.
26:31
You're copying for a dot text to Barney dot text.
26:36
OK, you're copying thread dot text, a copy of it, and renaming it Barney dot text and there is a system call for that that says take the source file thread dot text and copy it to the destination file Barney dot text and you can see there's a whole bunch of things that have to happen for that. To work, what's the name of the input? What's the name of the output? Go through it until you've gone through all of this, all of the data in that file.
27:06
And if your rating these things, then you'll become familiar with this kind of stuff.
27:13
This is how you read a file.
27:16
In a program program.
27:20
I genuinely cannot speak this morning. It's really else in a programming language called C.
27:27
So first of all, it returns something, but the function is called read, so this is not surprisingly, reading a file.
27:36
Let me see what's the UFD. What does FD mean? All the file descriptor void asterisk buff? Or a buffer where data is read into OK size T count.
27:50
Maximum number of Bates to be read into the buffer. OK, so go and read a go and read this Android 1000 bytes that time or whatever it's going to be. So we might not read all of our five. MB fail will make you did in one K chunks, so it makes you read my file into. The buffer size 1024 let me take one elevator a time.
28:16
So if you have the interface and if you have to create programs at the low level, that's the sort of thing you have to understand, and this whole manuals for that either online or on paper.
28:31
And when you call that.
28:35
Command. The operating system will run an internal.
28:40
And.
28:41
Piece of code to make that happen.
28:45
So if you've got a failed copy that's written into the the operating system, so someone has written that code to happen, and all you're doing is calling it.
28:53
And if you have. Don't programming. If you think of calling a function, it's exactly like that. The difference is something else is written the function, and it's running in the operating system.
29:06
So the user will say open that will go to the system interface and then that will happen down at a low level. For that to happen and go back and make it available to the user application. I can, if that's not your thing, don't worry about.
29:24
As I pointed out in the example, you probably have to tell it some things you don't just say open a file, you open thread dot text or you open. And D colon Fred dot text so you tell it which device it's going to be on. Or. No. Anything at all like that. You might want to open it in text mode or open it in data mode. And even if you don't know that you're doing that, some operating systems will take care of that. For you. So for example, if you open the failed thread text.
29:58
Windows.
29:59
Will more than likely have an association that says any file that ends in dot TXT is a text file, and I'm going to have a particular program that I will use to open that.
30:13
Notepad.
30:17
If you open a different type of fail. If you open an MP4 file, for example.
30:24
On my computer that's associated with the films and TV application, and it runs that video.
30:33
The depending on which fail you have, it will open it in different modes and make the text mode it might be.
30:40
Data mode, a video, a graphic, or it might be an executable mode. It might be a program that you're opening to run.
31:07
I've completely lost my.
31:13
Most pointer there we go.
31:18
OK. So we will pass parameters, whether that's the name or whatever to make something happen.
31:25
And there's all sorts of. Justin calls that you could have.
31:29
And one of the things you'll have to be careful of is is the the main culture. So we talk about running a program, either run the program PowerPoint, I run the program teams, but actually as far as the operating system is concerned, that's a process. It's something that's running on the system. And you saw when I opened up task manager, that was a whole bunch of other processes running. Things to facilitate that, things to run the speakers, things to run the displays. All of those.
31:58
It up and running all the other things that you're.
32:02
So. We can start and stop processes.
32:07
We can wait for things. So at the moment I've started a process called PowerPoint. It's created an output of this slide. And it's not doing anything else. What's it doing? It's waiting. It's waiting for me to press a button.
32:23
And move to the next slide.
32:26
So those all sorts of system calls for file management for device management.
32:32
You seem that device management. It says request and release. That's the thing that was talking about earlier like, but the printer. If you want to print a document you request the printer. You print the document and then you release the printer because there's no point in anyone else having it.
32:49
But the same thing happens with all your other devices. Only one thing can use the one time. So you request the mouse, you're request the keyboard, you're request the screen to update it.
33:00
And all these things happened with the operating system sorting out who's getting access. Two point for how long?
33:12
There's also general maintenance things. What's the time? What are the attributes of a file?
33:20
And if you haven't come across fail attributes.
33:30
This is why my computer is so slow and all these things running in the background to be able to show you things.
33:36
On Windows, it's not called attributes, it's called properties. And it says things like it's an MP4 file when it opens with films and TV, and it's called it's name and it says how big it is and when it was created. And you can decide whether you're going to have it read only so that you can't edit it. I can give access to other people now. This is a Windows machine, so it's.
33:59
And the main single user.
34:01
But more people could log in so. At the moment, as as only me. So I've got all the. System rates and my rates and ministrations rates, and I can do everything with it. I've got full control of this fail, I can modify it, read it, execute it, delete it, whatever.
34:20
The operating system stores all those properties and gives me access to them.
34:26
It also allows communications and us spoke about earlier. If you're talking from one process to another, but it's also about.
34:35
Connecting different devices on the computer itself. Connecting the.
34:43
PowerPoint program. With the PowerPoint fail.
34:49
So both held in memory and whenever I move between each PowerPoint file, the PowerPoint program looks to the PowerPoint file and loads in the next chunk, specifically the next.
35:02
Slight.
35:04
When I press the button, memory is accessed from the PowerPoint program to PowerPoint data and it loads in the next slide.
35:16
All the stuff I was talking about earlier, but when you get access, that's also the operating system as well. Remember when you log into your?
35:25
University account. You're logging into an operating system, specifically a server stay operating system.
35:33
And that gives you access to things, so all that stuff that was there where I showed you there was multiple accesses for.
35:41
I am.
35:43
Me for the System Administrator and all that kind of stuff can be extended to you guys, for example.
35:51
So those all of these sort of things, they exist in most operating systems, not all there is very few, there are very few calls for the operating system, for the ABS in your car to open a file. So that's not there, but most things you'll see some other things.
36:10
So for Windows, there's an API for clear process and for Unix it's called fork.
36:18
Which means that splits one process internals to create another.
36:23
Read file for Windows and read in Unix so there are similar things happening in all these operating systems.
36:31
Which means that we can rate programs to do things.
36:36
So I showed you that program.
36:41
In my case I was using Python.
36:45
To print out Hello OS class. What I had to do? An example here is instead and.
36:53
I see.
36:56
When I said print see meet says printf but it still had to go to the library. I had to get a right system call. In other words, right to the screen that then came back and displayed it on the screen.
37:09
So all of these things have to work together. I'll make sense to everybody.
37:21
Thank you, aunt. Right.
37:24
So just some examples. So there's there's different types of operating system and I said. Earlier that I was running Windows which to intents and purposes a single user, even though we can set multiple user profiles.
37:38
Very much a single user is something called MS-DOS. Some of you may have heard of it. It was the first piece C operating system. Well, it wasn't first, but it was first popular one.
37:52
It's something called single tasking so. I keep saying it. I've got PowerPoint on and got teams running it. Multiple things running, single tasking means you only get one. So you've got single tasking and multitasking DOS with single tasking. You do one thing at one time. Windows is multitasking. You can do lots of things.
38:11
You also get single user and multi user which work exactly as you'd expect. You can either have one user or multiple users.
38:20
When a computer boots up with MS-DOS.
38:26
And just so you know, this is the memory map. So that says 0.
38:33
At the bottom of memory up to high. And I've deliberately put high rather than putting a number.
38:43
Because.
38:50
I don't know how much memory is in this computer, seems I don't know how much memory is in my Windows machine or your Windows machine, but I do know that it starts at memory address here.
39:00
So when MS-DOS starts up, it loads. The kernel.
39:06
So that's the kernel of the operating system.
39:10
To get everything working. The kernel then loads a command interpreter.
39:16
And the command interpreter for MS-DOS looks exactly like that.
39:25
It has a display you type in commands and things happen.
39:31
That's just the way those looked.
39:35
Way back when.
39:39
If I type in a command then it runs that process and that process gets loaded into memory and it's running.
39:48
And at the moment what I've got is Python, so I can't type this DIR command again. Because that's for the operating system.
39:59
I can only type in commands that make sense for the program that I'm running, which in this case is Python.
40:13
But once I've finished with this program and I exit, no.
40:20
I did none of my introduction to programming students, remaining that I needed brackets.
40:26
I can exit that program.
40:29
And go back. To.
40:39
The operating system command interpreter. So we run the operating system, we run the command interpreter, I typed in the word Python.
40:50
Oops.
40:59
I typed in the word Python at the command interpreter.
41:05
That then run the process, loaded it into memory and that process then just run on a loop until I exited, at which point that piece of memory was removed.
41:18
And we go back to this state again, where it's a command interpreter and I can type in another command.
41:25
No, I'm saying that like the commands DIR and Python are different. They're not. It just so happens that the command D IR is built in that also.
41:35
I tape and DIR now also runs a process that runs AD IR command that prints off the list of files and then automatically exits. So that's only difference really. Dir automatically extended Python had to tell it to exit.
41:52
So it can only discuss single memory space. It can only run one thing at a time, and you have to load that program, run it, and then when you want to load something else, you have to exit, go back to the shelter on a new one.
42:06
Other things like Unix will run lots of processes at once, and here you can see the same kind of idea. So we've got low memory at 0.
42:15
All the way up to high memory.
42:20
We still have the kernel.
42:23
Loaded and at the beginning.
42:28
But rather than as it was before, where the first thing it was installed was a command interpreter, that interpreter can be anywhere in memory.
42:38
We don't care and it's one of the things that we'll talk about later, how we make sure that things can load anywhere so we can have lots of processes scattered about memory, all running at once, so it's multitasking.
42:56
But the same principle applies. You're on each process until it's done, then you exit it.
43:02
Just let me click in the big Red X and Windows.
43:07
So you have your programs. You also have system programs programs like DIR to show list of files. So it's a whole pile of things that you can run.
43:21
No.
43:28
That's going on. So Peng is a network command that sends a packet of data to another computer on the network.
43:37
In this case I've pinged bbc.co.uk.
43:42
I pinged it with 32 bytes of data and it's telling me that it takes an average of 19 milliseconds to go from my computer. To the BBC and bike.
43:56
Some of you are gamers will understand this Pingree perfectly because that's how quickly you can get a command and if you're paying rates too low, you'll be shot before you can shoot somebody else. And some of these online games. But more importantly for what we're doing. It gives us an idea that we can run other programs, so I've run DIR. I've run Python, I've run ping.
44:24
Sorry I P states this is the thing when I said earlier about command line interfaces. They're good when you remember them. I've just typed in a A Unix command, but I'm on a DOS machine. So I get confused as well.
44:44
So there's all sorts of system programs and that will depend on the operating system that you're running, what you have available. But again, just like with the. API calls. There are similar things for some of their operating systems. Most operating systems like you open files, save files. And print fails.
45:14
Most operating systems also have text editors built in.
45:19
Or programming languages.
45:23
Not so much anymore, because we tend not to use command lines, so we tend to use a a whole other thing. I had to install Python to make that happen.
45:33
But there's a whole bunch of system programs and it will depend on the operating system. Depending on what you need to do, depending whether you want a command line or a mouse, or whether you're touching things with your fingers.
45:51
So we have all these things in the operating system.
45:56
They're all working away and your heads are all swimming.
46:00
So.
46:04
Can I suggest that I use one of my multiple tabs?
46:10
To stop my countdown timer and you take 5 minutes just to get up and walk around and then we'll come back and look at the operating system structure.
46:18
OK. And I'll see you back here on five.
46:26
OK Google set 4 minute timer.
52:16
OK, so we're back.
52:19
Anybody thought of any questions why we had a break?
52:24
No.
52:26
OK, so I want to end by talking about structures of the operating system, so we've got. Lots of things going on, clearly. Clearly lots of stuff happening. With what we're doing.
52:42
So let's look at.
52:45
Some of the structures that were made having an operating system, so we've got symptoms like DOS.
52:59
We have things called device drivers, so device driver is to allow us to talk to specific types of hardware. We may have a device driver for a keyboard or a display.
53:13
We need the keyboard on the display before we even start doing what we want to do, so they are stalled in the room, so they are part of the core system.
53:25
Well, once we start running, we might have other things that we want to do like run a printer. Now, there's lots of different types of printers and lots of ways that could work. So we can't store them on the device driver. So we have an MS-DOS device driver.
53:42
Programs will contact these things to contact devices.
53:47
Keyboard helpdesk, whatever.
53:50
And the application period. Can either go through.
53:55
Doors bought.
53:58
Actually, MS-DOS has access to the core device drivers. Tops stalled as part of the bias.
54:08
Problem with that is we don't have that separation anymore. We don't have that thing. That was in that slide and many, many slides ago. Where we say it that.
54:22
We don't get access to hardware.
54:29
I know it's here somewhere.
54:31
I'll say that we're at the hardware is doing there and we don't get a chance to do it. MS-DOS does not enforce that.
54:42
So it can cause problems.
54:45
The fact that we can get access to the hardware is not a good idea.
54:51
So it's really a simple structure for DOS. Unix is not simple top.
54:58
And what it does is it loads something called a kernel.
55:02
A kernel is the smallest, most protected part of the operating system, so it's it's a spider at the center of the web, controlling everything else. So you say to the kernel I want to open a file and the kernel will call the file opening. That's software.
55:22
Well, you say to the Council, I want to print a fail and the kernel will call the fail printing bit of the software.
55:31
So it provides a whole bunch of other functions.
55:38
So we start program which calls. The system calls that can do all of these things, get memory, get a keyboard. Get a key and from the keyboard. And that then talks to the memory.
55:53
Excuse me. That then talks to the hardware memories about that.
55:58
So we never get access. So we've got this. I am.
56:04
Barrier between US and the hardware again, which is far better.
56:09
No, the way that it's shown there is OK, but it's not great. I actually prefer to think of the operating system this way. So the hardware.
56:22
Is right no matter what's protected.
56:25
And you have different layers outside. So say for example. You want to open a file, so you're out here.
56:37
Opening a file.
56:43
So you need to talk first of all to your command line interface. Or you're gay.
56:53
Which calls the file opening.
56:58
System.
57:00
Now remember, this is just an example. Different operating systems or set up in different ways. There are different layers. They work in different ways. This is an example that will call the file system which will call the IO system.
57:14
To go retrieve that fail. From hardware when it does. That will then send it back out. The wheels again, so they've fail. IO will send it back.
57:29
To.
57:33
Memory.
57:36
Which sends a signal to the file system that it's in memory and available to use with all its information, which then sends another. Message back to the user interface. Seeing the fails ready.
57:52
Which lets you know at the end so it works its way through the layers and then works its way back, but each one is protected to stop you getting it.
58:12
Depending on how much stuff you want in that kernel, we can talk about kernels or we can talk about microkernels.
58:21
Basically just trying to make the kernel is as small as possible. The idea of being that anything that. And isn't core to that should be hived off to other things?
58:32
So if we've got.
58:34
File systems or print systems or IO systems. Why would we have them in the kernel? Let's take as much out of the kernel as we can and put it elsewhere, and we call that a microkernel and Mac OS 10.
58:49
Users are may cook on in that way, so it. It puts as little as possible in that central bit and hives everything off, and that makes it easier to add in new things.
59:02
However, there is a detriment all of that stuff where we're working our way through the layers and. You talked to the user interface that talks to the file system that talks to the IO system that talks to memory that talks back to the file system. It talks back to the. User interface that talks to you.
59:21
Well, those overhead in that will the we said before, the operating systems have communications, that communication isn't free. So that can potentially slow it down, but it does make.
59:36
The operating system much more secure.
59:40
So it depends how you want to approach it. Wouldn't make much sense to approach the. I keep coming back to it. The operating system for cars antis get breaks. There wouldn't be much point in having everything separated out for that.
59:56
Simply because of the way it works, the overhead would be too much.
1:00:01
So you don't do it that way.
1:00:06
So a microchannel works like that.
1:00:10
You have kernel mode where you have all these things in there for communications, memory management and scheduling and all that kind of thing.
1:00:20
Did they even talked to things that happen at the user mode? Whether that's for applications or fails or device drivers?
1:00:29
And if you have new things happening or you have extra hardware or you want to add extra functionality into your system, you can have loadable modules so you can add extra things in there.
1:00:42
Which is great if you want to add the extra functionality, and in fact, as I said before the the Mac.
1:00:49
Graphical interface is just one of those modules loaded onto all the other things, just to make the map look like the map.
1:00:58
And lots of operating systems take that approach to allow you to have extra stuff that you'll load in.
1:01:05
It helps in other ways as well because I keep saying that that we get different types of operating system. They are there to solve different problems and to cope with different workloads.
1:01:20
If you've got a system and all it's doing is taking the Asda transactions for the Bank of Scotland.
1:01:27
Why would you have anything built into the operating system to run a printer? All students taking data and applying it to if to file somewhere else. So you need your file system but waiting to print our system. In fact, waiting to a graphical user interface or command line interface come to that. Get rid of all those extraneous modules and just have what you need.
1:01:48
So you load in what you have and it means that the operating system can be as lean as possible.
1:01:54
But with the flexibility to add another things.
1:01:59
So other operating systems take that approach. So Larus is another Unix based system. It does the same sort of.
1:02:09
Umm.
1:02:11
But because there are pros and cons and you'll hear me say this a lot during this module, there are pros and cons to all of these things. Some operating system take this hybrid approach.
1:02:21
So we want high performance, but we want flexibility.
1:02:28
So. Operating systems like Windows and Mac.
1:02:33
Hilda and the have.
1:02:37
Chunks of it, so windows has a huge chunk chunk of stuff that's built into its kernel.
1:02:45
But then has the opportunity to change that. With different views of different whatever.
1:02:55
Mike is also hybrid. And you have the option of how. Of what sort of things that you're going to load in. So you have and put output and you have kernel in there. Which is called mark for the I OS.
1:03:16
I don't know what BSD stands for.
1:03:22
No freebase or something like that is it?
1:03:26
Hey, not exactly.
1:03:32
Also, distribution is something's offer distribution.
1:03:38
Berkeley or Berkeley? I'm not quite sure how to pronounce it. Barkley software distribution basically when Unix came out and they made it free, which meant that universities got really excited because they could get an operating system for the very expensive computers without having to buy one from IBM digital equipment.
1:04:01
And one of the one of the universities that got excited about it was the University of California at. Buckley, Berkeley. Ohh Barkley. I think so. That was part of the Unix kernel and that. Was created in the 70s and it's still hanging about inside and up a micro operating system.
1:04:23
So we have that as part of the kernel and then it adds an extra bits for whatever you're doing.
1:04:28
You might be running Java stuff all calls just a different type of.
1:04:34
Application Environment, QuickTime for video and audio. BSD for. They interface and that interface can be loaded and top of it. So we've got the Aqua interface, the Mac interface that we know.
1:04:50
So there's some stuff held in the kernel, some stuff added in later. They've decided that I owed belongs in the kernel, but specific video IO for quick time belongs outside because not everybody will use it. So it's again getting that balance between let's have general IO. No, in the work is that will make it quicker, but let's have more specific ones go out.
1:05:15
OK, Alan, good luck and you can watch the end of the lecture later and ask me questions if you want, of course.
1:05:26
I always have the same kind of idea of core operating system. We've got services.
1:05:33
Media services are different, so the built on separately and so is Coco, which is the same as a an app development. So if you want to write and I OS program use the cocoa development and it's a a version of C.
1:05:50
Android on the other hand is.
1:05:54
Available and you can go and look at the Android.
1:05:58
And. Operating system. And see what it does.
1:06:03
Again based on Unix.
1:06:06
And I see based on Unix because it says they are based on Linux, but Linux is based on Unix, so all of these things.
1:06:13
No, don't each other in the same way as. Unix begat BSD begat Micro S.
1:06:21
Unix biggart Lennox which begat. Android.
1:06:27
So the basic Android kernel provides those things there, power processor, process, memory device. And I didn't power because that was really important. I was power management really important.
1:06:42
Because this report will devices. Yeah. It's for a small device that you'd put in your pocket. You're not going to be plugging it into the wall and you need to make sure that battery last year at least, you get home with it. Which some phone developers seem to have forgotten. I'm have to say.
1:07:01
So I didn't power management to that because it's a mobile device and then it decided, well, how are we going to build applications for this and that uses something called a Dalvik virtual machine. So you write a program in something called Java.
1:07:17
And those of you who remember introduction to programming last year will remember those compilers which create one and program, and those interpreters that run at one one line at a time.
1:07:29
Well.
1:07:32
Dalvik allows you to take the Java interpreted language and convert it to run it in what's essentially a virtual machine. This Dalvik virtual machine that can run that as an executable. So all starts getting quite complicated.
1:07:49
And you know, if you try and write any Android programs as a whole bunch of cats. So we were talking earlier about the API and the sorts of things that you have to call. The same thing happens if you're getting an Android app. You might need access to the web. You might need access to pressing buttons. You make need access to the phone you make need access to know anything at all.
1:08:09
So you end up with something like this.
1:08:13
You get poor Android.
1:08:17
So that's, that's the phone itself. You get something called the Dalvik virtual machine, which runs this pretend. Machine that doesn't actually exist, but gives you the option of running it everywhere, which is why your applications when you upgrade from Android 8:00 to 9:00 to 10:50. You're applications keep running because it's still running on that virtual machine inside the core Android system. And it's a big change to change that virtual machine. And again,
1:08:49
if you've tried to write programs for Android, you'll see that there's usually a choice and somebody can create new. I think I'm right. You can.
1:08:59
Point them at Android versions up to four. And I Android versions after four and the reason for that is that changed the virtual machine.
1:09:16
And as I said, I'm not all operating systems cope with the same workloads, do the same things. Some operating systems take that step further. You don't have an operating system. You decide what is it. This machine is going to be doing. So if you buy a big machine from IBM to run your accounting. Software. You might see. OK, well, I'm gonna need access to my fails. I'm going to need access to output, to print stuff up. Selling. Not going near the graphical user interface. I
1:09:46
don't need any Internet or any networking because it's all in one machine.
1:09:52
So you pick and choose which parts of the operating system you want to have. You're an assist chain, and that creates a version of the operating system that runs just for your workload.
1:10:05
Hopefully making it even faster for you to do that.
1:10:12
Once you have that, you need to get that started and for all the operating systems that we have looked at, it runs in the same sort of way. You start the computer, it checks the hardware. Have I got a screen? Have I got a keyboard?
1:10:25
Runs some initial boot code to do that. I want to check that you have an operating system stored somewhere.
1:10:34
Some of you may have seen it if you're operating system becomes corrupted, you'll get an error message saying can't find operating system on the hard disk.
1:10:41
Thought finds the operating system.
1:10:44
Loads that.
1:10:46
And to memory and then.
1:10:50
Transfers control to the new operating system.
1:10:56
Some go further. Some allow you to choose which operating system you want to install.
1:11:01
So you can start up a machine and say, well, I want to your on Windows or I want to run Unix or I want to run.
1:11:08
Now you choose.
1:11:11
To all of these things available to you.
1:11:16
Any questions?
1:11:26
No.
1:11:31
OK.
1:11:33
If there's no questions, then.
1:11:38
What did I want to see? I wanted to see.
1:11:42
Not following that.
1:11:47
There was a tutorial on.
1:11:50
OneNote. And it's a very specific tutorial.
1:11:56
Remember that your assessment? There's a good report. That takes the general theories of operating systems, and that's what we've been talking about. Different ways we can approach and operating system. How DOS does it differently to Windows, which does differently to Mac, which does it differently to Android.
1:12:15
You're.
1:12:16
Group report is to take each of these theories. And figure out how the work in a Linux operating system.
1:12:27
OK. So you're going to have to go into the.
1:12:30
The depths of here's why we chose this is the type of file system we have. This is a type of interface we have.
1:12:38
And to do that, it's probably helpful to actually have used a Unix operating system. So if you haven't.
1:12:45
We have a tutorial here.
1:12:48
And it's basically two parts. One is something called VirtualBox. And in the same way as Android the Ohata virtual machine running in the Android operating system, you can install VirtualBox to run other operating systems in your operating system. Now the. Instructions I've given here for Windows 10 because I assume that's what most people were on, but there are instructions for Windows 7 for Mac or whatever you want. So you install first of all VirtualBox.
1:13:20
That allows you to host on the operating systems.
1:13:24
And there are lots and lots of Linux operating systems, lots of different. Distributions. I don't mind which one you choose, but I have given you instructions here for installing Ubuntu, which is a popular Linux distribution.
1:13:40
So those links here as to how to install.
1:13:44
You've been to. On VirtualBox. On Windows 10.
1:13:51
So if you're doing this report, you might want to have a a Linux distribution to play with, and that's a way to do it.
1:14:00
So Ryan saying so basically what we need to do is write about how operating systems work. Correct. And talk about how it would work on a Linux OS. Almost correct. It's talk about how it does work, so we were talking there about kernels and Michael kernels and stackables and all that kind of stuff. What choice has your Linux system made and why?
1:14:27
If it choose a microkernel, why did it choose a microkernel, and what did that allow if it chose a a monolithic operating system, why did it do that and what are the pros and cons?
1:14:44
Any questions about that?
1:14:49
No. So no questions, what we'll do is I'm going to stop the recording in that case.
1:15:00
No, they said. The light. My fancy animation.
1:15:05
Is very cool. Weeks that took me.
1:15:11
I'm lying.
Here to help you learn
Sign in to keep a private conversation with your course tutor.
Ask me anything about the material…
Sign in to chat