writing to vdu memory

This is a discussion on writing to vdu memory within the C Programming forums, part of the General Programming Boards category; i'm new to linux programming but done enough c programming in dos my problem is that i use the following ...

  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    38

    writing to vdu memory

    i'm new to linux programming
    but done enough c programming in dos

    my problem is that i use the following code set a poniter to VDu memory in dos

    char far *scr=(char far *)0xB8000000L;

    unaware that gcc supports flat memory model i used the same code in programming for linux

    obviously it didn't work and error was flashed
    then i read some documentation and found where the problem was

    so i modified the above code as(removed far keyword and converted 0xB8000000 to flat model equivalent 0xB800000 ..tell me if i'm wron here)
    char *scr=(char *)0xB800000;

    this time it compiled successfully but when i treid to run the executable it didn't give proper result .......

    please help me how to do this(ihave also treid including farptr.h ..but no use)

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    You probably don't have access to direct video memory that way in linux. I'd be surprised if the kernel let you play with it directly. Though, admitedly, I haven't looked into it. You're better off finding a graphics library and using it. Or, perhaps, Googling for it. You may want to try the Linux forum here. Though don't bother cross-posting this there. It will likely get moved there for you by a moderator.

    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,834
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. memory reading vs. writing
    By R.Stiltskin in forum C++ Programming
    Replies: 14
    Last Post: 08-20-2008, 05:57 AM
  2. help! fifo read problem
    By judoman in forum C Programming
    Replies: 1
    Last Post: 08-16-2004, 10:19 AM
  3. Pointer's
    By xlordt in forum C Programming
    Replies: 13
    Last Post: 10-14-2003, 03:15 PM
  4. Managing shared memory lookups
    By clancyPC in forum Linux Programming
    Replies: 0
    Last Post: 10-08-2003, 05:44 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21