OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 5:48 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Decision of Which I/O Model To Use
PostPosted: Sat Jun 29, 2019 10:43 am 
Offline

Joined: Sun Jun 16, 2019 11:32 am
Posts: 9
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.


Top
 Profile  
 
 Post subject: Re: Decision of Which I/O Model To Use
PostPosted: Sat Jun 29, 2019 10:51 am 
Offline
Member
Member
User avatar

Joined: Tue Mar 06, 2007 11:17 am
Posts: 1225
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.

_________________
Live PC 1: Image Live PC 2: Image

YouTube:
http://youtube.com/@AltComp126/streams
http://youtube.com/@proyectos/streams

http://master.dl.sourceforge.net/projec ... 7z?viasf=1


Top
 Profile  
 
 Post subject: Re: Decision of Which I/O Model To Use
PostPosted: Sat Jun 29, 2019 1:30 pm 
Offline
Member
Member

Joined: Thu May 17, 2007 1:27 pm
Posts: 999
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].


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], DotBot [Bot], Google [Bot] and 64 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group