LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] linux device drivers: port or memory mapped i/o?

[ILUG] linux device drivers: port or memory mapped i/o?

Padraig Brady padraig at antefacto.com
Tue Oct 16 16:39:26 IST 2001


What this has to do with Linux I don't know, but:
It depends on your platform, some CPUs don't support
io instructions.

Advantages of MM io is you don't need special instructions and so can use
all the powerful addressing modes for IO. For e.g. you can define a 
structure
that corresponds to the IO space of the device and just read/write the 
members
to control the device. Also for I/O mapped I/O you need extra pins in 
the system
that are driven by the I/O instruction.

The disadvantages are that the memory space is depleted.
Also it's harder to debug since any memory issues in your program (or others
on non MMU hardware) could be interacting with your device. Also the full
address size of the machine must be used for each instruction 
interacting with
the device and so is slower in this respect.

Note most of the modern RISC and all 68K CPUs have  no I/O instructions.

Personally I like working with MM I/O hardware as it allows for
elegant programs IMHO.

Padraig.

Stephen Shirley wrote:

>Mornin,
>	I have to write a device driver for a chip which allows both port
>mapped and memory mapped i/o. Now I know that memory mapped is easier for
>the programmer (can use any instruction that can access memory, don't need
>to copy out data to look at it etc), but i was wondering was there any
>particular reasons why people would choose one over the other.
>
>TIA,
>Steve
>







More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell