Video and Audio device driver interface
Video and Audio device driver interface
I've written an interface for my drivers, but I don't know how to handle audio and video drivers...
I have some doubts, I liked to see how Linux handles them, but I can't find anything about it. How, for example, Linux talks with NVIDIA closed-source driver?
Video drivers must be implemented in kernel-mode or in user-mode? Maybe in user-mode they are faster because there isn't the necessity of system calls... But in user-mode how can they use privileged instructions like in and out?
Which functions video drivers must handle? (this is the less important question)
I have some doubts, I liked to see how Linux handles them, but I can't find anything about it. How, for example, Linux talks with NVIDIA closed-source driver?
Video drivers must be implemented in kernel-mode or in user-mode? Maybe in user-mode they are faster because there isn't the necessity of system calls... But in user-mode how can they use privileged instructions like in and out?
Which functions video drivers must handle? (this is the less important question)
Rewriting virtual memory manager - Working on ELF support - Working on Device Drivers Handling
http://sourceforge.net/projects/jeko - Jeko Operating System
http://sourceforge.net/projects/jeko - Jeko Operating System
- Combuster
- Member

- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Video and Audio device driver interface
Accelerated Graphic Cards <- search firstJeko wrote:I've written an interface for my drivers, but I don't know how to handle audio and video drivers...
I have some doubts, I liked to see how Linux handles them, but I can't find anything about it. How, for example, Linux talks with NVIDIA closed-source driver?
Practically all 3D hardware uses Memory Mapped I/O, which does everything on the much faster memory bus.Video drivers must be implemented in kernel-mode or in user-mode? Maybe in user-mode they are faster because there isn't the necessity of system calls... But in user-mode how can they use privileged instructions like in and out?
Re: Video and Audio device driver interface
I know this.Combuster wrote:Accelerated Graphic Cards <- search firstJeko wrote:I've written an interface for my drivers, but I don't know how to handle audio and video drivers...
I have some doubts, I liked to see how Linux handles them, but I can't find anything about it. How, for example, Linux talks with NVIDIA closed-source driver?
Ok. But this isn't an answer to my questions:Combuster wrote:Practically all 3D hardware uses Memory Mapped I/O, which does everything on the much faster memory bus.Jeko wrote:Video drivers must be implemented in kernel-mode or in user-mode? Maybe in user-mode they are faster because there isn't the necessity of system calls... But in user-mode how can they use privileged instructions like in and out?
Video drivers must be implemented in kernel-mode or in user-mode? Are they faster in user-mode?
If they are in user-mode, how can they use privileged instructions?
Rewriting virtual memory manager - Working on ELF support - Working on Device Drivers Handling
http://sourceforge.net/projects/jeko - Jeko Operating System
http://sourceforge.net/projects/jeko - Jeko Operating System
- Combuster
- Member

- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Video and Audio device driver interface
Then WHY did you ask for what you already know?I know this.
It is, you just have to realize your question is a bad one.Ok. But this isn't an answer to my questions
Re: Video and Audio device driver interface
Because that wiki article doesn't explain how Linux handles video drivers or how he thinks video drivers must be handled.Combuster wrote:Then WHY did you ask for what you already know?Jeko wrote:I know this.
Why my question is bad?Combuster wrote:It is, you just have to realize your question is a bad one.Jeko wrote:Ok. But this isn't an answer to my questions
Rewriting virtual memory manager - Working on ELF support - Working on Device Drivers Handling
http://sourceforge.net/projects/jeko - Jeko Operating System
http://sourceforge.net/projects/jeko - Jeko Operating System
- JackScott
- Member

