Subversion Repositories shark

Rev

Blame | Last modification | View Log | RSS feed

%----------------------------------------------------------------------------
\chapter{The Linux Compatibility Layer}
%----------------------------------------------------------------------------

It is the glue code used for the interaction between the kernel and the linux
code. It is the suggested option for using drivers ported from the Linux 2.6
kernel tree.

\vspace{7mm}

\begin{intest}
LINUXC26\_REGISTER\_MODULE\index{linuxc26\_register\_module(int use\_intdrive)}
\end{intest}

\begin{description}
\item [\texttt{void LINUXC26\_register\_module(int use\_intdrive);}]
\item [\texttt{Description:}] It initializes the compatibility layer interface
and the library's internal data structures.
\item [\texttt{Parameters:}] TRUE indicates to use the IntDrive for managing
interrupts; FALSE makes the glue layer to use the old interrupt management
system.
\item [\texttt{Return value:}] 0 if the module is installed; 1 otherwise.
\end{description}

\begin{description}
\item [Example:]
\end{description}

\begin{verbatim}
int device_drivers_init() {
    int res;
    KEYB_PARMS kparms = BASE_KEYB;

    LINUXC26_register_module(TRUE);
    PCI26_init();
    INPUT26_init();

    keyb_def_ctrlC(kparms, NULL);
    KEYB26_init(&kparms);

    FB26_init();
    res = FB26_open(FRAME_BUFFER_DEVICE);
    if (res) {
        cprintf("Error: Cannot open graphical mode\n");
        KEYB26_close();
        INPUT26_close();
        exit(1);
    }
    FB26_use_grx(FRAME_BUFFER_DEVICE);
    FB26_setmode(FRAME_BUFFER_DEVICE,"640x480-16");

    return 0;
}
\end{verbatim
}