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.
Decision of Which I/O Model To Use
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.
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.
YouTube:
http://youtube.com/@AltComp126
My x86 OS/software:
https://sourceforge.net/projects/api-simple-completa/
Donate to get more food/programming resources/computers:
https://www.paypal.com/donate/?hosted_b ... QS2YTW3V64
http://youtube.com/@AltComp126
My x86 OS/software:
https://sourceforge.net/projects/api-simple-completa/
Donate to get more food/programming resources/computers:
https://www.paypal.com/donate/?hosted_b ... QS2YTW3V64
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).
managarm: Microkernel-based OS capable of running a Wayland desktop (Discord: https://discord.gg/7WB6Ur3). My OS-dev projects: [mlibc: Portable C library for managarm, qword, Linux, Sigma, ...] [LAI: AML interpreter] [xbstrap: Build system for OS distributions].