Chapter 45
Video Support: liboskit_video.a

45.1 Introduction

Video support is currently a three-way mishmash and it’s incomplete, but it provides useful services for some popular boards.

The first way provides the XFree86 S3 driver and its normal XFree86 interface, along with a few other functions.

The second way provides the VGA portion of the well known “Svgalib” library for Linux.

The third way for OSKit kernels to access video (and the keyboard and mouse) is via X11 client support. Through this support OSKit kernels can interact (like any other X client) with remote machines running an X server. In the x11/client source directory we provide patches against both the stock XFree86 X11R6.3 and XConsortium X11R6.3 distributions, along with helper functions specific to the OSKit. See the README’s there.

45.2 X11 S3 Video Library

The x11video library contains a video driver supporting S3 video cards. This includes all video hardware supported by the XF86_S3 server (see http://www.xfree86.org for more information).

45.2.1 So how do I use this?

The driver currently requires a configuration (XF86Config) file. A sample file is included in the x11/video directory. You’ll need to make sure that it’s readable as /etc/XF86Config. This can either be done through the BMOD (section 15.20) filesystem, or by using the FreeBSD or Linux filesystem components.

This file is a subset of a standard XF86Config file and can only contain the Monitor, Device and Screen sections. The easiest way to get things running is when you already have an XF86Config file for that computer/monitor configuration. In that case you can just strip out everything from it but the sections listed above. Otherwise you’ll need to make one from scratch, or from a sample config file from an XFree86 distribution.

Currently the x11video driver only uses the default (first) entry in the Screen section. Unlike XFree86, there is no way to change or specify color depths or resolution at runtime.

45.2.2 Dependencies

x11video depends on oskit_startup, oskit_unsupp, oskit_dev, oskit_kern, oskit_freebsd_m, oskit_c, and oskit_lmm.

45.2.3 API reference

45.2.4 s3_init_framebuffer: Initializes the s3 video code

SYNOPSIS

#include <oskit/video/s3.h>

oskit_fb_t *s3_init_framebuffer(void);

45.2.5 s3_cmap_write: Write a colormap entry

SYNOPSIS

#include <oskit/video/s3.h>

int s3_cmap_write(oskit_cmap_entry_t *c);

45.2.6 s3_cmap_read: Read a colormap entry

SYNOPSIS

#include <oskit/video/s3.h>

int s3_cmap_read(oskit_cmap_entry_t *c);

45.2.7 s3_cmap_fg_index: Return the colormap index for the foreground color

SYNOPSIS

#include <oskit/video/s3.h>

int s3_cmap_fg_index(void);

45.3 Svgalib Video Library

The video_svgalib library contains the VGA portion of the well known “svgalib” library. It does not support the keyboard, joystick, mouse or gl functionality of svgalib.

This library and its interface may change or disappear in the future, but it’s useful for now.

45.3.1 So how do I use this?

The interface is the same as the VGA interface for Svgalib. The extensive man pages for those functions are in oskit/video/svgalib/doc, handily formatted for you. Svgalib programs that use only the VGA interface should work with little change: you should only have to add code to do OSKit initialization.

For an example of how to convert an svgalib program, you can look at examples/x86/svgalib.c, which is one of the standard svgalib example programs converted to run on the oskit.

45.3.2 Dependencies

video_svgalib depends on oskit_startup, oskit_dev, oskit_kern, oskit_freebsd_m, oskit_c, and oskit_lmm.