<To RTLinux [EMAIL PROTECTED]>

>daniel sheltraw wrote:
>> 
>> Hello realtimers
>> 
>> I have a function which writes to video memory in kernel-space (and the
>> palette registers) after setting up the video mode using SVAGlib in
>> user-space. I have used this function previously in a non-RT kernel
>> module where it worked as expected. Now I am trying to use the same
>> function in a RT kernel module and it keeps locking up my machine. So
>> my question is: Is there some reason that I should not be able to write
>> to video memory (at 0xA0000) under RTAI (or RTL)?
>> 
>
>Hi Daniel,
>
>In in the 2.2 kernels, you need to use the following to adjust the
>physical address to the kernel virtual address as shown:
>
>int init_module(void)
>{
>    int err;
>
>#if LINUX_VERSION_CODE >= 0x20100
>    GM = phys_to_virt(0xA0000);
>#else
>    GM = (char *)0xA0000;
>#endif

I would like to write characters (state information) directly to VGA
video ram from my RTLinux interrupt service routine (ISR) in an RTL
2.2 module (on Red Hat Linux 6.1).  I've used this technique to
debug ISRs in DOS and have found it useful because it is very fast
and it provides useful info even when the operating system crashes.

Here is a little test program that doesn't work (I see no output on
the VGA monitor).  I do see the output from rtl_printf() on the
monitor (which is in character mode waiting at login prompt):
    
    vram=C00A0144 row=2 col=2 str='Hello, world!'

Can anyone offer a suggestion as to what I'm doing wrong?

#include <rtl.h>
#include <asm/io.h>

void video(short row, short col, char *str);
 
//---------------------------------------------------------------------
int init_module(void)
{
video(2, 2, "Hello, world!");
return(0);
}

//---------------------------------------------------------------------
int cleanup_module(void)
{
return(0);
}

//---------------------------------------------------------------------
void
video(short row, short col, char *str)
{
    char    *vram;                      // Pointer to video ram
    
#if LINUX_VERSION_CODE >= 0x20100       // See RTL email 24Jul2000 01:44:49
vram = phys_to_virt(0xA0000);    
#else
vram = (char *) 0xA0000;
#endif  // if LINUX_VERSION_CODE >= 0x20100

vram += (row * 80 + col) * 2;           // 2 bytes per screen character!

rtl_printf("vram=%X row=%d col=%d str='%s'\n", vram, row, col, str);

while (*str)
    {
    *vram++ = *str++;                   // Write character byte
    vram++;                             // Skip attribute byte
    }
}

Thanks in advance for your consideration!

-------------------------
Shel Hoffman
Reflective Computing
917 Alanson Dr
St. Louis, MO 63132 USA
(314) 993-6132 voice
(314) 993-3316 fax
[EMAIL PROTECTED]
-------------------------


-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to