Lecture 3

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 43

Systems Programming (CS 423)

Lecture 3:

Basic Systems Programming Concepts

Dr. Mohamed Abbas Alameen Saleh


Classes of Software
• Systems software:
Set of programs that coordinates activities and
functions of the hardware and various other
programs.
• Application software:
Programs that help users solve particular
computing problems.
Spheres of Influence:
• Personal:
Information systems that serve the needs of an
individual user.
• Workgroup:
Two or more people who work together to
achieve a common goal.
• Enterprise:
Information systems that support the firm in its
interaction with its environment.
Issues and Trends
• Software licensing:
Protection by software vendors to prevent
unauthorized use.
• Software upgrades:
A revised version of software that usually
includes fixes of known problems, plus
enhancements to existing capabilities.
• Global software support:
Software that is distributed around the globe
may require unique support mechanisms due
to local political and economic conditions.
Ownership
• Freeware
• Shareware
• Public-domain software
Freeware
• Copyrighted software given away for free by the
author. Although it is available for free, the
author retains the copyright, which means that
you cannot do anything with it that is not
expressly allowed by the author. Usually, the
author allows people to use the software, but not
sell it.
Shareware (1)
• Software distributed on the basis of an honor
system. Most shareware is delivered free of
charge, but the author usually requests that you
pay a small fee if you like the program and use it
regularly.
• By sending the small fee, you become registered
with the producer so that you can receive service
assistance and updates.
• You can copy shareware and pass it along to
friends and colleagues, but they too are
expected to pay a fee if they use the product.
Shareware (2)
• Shareware is inexpensive because it is usually
produced by a single programmer and is offered
directly to customers. Thus, there are practically
no packaging or advertising expenses.
• Note that shareware differs from public-domain
software in that shareware is copyrighted. This
means that you cannot sell a shareware product
as your own.
Public-domain Software
• Refers to any program that is not copyrighted.
Public-domain software is free and can be used
without restrictions. The term public-domain
software is often used incorrectly to include
freeware, free software that is nevertheless
copyrighted.
Role of Systems Software

• System software:
o Is an interface or buffer between application
software and hardware.
o Controls the computer hardware and acts as
an interface with applications programs.
Operating System Functions
• Perform common computer hardware
functions.
• Provide a user interface.
• Provide a degree of hardware independence.
• Manage system memory.
• Manage processing tasks.
• Provide networking capability.
• Control access to system resources.
• Manage files.
User Interface
• User interface:
A function of the operating system that allows
individuals to access and command the
computer
• Command-based user interface:
A particular user interface that requires text
commands be given to the computer to
perform basic activities
E.g., unix, DOS
• Graphical user interface (GUI):
A user interface that uses pictures (icons) and
menus displayed on the screen to send
commands to the computer system
E.g. Windows, MAC OS
Systems Software Concepts
• Hardware independence:
o Operating system (OS) provides hardware
independence for application software.
o Application software interfaces with the
operating system which interfaces with the
hardware.
o When the hardware is changed, the operating
system is changed so that the application
software is not required to be changed.
Software Concepts

• Memory management.
• Virtual memory & paging.
• Multitasking.
• Multithreading.
• Timesharing.
Memory Management
• Memory management:
Controls how memory is accessed and
maximizes available memory and storage.
Virtual Memory & Paging
• Virtual memory:
Memory that allocates space in secondary storage
to supplement the immediate, functional memory
capacity of RAM.

• Paging:
A function of virtual memory allowing the computer
to store currently needed pages in RAM while the
rest of the pages wait in secondary storage.
Memory Disk

Program 1 (a few pages)

Program 2 (a few pages)

Program 3 (a few pages)


Operating
system and Programs
Program 4 (a few pages)
system and other
software software
Program 5 (a few pages)

Program 6 (a few pages)

Other memory requirements


Multitasking, Multithreading, Time-sharing:
• Multitasking:
A processing activity that allows a user to run
more than one application at the same time.
• Multithreading:
A processing activity that is basically
multitasking within a single application.
• Time-sharing:
A processing activity that allows more than one
person to use a computer system at the same
time.
Software Concepts
• Network capability:
Aids in connecting the computer to a network
• Access to system resources:
Provides security for unauthorized access
• File management:
Ensures that files in secondary storage are
available when needed, and they are
protected against unauthorized usage
Utility Programs
• Utility programs:
Programs used to merge and sort sets of data,
keep track of computer jobs being run,
compress files of data before they are stored
or transmitted over a network, and perform
other important tasks
Types of Application Software
• Proprietary
Designed to solve a unique and specific
problem.
• In-house
Development of application software using the
company’s resources.
• Contract
Developed for a particular company.
• Off-the-shelf
An existing software program that can be used
without considerable changes expected.
Sources of Software
• Customized package:
Blend of external and internal software
development.
o In-house customized
o Contract customization

• Programming languages:
Coding schemes used to write both systems and
application software.
Categories of Programming Languages (1)

• Machine Language:
1st generation programming language
Considered a low-level language because it
involves basic coding using the binary symbols
1 and 0.
• Assembly Language:
2nd generation language
Replaced binary digits with mnemonics (e.g.,
“ADD”) programmers could more easily
understand.
Categories of Programming Languages (2)