- Posts: 1054
- Joined: Thu Dec 21, 2006 3:03 am
- Location: Hobart, Australia
- Mastodon: https://aus.social/@jackscottau
- Matrix: @JackScottAU:matrix.org
- GitHub: https://github.com/JackScottAU
- Contact:
Re: Video and Audio device driver interface
Device driver design is something that I think is missing from the wiki. Notice that it's on the Wish List.
How to design the interface isn't on the AGP page for a good reason: it's not related at all to AGP. The drivers are a completely seperate issue.
Drivers in general can be implemented in either mode. Kernel allows them to access hardware directly. User mode, they will have to go through the kernel (making system calls, which then do the hardware call on the driver's behalf). Performance will be similar in both modes.
Your question is bad because it could have been resolved with an Internet search.
How to design the interface isn't on the AGP page for a good reason: it's not related at all to AGP. The drivers are a completely seperate issue.
Drivers in general can be implemented in either mode. Kernel allows them to access hardware directly. User mode, they will have to go through the kernel (making system calls, which then do the hardware call on the driver's behalf). Performance will be similar in both modes.
Your question is bad because it could have been resolved with an Internet search.
Re: Video and Audio device driver interface
I've searched, but I can't find anything interesting. If you found something useful, could you give me the links?Yayyak wrote:Device driver design is something that I think is missing from the wiki. Notice that it's on the Wish List.
How to design the interface isn't on the AGP page for a good reason: it's not related at all to AGP. The drivers are a completely seperate issue.
Drivers in general can be implemented in either mode. Kernel allows them to access hardware directly. User mode, they will have to go through the kernel (making system calls, which then do the hardware call on the driver's behalf). Performance will be similar in both modes.
Your question is bad because it could have been resolved with an Internet search.
Rewriting virtual memory manager - Working on ELF support - Working on Device Drivers Handling
http://sourceforge.net/projects/jeko - Jeko Operating System
http://sourceforge.net/projects/jeko - Jeko Operating System
- JackScott
- Member

- Posts: 1054
- Joined: Thu Dec 21, 2006 3:03 am
- Location: Hobart, Australia
- Mastodon: https://aus.social/@jackscottau
- Matrix: @JackScottAU:matrix.org
- GitHub: https://github.com/JackScottAU
- Contact:
Re: Video and Audio device driver interface
http://en.wikipedia.org/wiki/Device_driver#Design. The two sections after that are also worth reading.
- Combuster
- Member

- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Video and Audio device driver interface
That isJeko wrote:Because that wiki article doesn't explain how Linux handles video drivers or how he thinks video drivers must be handled.Combuster wrote:Then WHY did you ask for what you already know?Jeko wrote:I know this.
a) not what you asked
b) Video drivers are not anything different than other drivers
c) You apparently did not investigate at all how video is handled under linux.
d) http://www.catb.org/~esr/faqs/smart-questions.htmlWhy my question is bad?
e) See point C
f) Your line of questioning:
Must all people sit on a chair, or on a bench?Video drivers must be implemented in kernel-mode or in user-mode?
Is the bench always more comfortableAre they faster in user-mode?
I don't have a screwdriver, but I want one to paint this bench...If they are in user-mode, how can they use privileged instructions?
I posted a link, but since you already know that but couldn't take a lesson from it, how do we know you haven't seen every other link you ask us to post?I've searched, but I can't find anything interesting. If you found something useful, could you give me the links?
Re: Video and Audio device driver interface
Ok. Thank you.
I must read DRI, Mesa and XFree86 source code to understand how Linux handles video drivers.
However they are in user-mode, in fact OpenGL works in user-mode and Linux video drivers are for OpenGL.
http://en.wikipedia.org/wiki/Comparison ... _switching
Maybe I will implement XFree86 in my OS, also if I think it's really slow. Isn't it?
I must read DRI, Mesa and XFree86 source code to understand how Linux handles video drivers.
However they are in user-mode, in fact OpenGL works in user-mode and Linux video drivers are for OpenGL.
http://en.wikipedia.org/wiki/Comparison ... _switching
Maybe I will implement XFree86 in my OS, also if I think it's really slow. Isn't it?
Rewriting virtual memory manager - Working on ELF support - Working on Device Drivers Handling
http://sourceforge.net/projects/jeko - Jeko Operating System
http://sourceforge.net/projects/jeko - Jeko Operating System
- Combuster
- Member

- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Video and Audio device driver interface
Somebody restrain me 
- JackScott
- Member

- Posts: 1054
- Joined: Thu Dec 21, 2006 3:03 am
- Location: Hobart, Australia
- Mastodon: https://aus.social/@jackscottau
- Matrix: @JackScottAU:matrix.org
- GitHub: https://github.com/JackScottAU
- Contact:
Re: Video and Audio device driver interface
Let slip the dogs of war?
Re: Video and Audio device driver interface
Jeko,
Before you post anything else on this topic, I strongly suggest that you do some research first. Let me try to make a few things clear (that should already be obvious if you have followed the links handed to you earlier in this thread):
1) Until very recently, most accellerated graphics card specifications were closed source. This has recently changed with ATI/AMD starting to open up some of their specs. The accellerated graphics wiki article which has appropriate links has already been pointed out.
2) The fundamental point here is that this is your OS. There are systems out there where most graphics code runs in ring 3 and there are systems where it runs in ring 0. Which your OS does is entirely up to you.
3) Code runs equally quickly in ring 3 (user) and ring 0 (kernel). For ring 3 drivers, you may have the additional overhead of privilege switches for certain functions, depending on how you allocate memory mapped IO to the graphics driver process.
4) See the IO Bitmap related to your TSS for more information on port based IO.
5) The way linux talks to its drivers is highly publicised. You may like to search for the Linux Documentation Project for more information.
I hope this clears a few things up, but please now do some research and experimentation with the answers you have been given first.
Cheers,
Adam
Before you post anything else on this topic, I strongly suggest that you do some research first. Let me try to make a few things clear (that should already be obvious if you have followed the links handed to you earlier in this thread):
1) Until very recently, most accellerated graphics card specifications were closed source. This has recently changed with ATI/AMD starting to open up some of their specs. The accellerated graphics wiki article which has appropriate links has already been pointed out.
2) The fundamental point here is that this is your OS. There are systems out there where most graphics code runs in ring 3 and there are systems where it runs in ring 0. Which your OS does is entirely up to you.
3) Code runs equally quickly in ring 3 (user) and ring 0 (kernel). For ring 3 drivers, you may have the additional overhead of privilege switches for certain functions, depending on how you allocate memory mapped IO to the graphics driver process.
4) See the IO Bitmap related to your TSS for more information on port based IO.
5) The way linux talks to its drivers is highly publicised. You may like to search for the Linux Documentation Project for more information.
I hope this clears a few things up, but please now do some research and experimentation with the answers you have been given first.
Cheers,
Adam
