Problem using glPixelMap

When I use glPixelMap to set the map values and get them back using glGetPixelMap I get the values that I have set, but when I call the glTexImage2D the whole screen becomes white. This is when use “GL_RGBA8” as the internal format for the “glTexImage2D”.

When I use “GL_RGB8” the whole screen goes black. For setting the pixel maps I used the “mapsize” of 256.

After setting the pixel maps in the call to
“glGetIntegerv” with GL_PIXEL_MAP_I_TO_R_SIZE does not give me 256. Why? I get a very large value (some 8 or 9 digits in it) instead of 256.

The texture image I use is not in RGBA mode,it is specified by color indexes and I want to map it to a color palette. How can I do this?

Please help me on this issue.