operating-system


How to write data directly into video memory?


Is there any way for a programmer to write data directly into video memory? I know OS's are very strict about this, but then how some types of applications (like videos players or computer games) can write their data directly into videos memory.
I know there are a bunch of well-known libraries for this (e.g. OpenGL); but they are just normal libraries after all and there's no fundamental difference between them and the programs that me and you write.
I know there are a bunch of well-known libraries for this (e.g. OpenGL); but they are just normal libraries after all and there's no fundamental difference between them and the programs that me and you write.
Oh, they are quite different from "normal libraries".
Take OpenGL for example. Part of that is a DLL or SO that you load. But part of that is something called a "driver" or "graphics driver". That is not a "normal library" at all; it is fundamentally a part of the operating system. It's basically a part of the OS that someone other than the OS maker wrote.
The system defines the interface for a driver, and hardware makers provide a driver library that fits into that interface. But that's not something that a normal user is able to provide, nor do most games run by installing their own graphics driver.
The purpose of the driver is to provide a uniform interface to graphics hardware for the OS and clients of the OS. Different hardware is different, but each driver for an OS exports the same interface (more or less), which allows client code to not have to know the details of the hardware.
This also prevents client code from breaking the system. If you crash a GPU (which, since it's a processor, is a thing you can do nowadays), someone has to deal with that. The OS handles CPU faults, and the graphics driver/OS nowadays handles GPU faults too. But in order to do that, it has to stand between you and the hardware.
On most operating systems, directly and arbitrarily accessing video memory is not allowed. Not for any program which is not itself a graphics driver. Many low-level APIs like OpenGL allow you to map certain memory allocations, so that you can access them. But that's very different from just giving someone a GPU memory pointer; after all, there's no guarantee that the mapped pointer actually points to GPU memory.
Oh, and they don't let you map textures or framebuffers, since they want to keep the details of hardware texture formats implementation-defined.

Related Links

qemu request for a disc image
How does the OS decide data that goes in each page?
SCAN and C-SCAN disk scheduling
Why xv6 scheduler calls sti() in the begining of every loop?
How do i find bits in virtual and physical address?
Why not to double number of registers for fast syscalls?
can i use pen drive for booting os into beagle board xm instead of sd card
How to Calculate Effective Access Time
Had 16-bit DOS a memory access limitation of 1 MB? If yes, how?
Determine addresses and page table size
How to detect operating system with GIMP scheme?
Does ARM have any mechanism like the VESA/VGA text mode console on x86?
What is greater logical address or physical address?
index allocation maximum file size
Random access alternative to named pipes
How to determine how many entries there are in a page table

Categories

HOME
firebase
matrix
add-on
hid
risk-management
openlayers-3
biztalk
celery
malware
elisp
qooxdoo
moodle-api
kurento
match
erd
jquery-file-upload
jqxgrid
varnish-vcl
wsf
liferay-6.2
conda
quantitative-finance
plyr
multi-dimensional-scaling
network-analysis
toad
objectmapper
mapnik
actframework
bootstrap-sass
runtimeexception
spinner
nsuserdefaults
selenide
slideshow
word-cloud
access-denied
haar-classifier
google-prediction
latexml
zend-form
nuclio
react-intl
webalizer
android-5.0-lollipop
word-2007
http-basic-authentication
zend-server
instafeedjs
maatwebsite-excel
qtextedit
google-identity-toolkit
swiffy
seadragon
smart-tv
decidable
arbre
mousehover
replicaset
abstract-factory
prism-4
hp-idol-ondemand
rebar
dc
utf8-decode
tabris
osascript
squeezebox
xulrunner
webaii
property-injection
principalcontext
eclim
vlab
mp4parser
dynamic-rdlc-generation
axacropdf
asp.net-mvc-3-areas
tfs-sdk
icenium
simplecov
opends
uploading
mvcrecaptcha
ognl
nsconnection
chunking
eai
iphone-sdk-3.1.3
motif

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App