Basics of Programming #3 – Software & Operating Systems

Basics of Programming #3 – Software & Operating Systems


Hello there! I’m back with another video,
yeah, I know, the last video was really long, but, don’t worry, from this point onwards,
it’s going to be pretty simple. So, what did we cover last episode? Well,
let’s see… We covered these! The RAM is the temporary memory a computer needs while
running! The storage is where all of your files and programs go – all of the permanent
stuff. The CPU is the part of the computer that does all of the hard work. And the motherboard
sticks all of them together. Inside the CPU, you have the ALU, which does
all of the maths, the control unit, which manages everything, and, the registers which
store super-temporary data. That’s all you need! Now, then, let’s move away from the
physical stuff and start thinking about the digital stuff, how are programs ran? How comes
you can have two programs running at the same time? What’s an operating system? All of
these will be covered, in this episode! First of all, let’s make sure we understand
what “read” and “write” means. When you “read” data, it means you are taking
data off of something, like when you open a program, it has to read all of the code
and stuff off of the secondary storage. Writing is where you put data on there, like saving
a file. OK, there’s one component I missed in my
previous video. On the motherboard, there’s a chip, and this chip is called the “ROM”,
standing for “Read Only Memory”. It’s non-volatile storage, so it does store data
permanently, but based on what I just said about reading and writing, the name says exactly
what its main feature is – you can’t write to the read only memory.
So, I know you might wonder: “Wait, how do you put data on it if you can’t write
to it”, and, pretty much, you don’t. The read only memory comes with data on it straight
from the factory. And, you pretty much can’t change the data on it.
So, what data does it come with when you get it from the factory? Well, it contains some
very small (usually about a megabyte), very important code that runs the second you turn
on your computer. The job of this code is to scan your hard drive for the “operating
system” (more on that in a second) and run it.
Right, that’s what it does. Let’s step back a bit here and explain what that means.
Let’s say you just built a brand-new computer from scratch, you didn’t buy it from a company,
or anything, you built it yourself, you got the CPU, the motherboard and all of that,
and put it together. When you go to turn it on, you’ll find that… It does pretty much
nothing, but just give you an error. That’s because it needs to have an “operating system”
on it. So, what is an operating system? Well, an
operating system is, pretty much a program. And its job is to manage everything on your
computer. It acts kind of like a layer between your programs and your computer. Let’s use
an analogy here. Let’s say you have this huge machine…
that does… something. There are literally thousands of buttons on this machine, and
doing even a simple task, requires pressing hundreds of them in all different combinations
and orders. Now, you don’t want to have to deal with all of that, it would take forever
for you to do all of that yourself. So, you get a team of people, who are absolute experts
in this, and instead of doing all of that button pressing yourself, they do it for you.
So, let’s say one thing this machine can do is create paper. Instead of you having
to carefully press the buttons correctly, you can just tell your team that you want
10 pieces of paper, and they’ll do all of the complex stuff for you, and there you go,
you now have 10 pieces of paper. In this, the machine is your computer, it
technically takes a lot of work in the background to do even simple tasks. The team is the operating
system, it simplifies things, instead of you have to do all of the complex stuff, it does
a lot of it for you. And, you, not only represent yourself, but you also represent most programs.
When people make programs, they don’t want to mess around with all of the tiny little
details. And so, that’s the job of an operating system,
it does a lot of the stuff for you and your programs. So, you are most likely familiar
with this. This is your desktop, and… this! This is your “start menu”. All of these
don’t just appear like magic, they’re actually part of your operating system. And,
so, when you build a brand-new computer, and you don’t have an operating system on it,
you don’t have a desktop, or start menu or anything, you just have the code from the
ROM which is pretty much useless in this case. You have to “install” the operating system,
just like a program, you can remove it from your hard drive, if you want, although then
your computer won’t really do much until you install one again.
This operating system is called Windows, made by Microsoft, and you’ve probably heard
both of those names a lot. This disc here is Windows 8.1, for 64-bit computers. And
Windows has come a long way, this is Windows 3.1 from 1992, and look, there’s no desktop
or start menu, that’s because they hadn’t even though of that yet.
So, in summary: It’s the operating system’s job to simplify tasks, an example is by adding
an easy-to-use interface, for both you and your programs. Without an operating system,
your computer won’t do anything because it has nothing to run. Now, not all computers
have this interface, that’s because Windows isn’t the only operating system, it just
so happens to be the most popular. But there are others. There’s also Mac OS,
which is used on Apple’s MacBook, there’s also android, which is used on (almost) all
non-apple phones. Ever wondered why a phone’s interface is different from a laptop’s?
That’s because they run different operating systems, and different operating systems tend
to have their own interfaces. Operating systems also tend to use very clever
tricks, like, for example, allowing more than one program to run at the same time, you see,
that’s technically not possible, I mean, if you remember what I said about registers,
if you had two lines of code running at the same time, and they both tried to access the
same register… Then your whole computer would act all messed up.
So, an operating system uses a trick to make it look like multiple programs are running
at the same time. What it does is run one line from one program, then run one line from
the another, then one line from the first program, and one from the second and so on,
but that happens so fast that you don’t even notice! It looks like they’re both
running at the same time. Operating systems are yet another reason why
you can’t just take an app from your phone and put it onto a computer – most programs
are built around a specific operating system, and usually, programs that run on both your
phone and on your computer have actually been remade to work on one of the operating systems.
So then, let’s summarize this pretty short episode. When you turn on your computer, the
CPU will instantly run the code that’s stored on your ROM, this code then scans your secondary
storage for an operating system. If it doesn’t find one there, then it also scans in other
places, like in the CD drive (because of course, you have to be able to put an operating system
on it somehow) Once it has found the operating system, it
will point the CPU towards the address the operating system is at and then the CPU will
start running the code of the operating system. So, let’s put all of that in one screen.
We have the ROM, which is “Read Only memory” and it comes with very important code that
helps the computer find the operating system. The operating system is a kind of layer between
the programs and your computer. This diagram shows very roughly what it’s
all about. Right at the bottom, you have your computer, which is really complicated and
stuff, and then you have the operating system, which does a lot of the work for the programs,
and for you. And then, you have the programs which talk to the operating system and tell
it what they want. So, that diagram is available for download,
link in the description, and yeah, this video was quite short, but we’re getting closer
and closer to programming, which will be a lot of fun! Bye!

2 thoughts on “Basics of Programming #3 – Software & Operating Systems”

Leave a Reply

Your email address will not be published. Required fields are marked *