HCW - 3.04 - coding - layers
When you are talking about software, and programming, it's often useful to talk about layers of software. This really doesn't help in terms of how the computers operate, because the software doesn't always, cleanly, work in layers. Sometimes it does. Actually, there are an awful lot of things, particularly in data communications, that operate in layers. But frequently it is useful, for your own understanding of how computers work, and how they can go wrong, to think about the software in layers because that helps you identify where a problem might be happening.
The first logical layer is not, in fact, software. It is the hardware. Knowing what usually happens in the hardware, and what usually happens in the software, is very useful in terms of trying to figure out why what you thought should happen, didn't happen.
But, of course, we generally try to mess things up, rather than make it clearer. So, when you are talking about the hardware, you are generally talking about the platform that you are running. The platform is the hardware that you bought, or hardware that is functionally identical to the hardware that you bought. For example, if you bought an iPhone, this is a different platform then if you bought an Android cell phone. It has a different central processor, it has a different camera, and even though it makes phone calls in pretty much the same way, the icons that you use to call up the phone are going to be different. The programs that you are able to run on your smartphone are going to be different.
But, of course, I immediately have to retract this. iPhone is the hardware that is made by Apple Corporation. Android is the operating system that runs on most of the other smartphones in the world. But, of course, an operating system is software. Android is software. The hardware that you actually bought, that runs the Android software, is possibly made by Samsung. A number of different hardware manufacturers, manufacturers of smartphone hardware, will all use the Android operating system in order to provide a user interface for the hardware that they have sold you. iPhone is hardware made by Apple corporation. The operating system that the iPhone runs is called iOS.
And, just to make things even more confusing, the operating system also tends to be called a platform. So we have a hardware platform, and a software platform.
Apple Corporation also makes computer hardware. Generally speaking, this will be called a Mac. It runs an operating system called MacOS.
Microsoft corporation hardly makes any computers at all, except for a skinny, and rather underpowered, thin laptop called Surface. It is extremely unlikely that you have ever seen a Surface. However, all kinds of companies, all around the world, make computers that will run the software (operating system) platform that Microsoft corporation makes, called Windows.
Just to make things even more confusing, you can buy software that will allow you to run Windows software on Mac hardware. And you can also buy software that allows you to run MacOS on a computer that would normally run Windows.
(And you can do yourself a favour, and get yourself a free copy of an operating system called Linux, that will run on either Macs or Windows machines.)
So, we have (possibly confusingly but I can't help that) covered two different types of platforms: the hardware of the computer, and the operating system of the computer.
If you even understand what an operating system is, you will probably think of it as the interface with the computer. How the computer looks, even when you started up and it has worked its way through its boot up process, whether you need to type in specific words as commands, whether you are presented with icons in order to call up the programs that you want, and all that sort of thing.
That is, in general, true. Actually, it is much truer today than it was, say, forty years ago. The interface for how you would use each program was basically up to the program. Nowadays, programmers, when developing a program, do not need to make as many decisions about how the program looks, and what the interface looks like. An awful lot of that is now built into the operating system, and the individual programs, or applications, simply call the functions dealing with the interface. That is why so many programs look almost identical. They appear in rectangular boxes on the screen, with a strip at or near the top which gives different areas of functions that you might want to use, such as file, or view, or help, and each of those subjects drops down a list of specific functions that you might want. This is what everybody thinks that computers work like, or present as an interface, but it doesn't need to be. Forty years ago, programs would present you with quite a variety of different interfaces, and so learning a new program meant learning a new interface, as well. This current appearance and interface, used by pretty much all computers, started to appear more frequently in various types of computers, all based on a system called CUA, or common user access, that was invented by IBM.
But the thing is, while a lot of the parts of the user interface these days are supplied by the operating system, the operating system does an awful lot more for you than simply allow you a common interface display.
Much more important is the fact that the operating system provides a set of functions that pretty much all of your applications are going to want to use. For example, if you want to read or write a file, the program that you were using, when you ask it to save a file, or to read some information from the disc, is going to me making what is known as a system call to the operating system. Therefore, not every program is going to have to have the functions for accessing the disc, or sending information to the printer, or turning on the webcam, or sending some sound to the speakers, for itself and in its own programming. All of these are handled by system calls to the operating system.
The operating system itself may make calls to other system utilities. For example, while disc drives may be fairly standard, printers definitely aren't. Printers will have different functions and capabilities. And so, when you install a printer, the operating system is (generally these days automatically) going to go out and look for what is known as driver software. It will find a driver for that particular printer, and therefore we'll have a separate piece of software which knows what that particular printer is capable of, and how to call on its specific capabilities.
But all of this starts to get pretty complicated pretty quickly. At this point, probably the most important thing that you need to know is that the platform of the operating system has layers within its own layer.
So, now we are down to programs, or applications, or apps. Some people will make distinctions between these terms. Some people will say that apps are small programs. Some people will say that programs, or applications, are made up of a number of different apps, with the different apps performing various specific functions. This is, in my opinion, making things much too complicated. In reality, a program, or an application, or an app, may be developed in a variety of ways. They may be made up of a number of individual program files, or they may be amalgamated into one large application file. In reality, as far as you are concerned, this is a distinction that makes no difference. You can program in a variety of ways, and you can use one file, or many. In operation, if you make an application with many files, you will be using the interface to call the various parts or functions of the overall program. From the user's perspective, it doesn't make any difference. And, in fact, from the computer hardware's perspective it doesn't make any difference, either. Operating codes will be given to the central processor, and the central processor will execute those operating codes. The central processor doesn't particularly care whether the operating codes come from one file or many.
The programming, coding, or development of the application may be done in a variety of ways. The tools that the programmer will use may prefer to output one monolithic file, or a variety of small ones. Again, it doesn't particularly matter to the computer, or to the end user, when all the development is done. The user sees an interface, and the computer just sees a series of operating codes. The operating system itself may have to take more actions if the program is in a variety of small files, rather than one large one, but that's the operating systems problem. (And maybe that's why we have the layer of the operating system in the first place.)
Introduction and ToC: https://fibrecookery.blogspot.com/2025/12/how-computers-work-from-ground-up.html
Next: TBA
No comments:
Post a Comment