Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1375 → Rev 1374

/demos/trunk/base/pcidemo.c
5,6 → 5,10
* 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
29,45 → 33,54
* 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/shark_linuxc26.h"
#include "drivers/shark_pci26.h"
#include "drivers/llpci.h"
#include "drivers/pci.h"
 
int device_drivers_init() {
LINUXC26_register_module();
PCI26_init();
void scan()
{
BYTE bus, dev;
 
return 0;
/* 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");
}
 
int device_drivers_close() {
 
return 0;
 
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);
 
unsigned long long i;
 
device_drivers_init();
 
cprintf("Init Done...\n");
 
for (i=0;i<100000000;i++);
 
device_drivers_close();
 
sys_end();
return 0;
 
scan();
sys_end();
return 0;
}