Saturday, December 25, 2010

Nepali Lyrics With Chords

80186 and 80286

After a bit 'light of articles devoted to video games, it's time to talk again a bit' of hardware by analyzing the second generation of the x86 family of processors. So no more talk and we continue our ride on the bike at the very heart of our beloved PC ...

80186

early 1982 the x86 family of Intel has added a new microprocessor, the 80186 misunderstood that, despite some interesting innovations, was soon relegated to the only market for microcontrollers (single-chip processors generally used in embedded systems for specific applications of digital control).

The comfortably accommodate its 80,186 homes in 68-pin PLCC


The new Intel CPU derives directly from ' 8086 it inherits from the 16-bit data bus and the bus 20 addresses that allow access to 1MB of memory with the same convoluted mechanism already described for the parent of the x86 architecture. The first dell'80186 marketed versions, capable of operating at a frequency of 6MHz, were significantly more CPU performance of the previous generation of the same frequency, thanks to the many hardware-coded instructions in (address calculation, multiplication and division operations, etc.) . To reduce the number of
external to the processor chip, the 80186 integrates the part of the logic necessary for the operation, as shown in the diagram below.



The architecture block diagram 80186 (click to enlarge)

As you can see some components such as generator of clock, the DMA controller and interrupt controller are directly inside the chip . This choice facilitated the use dell'80186 as microcontroller (practice being able to function with few external elements) but penalize usage within the personal computer , given the fundamental incompatibility with the IBM PC architecture built around 8086. Despite this "flaw" the new Intel processor found within the space of a few systems come in their own way in the history between all the Tandy 2000 , computer marketed by U.S. electronics chain Radio Shack early 1983, Thanks to its innovative graphics card was able to provide respectable performance for those days.


A very young Bill Gates posing next to the Tandy 2000 with the very first version of Windows

before moving on to point out the record, the 80188, version dell'80816 with economic data bus 8-bit.

80,286

The February 1, 1982 arrives on the market the new Intel processor mother intended to supplant the now ancient 8086 (dated 1978) in the increasingly vibrant market IBM PC. The 80,286 shares the same architectural innovations that will enable the younger brother performance to produce as many as twenty times greater than a 8086 working at the same clock frequency . They are not, however, repeat the characteristics that made the 80,186 more like a microcontroller to a real processor allowing IBM to define the second generation of its personal computer architecture called PC AT (Advance Technology ) that was marketed from 1984 to 1987.



the 80286 in all its glory

Among the most interesting we have the expansion of the address bus that goes from 20 to 24 bit that allows the processor to address well 16MB of memory, a very considerable amount for the beginning of the 80s. The complete address space is not available in real mode , inherited directly dall'8086 mode that provides addresses of 20 bits (accessible through the segmentation technique which I have already spoken) and consequent roof of 1MB, but only in new protected mode of which we'll talk soon. Protected mode, as well as allowing access to a larger amount of memory, provides, in hardware, support for multithreading feature that promoted the spread of Unix operating systems like (as Venix, SCO Xenix) even on the platforms of the duo IBM / Intel. At this point, good old MS-DOS begins to show his side being able to operate only in real mode and strictly monothread . Nothing prevents MS-DOS to operate in protected mode as long as you have installed an appropriate Dos Extender that fills the gaps of the base operating system. One of the major flaws dell'80286 was the inability to "return" from protected mode without rebooting , feature that made this mode in fact little used, at least in the MS-DOS (speech for different operating systems that they acted completely in protected mode, as unix, where such limitation in fact disappears) ... definitely a blow to fans of video games that this would have taken many benefits!

memory addressing in protected mode

As I mentioned earlier, the protected mode allows the CPU to gain full access to 16 MB addressable by 286. This is not a linear addressing mode (such as that adopted by some competitors, Read Motorola 68000) but is passed from the management segment in 8086 that switches. Let's see what it is to avoid going into excessive technicalities while trying to be as comprehensive as possible ..

The first thing that catches the eye, as had happened for the 8086 is that the address bus width is greater than that of logs (which are obviously 16-bit), this implies that even in this case the address "final" will be determined by a combination of two values \u200b\u200bthat define a basic position and the other its deviation (offset ) than the latter. Nell'8086 While the operation was very simple, you add the value of one of the basic registers multiplied by 16 (shift 4-position to the left) with the contents of the corresponding index register (with the "embarrassing" result different pairs of values \u200b\u200bgenerated the same physical address), this will complicate things a bit mainly because of the ability to run multiple threads same time (well ... not really but at the same time paying a little 'time to perform each one giving the "feel "field") that they must live "thinking" of having all the resources at their disposal.

In protected mode the segment registers become selectors whose structure is shown in the figure below:

selector

