Lines: 34
X-Admin: news@aol.com
From: johnnedwardbrown@aol.com (Johnnedwardbrown)
Newsgroups: comp.os.minix
Date: 21 Apr 2001 04:56:33 GMT
References: <3ACCBF39.9030105@NOSPAM.uv.net>
Organization: AOL http://www.aol.com
Subject: Re: writing to video memory and ioctl.
Message-ID: <20010421005633.13756.00000330@ng-cu1.aol.com>
Path: news.adfa.edu.au!clarion.carno.net.au!news0.optus.net.au!news1.optus.net.au!optus!intgwpad.nntp.telstra.net!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!howland.erols.net!portc.blue.aol.com.MISMATCH!portc03.blue.aol.com!audrey05.news.aol.com!not-for-mail
Xref: news.adfa.edu.au comp.os.minix:37225

Did you ever fix this, I was trying to do the same thing and finally got it to
work. I had to change the klib, similiar to the text driver, here is some code.
 I basically copied what was done to write a character to video memory.  Your
way seems like it might work, but I had trouble with using the phys_copy(don't
know if it actually writes to that exact memory location, or maybe it does
work?), so instead I went to using the gdt and setting vga memory that way.   

KLIB386.S:
setpixel:
	push	edi
	push	es			! Save values on stack
	mov	edi, SP_ARGS(esp) 	! Get dest offset
	mov	ecx, SP_ARGS+4(esp)	! Get pixel value
	mov	es, (_vga_seg)		! Get vga selector
	mov	eax, ecx		! Return = pixel value	
 	o16 stos			! set vga memory with pix val
	mov	eax, ecx		! Return pixel value		
	pop	es
	pop	edi
	ret				! return to caller

CONSOLE.C:(in function scr_init)
  /* vga_seg is the es:?? used accessing free memory	*/
  vga_seg = protected_mode ? VGA_SELECTOR : physb_to_hclick(vga_base); 

  /* setup a memory entry for vga in the gdt		*/
  init_dataseg(&gdt[VGA_INDEX], vga_base, (phys_bytes)vga_size,
  		TASK_PRIVILEGE);

I have some code on my site too, if any body is interested.
Berlin Brown
bigbinc@hotmail.com
http://bama.ua.edu/~brown084/programming

