Grade by Grade
C. Computer Environments and Systems · Computer Environments and Systems

Applications, Programming Languages and Operating Systems

C3.5About 65 minutes
Learning goals
  • I can explain the functions of an operating system: managing programs, memory, files, devices and security, and providing a user interface and services to applications.
  • I can explain what application software is for, and how it relies on the operating system.
  • I can explain what a programming language is and how languages are used to build both applications and operating systems.
  • I can classify software correctly and justify my answer.

Words to know

operating system (OS)
System software that manages the computer's hardware and resources and provides services to applications. Examples: Windows, macOS, Linux, ChromeOS, Android, iOS.
kernel
The core of the operating system that controls the CPU, memory and devices.
application (app)
Software that helps the user do a task, such as writing, browsing, editing photos or playing a game.
programming language
A formal language with rules (syntax) and meanings (semantics) for writing instructions a computer can carry out, such as Python, Java or C++.
system software
Software that runs and manages the computer itself: the operating system, device drivers, firmware and utilities.
device driver
A small program that lets the operating system control one specific type of hardware.
utility
A program that helps maintain or protect the computer, such as anti-malware, backup or disk-cleanup tools.
system call / API
A request a program makes to the operating system for a service, such as opening a file or drawing a window.

Three words that get mixed up

"Is Python an app?" "Is Windows a program?" "Is Chrome an operating system?" These are good questions, and their answers are not obvious. The curriculum asks you to explain the difference between the functions of three kinds of software you have used throughout this unit:

  • operating systems, which run the computer;
  • applications, which do the user's tasks; and
  • programming languages, which are how all software is written.

Operating systems: running the computer

The operating system starts when the firmware hands over control at power-on (see Inside the Computer) and runs until you shut down. Its main functions:

  • Process management. Many programs run "at the same time", but each CPU core can only run one stream of instructions at a moment. The OS schedules them, switching between programs many times per second.
  • Memory management. Gives each program its own part of RAM, keeps programs from reading each other's memory, and moves data to storage when RAM runs low.
  • File management. The file system organizes files and folders on drives (the lesson Organizing Programs and Files).
  • Device management. Uses device drivers to talk to printers, keyboards, displays, network cards and storage.
  • Security. User accounts, passwords, permissions, firewall and built-in malware protection (the protection-plan lesson).
  • User interface. A graphical interface (windows, icons, menus) and a command-line interface (Command Prompt, PowerShell, Terminal).
  • Services for applications. Programs make system calls through the OS's API to open files, draw windows, play sound or use the network, instead of controlling hardware themselves.

Examples: Windows, macOS and Linux on computers; ChromeOS on Chromebooks; Android and iOS on phones.

Useryou: clicks, typing, touchApplicationsbrowser, word processor, games, your Python programs, the IDEOperating systemmanages programs, memory, files, devices, security; offers servicesDevice driverstranslate OS requests for each specific deviceHardwareCPU, RAM, SSD, keyboard, monitor, network cardwrittenwithprogramminglanguagesrequestsgo down,resultscome up
Software in layers. Applications ask the operating system for services, the OS uses drivers to control the hardware, and results travel back up. All three software layers (applications, the OS and drivers) were written in programming languages.

Applications: doing the user's tasks

Applications (apps) let people do things: write an essay (word processor), browse the web, edit photos, track a budget, play games, video-call a grandparent, or write code (your IDE is an application too!). Applications depend on the operating system: an app built for Windows uses Windows' services, which is why it will not simply run on macOS (see Source Code and Machine Code).

Utilities such as anti-malware, backup and disk-cleanup tools sit in between: they are programs, but their job is to maintain or protect the system, so they are often grouped with system software.

You clickSaveApplicationasks the OS towrite a fileOS file systemfinds space,updates foldersStorage driversends commandsto the deviceSSDstores the bitsThe application never talks to the SSD directly: the operating system does that for every program.
What happens when you click Save in an application. Each layer does its own job.

Programming languages: building software