• Third Generation Languages:


Continued trend to more symbolic code (e.g.
COBOL).
• Fourth Generation Languages (4GLs):
Languages that are less procedural and even
more English-like than third-generation
languages (e.g. FOCUS).
Categories of Programming Languages (3)

• Query languages:
Used to ask the computer questions in English-
like sentences.
Also known as database languages
• Structured query language (SQL):
A standardized language often used to perform
database queries and manipulations.
Object Oriented Languages (1)
• Object-oriented languages (OOL):
Languages that allow interaction of programming
objects, including data elements and the actions that
will be performed on them
Note: OOP = object-oriented programming
• Encapsulation:
The process of grouping items into an object
• Polymorphism:
A process allowing the programmer to develop one
routine or set of activities that will operate on
multiple objects
Object Oriented Languages (2)
• Inheritance:
Property used to describe objects in a group of
objects taking on characteristics of other objects
in the same group or class of objects.
• Reusable code:
The instruction code within an object that can be
reused in different programs for a variety of
applications.
• Examples: C++, Java.
Visual Programming Languages
• Visual programming languages:
o Languages that use a mouse, icons, or
symbols on the screen and pull-down menus
to develop programs.
o Examples: Visual Basic, Visual C++.
Fifth-Generation Languages
• 5th generation languages…
Combines rule-based code generation,
component management, visual programming
techniques, and reuse management.
• Knowledge-based management:
An approach to the development of computer
programs in which you do not tell a computer
how to do a job, but what you want it to do.
Programming Languages: Terminology (1)
• Language translator:
Systems software that converts a programmer’s
source code into its equivalent in machine
language
• Source code:
High-level program code written by the
programmer
• Object code:
Another name for machine language code
Programming Languages: Terminology (2)

Interpreter:
A language translator that translates one
program statement at a time into machine
code.

Program Machine
Interpret
statemen language
er statement
t
Statement
execution
Programming Languages: Terminology (3)
Compiler:
A language translator that converts a complete
program into machine language to produce a
program that the computer can process in its
entirety.
Step 1: Translate program

Machine
Computer
Compiler language
program program

Step 2: Execute program

Machine
language
program

Program
execution
System Calls
• An OS’s system calls are called the Application
Programmers Interface (API).
• System calls are routines run by the OS on behalf
of the user.
• They are run in supervisory mode
• Allow user to access I/O, create processes, get
system information, etc.
• How many system calls an OS has varies
o Unix: around a hundred
o Windows: around a thousand
System Startup
• On power up:
o everything in system is in random, unpredictable state
o special hardware circuit raises RESET pin of CPU
o sets the program counter to 0xfffffff0
o this address is mapped to ROM (Read-Only
Memory)
• BIOS (Basic Input/Output Stream):
o set of programs stored in ROM
o some OS’s use only these programs
 MS DOS
o many modern systems use these programs to load
other system programs
o Windows, Unix, Linux
BIOS
General operations performed by BIOS:
1) find and test hardware devices - POST (Power-
On Self-Test).
2) initialize hardware devices:
- creates a table of installed devices.
3) find boot sector:
- may be on floppy, hard drive, or CD-ROM.
4) load boot sector into memory location
0x00007c00.
5) sets the program counter to 0x00007c00:
- starts executing code at that address.
Boot Loader
• Small program stored in boot sector.
• Loaded by BIOS at location 0x00007c0.
• Configure a basic file system to allow
system to read from disk.
• Loads kernel into memory.
• Also loads another program that will
begin kernel initialization.
Initial Kernel Program
• Determines amount of RAM in system:
o uses a BIOS function to do this.

• Configures hardware devices:


o video card, mouse, disks, etc.
o BIOS may have done this but usually redo it portability.

• Switches the CPU from real to protected


mode:
o real mode: fixed segment sizes, 1 MB memory
addressing, and no segment protection.
o protected mode: variable segment sizes, 4 GB memory
addressing, and provides segment protection.
• Initializes paging (virtual memory):
Final Kernel Initialization
• Sets up page tables and segment
descriptor tables.
o these are used by virtual memory and
segmentation hardware (more on this later)
• Sets up interrupt vector and enables
interrupts.
• Initializes all other kernel data structures.
• Creates initial process and starts it
running:
o init in Linux
o smss (Session Manager SubSystem) in NT
OS Philosophy
• Microkernel versus Macrokernel.
o few services versus lots of services
• Hard to agree on what should go in OS.
• More functionality, less generality.
• More services, more complexity, more
bugs.
o longer time to market, too.
• But macrokernels dominate the market.
o Unix, Linux, Windows, Mac.
OS Philosophy

many services

mach Unix
System Programs
• Application programs included with the
OS.
• Highly trusted programs.
• Perform useful work that most users need.
o listing and deleting files, configuring system.
o ls, rm, Windows Explorer and Control Panel.
o may include compilers and text editors.
• Not part of the OS.
o run in user space.
• Very useful.
Thanks ...

You might also like