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

How to decide if a “Device ” need an Operating System or not
Difference between shared memory IPC mechanism and API/system-call invocation
Is it possible to create an OS that can run all application?
Can't understand Belady's anomaly
Paging: Basic, Hierarchical, Hashed, and Inverted
What is the difference between kernel stack and user stack?
Ridiculous Question, but can I have SAS return the computer's volume level?
Why is an operating system software loaded from hard disk than from a rom chip? [closed]
What sort of things can cause a whole system to appear to hang for 100s-1000s of milliseconds?
How to make an bootable iso(not cd or flash drive) for testing your own boot loader?
Application-level scheduling
stack overflow method
How does communication occur in java through TCP sockets on the same machine
What happens when you overwrite a memory-mapped executable?
Valid characters for environment variables across operating systems
Instructions per sec for Operating systems

Categories

HOME
artificial-intelligence
memory
keyboard
cucumber
eclipse-plugin
long-integer
softlayer
twitter-fabric
lvm
u-boot
mailing-list
roku
wine
azure-graph-api
slide
phpstorm-2017.1
chromecast
stimulsoft
google-awareness
asp.net-core-1.0
phonegap-build
reselect
web-deployment
l20n
error-logging
workday
ava
dragula
window-managers
python-appium
beego
running-object-table
tf-idf
react-bootstrap-table
guice
mapnik
steam-web-api
cucumber-junit
creation
busboy
des
widestring
iscroll
linq.js
reset
stat
cloudera-sentry
pyttsx
word-cloud
docker-ucp
gcal
windows-media-player
cyanogenmod
password-hash
non-linear-regression
nusoap
node-apn
solr-query-syntax
extjs4.1
iptv
android-sharing
mobile-angular-ui
apache-modules
maatwebsite-excel
petsc
elastic4s
tablespace
fuzzer
fiber
bbc-micro
exists
django-validation
wepay
chicagoboss
srv-record
asp.net-web-api-helppages
extend
mathematical-expressions
microsoft-expression-web
symja
flurry-analytics
accessory
mfmessagecomposeview
.htpasswd
strdup
eclim
progress-db
indesign-server
semicolon
ofstream
icenium
server-name
nsfont
qtextbrowser
botnet
nsrangeexception
startupscript
upshot
directshow.net
turbine
ccl
main-method
index.dat
version-control-migration

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App