InterviewSolution
| 1. |
Solve : I/O Address Range - Why?? |
|
Answer» Why do we have a range of port addresses just for one type of peripheral device? What's the point of leaving black spaces in I/O map?I was told by my teacher 8 years ago when asking a similar question at college that this is because there are plenty of port addresses to go around, more than needed to operate, so it made no sense to bind them all tightly together, but rather have them gapped instead. But this was just a verbal answer from the teacher with no physical proof to show as to why.An I/O address range "maps" device input to memory. Sort of like how in old computers you could use the built in BASIC to "poke" values directly into the Video memory; the video memory was on the video board, but it was "mapped" into addressable memory. An I/O address range "maps" device input to memory. Sort of like how in old computers you could use the built in BASIC to "poke" values directly into the Video memory; the video memory was on the video board, but it was "mapped" into addressable memory.That may cause confusion. The term Memory mapped I/O generally refers to the method used my Motorola, not Intel. Apple built machines that used Memory mapped I/O . The I/O array does not cut into space in the Memory area. Please see this reference: http://www.pcguide.com/ref/mbsys/res/ioSummary-c.htmlAnd where does it state that this is a Motorola method that Intel does not use ? ? You need to start qualifying your broad over-generalisations hers... That's what causes more confusion than anything... PS. Noone mentioned Apple...who cares how they choose to do it.Quote from: patio on December 13, 2010, 05:55:54 PM And where does it state that this is a Motorola method that Intel does not use ? ?Sperry that my first post was not edited. Until recently, Apple used Motorola chips, not Intel. Quote The 68000 had many high-end design wins early on. It became the dominant CPU for Unix based workstations including Sun workstations and Apollo/Domain workstations, found its way into heralded computers such as the Amiga, Atari ST, Apple Lisa and Macintosh, and was used in the first generation of desktop laser printers including the original Apple Inc. LaserWriter and the HP LaserJet.Intel does NOT use memory map I/O. The specific I/O instructions are for port mapped devices. Quote Port-mapped I/O uses a special class of CPU instructions specifically for performing I/O. This is generally found on Intel microprocessors, specifically the IN and OUT instructions which can read and write one to four bytes (outb, outw, outl) to an I/O device. I/O devices have a separate address space from general memory, either accomplished by an extra "I/O" pin on the CPU's physical interface, or an entire bus dedicated to I/O. Because the address space for I/O is isolated from that for main memory,The above are from the Wikipedia. Look for 'memory map I/O' Intel instruction set for the x86 CPUs. http://home.comcast.net/~fbui/intel.html Motorola Instruction set for 68000. http://en.wikipedia.org/wiki/Motorola_68000 It SEEMS that others are confused by this. I just assume everybody knew the historical use of the term. Here is one user's confusion: http://stackoverflow.com/questions/3194139/x86-memory-and-i-o-map Of course, it you want to, you can build a memory map I/O thing for a PC. Most devices use port map instead of memory map. A separate array for slower devices is a feature of the Intel design. As yet, it is not not used to its full potential. BC, Please read the x86 instruction set from COVER to cover. EDIT: Microprocessors and microcomputer-based system design - Google Books Result Quote Intel microprocessors can use either standard or memory- mapped I/O while Motorola microprocessors use only memory-mapped I/OQuote from: Geek-9pm on December 13, 2010, 05:21:52 PM That may cause confusion. The term Memory mapped I/O generally refers to the method used my Motorola, not Intel. Apple built machines that used Memory mapped I/O .the IBM PC uses memory mapped IO as well. Quote The I/O array does not cut into space in the Memory area.I never said it did. In fact I'm not sure if you're talking about I/O ports, or I/O addresses, since it's rather vague. I'm not sure if it does anymore (things are probably different in protected mode and x64 Native mode ) Although it does "use" memory in Real Mode; the 384K of HMA memory above the DOS accessible 640K was addressable by even the original IBM PC; it was reserved however to perform memory mapped I/O with the various hardware devices, as well as map the various ROM codes into addressable memory space, so that they could, you know, be executed. Additionally, if what you say is true, I've witnessed magic when using the original PC [GW]BASIC[A] "POKE" instruction to write values to memory would light up pixels/characters on the display. I am curious how this mapping took place if there was no mapping. This was using POKE to poke memory addresses, not OUT to work with I/O Ports directly. Today the memory doesn't stay "used"; the device driver locks an area of memory using appropriate kernel functions and communicates with the device using that memory, and then when it's finished communicating with it it unlocks it, which means the OS is free to use it for what it pleases. Bear in mind however that almost no Device nowadays really uses I/O addresses in this manner; generally the communication is handled by DMA transfers by the chipset, which manages all the hairy stuff. In fact I/O memory mapping like this is only done if you purposely force Programmed I/O on your devices; usually it's slower but if your hardware is finicky can be more reliable then DMA bus mastering. I/O Ports are not necessarily I/O addresses, and I/O ports do not necessarily correspond directly to the electronic input into a chip or chipset. From the same wikipedia article you quoted: Quote A final reason that memory-mapped I/O is preferred in x86-based architectures is that the instructions that perform port-based I/O are limited to one or two registers: EAX, AX, and AL are the only registers that data can be moved in to or out of, and either a byte-sized immediate value in the instruction or a value in register DX determines which port is the source or destination port of the transfer[1][2]. Since any general purpose register can send or receive data to or from memory and memory-mapped I/O, memory-mapped I/O uses less instructions and can run faster than port I/O. AMD did not extend the port I/O instructions when defining the x86-64 architecture to support 64-bit ports, so 64-bit transfers cannot be performed using port I/O[3]. and Quote Memory-mapped I/O is the cause of memory barriers in older generations of computers – the 640 KiB barrier is due to the IBM PC placing the Upper Memory Area in the 640–1024 KiB range (of its 20-bit memory addressing), while the 3 GB barrier is due to similar memory-mapping in 32-bit architectures in the 3–4 GB range. If they didn't do memory mapped I/O, I'd like to know how they caused these observable barriers and how they would be preferable. thx. also: http://duartes.org/gustavo/blog/post/motherboard-chipsets-memory-map Quote Physical memory addresses are also used for communication with assorted devices on the motherboard (this communication is called memory-mapped I/O). These devices include video cards, most PCI cards (say, a scanner or SCSI card), and also the flash memory that stores the BIOS. Quote BC, Please read the x86 instruction set from cover to cover.haha, yeah, I should read it. k. Yes, read it! To clarify. Intel CPU have specific I/O constructionist write to the I/O array. There is a wire, a pin on the original 8086 CPU that indicates there is an I/O operation. In general, I/O operations in the Intel universe means any operation using the specific IN and OUT instructions.Not memory references. An engineer who built a memory map I/O for an Intel CPU may live to regret it. The dubious advantage is offset by other issues. But there has not been universal agreement on the point. But the ones who use memory-map do not wear a suit and tie. They are rebels. The rest of us are quite proper and only use the I/O map. I never used a memory map U/O in any of my designs. And I don't PEKK and POKE, I do INP and OUT, the way Intel meant it to be. Read the Intel documentation The floppy controller, the HDD controller, the system timer, the keyboard, the mouse and the printer port and both serial ports are devices that have a specific range of address in the I/O map. They are address, but the proper terminology is not to refer to them as memory. Please refer to the first reference. It is an I/O port map. There are NOT memory locations. Thane are ports. That is P O R T S - to make sure I splet it write. http://en.wikipedia.org/wiki/Input/Output_Base_Address *insert Facepalm demotivator* |
|