Tuesday, August 21, 2007

Exer1 Pre Finals

* Memory Allocation

In computer science, dynamic memory allocation is the allocation of memory storage for use in a computer program during the runtime of that program. It is a way of distributing ownership of limited memory resources among many pieces of data and code. Importantly, the amount of memory allocated is determined by the program at the time of allocation and need not be known in advance. A dynamic allocation exists until it is explicitly released, either by the programmer or by a garbage collector; this is notably different from automatic and static memory allocation, which require advance knowledge of the required amount of memory and have a fixed duration. It is said that an object so allocated has dynamic lifetime.

- Memory Segmentation

Is one of the most common ways to achieve memory protection; another common one is paging. Segmentation means that a part or parts of the memory will be sealed off from the currently running process, through the use of hardware registers. If the data that is about to be read or written to is outside the permitted address space of that process, a segmentation fault will result.
This usage should not be confused with that of the memory segments used by early x86 processor architectures.
For details of x86's implementation of segmentation in both 16-bit and 32-bit mode, please see the article on memory segments.
Segmentation is a memory-management scheme that supports this user view of memory. A logical address space is actually a collection of segments. Each segment has a name and a length. The address specifies both the segment name and the offset within the segment. The user therefore specifies each address by 2 parameters: a segment name and an offset.

- Input/Output Ports

Port located on the outside of a computer that allows for an input or output device to be connected to it.


* Interrupt Vectors

Is the memory address of an interrupt handler, or an index into an array called an interrupt vector table or dispatch table. Interrupt vector tables contain the memory addresses of interrupt handlers. When an interrupt is generated, the processor saves its execution state via a context switch, and begins execution of the interrupt handler at the interrupt vector.

- BIOS

(pronounced [ˈbaɪoʊs]), in computing, stands for Basic Input/Output System.
The term is incorrectly known as Binary Input/Output System, Basic Integrated Operating System and occasionally Built In Operating System for example in Neal Stephenson's novel Snow Crash.
BIOS refers to the firmware code run by an IBM compatible PC when first powered on. The primary function of the BIOS is to prepare the machine so other software programs stored on various media (such as hard drives, floppies, and CDs) can load, execute, and assume control of the PC. This process is known as booting up.
BIOS can also be said to be a coded program embedded on a chip that recognizes and controls various devices that make up the PC. The term BIOS is specific to personal computer vendors. Among other classes of computers, the generic terms boot monitor, boot loader or boot ROM are commonly used. Boot is short for bootstrapping.
The term first appeared in the CP/M operating system, describing the part of CP/M loaded during boot time that interfaced directly with the hardware (CP/M machines usually had a simple boot loader in ROM, and nothing else). Most versions of DOS have a file called "IBMBIO.COM" or "IO.SYS" that is analogous to the CP/M disk BIOS.

- DOS

(short for Microsoft Disk Operating System) is an operating system commercialized by Microsoft. It was the most commonly used member of the DOS family of operating systems and was the dominant operating system for the PC compatible platform during the 1980s. It has gradually been replaced on consumer desktop computers by various generations of the Windows operating system.
MS-DOS was originally released in 1981 and had eight major versions released before Microsoft stopped development in 2000. It was the key product in Microsoft's growth from a programming languages company to a diverse software development firm, providing the company with essential revenue and marketing resources.

* Instruction Sets

Is (a list of) all instructions, and all their variations, that a processor can execute.
Instructions include:
arithmetic such as add and subtract
logic instructions such as and, or, and not
data instructions such as move, input, output, load, and store
control flow instructions such as goto, if ... goto, call, and return.
An instruction set, or instruction set architecture (ISA), is the part of the computer architecture related to programming, including the native data types, instructions, registers, addressing modes, memory architecture, interrupt and exception handling, and external I/O. An ISA includes a specification of the set of opcodes (machine language), the native commands implemented by a particular CPU design.
This concept can be extended to unique ISAs like TIMI (Technology-Independent Machine Interface) present in the IBM System/38 and IBM AS/400. TIMI is an ISA that is implemented as low-level software and functionally resembles what is now referred to as a virtual machine.

