LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 05-18-2017, 04:08 AM   #1
Peewe
LQ Newbie
 
Registered: May 2017
Posts: 8

Rep: Reputation: Disabled
How to add function to the display module or write one of my own


Hello everyone,
I'm trying to interact with the GPU in order to write directly to the screen.
After a log research, the best ( I'm not saying the easiest ) way to do it is by Linux Kernel Modules. I'm trying to find out if I can find the module that interact with the GPU and modify it do to more things I want.
If I can't modify it I would like to know what I need to do in order to write such module. I didn't understand the following things :
1. Can 2 modules interact with the same HW ?
2. Is it depend on my GPU or I can write generic function ?
3. What are the steps I need to know in order to make such module to work ?

I'm not trying to make complicated thing .. just to write some pixels to the screen, but because some other reasons I need it to be from the kernel mode as a module.

My machine : I just install Ubuntu 64bit in Dual Boot with Windows 10
I have i7-6700 with Intel Graphics 530

If there is something unclear pls feel free to ask me. Thank you all and have a nice day
 
Old 05-18-2017, 04:20 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,927

Rep: Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320
the device driver is used to send "general" commands to the device, like draw a line/box/circle.
The driver is responsible to translate this message to something usable on the device. That's why the device driver itself is hardware dependend.
The existing video drivers are really complex and really hard to add anything (and without knowing the hardware itself).
Usually only one driver is used to drive a device.
I would say such kind of generic functions are already available, you only need to use them.
 
Old 05-18-2017, 04:23 AM   #3
Peewe
LQ Newbie
 
Registered: May 2017
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
the device driver is used to send "general" commands to the device, like draw a line/box/circle.
The driver is responsible to translate this message to something usable on the device. That's why the device driver itself is hardware dependend.
The existing video drivers are really complex and really hard to add anything (and without knowing the hardware itself).
Usually only one driver is used to drive a device.
I would say such kind of generic functions are already available, you only need to use them.
So if I want to display some pixels on the screen, how do I write the module which does it ? or should I write a device ? or I can edit the device driver which say to the GPU what to write..

Last edited by Peewe; 05-18-2017 at 04:24 AM.
 
Old 05-18-2017, 04:33 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,927

Rep: Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320
a device is a piece of hardware (for example a video card), actually which works, do the real job (=draws and displays the result).
You won't be able to modify the driver of your intel card (at least I think).
Probably you need to check this: https://en.wikipedia.org/wiki/Direct...Infrastructure
 
Old 05-18-2017, 04:37 AM   #5
Peewe
LQ Newbie
 
Registered: May 2017
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
a device is a piece of hardware (for example a video card), actually which works, do the real job (=draws and displays the result).
You won't be able to modify the driver of your intel card (at least I think).
Probably you need to check this: https://en.wikipedia.org/wiki/Direct...Infrastructure
Thanks for your answer ! As far as I know, It's possible I talked with someone who done it but I can't find him.
He told me to look at Linux Kernel Modules which lead me to the thread and now I'm trying to do what he has done.
I think I'll wait for more answers, but thank you
 
Old 05-18-2017, 04:41 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,927

Rep: Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320
Yes, that is definitely possible, the device drivers are written by human beings. But actually they know about this much more than me.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] read function call returning more amount of data than wiritten using write function chakka.lokesh Programming 1 09-11-2014 03:14 AM
How do I write the following callback function? coffeenet Programming 2 01-03-2012 12:15 AM
Mandriva 2010 - Laptop Function Key Dims Display, Display Auto-Brightens Oceans80 Mandriva 2 08-28-2010 06:12 PM
Bash array Add function example using indirect array reference as function argument bobywelsh Programming 10 07-05-2010 04:44 AM
write function cxel91a Programming 4 01-15-2004 11:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 01:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration