Subversion Repositories shark

Rev

Rev 1377 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1120 pj 1
/*
2
 * Project: S.Ha.R.K.
3
 *
4
 * Coordinators:
5
 *   Giorgio Buttazzo    <giorgio@sssup.it>
6
 *   Paolo Gai           <pj@gandalf.sssup.it>
7
 *
8
 * Authors     :
9
 *   Paolo Gai           <pj@gandalf.sssup.it>
10
 *   (see the web pages for full authors list)
11
 *
12
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
13
 *
14
 * http://www.sssup.it
15
 * http://retis.sssup.it
16
 * http://shark.sssup.it
17
 */
18
 
19
/*
20
 * Copyright (C) 2000 Paolo Gai, Luca Abeni
21
 *
22
 * This program is free software; you can redistribute it and/or modify
23
 * it under the terms of the GNU General Public License as published by
24
 * the Free Software Foundation; either version 2 of the License, or
25
 * (at your option) any later version.
26
 *
27
 * This program is distributed in the hope that it will be useful,
28
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
30
 * GNU General Public License for more details.
31
 *
32
 * You should have received a copy of the GNU General Public License
33
 * along with this program; if not, write to the Free Software
34
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
35
 *
36
 *
37
 * CVS :        $Id: pcidemo.c,v 1.1 2002-11-11 08:22:46 pj Exp $
38
 
39
 This is the pcitest Hartik's example.
40
 
41
*/
42
 
43
#include "kernel/kern.h"
44
#include "drivers/keyb.h"
45
 
46
#include "drivers/llpci.h"
47
#include "drivers/pci.h"
48
 
49
void scan()
50
{
51
    BYTE bus, dev;
52
 
53
    /* Scan the devices connected to the PCI bus */
54
    if (pci_init() == 1) {
55
        clear();
56
        pci_show();
57
        bus = 0; dev = 0;
58
        if (pcibios_find_device(0x8086, 0x7000, 0, &bus, &dev) == NULL)
59
            cprintf("Not found... %d %d\n", bus, dev);
60
        else cprintf("Found: %d \t %d\n", bus, dev);
61
 
62
        if (pcibios_find_class(0x300, 0, &bus, &dev) == NULL)
63
            cprintf("Not found... %d %d\n", bus, dev);
64
        else cprintf("Found: %d \t %d\n", bus, dev);
65
    } else cprintf("PCI not found!!!\n");
66
}
67
 
68
void endfun(KEY_EVT *k)
69
{
70
    sys_end();
71
}
72
 
73
int main (int argc, char *argv[])
74
{
75
    KEY_EVT k;
76
 
77
    k.flag = CNTR_BIT;
78
    k.scan = KEY_C;  
79
    k.ascii = 'c';
80
    keyb_hook(k,endfun);
81
 
82
    scan();
83
 
84
    sys_end();
85
    return 0;
86
}