Index: [thread] [date] [subject] [author]
  From: GGI Mailinglist <ggi@mluwis17.wiwi.uni-halle.de>
  To  : ggi-develop@eskimo.com
  Date: Fri, 26 Nov 1999 14:08:11 +0100 (CET)

Re: ATI Mach64, XGGI ...

> > i've noticed another strange reaction,
> > 
> > today i tested a little assembly program which changes the color palette
> > in 8bpp mode, but it doesn't seem to work, the palette entries stay the
> > same with or without change, but after the syscall bit31 in eax isn't set,
> > this means the syscalls was sucessful.
> 
> How do you set palette exactly ? You are talking about assembler, so ...

nasm snippet:
-----------------------------------------
%macro SYS_IOCTL 0-3
%if %0 > 0
                        SET_REGISTER  ebx, %1           ;file handle
%endif
%if %0 > 1
                        SET_REGISTER  ecx, %2           ;ioctl number
%endif
%if %0 > 2
                        SET_REGISTER  edx, %3           ;address of the
                                                        ;data
%endif
                        mov     dword eax, __NR_ioctl
                        int     byte  080h
%endmacro


                        ... opening /dev/fb0 ...
                        ... mmaping ....


                        mov     dword eax, [fb_handle]
                        SYS_IOCTL  eax, FBIOPUTCMAP, .cmap_color_table
                        test    dword eax, eax
                        js      near .ioctl_error
 
                        ... more programcode ...

.red:                   dw      00000h, 0e000h, 06000h, 00000h
                        dw      06000h, 00000h, 00000h, 0e000h
                        dw      06000h, 04000h, 0e000h, 02000h
                        dw      04000h, 06000h, 06000h, 06000h
.green:                 dw      00000h, 0e000h, 02000h, 0e000h
                        dw      02000h, 06000h, 00000h, 0e000h
                        dw      04000h, 02000h, 06000h, 02000h
                        dw      04000h, 0e000h, 06000h, 06000h
.blue:                  dw      00000h, 0e000h, 02000h, 0e000h
                        dw      06000h, 04000h, 06000h, 06000h
                        dw      02000h, 00000h, 06000h, 02000h
                        dw      04000h, 06000h, 0e000h, 06000h
.transparent:           times 16 dw 0000h

.cmap_color_table:
                        dd      16
                        dd      16
                        dd      .red
                        dd      .green
                        dd      .blue
                        dd      .transparent
----------------------------------------------- 



> Is the syscall you talk about the KGI SETPALVEC ioctl call, or are you
> trying to outb to the card ports ?

no the FBIOPUTCMAP-ioctl as found in the fb-header files in the
kernelsource
 
> > On another computer with cirrus Logic 5464 Chipset and KGI Module the
> > program works fine.
> 
> If you write to the card's ports directly, you are bound to loose on most
> (but not all) modern chipsets. KGI drivers usually place the card in "native"
> mode (if such a thing exists for the given card) which will disable all
> "normal" VGA ports. This is done to 

no i don't access direct the VGA registers, i think this is the uncleanest
way to do it, i love linux for the hardware-independency that DOS
lacks [and for many more reasons ;-].

> 1. Get maximum performance from the card as the mmaped access is usually
> faster.

i know, i use the mmaped framebuffer


karsten


Index: [thread] [date] [subject] [author]