Thread: accessing VDU memeory

  1. #1
    Registered User
    Join Date
    Jun 2005
    Posts
    9

    accessing VDU memeory

    hello all,
    firstly i will have to thank u all for helping me out so far. i have a quick question here about the VDU memeory. i was writting a programm to read the data from the VDU. and the follwing code was my approch to do

    Code:
    #include<stdio.h>
    
    int main()
    {
        char *vdu=(char *)0xB8000000;
        int i;
        
        for(i=0;i<10;i++)
            printf("%c",*(vdu+i));
        
        getchar();
        return 0;
    }
    but when i do this i get a rum time error( from the microsoft windoows). i am just reading first 5 char from the memeory. can any one correct me please or guide me how to do that.

    thank you ,

    -onthewaytoC
    Last edited by onthewaytoC; 06-12-2005 at 05:27 AM.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Well unless your compiler is for DOS, and DOS is really your operating system, the chances of this working are slim.
    Modern operating systems don't like you picking random absolute addresses.

    How about starting with which OS and compiler you're using, and what you're really trying to do, then we can help.

    Oh, if you're using some ancient fossil (say borland turbo-c) and your OS is say XP, then consider upgrading to a compiler for this century.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    9
    it was just a prob given in some book. the aim of this prog is to read the char from the memory and change the upper case letter to lower case and low to upper case

    and i am using Dev-C++ on XP platform

    -onthewaytoC

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Registered User
    Join Date
    Jun 2005
    Posts
    9
    thax very much salem it was interseting to go through the Adrianxw's console tutorial and i am still going through the tutorial, but a question interrupted me to post this question. well, if i am using some compiler like DEV-C++ on XP like what i am using now. i can call some of the API function to do the job. but the question still reamins how do u access the VDU memory if you are using something like GCC compiler on Linux platform which don't suppot any API function which does the job on windows.

    thax very much

    -onthewaytoC

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Well you need a different API for working on Linux.

    My initial thought is that you should be able to do something with the ncurses library.

    Interestingly, there is also a windows port of ncurses, so if you want the same code to run on win32 and Linux, then ncurses is something you should look into.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. vector : accessing values
    By rahulsk1947 in forum C++ Programming
    Replies: 1
    Last Post: 06-01-2009, 09:26 PM
  2. Problems accessing logged on user via System.Security
    By conor20_ie in forum C# Programming
    Replies: 5
    Last Post: 11-16-2007, 07:52 AM
  3. VDU memory
    By mdamjad in forum C Programming
    Replies: 5
    Last Post: 09-27-2004, 02:37 PM
  4. Accessing hardware directly (equivalent) in XP
    By Trauts in forum Windows Programming
    Replies: 7
    Last Post: 01-30-2003, 12:35 PM
  5. Accessing VDU Memory
    By a_learner in forum C Programming
    Replies: 0
    Last Post: 10-18-2001, 01:48 PM