Subversion Repositories shark

Rev

Rev 1676 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1676 tullio 1
%----------------------------------------------------------------------------
2
\chapter{The Linux Compatibility Layer}
3
%----------------------------------------------------------------------------
4
 
5
It is the glue code used for the interaction between the kernel and the linux
6
code. It is the suggested option for using drivers ported from the Linux 2.6
7
kernel tree.
8
 
9
\vspace{7mm}
10
 
11
\begin{intest}
12
LINUXC26\_REGISTER\_MODULE\index{linuxc26\_register\_module(int use\_intdrive)}
13
\end{intest}
14
 
15
\begin{description}
16
\item [\texttt{void LINUXC26\_register\_module(int use\_intdrive);}]
17
\item [\texttt{Description:}] It initializes the compatibility layer interface
18
and the library's internal data structures.
19
\item [\texttt{Parameters:}] TRUE indicates to use the IntDrive for managing
20
interrupts; FALSE makes the glue layer to use the old interrupt management
21
system.
22
\item [\texttt{Return value:}] 0 if the module is installed; 1 otherwise.
23
\end{description}
24
 
25
\begin{description}
26
\item [Example:]
27
\end{description}
28
 
29
\begin{verbatim}
30
int device_drivers_init() {
31
    int res;
32
    KEYB_PARMS kparms = BASE_KEYB;
33
 
34
    LINUXC26_register_module(TRUE);
35
    PCI26_init();
36
    INPUT26_init();
37
 
38
    keyb_def_ctrlC(kparms, NULL);
39
    KEYB26_init(&kparms);
40
 
41
    FB26_init();
42
    res = FB26_open(FRAME_BUFFER_DEVICE);
43
    if (res) {
44
        cprintf("Error: Cannot open graphical mode\n");
45
        KEYB26_close();
46
        INPUT26_close();
47
        exit(1);
48
    }
49
    FB26_use_grx(FRAME_BUFFER_DEVICE);
50
    FB26_setmode(FRAME_BUFFER_DEVICE,"640x480-16");
51
 
52
    return 0;
53
}
54
\end{verbatim}
55
 
56
 
57
 
58