[comp.unix.xenix] graphics under SCO xenix with a hercules adapter

emmett@runx.ips.oz (Emmett Lazich) (04/09/89)

Has anyone successfully made David T. Lewis's GL Graphics
Library work under SCO 286 xenix 2.2.1 with a hercules mono
graphics board?

/dev/mono seems to return the correct far address for the
display memory (I bet it hasn't set up the correct limit
in the segment descriptor!).  But I cannot put the CRT 
controller into graphics mode!

No ioctl() call (or stty command) will put the herc board
into graphics mode. SCO didn't seem to want to support it?

What would have been nice is if the console driver (maj
dev == 0) supported the hercules graphics mode using the
second 32K page of display memory.  Then when you switch
between multiscreens you could have text where there
should be text, and graphics in the screen being accessed
by the GL library (what I am saying here is that the
console driver keeps track of what's going on in each
screen and does a few outb() calls when it has to talk to
the 6845).  

I guess you could go the whole way and do a "rep movsw"
(ie a multiscreen switch :-)) and CRT controller mode
change to/from graphics mode when necessary, and have
graphics on as many screens as you like.  It would not be
too hard if one had the source to the console driver.

Any help appreciated!  (David Lewis are you there??)

I will probably write a weee little device driver with just
an open() a close(),and an ioctl() and use it to switch the herc
board between text and graphics mode. So if someone could
tell me the values to put into the 6845 data register I'd
be very grateful. (If I simply turn on bit 1 at 0x3b8 my 
screen goes really crazy! (experimented under MSDOS))
I'll use the hercioctl() routine to return the segment address
             ^^^^^^^^^ (I'll call it the herc driver in master) :-)
of the video memory to the user program after it sets up
a descriptor with the correct segment limits and all that crap.
I'll use the second page of video memory so that if the
user switches multiscreens nothing will get messed up. (Not
only that! - multiscreens would be temporarily inactive
while graphics is being displayed. A pity :-( But I
dont have the source for the console driver so it
must be this way.)

Well.... any comments? Anyone interested? I only dreamed
it all up just then but it seems like it would work. I think
I'll do it!

6845/herc info please!

Any info on PHIGS for people with UNIX running on AT machines?

--Emmett

-----------------------------------------------
Internet: emmett@runx.ips.oz.au
UUCP: ...!uunet!munnari!runx.oz!emmett

:w herc.msg

jim@applix.UUCP (Jim Morton) (04/12/89)

In article <2093@runx.ips.oz>, emmett@runx.ips.oz (Emmett Lazich) writes:
> 
> /dev/mono seems to return the correct far address for the display memory 
> (I bet it hasn't set up the correct limit in the segment descriptor!).  
> But I cannot put the CRT controller into graphics mode!
> No ioctl() call (or stty command) will put the herc board into graphics mode.
> SCO didn't seem to want to support it?

These definitions were added in (I think) 2.2.2. They may be 386 only:

comcrt.h:#define M_HGC_P0	0xe0	/* hercules graphics - page 0 @ B0000 */
comcrt.h:#define M_HGC_P1	0xe1	/* hercules graphics - page 1 @ B8000 */
machdep.h:#define SW_HGC_P0  (MODESWITCH | M_HGC_P0)
machdep.h:#define SW_HGC_P1  (MODESWITCH | M_HGC_P1)

If they aren't in your 286 release, you can use the /dev/mono address and 
either write a tiny fooopen() fooclose() driver that does ins & outs on the
Hercules controller ports to enter and exit graphics mode respectively, or 
use the /dev/mem - /dev/port device that Steve Dyer posted here a while ago.
(I think it was major #4, minor #4, and you can adb or lseek() to the port
address - reads will do an in(), writes will do an out() ).

--
Jim Morton, APPLiX Inc., Westboro, MA
UUCP: ...harvard!m2c!applix!jim
      jim@applix.m2c.org