System Software

Reading Time: 3 minutes

System software

  • System software is a type of software that manages the hardware of a computer and provides services for application software.
  • Think of it as a bridge that allows your apps to talk to the computer hardware.

Machine language

  • The lowest-level programming language.
  • Made up of binary code (0s and 1s).
  • The cpu can execute it directly without translation.
  • Example: 1011000001100001 (binary instruction for cpu).

Assembly language

  • Uses mnemonics instead of binary (e.g., add, mov).
  • Easier for humans to read than pure binary.
  • Needs an assembler to convert it to machine code.

High-level languages

  • Designed for humans to read and write easily.
  • Examples: c, java, python.
  • Must be translated into machine code using a compiler or interpreter.

Compilers

  • Translates the entire program into machine code before execution.
  • Produces an executable file (.exe).
  • ADVANTAGE : FASTER EXECUTION BECAUSE TRANSLATION HAPPENS ONCE.
  • EXAMPLE: C, C++

Interpreters

  • Translates the program line by line at runtime.
  • sLOWER THAN COMPILER BUT USEFULFOR DEBUGGING.
  • EXAMPLE: PYTHON, JAVASCRIPT.

Loaders

  • What it does : the loader is a system software that loads an executable program from secondary storage (like a hard disk) into ram so the cpu can run it.
  • why it’s needed : a program on disk cannot be executed directly; it has to reside in memory first.
  • example : you double-click a program like notepad. The operating system uses the loader to bring the program into ram so it can start executing.

Linkers

  • What it does : programs are often split into multiple object files (e.g., file1.obj, file2.obj). The linker combines these into a single executable program.
  • Types of linking
    • Static linking: combines all code and libraries into one executable at compile time.
    • dynamic linking:links some libraries at run time, reducing executable size.
  • Why it’s needed : without linking, the program cannot resolve references between different files or externallibraries.
  • Example : if your program calls a function in a math library, the linker ensures that the executable knows where to find that function.

Relocation

  • What it does : when a program is loaded into ram, it may not always be loaded at the same memory address. Relocation adjusts the memory addresses in the program so that it runs correctly no matter where it is in memory.
  • Why it’s needed : without relocation, the program might try to access memory at the wrong location, causing crashes or unexpected behavior.
  • Example : suppose a variable is supposed to be at memory address 0x1000, but the os loads the program starting at 0x5000. The loader/relocator adjusts all addresses so the program uses the correct location in ram.

Linker, relocator, loader

Think of it like this

  • The linker builds the map of the city (program)
  • Relocation adjusts the street numbers so houses are reachable from any starting point
  • Loader moves all the houses into the city (ram) so people (cpu) can live there and work

Macros

  • Macros are code templates that are expanded by the compiler before actual compilation.
  • Purpose : avoid repetitive code , make programs more readable and maintainable

Debuggers

  • Definition : debuggers are tools used to detect, trace, and fix errors (bugs) in programs.
  • Purpose : identify syntax, logical, or runtime errors , examine program flow and variable values common features
  • Examples of debuggers : gdb for c/c++ programs, visual studio debugger for .net and c++ , pdb for python