The first two bits (RPL, Requested Privilege Level ) define the privilege level (between the four available) thus allowing the switch to "protect" the most important pieces of code, such as the operating system from malicious "interference" (eg user programs). The third bit (TI, Table Indicator) indicates which belongs together with the switch: local application (LDT , Local Descriptor Table ) or global system (GDT, Global Descriptor Table). The remaining 13 bits define the index of the descriptor table (we will have as many local and global descriptors 8192).
At this point you may have guessed that the name switch stems from the fact that this value is used to select an item in the table of descriptors, which are the real starting point for the calculation of the address.

descriptors are special memory structures (large 8-byte, 64 bit) that describe a segment. Their structure is as follows (each "line" represented 2 bytes)

Structure of a segment descriptor
  • 2 byte (16 bit) number of bytes available to the segment (LIMIT)
  • 3 byte (24 bit) base address of segment (BASE)
  • 1 byte containing the indicators ( flag ) control
  • 2 bytes reserved for future extension (Formerly thought to the future generation of 32-bit processors)


The control flag of the segment descriptor


I control flags are as follows:
  • A : Accessed , that if an access was made to segment
  • TYPE: Defines the type of segment (code, data, stack , etc.)
  • 1: This bit is always one for the segment descriptors (there are other types of descriptors, but I omit not to "overload" too)
  • DPL: Descriptor Privilege Level , privilege level required to access the segment
  • P: Present , is 1 if the segment is present in physical memory

To close the circle and make the "process" of addressing is necessary to introduce two new records GDTR (GDT Register ) and LDTR (LDT Register ) that contain the address of the memory location that begins Global Descriptor Table and Local Descriptor Table . The GDT is a subsidiary and is, in general, the operating system. LDT there are more of one because they are generally associated with each application running (pointers to the various LDT are stored in special descriptors in the GDT on which I will not delay further, suffice it to say that the value is loaded to the need within the Register LDTR).
In light of this, the mechanism for the transition address logic (selector: offset , register selector: index register) is illustrated by the following diagram

Switching from logical address to physical address

  • Using the TI bit of the selector to select which table to go to work descriptors
  • Through records and
  • GDTR LDTR selects the beginning of descriptor table to be used, the value contained in it is added to the component selector Index multiplied by 8 (size in bytes descriptor)
  • address thus obtained is used to access the segment descriptor
  • It checks whether the application has the privileges required to access the memory segment (comparison between RPL and DPL). Otherwise an exception is triggered that stops the execution of the program
  • It controls the ' offset contained in the index register with the limited value of the descriptor, if the' offset exceeds the size of the segment is an exception that stops the execution of the program
  • adding up the base value of the descriptor with the 'offset obtaining access to physical memory
The procedure may seem a bit' complex, but the excellent implementation in hardware of this algorithm, by Intel engineers, is that it can be done efficiently.

Call-Gate

The "wonders" of the protected mode do not end there, the show introduced the infamous gate (literally, gate) that provide access to functions having a higher privilege level. The most classic example is the call-gate that enable applications, which typically operate at lower privilege level, to make routine calls to OS (operating at more than privilege).


Through the mechanism of gate all this is made possible. In addition to calls to the operating system functions (those that later API calls) are introduced interruput -gate, for carrying out routine break, and task-gate dealing with run the task-switching that the transition by a thread to another to give the impression of competition between multiple processes.

Conclusions

Well then we come to the end of this article, despite its inevitable complexity, has allowed us to know a little 'better the second generation of Intel processors . Before closing I invite you to argue with me on the following considerations.

The 80286 provides access to 2 ^ 14 = 16,382 (divided equally between global and local) segments through the fields Index TI and the selector. Each descriptor provides access to a segment of 64KB (2 ^ 16). Doing the math we find that the 286 is capable of virtual address 2 ^ 14 (# segments) * 2 ^ 16 (segment size) = 1GB of memory (divided equally between applications and operating system). How is it possible to "map" only 1GB of storage on 16MB? Nothing could be simpler, the segments are not used are stored on disk and reloaded as needed for the development. The bits P ( Presence) and A (Accessed ) serve precisely this purpose: P tells the processor if the segment is present in memory must be loaded on the disk, tells the processor where the segment was changed, and then if, if required, must be written to disk (if it is modified and this operation is already on the disc is useless). These mechanisms and others that I have deliberately overlooked for not bore you too, make that every thread have the impression that the whole machine to it although it is not.

With the 286 also begins to appear cache (still very limited), which in this case is used to keep the addresses of active descriptors to make sure that the processor can access directly without performing all the operations I have described previously.

short, however you think the 80286 has been a marked improvement over its immediate predecessor. Some structural defects (the "no return" from protected mode, slow gate) but it undermined the success it is essential to know why he opened the way for 80,386 a few years later he helped to establish the rule of the Intel processors competition.

Everything that I have told has no relevance for the players or programmers (at least not to work at the level of kernel) but I find it interesting to know a bit 'better, without going into too much detail, the operation of that 'mass of silicon that allows us all to use a personal computer . Until next time ....

The Olivetti M28, the first personal computer in the house based Ivrea sull'80286 (1986)

0 comments:

Post a Comment