Title: Kernels and Routines
1Kernels and Routines
- Dr. Harold D. Camp
- IT 212 002
- 29 March 2007
2Homework 6
- For an application that maintains your checkbook,
build three flow charts - Kernel flow chart showing the process of
balancing a check book - Routine flow chart showing the accessing of data
from a hard drive (that is called from the Kernel)
3Flow Charting
Call Routine
Function
Decision
Start/Stop
Input or Output
4Sample Flow Diagram
Start/Stop
OS Supplied Routines
Read Balance, Type, Amount
If Type Is Debit
Kernel
Call Debit
Call Credit
Kernel Specific Routines
Stop
5Sample Flow Diagram
Debit
Start/Stop
NBal Bal - Amt
Read Balance, Type, Amount
If NBal gt 0
Call Dispense
If Type Is Debit
Call Debit
Write NBal
Call Reject
Call Credit
Return
Stop
6So, Check Book Kernel
- Checkbook Activities
- Debit
- Credit
- Balance
- Does my balance agree with Banks balance?
- Routines (One Kernel Specific and One OS
Required) - DLL
- API
- Registry
7Dynamic Link Library (DLL)
- A library of executable functions or data that
can be used by a Windows application - A DLL provides one or more functions
- A program accesses the functions by creating a
static or a dynamic link to the DLL - A static link remains constant during program
execution - A dynamic link is created by the program as
needed - A DLL can be used by several applications at the
same time - Some DLLs are provided with the Windows operating
system and available for any Windows application - Other DLLs are written for a particular
application and are loaded with the application
8Dynamic Link Library (DLL)
- DLL is Microsoft's implementation of the shared
library concept in the Microsoft Windows and OS/2
operating systems - Usually have the file extension DLL, OCX (for
libraries containing ActiveX controls), or DRV
(for legacy system drivers) - DLL file formats are the same as for Windows EXE
files - Portable Executable (PE) for 32-bit Windows
- New Executable (NE) for 16-bit Windows
- DLLs can contain code, data, and resources, in
any combination.
9Dynamic Link Library (DLL)
http//www.eldos.com/documentation/solfs/dll_funct
ions_list.html
10Application Program Interface (API)
- A set of routines, protocols, and tools for
building software applications - A good API makes it easier to develop a program
by providing all the building blocks - A programmer puts the blocks together
- Most operating environments, such as MS-Windows,
provide an API - Programmers can write applications consistent
with the operating environment - Guarantee that all programs using a common API
will have similar interfaces - Examples?
11Registry
- A database used by the Windows operating system
to store configuration information - The Registry consists of the following major
sections - Roots - file associations and OLE information
- Users Preferences - all preferences set for
current user - User Information - all the current user
information for each user of the system - Local Machine Settings - settings for hardware,
operating system, and installed applications - Current Configuration - settings for the display
and printers and other devices - Dynamic Data - performance data
- Most Windows applications write data to the
Registry - You can edit the Registry directly by using the
Registry Editor - regedit.exe provided with the operating system
- Errors in the Registry could disable your
computer.
12In Class Example
- Digital Clock Kernel
- Kernel Specific Routines
- OS Specific Routines
- Be careful here
- Must use API, DLL, Registry
13Bandwidth and Moving Data,A/D Converters, UPS,
Ports, SATA, USB
14How Bandwidth Moves Data
15Analog to Digital Converters
- Signals in the real world are analog
- Light, sound, you name it
- Must be converted into digital, using a circuit
called ADC (Analog-to-Digital Converter), before
they can be manipulated by digital equipment
16Analog to Digital Converters
- Signals in the real world are analog
- Light, sound, you name it
- Must be converted into digital, using a circuit
called ADC (Analog-to-Digital Converter), before
they can be manipulated by digital equipment
17Digital to Analog Conversion
18Analog to Digital Converters
- In Class Discussion
- http//electronics.howstuffworks.com/analog-digita
l4.htm
19Uninterruptable Power Supplies
- http//www.aeceuro.co.uk/upsAnimation.asp
- Voltage surges and spikes - Times when the
voltage on the line is greater than it should be - Voltage sags - Times when the voltage on the line
is less than it should be - Total power failure - Times when a line goes down
or a fuse blows somewhere on the grid or in the
building - Frequency differences - Times when the power is
oscillating at something other than 60 Hertz
20Ports
- A port serves as an interface between the
computer and other computers or devices - Physically, a port is a specialized outlet to
which a plug or cable connects - Serial ports send and receive one bit at a time
via a single wire pair (Ground and /-) - Parallel ports send multiple bits at the same
time over several sets of wires
21Ports
- After ports are connected, they typically require
"handshaking," - similar to negotiation, where transfer type,
transfer rate, and other necessary information is
shared before data are sent - Hot-pluggable ports can be connected while
equipment is running - Hot-plugging a keyboard on many computer models
can cause permanent damage to the motherboard - Plug-and-play ports are designed so that the
connected devices automatically start handshaking
as soon as the hot-plugging is done - USB ports and FireWire ports are plug-and-play
- At times, special software (driver) must be
loaded to allow communication (correct signals)
for certain devices - A driver doesn't change the port,
- Rather a driver uses the port signal to control
the attached device
22Ports
- Currently (2006) manufacturers have nearly
standardized on colors associated with ports on
personal computers, although there are no
guarantees. The following is a short list - Orange, purple, or Grey Keyboard PS/2
- Green Mouse PS/2
- Blue or magenta Parallel Printer DB-25
- Amber Serial DB-25 or DB-9
- Pastel pink Microphone 1/4" stereo (TSR)
Minijack - Pastel green Speaker 1/4" stereo (TSR) Minijack
23Ports
http//www.cyberwalker.net/connectors
24Serial Advanced Technology Attachment (SATA)
- SATA
- A computer bus technology primarily designed for
transfer of data to and from hard disks and
optical drives - Designed as a successor to the legacy Advanced
Technology Attachment standard (ATA) - Expected to replace the older Parallel ATA
technology - Serial ATA adapters and devices communicate over
a high-speed serial link - Architecture
- Two pairs of (unidirectional) signal wires
- Low Voltage Differential Signaling (LVDS)
- 1.5 Gbit/s and up
- Above the SATA physical level are the link level
and transport level - Convert data into discrete ordered packets
- The application level generates read/write PIO
and DMA requests - Each SATA/device has a link to a SATA host-port,
with no sharing of cable or bandwidth between
devices
25Serial Advanced Technology Attachment (SATA)
26Universal Serial Bus
- A serial bus standard to interface devices
- Designed for personal computers
- Has become commonplace on handheld devices
- Devised to help retire all serial and parallel
ports on personal computers - A USB system has an asymmetric design
- Host controller
- Multiple daisy-chained peripheral devices
- Additional USB hubs may be included in the chain
- Allows branching into a tree structure, subject
to a limit of 5 levels of branching per
controller - No more than 127 devices
- USB's ability to daisy-chain devices
- Led to computers shipped only two USB ports
- To reduce the need for USB hubs, desktop
computers now come with more USB ports - Up to half of them on the front panel to
facilitate temporary connection of portable
devices
27Universal Serial Bus
- USB designed to allow peripherals to be connected
without expansion cards - And to improve plug-and-play capabilities by
allowing devices to be hot-swapped - Connected or disconnected without powering down
or rebooting the computer - When a device is first connected, the host
enumerates and recognizes it, and loads the
device driver it needs - USB can connect peripherals
- Such as mouse devices, keyboards, PDAs, gamepads
and joysticks, scanners, digital cameras,
printers, external storage, networking
components, etc. - For many devices such as scanners and digital
cameras, USB has become the standard connection
method - USB is also used extensively to connect
non-networked printers, replacing the parallel
ports that had previously been in wide use
28Universal Serial Bus Features
- The computer acts as the host.
- Up to 127 devices can connect to the host, either
directly or by way of USB hubs. - Individual USB cables can run as long as 5
meters with hubs, devices can be up to 30 meters
(six cables' worth) away from the host. - With USB 2.,the bus has a maximum data rate of
480 megabits per second. - A USB cable has two wires for power (5 volts and
ground) and a twisted pair of wires to carry the
data. - On the power wires, the computer can supply up to
500 milliamps of power at 5 volts. - Low-power devices (such as mice) can draw their
power directly from the bus. High-power devices
(such as printers) have their own power supplies
and draw minimal power from the bus. Hubs can
have their own power supplies to provide power to
devices connected to the hub. - USB devices are hot-swappable, meaning you can
plug them into the bus and unplug them any time. - Many USB devices can be put to sleep by the host
computer when the computer enters a power-saving
mode. - http//computer.howstuffworks.com/usb.htm
29(No Transcript)