Computer Science Fundamentals: From Assembly to Operating Systems
Second-Generation: Assembly Language
- A mnemonic system for representing machine instructions:
- Mnemonic names for op-codes
- Identifiers: Descriptive names for memory locations, chosen by the programmer
Assembly Language Characteristics
- One-to-one correspondence between machine instructions and assembly instructions:
- The programmer must think like the machine
- Inherently machine-dependent
- Converted to machine language by a program called an assembler
Third-Generation Languages
- Uses high-level primitives:
- Similar to our pseudocode in Chapter 5
- Machine independent (mostly)
- Examples: FORTRAN, COBOL
- Each primitive corresponds to a sequence of machine language instructions
- Converted to machine language by a program called a compiler
Procedural Units
- Local versus Global Variables
- Formal versus Actual Parameters
- Passing parameters by value versus reference
- Procedures versus Functions
Protocols
- CSMA/CD:
- Used in Ethernet
- Silent bus provides the right to introduce a new message
- CSMA/CA:
- Used in WiFi
- Hidden terminal problem
Inter-process Communication
Client-Server
One server, many clients. The server must execute continuously. The client initiates communication.
Peer-to-Peer (P2P)
Two processes communicating as equals. Peer processes can be short-lived.
Traditional Internet Applications
- Electronic Mail (email):
- Domain mail server collects incoming mail and transmits outgoing mail
- Mail server delivers collected incoming mail to clients via POP3 or IMAP
- File Transfer Protocol (FTP)
- Telnet and SSH
World Wide Web
- Hypertext and HTTP
- Browser gets documents from the Web server
- Documents identified by URLs
Hypertext Document Format
- Encoded as a text file
- Contains tags to communicate with the browser:
- Appearance
<h1>
to start a level one heading<p>
to start a new paragraph- Links to other documents and content
- Insert images:
<img src="" alt="">
Client-Side Versus Server-Side
- Client-side activities:
- Examples: Java applets, JavaScript, Macromedia Flash
- Server-side activities:
- Common Gateway Interface (CGI)
- Servlets
- PHP
Internet Software Layers
- Application: Constructs the message with the address
- Transport: Chops the message into packets
- Network: Handles routing through the Internet
- Link: Handles the actual transmission of packets
TCP/IP Protocol Suite
- Transport Layer:
- TCP
- UDP (User Datagram Protocol)
- Network Layer:
- IP (IPv4 and IPv6)
Functions of Operating Systems
- Oversee the operation of the computer
- Store and retrieve files
- Schedule programs for execution
- Coordinate the execution of programs
Evolution of Shared Computing
- Batch processing
- Interactive processing:
- Requires real-time processing
- Time-sharing/Multitasking:
- Implemented by Multiprogramming
- Multiprocessor machines
Types of Software
- Application software:
- Performs specific tasks for users
- System software:
- Provides infrastructure for application software
- Consists of the operating system and utility software
Operating System Components
- User Interface: Communicates with users:
- Text-based (Shell)
- Graphical User Interface (GUI)
- Kernel: Performs basic required functions:
- File manager
- Device drivers
- Memory manager
- Scheduler and dispatcher
File Manager
- Directory (or Folder): A user-created bundle of files and other directories (subdirectories)
- Directory Path: A sequence of directories within directories
Memory Manager
- Allocates space in main memory
- May create the illusion that the machine has more memory than it actually does (virtual memory) by playing a “shell game” in which blocks of data (pages) are shifted back and forth between main memory and mass storage
Getting it Started (Bootstrapping)
- Boot loader: Program in ROM (example of firmware):
- Run by the CPU when power is turned on
- Transfers the operating system from mass storage to main memory
- Executes a jump to the operating system
Processes
- Process: The activity of executing a program
- Process State: Current status of the activity:
- Program counter
- General purpose registers
- Related portion of main memory
Process Administration
- Scheduler: Adds new processes to the process table and removes completed processes from the process table
- Dispatcher: Controls the allocation of time slices to the processes in the process table. The end of a time slice is signaled by an interrupt.
Representing Numeric Values
- Binary notation: Uses bits to represent a number in base two
- Limitations of computer representations of numeric values:
- Overflow: Occurs when a value is too big to be represented
- Truncation: Occurs when a value cannot be represented accurately
Representing Images
- Bit map techniques:
- Pixel: Short for “picture element”
- RGB
- Luminance and chrominance
- Vector techniques:
- Scalable
- TrueType and PostScript
Representing Sound
- Sampling techniques:
- Used for high-quality recordings
- Records actual audio
- MIDI:
- Used in music synthesizers
- Records “musical score”
Compressing Audio and Video
- MPEG:
- High-definition television broadcast
- Video conferencing
- MP3:
- Temporal masking
- Frequency masking
Communication Errors
- Parity bits (even versus odd)
- Checkbytes
- Error-correcting codes