- Data Transfer Instruction
When stored memory the bytes, words, and doublewords in the packed data types are stored in consecutive addresses, with the least significant byte, word, or doubleword being stored in the lowest address and the more significant bytes, words, or doubleword being stored at consecutively higher addresses. The ordering of bytes, words, or doublewords in memory is always little endian: the bytes with the lower addresses are less significant than the bytes with the higher addresses.

- Branch Instructions

A branch (or jump on some computer architectures, such as the PDP-8 and Intel x86) is a point in a computer program where the flow of control is altered. The term branch is usually used when referring to a program written in machine code or assembly language; in a high-level programming language, branches usually take the form of conditional statements, subroutine calls or GOTO statements. An instruction that causes a branch, a branch instruction, can be taken or not taken: if a branch is not taken, the flow of control is unchanged and the next instruction to be executed is the instruction immediately following the current instruction in memory; if taken, the next instruction to be executed is an instruction at some other place in memory. There are two usual forms of branch instruction: a conditional branch that can be either taken or not taken, depending on a condition such as a CPU flag, and an unconditional branch which is always taken.

a.) Conditional Jumps

This ternary operator can also be used (though less commonly) in conditional jump statements, as in Linoleum:? logical comparison -> code label;
Although the usage and format are different, it's still a ternary operator (used as a conditional expression) because the three arguments come from the code label and from the two arguments in the logical comparison. (The -> operator, which signifies an unconditional jump, takes the place of the : operator.)

b.) Unconditional Jumps

Another way to break a loop is the goto statement. For example, we can modify the example above as follows: do :: count = count + 1 :: count = count - 1 :: (count == 0) -> goto done od done: skip;
The goto in this example jumps to a label named done. A label can only appear before a statement. If we might want to jump at the end of the program, for example, a dummy statement skip is useful: it is a place holder that is always executable and has no effect.

Tuesday, August 7, 2007

Network topology

1. Different network topologies

Mesh Topology
Devices are connected with many redundant interconnections between network nodes. In a true mesh topology every node has a connection to every other node in the network.

Star Topology
All devices are connected to a central hub. Nodes communicate across the network by passing data through the hub.

Bus Topology
All devices are connected to a central cable, called the bus or backbone.

Ring Topology
All devices are connected to one another in the shape of a closed loop, so that each device is connected directly to two other devices, one on either side of it.

Tree Topology
A hybrid topology. Groups of star-configured networks are connected to a linear bus backbone.


2. What is:

UTP

Speed: 10,100,1000 Mbps
Maximum Distance: 100m
Cost: inexpensive

-Short for unshielded twisted pair, a popular type of cable that consists of two unshielded wires twisted around each other.

-UTP cables are not shielded. This lack of shielding results in a high degree of flexibility as well as rugged durability. UTP cables are found in many ethernet networks and telephone systems. For indoor telephone applications.

-UTP is often grouped into sets of 25 pairs according to a standard 25-pair color code originally developed by AT&T. A typical subset of these AD1L colors (white/blue, blue/white, white/orange, orange/white) shows up in most UTP cables.

-UTP cabling is often used in data networks for short and medium length connections because of its relatively lower costs compared to fiber and coaxial cabling.

STP

Speed: 10, 100 Mbps
Maximum Distance: 100m
Cost: expensive

-STP cabling includes metal shielding over each individual pair of copper wires. This type of shielding protects cable from external EMI (electromagnetic interferences). e.g. the 150 ohm shielded twisted pair cables defined by the IBM Cabling System specifications and used with token ring networks.

Advantages

It is a thin, flexible cable that is easy to string between walls.
Most modern buildings come with CAT 5 UTP already wired into the wall outlets or at least run between the floors.
Because UTP is small, it does not quickly fill up wiring ducts.
UTP costs less per foot than any other type of LAN cable.

Disadvantages