A programming language is not a program you use to finish a task; it is a language with syntax (grammar rules) and semantics (meaning) for giving instructions. To be useful, a language comes with:

  • a translator (compiler or interpreter) that turns source code into something the computer can run;
  • a standard library of ready-made code (Python's math, random, os...); and
  • tools such as IDEs and documentation.

Programming languages are used to build everything else: applications, utilities, games, websites, and operating systems themselves. The Linux kernel is written mostly in C, and much of Windows in C and C++; many apps are written in Java, Kotlin, Swift, C#, JavaScript or Python.

Careful with one detail: the Python interpreter you install is a program (an application, in the operating system's eyes) that implements the Python language. The language is the set of rules; the interpreter is the software that follows them.

import os
with open("note.txt", "wb") as f:
f.write(b"Snow day!\n")
print(os.path.exists("note.txt"), os.path.getsize("note.txt"), "bytes")
os.remove("note.txt")
print(os.path.exists("note.txt"))

A Python program (an application) asking the operating system for file-management services: create a file, check that it exists, ask its size, and delete it. b"Snow day!\n" is exactly 10 bytes. Output (one line each): True 10 bytes / False

import platform
print("Operating system:", platform.system())

Asking the OS who it is. On Windows this prints Operating system: Windows, on macOS Operating system: Darwin (the name of macOS's core), and on Linux, including the Linux environment on a Chromebook, Operating system: Linux.

Operating systemApplicationProgramming language
Main purposemanage hardware and resources; run other softwarehelp the user do a taskwrite instructions to create software
Who uses it directlyeveryone, mostly in the backgroundend usersprogrammers
ExamplesWindows, macOS, Linux, ChromeOS, Android, iOSbrowser, word processor, game, IDEPython, Java, C++, JavaScript
Runs onthe hardware (with firmware and drivers)the operating systema translator, which runs on the OS
Could you use a computer without it?not normallyyes, but not do muchyes, if you never write software
The three kinds of software compared.
Worked example

Example 1: Classify and justify

Classify each and give a reason: (a) Android (b) a spreadsheet program (c) Java (d) a printer driver (e) Thonny (f) an anti-malware scanner.

  1. (a) Operating system: it manages a phone's hardware, apps, memory and security.
  2. (b) Application: it helps a user do a task (calculations, budgets).
  3. (c) Programming language: a set of rules for writing programs (it comes with a compiler and the JVM).
  4. (d) System software (device driver): it lets the OS control one printer model; it is part of the OS's device management.
  5. (e) Application (an IDE): it helps a user, who happens to be a programmer, write and debug Python.
  6. (f) Utility (system software): it protects the system rather than doing a user task.

(a) OS (b) application (c) language (d) driver/system software (e) application (f) utility.

Worked example

Example 2: Which layer is responsible?

For each problem, which layer is most likely responsible: application, OS (including drivers) or hardware?

(a) After an update, only one game crashes; every other program works. (b) A new printer does not appear in any program's Print menu. (c) Two programs try to use the same memory, and the OS stops one of them.

  1. (a) Only one program is affected, so it is most likely the application (the game or its update).
  2. (b) No program can see the printer, so the problem is below the applications: most likely a missing or broken device driver (part of the OS layer), or the printer's connection.
  3. (c) This is the OS doing its job: memory management protects programs from each other. The bug is in the application that tried to use memory it did not own.

(a) application; (b) OS/driver (or connection); (c) the OS correctly protected memory from a faulty application.

Just for fun

In 1991, a Finnish university student named Linus Torvalds announced a new operating system kernel and wrote that it was "just a hobby, won't be big and professional." Today the Linux kernel runs the world's fastest supercomputers and sits at the heart of every Android phone.

Hands-on activity

Software safari

You need: a computer or phone you are allowed to explore, and Python.

  1. Open the list of running programs (Task Manager on Windows, Activity Monitor on macOS, Task Manager in ChromeOS with Search + Esc). Find three applications and three background processes that belong to the operating system or to utilities.
  2. Find where the OS shows device drivers or connected devices (Windows: Device Manager; macOS: System Information). Name two devices.
  3. Run both Python programs above. Write which OS service each one used.
  4. Make a three-column poster (OS, Applications, Languages) with at least five correct examples in each, including at least one item that is easy to misclassify (such as the Python interpreter, a web browser or ChromeOS) with a sentence explaining it.

What to look for: correct classifications with reasons; drivers named for real devices; the first program used file-management services (create, check, size, delete) and the second asked for system information; the tricky items explained (for example, a browser is an application even though web apps run inside it).

Your turn

1

Give four functions of an operating system.

2

What is an application? Give two examples.

3

What is a programming language used for?

4

Classify: macOS, Python, a photo editor.

5

Why does an application ask the OS to save a file instead of writing to the SSD itself?

6

Is an IDE an application or a programming language? Explain.

7

What is a device driver?

More practice: warm-up

1

Name three operating systems.

2

Name three programming languages.

3

Is a web browser an application or an operating system?

4

Which part of the OS organizes files and folders?

5

What is the core of an operating system called?

More practice: on your own

1

Explain what process scheduling is and why it is needed.

2

Why can a Python script run unchanged on Windows and macOS, while a Windows application usually cannot run on macOS?

3

Which OS function is used when you plug in a USB flash drive and it appears as a new drive?

4

Your teacher says, "Python is both a language and a program on your computer." Explain.

5

Predict the output of the first Python program if the bytes were b"Hi\n".

Challenge

1

ChromeOS is built on Linux and most of its apps run inside the Chrome browser. Is ChromeOS an operating system or an application? Is Chrome? Justify.

2

A game uses 6 GB of RAM on a computer with 8 GB, and the user also opens a browser using 3 GB. Describe what the operating system does.

3

Explain why the same programming language (for example C) can be used to write both an operating system and an application, but an application cannot replace an operating system.

Check your understanding

Quiz

1.

Which is the main job of an operating system?

2.

Which item is a programming language?

3.

Which item is an application?

4.

A new printer does not appear in any program. Which is the most likely cause?

5.

When a program opens a file, it usually...

6.

Which statement about Python is correct?

For parents and teachers

Big idea: Expectation C3.5 asks students to explain the difference between the functions of applications, programming languages and operating systems. The layered diagram is the key picture: applications rely on the OS, the OS controls the hardware, and everything is written in programming languages.

How to help: Point at things on your phone or computer and ask, "OS, application or language?" Good tricky ones: the web browser, ChromeOS, the Python interpreter, the App Store, a printer driver. Ask your teen to justify each answer.

Common difficulties:

  • Calling any software an "app"; utilities and drivers are system software.
  • Thinking a programming language is a program you run to do a task.
  • Not seeing that applications depend on the OS (why Windows apps do not run on macOS).
  • Mixing up the language and its interpreter.