C SC 100 Lecture Notes
Spring 2008
Pete Sanderson
[
previous
|
schedule
|
next
]
major resource: Tomorrow's Technology and You (Complete), Eighth Edition, Beekman and Quinn,
Pearson Prentice Hall, 2008
Chapter 4, Software Basics
Overview
- computer without software is like Jacquard loom without its punched cards
- hardware provides mechanism
- software directs the mechanism toward some purpose
- software includes programs and data
- a program is a set of instructions, data is information (like names and addresses) that the program manipulates.
- Every program is an implementation of an algorithm, the abstract description of how the program accomplishes its task. We will examine algorithms in more detail later in the quarter, but for now it is sufficient for us to think of an algorithm being a kind of plan or design for the program. In this sense they are similar to recipes or blueprints.
Types of software
Computer programs (software) come in three major varieties
- application - used to accomplish a useful task, such as produce a document
- system - controls the computer hardware
- translation - converts computer programs written in English-like language into binary instructions
Application Software
- These are the programs you normally use.
- Examples are word processors, spreadsheet programs, games, and web browsers.
- Thousands of application programs are available for you to buy or download.
- Once the operating system is running, you can load application programs into RAM and run them.
Program compatibility
- Which computers or operating systems will your application work correctly on?
- A software program is not
universal, and its binary codes work only on certain types of systems.
- These include Windows,
Macintosh, and Linux (or UNIX).
- Older programs may not run on new versions of same operating system. Operating System requirements
are usually explained on the packaging when you buy software.
File type compatibility
- when application is updated, decision is made whether to support older data file formats
- if data file is created using old version of application, you may or may not be able to open and use it under newer version
Licensing and other legal issues
- When you buy or download software, you don't really own it! You are only buying a license to use it! The
licensing agreement typically appears when you install the program (you have to accept to complete
the installation). Ever read one of these?
- Do you know what software piracy is? Are you a software pirate?
- Do you know what freeware is?
- Do you know what shareware is?
- Do you know what the term intellectual property means? What is its purpose?
- Do you know what the fair use doctrine is?
- Have you heard of the Digital Millennium Copyright Act of 1998 (DCMA)? It
is sweeping copyright legislation intended to protect intellectual property
rights in our technological society.
- DCMA prohibits one from writing software that circumvents copy protection on a storage medium.
- DCMA also prohibits one from sharing this information.
- One high-profile case in 2000 involved DeCSS, a computer program that
unscrambles the contents of copy-protected DVDs.
- Even posting this program to the web could be ruled illegal. See
The DeCSS Gallery as an example.
Distribution
- commercial: producer of the software sells it and you buy it
- shareware: producer of the software lets you try it for free, with the request that
you pay if you want to keep using it. Variations on this "request" are to place a time limit on free use, or
make the free version less functional than the bought one
- freeware: producer of the software lets you use and distribute it for free. There are
variations here too, but they are beyond the scope of the course.
All the above have associated licenses.
System Software
- The primary example is the operating system.
- Most PCs are controlled by Microsoft Windows operating system.
- Macintoshes are controlled by the Macintosh operating system developed internally by Apple.
- There are others, such as Linux and Unix.
Operating system (O.S.) is the conductor
- controls which software programs get to use the CPU and when
- controls allocation of RAM
- controls transfer of data/instructions between disk/CD and RAM
- controls organization of files on disk/CD
- controls operations of all peripheral devices
Booting a computer
name comes from old saying about pulling yourself up by your bootstraps (get started without anyone's help)
- initially RAM is empty
- boot program resides in non-volatile memory on motherboard, called
Basic Input Output System or BIOS.
- when power is turned on,
- boot program is loaded into RAM
- then boot program is run (executed)
- boot program tells processor to load the operating system program from the hard drive into RAM
- processor then switches from running the boot program to running the operating system program
- operating system completes the booting process and remains in RAM for as long as the power is on
- you interact with the operating system (e.g. Windows XP) through its user interface
Operating System User Interface
- interactive use of computer requires interface between user and O.S.
- You are most familiar with Microsoft Windows.
- Which version(s) of Windows have you used? How can you find out which version you have?
- Have you used a Macintosh? How is it the same as Windows? Different?
- Have you used Unix or Linux? How is it the same as Windows? Different?
- Have you used MS-DOS? How is it the same as Windows? Different?
- O.S user interfaces come in two basic flavors:
- command-line interface (CLI)
- graphical user interface (GUI)
- both flavors have advantages and disadvantages
CLI is textual interaction using typed commands
- examples are MS-DOS, "native" Unix or Linux
- basic interaction cycle
- O.S. issues a "prompt"
- user types command and presses Enter key
- O.S. carries out command and possibly gives feedback
- go back to step 1
- commands resemble assembly language instructions: command followed by operands
GUI presents computing environment as a "virtual world"
- For history and example screen images, see the
Wikipedia article "History of the Graphical User Interface"
- predominant "virtual world" is desktop
- pioneered by Xerox PARC in 1970s
- Apple founder Steve Jobs copied the Xerox idea for Macintosh, 1983
- Microsoft founder Bill Gates copied the Macintosh idea (poorly) for Windows 3.1, 1992
- Windows finally "caught up" to original 1983 Macintosh GUI with 1995's Windows 95
- For a sample of original Macintosh GUI, see the Mac in my office
- To view the famous Macintosh "1984" commercial, see
http://www.uriah.com/apple-qt/1984.html.
This commercial was produced by Ridley Scott ("Blade Runner") and shown only once, during the
1984 Super Bowl. It is judged by many to be the best commercial in TV history.
OS Duty: CPU management
- CPU can run only one program at a time
- O.S. can switch what program the CPU is executing; this allows multi-tasking
- multitasking example: You can tell Word to save a document, then print it, then continue working while the save and print are both still in progress
- CPU does not need O.S. to carry out fetch-execute cycle, this is controlled by hardware
OS Duty: Memory management
- allocate primary memory to programs as needed
- deallocate primary memory as programs complete
- control cache memory
- cache (pronounce "cash") is French word for hiding place to store provisions
- a good explanation is found at
http://www.webopedia.com/TERM/c/cache.html
- memory cache is very high speed memory built into the processor chip to store
contents of recently/frequently-used RAM locations -- faster access because no need to read from memory unit
- disk cache is section of RAM used to store contents of recently/frequently-used disk locations -- faster access
because no need to read from disk unit
- this technique is also used by web browsers: disk files used to store recently/frequently used web pages -- faster access
because no need to read from remote Internet server
OS Duty: File management
- a file is a program or chunk of data stored under a given name in secondary storage (disk, CD, tape)
- a folder (a.k.a. directory) is a named collection of files and other folders
- Yes, I know you manage files yourself using Windows Explorer or by using Open and Save in your
software applications! Those software applications use O.S. services to carry out the Open and Save
operations.
- Windows uses file name extension (period followed by 1 to 3 letter
code) to associate the file with application that uses it.
- to view
file extensions, select My Computer from desktop or Start, then go to the Tools menu, select "Folder Options...",
then click the View tab and make sure the line "Hide extensions for known
file types" is unchecked.
- O.S. controls allocation of disk space to files when they are created and expanded
- O.S. controls deallocation of disk space when files are reduced or deleted
- O.S. allocates disk space in small (e.g. 1024 bytes) fixed size chunks, corresponding to disk track/sector intersection
- large files may thus be stored in pieces scattered across the disk; this is fragmentation
- fragmentation increases disk response time, defragmenting is process of reallocating to store all pieces of a file together
- in Windows, go to Start, then All Programs, then Accessories, then System
Tools, see if there is a defragmenting tool
OS Duty: Device (peripheral) management
- You can attach an assortment of I/O devices (scanner, joystick, camera, iPod) to your computer
- including some that were not yet invented when your computer or O.S. were developed
- How can O.S. communicate with these devices?
- O.S. communicates with peripheral devices through driver software
- driver manages data transfer between computer and peripheral
- driver, once installed, becomes part of O.S.
- many drivers are included with O.S., such as for keyboard, mouse, many disk drives, many printers
- driver software usually included when you purchase peripheral device, then you install both device and driver
- many drivers can be downloaded from device company's web site
Translation Software
- These are programs you rarely use unless you are a computer programmer.
- Each kind of processor (Intel, Motorola) has a special set of primitive instruction it understands.
- the processor's Control Unit contains circuitry to carry out these instructions
- the primitive instructions, stored in binary form, are called machine instructions
- these instructions are expressed using machine language
- We people, even programmers, are terrible at writing programs using machine language!
- English-like languages have been developed that we can use more effectively
- the processor, however, only understands its machine language, so the programs we write have to
be translated into machine language
- translation software does the translation
- Translation Example
- High-level language instructions to print the absolute value of data stored at memory location denoted by X.
| if X < 0 then print -X else print X; |
- A compiler will translate it into assembly language.
LOAD X
COMPARE zero
JUMPLT NEGATE
PRINT X
JUMP DONE
NEGATE: LOAD zero
SUBTRACT X
STORE abs
PRINT abs
DONE:  HALT
|
- An assembler will translate the assembly language into machine language.
0000000000001010
0111000000001011
1011000000000101
1110000000001010
1000000000001001
0000000000001011
0101000000001010
0001000000001100
1110000000001100
1111000000000000
|
- The machine language program is then stored in a file on some storage device.
- You can run the program later on, like you would run Word or any other application.
[
Pete Sanderson
|
Math Sciences server
|
Math Sciences home page
|
Otterbein
]
Last updated:
Pete Sanderson (PSanderson@otterbein.edu)