Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

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