[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

431.0. "Hacking VAXstation Bitmap/Scanmap" by FALEK::FALEK (ex-TU58 King) Wed Mar 18 1987 19:51

I'm trying to write a hack (as a learning exercise) to turn the display
on a VAXstation screen upside-down and backwards while preserving as much
as possible the behavior of windows, cursors, fonts, applications, etc.
To be done in software only - no touching of the tube's yoke!

The normal way of diddling the display on the screen is through the
video memory pointed to by the QVB data structure. Unfortunately
this won't do what I want. The scan line map pointed to by the QVB is
apparently a virtual, rather than the physical map. For example, I can
write a program (CMKRNL required) to reverse the order of the entries in
the scan line map pointed to by the QVB without immediately affecting what
is displayed on the screen (but then when I create new windows or move
existing ones boy, does wierd stuff happen!). Applications like UIS
apparently only look at the scan line map sometimes, when they think
they have to refresh something. There are fields in the QVB for the
highest and lowest map entry refreshed and also a reset QIO, but these
things don't do the right thing (My hack turns what's visible on the tube
upside-down and backwards by swapping contents of video memory pointed to
by various map entries, and then my original plan was to turn the map
itself upside-down to preserve the order and correspondance.)

Perhaps I can bypass all this "virtual" stuff and make my problem
simpler if I can get access to the physical memory the hardware uses?

According to the documentation contained in appendix C of the
"VAXSTATION II Hardware Information" book, the QVSS (VCB01) has
256K of memory that appears at the very end of the MicroVAX I/O
space (3FFC0000-3FFFFFFF).  The upper 2K bytes of this is the physical
scan-line map and the cursor RAM is the upper 16 bytes of that.

I wrote a program to map (via $CRMPSC) this into my P0 space, but when I
tried to create the section, I got a machine check (followed by a system
crash). When I try to access those high locations from the console when the
machine is halted, I get Invalid Address (non-existant memory) errors.

Anyone know what the poop is with this memory? The book says it's there
but I can't see it. Am I doing something dumb?

			- Lou Falek
    
T.RTitleUserPersonal
Name
DateLines
431.1Try thisTLE::GRIEBSET TERMINAL/READ_MOSTLYMon Mar 23 1987 08:4696
	I recently found that on my Vaxstation II that if I ran Ultrix
with the 32W software installed, then took Ultrix down and booted VMS,
that VMS would CRASH when trying to autosize the QVSS. The reason for this
appeared to be that Ultrix leaves the scan line map of the QVSS in a weird
state and VMS assumes that it's in a known state and blindly uses it.
Now by now you're probably saying to yourself "Self... What does any of this
have to do with my question ????". Well the answer to the problem I mentioned
above was to write a little program that uses a PFN global section and to
run it in my SYCONFIG.COM - before the QVSS was used. This program
resets the scanline map. I think that you can use it to add whatever code
you want to do weird and "wonderful??" things.
Code follows:
						Enjoy

--------------------------- Cut here ------------------------------------------
    		%TITLE 'FIXSCAN - Fix scan map'

MODULE fixscan 	(IDENT = 'X01-001',
    		MAIN=do$it,
		ADDRESSING_MODE(EXTERNAL=GENERAL, NONEXTERNAL=LONG_RELATIVE)
    		) =
BEGIN

LIBRARY 'SYS$LIBRARY:STARLET';			!System stuff

MACRO
    $check_status =
    IF NOT .status THEN SIGNAL( .status );
    %;


    		%SBTTL 'DO$IT ()'

GLOBAL ROUTINE do$it =
    BEGIN

EXTERNAL ROUTINE
    LIB$PUT_OUTPUT;

BIND
    smapdsc = %ASCID'SLMAP',
    header = %ASCID'      Fixing QVSS scan map';

LOCAL
    in_addr: VECTOR[ 2 ],
    ret_addr: VECTOR[ 2 ],
    scanmap: REF VECTOR[,WORD],
    privmask: BLOCK[8,BYTE],			!Privilege mask
    status;					!For completion code

BIND
    quadword = privmask: VECTOR[];		!Access as 2 longwords


    status = LIB$PUT_OUTPUT( header );
    $check_status;

    quadword[ 0 ] = 0;
    quadword[ 1 ] = 0;
    
    privmask[ PRV$V_CMKRNL ] = 1;		!Set needed priv on
    privmask[ PRV$V_PFNMAP ] = 1;		!Set needed priv on
    
    status = $SETPRV( PRVADR= privmask, ENBFLG= 1 );	!Do it
    $check_status;

    ret_addr[ 0 ] = 0;
    ret_addr[ 1 ] = 0;
    in_addr[ 0 ] = 0;
    in_addr[ 1 ] = 0;

    status = $CRMPSC( INADR= in_addr, RETADR= ret_addr,
    			FLAGS= (SEC$M_EXPREG OR SEC$M_PFNMAP OR SEC$M_WRT),
    			GSDNAM=smapdsc, VBN=%x'181FFC',
    			PAGCNT=  2*2 );
    $check_status;

    scanmap = .ret_addr[ 0 ];

    INCR idx FROM 0 to 863 DO
	BEGIN
	scanmap[ .idx ] = .idx;
	END;

    INCR idx FROM 864 to 1023 DO
	BEGIN
	scanmap[ .idx ] = 21845;
	END;

    RETURN ( SS$_NORMAL );			!All is well
    END;					!End of routine do$it

END				! End of module
ELUDOM