OSDev.org
https://forum.osdev.org/

Decision of Which I/O Model To Use
https://forum.osdev.org/viewtopic.php?f=1&t=33749
Page 1 of 1

Author:  Malfunction [ Sat Jun 29, 2019 10:43 am ]
Post subject:  Decision of Which I/O Model To Use

In x86 architecture we use I/O instructions like IN and OUT for I/O mapped I/O. We use memory instructions like MOV in memory mapped I/O as far as I know. This is all nice but who decides which I/O method will be used? If I want to build my own device (a peripheral) can I choose freely whether I use I/O mapped or memory mapped I/O to communicate with PC? Or all devices must support the both?

Can't understand who makes the decision on I/O method used to communicate with a device.

Author:  ~ [ Sat Jun 29, 2019 10:51 am ]
Post subject:  Re: Decision of Which I/O Model To Use

The hardware makes the decision.

Then the drivers must follow the specifications of a specific device model.

Whether you write your own drivers or write driver subsystems for DOS/Win3x,Win9x,WinNT,Linux so you can load existing drivers after reimplementing the existing driver model subsystems.
-----------------------------------------------------------------

For my OS, I have designed a lot of command line built-in commands in the kernel console, so I can invoke a command and it accesses the corresponding devices from a directory-like hierarchy for a raw standard PC with ISA, PCI, USB, IDE, serial/parallel, PS/2, VGA, etc...

I categorize devices internally among other direct ways, like directory paths that must be traversed functionally to actually reach/configure them in the actual physical path, and which only those special functions understand, so that they don't interfere with normal files that may have the same name and that would be accessed by real filesystem functions.

With those commands, I can command them to different degrees, but the complexity of the command also increases to handle things that cannot be done reliably step by step at human speed.

Author:  Korona [ Sat Jun 29, 2019 1:30 pm ]
Post subject:  Re: Decision of Which I/O Model To Use

You can more-or-less choose what to use. You need to follow the PCI specification if you want to make your device accessible on the system bus (i.e., either as I/O or as memory).

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/