Subversion Repositories shark

Rev

Rev 1377 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

/*
 * Project: S.Ha.R.K.
 *
 * Coordinators:
 *   Giorgio Buttazzo    <giorgio@sssup.it>
 *   Paolo Gai           <pj@gandalf.sssup.it>
 *
 * Authors     :
 *   Paolo Gai           <pj@gandalf.sssup.it>
 *   (see the web pages for full authors list)
 *
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
 *
 * http://www.sssup.it
 * http://retis.sssup.it
 * http://shark.sssup.it
 */


/*
 * Copyright (C) 2000 Paolo Gai, Luca Abeni
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 *
 * CVS :        $Id: pcidemo.c,v 1.1 2002-11-11 08:22:46 pj Exp $

 This is the pcitest Hartik's example.

*/


#include "kernel/kern.h"
#include "drivers/keyb.h"

#include "drivers/llpci.h"
#include "drivers/pci.h"

void scan()
{
    BYTE bus, dev;

    /* Scan the devices connected to the PCI bus */
    if (pci_init() == 1) {
        clear();
        pci_show();
        bus = 0; dev = 0;
        if (pcibios_find_device(0x8086, 0x7000, 0, &bus, &dev) == NULL)
            cprintf("Not found... %d %d\n", bus, dev);
        else cprintf("Found: %d \t %d\n", bus, dev);

        if (pcibios_find_class(0x300, 0, &bus, &dev) == NULL)
            cprintf("Not found... %d %d\n", bus, dev);
        else cprintf("Found: %d \t %d\n", bus, dev);
    } else cprintf("PCI not found!!!\n");
}

void endfun(KEY_EVT *k)
{
    sys_end();
}

int main (int argc, char *argv[])
{
    KEY_EVT k;
   
    k.flag = CNTR_BIT;
    k.scan = KEY_C;  
    k.ascii = 'c';
    keyb_hook(k,endfun);

    scan();
   
    sys_end();
    return 0;
}