Twisted pair’s susceptibility to the electromagnetic interference greatly depends on the pair twisting schemes (usually patented by the manufacturers) staying intact during the installation. As a result, twisted pair cables usually have stringent requirements for maximum pulling tension as well as minimum bend radius.

Firewire

-A very fast external bus standard that supports data transfer rates of up to 400Mbps (in 1394a) and 800Mbps (in 1394b). Products supporting the 1394 standard go under different names, depending on the company. Apple, which originally developed the technology, uses the trademarked name FireWire. Other companies use other names, such as i.link and Lynx, to describe their 1394 products.

-A single 1394 port can be used to connect up 63 external devices. In addition to its high speed, 1394 also supports isochronous data -- delivering data at a guaranteed rate. This makes it ideal for devices that need to transfer high levels of data in real-time, such as video devices.
-Although extremely fast and flexible, 1394 is also expensive. Like USB, 1394 supports both Plug-and-Play and hot plugging, and also provides power to peripheral devices.

Optical Cable

A technology that uses glass (or plastic) threads (fibers) to transmit data. A fiber optic cable consists of a bundle of glass threads, each of which is capable of transmitting messages modulated onto light waves.

Fiber optics has several advantages over traditional metal communications lines:

  • Fiber optic cables have a much greater bandwidth than metal cables. This means that they can carry more data.
  • Fiber optic cables are less susceptible than metal cables to interference.
  • Fiber optic cables are much thinner and lighter than metal wires.
  • Data can be transmitted digitally (the natural form for computer data) rather than analogically.

The main disadvantage of fiber optics is that the cables are expensive to install. In addition, they are more fragile than wire and are difficult to splice.

Fiber optics is a particularly popular technology for local-area networks. In addition, telephone companies are steadily replacing traditional telephone lines with fiber optic cables. In the future, almost all communications will employ fiber optics.

3. Arrangement of wires: cross over and straight through

UTP and STP

10 Base T / 100 Base T Straight

10BaseT and 100BaseT are most common mode of LAN. You can use UTP category-5 cable for both mode. (You can use UTP category-3 cable for 10BaseT, in which there are only 3 wires inside the cable.) A straight cable is used to connect a computer to a hub. You can use it to connect 2 hubs in the case one of the hub has an uplink port (and you use normal port on the other hub).
Pin ID
side A
side B
1
orange-white
orange-white
2
orange
orange
3
green-white
green-white
4
blue
blue
5
blue-white
blue-white
6
green
green
7
brown-white
brown-white
8
brown
brown

10 Base T / 100 Base T Cross

A cross cable for 10BaseT and 100BaseT is used to connect 2 computers directly (with ONLY the UTP cable). It is also used when you connect 2 hubs with a normal port on both hubs. (In other words, the cross cable is used relatively in a rare case.)
Pin ID
side A
side B
1
orange-white
green-white
2
orange
green
3
green-white
orange-white
4
blue
blue
5
blue-white
blue-white
6
green
orange
7
brown-white
brown-white
8
brown
brown

5. What is Wi-Fi?

Wi-Fi short for wireless fidelity and is meant to be used generically when referring of any type of 802.11 network, whether 802.11b, 802.11a, dual-band, etc. The term is promulgated by the Wi-Fi Alliance.

Any products tested and approved as "Wi-Fi Certified" (a registered trademark) by the Wi-Fi Alliance are certified as interoperable with each other, even if they are from different manufacturers. A user with a "Wi-Fi Certified" product can use any brand of access point with any other brand of client hardware that also is certified. Typically, however, any Wi-Fi product using the same radio frequency (for example, 2.4GHz for 802.11b or 11g, 5GHz for 802.11a) will work with any other, even if not "Wi-Fi Certified."

Formerly, the term "Wi-Fi" was used only in place of the 2.4GHz 802.11b standard, in the same way that "Ethernet" is used in place of IEEE 802.3. The Alliance expanded the generic use of the term in an attempt to stop confusion about wireless LAN interoperability.