How does /dev/video work ? - Minix

This is a discussion on How does /dev/video work ? - Minix ; Hi, I'd like to know how /dev/video works. 1. What are the requirements to make use of it, do I simply need to open the device, switch the console to graphics mode, do anything I need while in graphics mode ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: How does /dev/video work ?

  1. How does /dev/video work ?

    Hi,
    I'd like to know how /dev/video works.

    1. What are the requirements to make use of it, do I simply need to open the
    device, switch the console to graphics mode, do anything I need while in
    graphics mode and then close it when I have finished ?

    2. In other words do the low level graphics routines I am playing around
    with need to reference this device as though it is the raw video adapter or
    is there anything special that needs to be done ?

    3. Where in Minix is any code that implements this device or am I missing
    the point here totally ?

    Apologies if these seem dumb questions :-)

    Thanks

    Lynton



  2. Re: How does /dev/video work ?

    In article ,
    Lynton Towler wrote:
    >2. In other words do the low level graphics routines I am playing around
    >with need to reference this device as though it is the raw video adapter or
    >is there anything special that needs to be done ?


    Essentially the only thing /dev/video does is to allow an application
    program to mmap the video memory. It doesn't provide any kind of abstraction,
    it just provides access to the raw hardware.

    >3. Where in Minix is any code that implements this device or am I missing
    >the point here totally ?


    It is part of the tty/console driver.


    --
    That was it. Done. The faulty Monk was turned out into the desert where it
    could believe what it liked, including the idea that it had been hard done
    by. It was allowed to keep its horse, since horses were so cheap to make.
    -- Douglas Adams in Dirk Gently's Holistic Detective Agency

  3. Re: How does /dev/video work ?


    "Philip Homburg" wrote in message
    news:e2pb43ohhu31rack5aqiuk9cf1@inews_id.stereo.hq .phicoh.net...

    > Essentially the only thing /dev/video does is to allow an application
    > program to mmap the video memory. It doesn't provide any kind of
    > abstraction,
    > it just provides access to the raw hardware.


    Thanks for the information Philip, I obviously need to do some more reading
    on this subject. I'm getting the feeling I'm trying to run before I can walk
    so to speak.

    > It is part of the tty/console driver.


    OK, I'll start inspecting the source code for that and post any questions as
    and when I have them.

    Thanks once again for the help

    Lynton



  4. Re: How does /dev/video work ?

    > Thanks for the information Philip, I obviously need to do some more
    > reading on this subject. I'm getting the feeling I'm trying to run before
    > I can walk so to speak.
    >
    >> It is part of the tty/console driver.

    >

    OK so where is mmap defined, I know its in sys/mman.h usually but I can't
    seem to find any reference to it in Minix 3 ?
    Does anyone have a simple example of switching the Minix console to a
    graphics mode, writing say 1 pixel to the display then exiting back to text
    mode. I'm really stuck here but if I had such a code example I think I'd be
    able to build on that and move forward.
    Almost without exception the examples I have looked at seem to use
    sys/mman.h but Minix must use something else ?

    Kind Regards

    Lynton



  5. Re: How does /dev/video work ?

    In article ,
    Lynton Towler wrote:
    >> Thanks for the information Philip, I obviously need to do some more
    >> reading on this subject. I'm getting the feeling I'm trying to run before
    >> I can walk so to speak.
    >>
    >>> It is part of the tty/console driver.

    >>

    >OK so where is mmap defined, I know its in sys/mman.h usually but I can't
    >seem to find any reference to it in Minix 3 ?


    Minix 3 doesn't have the usual mmap interface (because it doesn't have virtual
    memory at all).

    The best thing is to look at the X sources
    in xc/programs/Xserver/hw/xfree86/os-support/minix3/ or
    http://derelict.cs.vu.nl/cvsweb/cvsw...upport/minix3/

    The functions mapVidMem and mapmem in mnx3_video.c map the video memory.


    --
    That was it. Done. The faulty Monk was turned out into the desert where it
    could believe what it liked, including the idea that it had been hard done
    by. It was allowed to keep its horse, since horses were so cheap to make.
    -- Douglas Adams in Dirk Gently's Holistic Detective Agency

  6. Re: How does /dev/video work ?

    >>OK so where is mmap defined, I know its in sys/mman.h usually but I can't
    >>seem to find any reference to it in Minix 3 ?

    >
    > Minix 3 doesn't have the usual mmap interface (because it doesn't have
    > virtual
    > memory at all).
    >
    > The best thing is to look at the X sources
    > in xc/programs/Xserver/hw/xfree86/os-support/minix3/ or
    > http://derelict.cs.vu.nl/cvsweb/cvsw...upport/minix3/
    >
    > The functions mapVidMem and mapmem in mnx3_video.c map the video memory.


    OK Philip thanks for the pointer but to be honest I'm still really
    struggling to make sense of this because I find the X sources really tough
    going.
    I'm one of those people who learns best by example and the example I need I
    think is one that causes Minix to:-

    1. Enter a graphics mode
    2. Plot a single pixel somewhere on the screen
    3. Exit back to text mode.

    Once I see how thats done I think the whole thing will start to make some
    sense.
    At this stage I'm not even bothered about restoring the screen contents on
    exit from graphics mode.
    Would you happen to have such a code example kicking around or be willing to
    offer more help ?

    Thanks

    Lynton



  7. Re: How does /dev/video work ?

    In article ,
    Lynton Towler wrote:
    >Would you happen to have such a code example kicking around


    No. Video cards are far too complex.


    --
    That was it. Done. The faulty Monk was turned out into the desert where it
    could believe what it liked, including the idea that it had been hard done
    by. It was allowed to keep its horse, since horses were so cheap to make.
    -- Douglas Adams in Dirk Gently's Holistic Detective Agency

+ Reply to Thread