Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
21 years ago

frame buffer

Hi,

I wrote a simple frame buffer driver for my LCD controller in uClinux 2.6.9.

My video card shares your memory with system memory.

How can I alloc video card memory in kernel space?

I make it with a kmalloc but when I want to point in fb memory from userspace mmap syscall don't work correctly.

If I don't use kmalloc, mmap return a correct pointer and I can write correctly in videomemory...

but kernel crash when alloc your structure in the same address.

In my driver I've implemented ..fb_mmap() function but the kernel never use it.

Why?

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Look into the function __get_free_pages(unsigned int flags, unsigned int order) -- it's described in Linux Device Drivers 3rd edition (published by O'Reilly press and supposedly freely available somewhere, but I've never found where).