Message-Id: Comments: Authenticated sender is From: "Salvador Eduardo Tropea (SET)" Organization: INTI To: Poppleton , djgpp AT delorie DOT com Date: Mon, 24 Aug 1998 11:46:30 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: mapping i/o ports? In-reply-to: <35DEAD9C.38821F62@Wanadoo.fr> Precedence: bulk Poppleton wrote: > I just have a few questions about I/O ports. I had heard somewhere > that it is possible to map certain True, and that's *certain* not all. > ports into memory, which speeds up > the reading and writing of ports, is this correct? Yes, most PCI video boards can do that. > If so, would it not > be possible to map every port into memory, No. > assuming there are 65536 > ports each longs They are bytes, not longs. When you address port 0x300 as a long you are writing in 0x300, 0x301, 0x302 and 0x303. Is like memory! just different signals used (I/O write instead of Memory write, etc). > that would only take up 256K, which I certainly can > spare if the speed up is significant. Could anyone please tell me if > this would be possible, and if so some example code on how it would be > done. You can't map all because: 1) Not all can be mapped, I think old chipsets can't do it at all and most of the I/O are used by the chipset (timer, interrupt controller, DMA controller, etc). 2) Different boards have your own I/O and your own mapping. 3) Normally when you map the I/O into memory the I/O dissapears so BIOS calls fails. In Trident boards if you map the I/O port in memory and you reset the computer it fails to reboot because the BIOS can't find the video board ;-) (you must turn off the computer). The speed gain is marginal, the only advantage is that you can use the memory addressing mode to access I/O so the code is smaller and you use the registers better, but I/O still slow. SET ------------------------------------ 0 -------------------------------- Visit my home page: http://set-soft.home.ml.org/ or http://www.geocities.com/SiliconValley/Vista/6552/ Salvador Eduardo Tropea (SET). (Electronics Engineer) Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org ICQ: 2951574 Address: Curapaligue 2124, Caseros, 3 de Febrero Buenos Aires, (1678), ARGENTINA TE: +(541) 759 0013