fbsim

framebuffer trivial "simulator"
git clone git://deadbeef.fr/fbsim.git
Log | Files | Refs | README

README (1686B)


      1 Description:
      2 
      3 This program only spawns a window and mmap it's content to
      4 a file, so that any other process can draw into that window.
      5 
      6 The initial purpose was to simulate a very, very simple to
      7 use framebuffer "emulator". There is no security built at
      8 all, even if errors should be handled correctly.
      9 
     10 * Users have to handle endianness themselves.
     11 * If multiple processes access the buffer at the same time,
     12   the only guarantee you have is to end with a mess.
     13 * Users must not attempt to read outside of the buffer's
     14   memory.
     15 * Only 32 bpp have actually been tested, 8 and 16 do not
     16   even theoretically work, because I'm lazy.
     17 * The program exits only when receiving a signal that, by
     18   default, imply termination.
     19 
     20 Usage:
     21 ./fbsim BUFFER WIDTH HEIGHT BPP REFRESHRATE
     22 
     23 BUFFER: path to a file which will be used as buffer. This
     24   file will be automatically deleted in most cases, but not
     25   if there is a faulty access to memory.
     26 WIDTH: the number of pixels per line.
     27 HEIGHT: the number of pixels per column.
     28 BPP: how many bits are needed to draw a pixel.
     29 REFRESHRATE: how many times per second the image should be
     30   updated.
     31 
     32 Compiling:
     33 
     34 This program requires a POSIX 2008 (probably) compatible
     35 libc and SDL 1.2.
     36 It should be compatible with any compiler supporting C99 or
     37 more recent, and compile with almost no warnings.
     38 
     39 Known warnings:
     40 * implicit-fallthrough (gcc)
     41 * missing-noreturn (clang)
     42 * padded (clang)
     43 
     44 Examples of build line:
     45 
     46 gcc: gcc -Wall -Wextra src/main.c -lSDL -o fbsim
     47 clang: clang -Wall -Weverything src/main.c -lSDL -o fbsim
     48 
     49 Notes:
     50 If using dd to write to the framebuffer, you will need to
     51 specify proper conversion options, by passing it:
     52 "conv=nocreat,notrunc"