Home arrow C++ arrow Video Memory Programming in Text Mode
C++

Video Memory Programming in Text Mode


Nowadays we take so many things for granted. This isn't necessarily a bad thing, as knowing that performing a certain task will usually yield the same result can be a blessing. Nevertheless, some basic knowledge of how a thing gets done lets you better understand the world in which we live. Therefore, today I invite anyone who likes to code in any of the popular languages to see how a word gets printed out on the console screen.

Author Info:
By: Gabor Bernat
Rating: 4 stars4 stars4 stars4 stars4 stars / 10
March 29, 2010
TABLE OF CONTENTS:
  1. · Video Memory Programming in Text Mode
  2. · Where to copy
  3. · The code
  4. · What do we have in the end?

print this article
SEARCH DEVARTICLES

Video Memory Programming in Text Mode
(Page 1 of 4 )

Any half respectable book that tries to describe a new programming language starts with this. Let us print a sentence on the screen. The classic one is "Hello World!" of course, but some like to spice things up and use a more elaborate example. To get the text on the screen, most of the time you just call a function that will take care of the rest.

However, getting any information on the screen isn't as simple for the operating system. Remember that an operating system needs to work on multiple types of hardware configurations, and the way that some information gets from the system memory to display some colors on your screen varies. To make life simpler for the OS and to avoid design chaos, some basic rules have been established that all hardware manufacturers follow at some level.

The actual job of drawing something to the screen always falls to the video card. It has to carry the input data to your screen. Now we cannot assure a real time procession, as a sudden data burst may overload our bandwidth no matter how large that is. Therefore, all video cards have, at some level, some memory for their own usage.

This memory also allows them to store data that they need frequently. Doing this relieves some pressure from the CPU, as recurring data needs to be transferred to the video card only once. If you are interested in how a CPU works in detail, I invite you to look up the article series I dedicated to this in my profile. Besides the technical description, I created a simple demo sketch of my words using the VHDL language.

Returning to the video card, the device itself will in the future take care of getting the information from its memory to the screen. Think of this task as turning on or off a given color channel of the monitor at a given point on the screen, based on whether the value of a predetermined memory bit is zero or one. With this approach, all that the OS needs to do is copy the correct information from the system memory to a predetermined zone of the video card.


blog comments powered by Disqus
C++ ARTICLES

- Intel Threading Building Blocks
- Threading Building Blocks with C++
- Video Memory Programming in Text Mode
- More Tricks to Gain Speed in Programming Con...
- Easy and Efficient Programming for Contests
- Preparing For Programming Contests
- Programming Contests: Why Bother?
- Polymorphism in C++
- Overview of Virtual Functions
- Inheritance in C++
- Extending the Basic Streams in C++
- Using Stringstreams in C++
- Custom Stream Manipulation in C++
- General Stream Manipulation in C++
- Serialize Your Class into Streams in C++

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials