www.digitalmars.com         C & C++   DMDScript  

c++.dos.32-bits - 32-bit Pointers

reply "Imran Haider" <absolute1008 hotmail.com> writes:
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi.   I tried to access 32-bit addresses (such as 000A:0000) through =
_x386_map_physical_memory but the program usually crashes with the =
warning: "General Protection Fault" and it gives me all the register =
values. Is there a way I can access the address without using any fancy =
functions that is provided, or by using the function provided =
effeciently?

I actually tried to access address not associated with any hardware (for =
example.  0005:1836) and it didn't work. The 000A000 works fine but this =
address didn't work. The reason I am tring to access this location is =
because the real-mode video-interrupt 0x10 only outputs buffer in the =
conventional memory. Is it possible that since this is a 32-bit =
protected mode environment, pointers to conventional addresses are =
illegal?   If so, can you give me some ideas on how I can access =
conventional memory? Thanks.
Oct 21 2001
next sibling parent "Walter" <walter digitalmars.com> writes:
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

To access the display directly, try the disp functions in disp.h. That =
will likely work better (and it's portable to win32 too!).

    Imran Haider wrote in message <9qvefh$124m$1 digitaldaemon.com>...
    Hi.   I tried to access 32-bit addresses (such as 000A:0000) through =
_x386_map_physical_memory but the program usually crashes with the =
warning: "General Protection Fault" and it gives me all the register =
values. Is there a way I can access the address without using any fancy =
functions that is provided, or by using the function provided =
effeciently?
   =20
    I actually tried to access address not associated with any hardware =
(for example.  0005:1836) and it didn't work. The 000A000 works fine but =
this address didn't work. The reason I am tring to access this location =
is because the real-mode video-interrupt 0x10 only outputs buffer in the =
conventional memory. Is it possible that since this is a 32-bit =
protected mode environment, pointers to conventional addresses are =
illegal?   If so, can you give me some ideas on how I can access =
conventional memory? Thanks.
Oct 21 2001
prev sibling next sibling parent Heinz Saathoff <hsaat bre.ipnet.de> writes:
Imran Haider schrieb...
 
 Hi.   I tried to access 32-bit addresses (such as 000A:0000) through 
 _x386_map_physical_memory but the program usually crashes with the 
 warning: "General Protection Fault" and it gives me all the register 
 values. Is there a way I can access the address without using any 
 fancy functions that is provided, or by using the function provided 
 effeciently?

Try to use _x386_zero_base_ptr, that is declared in dos.h as void *_x386_zero_base_ptr; You now can build a 32 bit absolute address by adding a 32bit offset to this pointer: char *ScreenAtA000 = (char*)_x386_zero_base_ptr + 0xA0000; Note that you don't use segment:offset in this case but a linear memory address. Regards, Heinz
Oct 21 2001
prev sibling parent reply Roland <rv ronetech.com> writes:
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

see a reply I sent in this group: "Re: Accessing VRAM directly"
there is evrything to manipulate pointers in it

Ciao

Roland


Imran Haider a écrit :

 Hi.   I tried to access 32-bit addresses (such as 000A:0000) through
 _x386_map_physical_memory but the program usually crashes with the
 warning: "General Protection Fault" and it gives me all the register
 values. Is there a way I can access the address without using any
 fancy functions that is provided, or by using the function provided
 effeciently? I actually tried to access address not associated with
 any hardware (for example.  0005:1836) and it didn't work. The 000A000
 works fine but this address didn't work. The reason I am tring to
 access this location is because the real-mode video-interrupt 0x10
 only outputs buffer in the conventional memory. Is it possible that
 since this is a 32-bit protected mode environment, pointers to
 conventional addresses are illegal?   If so, can you give me some
 ideas on how I can access conventional memory? Thanks.

Oct 23 2001
parent "Walter" <walter digitalmars.com> writes:
I added yours and Heinz's comments to the FAQ. Thanks!

    www.digitalmars.com/faq.html


Roland wrote in message <3BD56D53.E8D63C85 ronetech.com>...
see a reply I sent in this group: "Re: Accessing VRAM directly"
there is evrything to manipulate pointers in it

Ciao

Roland


Imran Haider a écrit :

 Hi.   I tried to access 32-bit addresses (such as 000A:0000) through
 _x386_map_physical_memory but the program usually crashes with the
 warning: "General Protection Fault" and it gives me all the register
 values. Is there a way I can access the address without using any
 fancy functions that is provided, or by using the function provided
 effeciently? I actually tried to access address not associated with
 any hardware (for example.  0005:1836) and it didn't work. The 000A000
 works fine but this address didn't work. The reason I am tring to
 access this location is because the real-mode video-interrupt 0x10
 only outputs buffer in the conventional memory. Is it possible that
 since this is a 32-bit protected mode environment, pointers to
 conventional addresses are illegal?   If so, can you give me some
 ideas on how I can access conventional memory? Thanks.


Oct 24 2001