Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1375 → Rev 1374

/demos/trunk/base/newpcidemo.c
0,0 → 1,65
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* 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
*
*/
 
#include "kernel/kern.h"
#include "drivers/shark_pci26.h"
 
#include "drivers/fg.h"
 
extern int i2c_dev_init(void);
 
int main (int argc, char *argv[])
{
unsigned long long i;
 
PCI26_init();
 
i2c_init();
i2c_dev_init();
 
videodev_init();
bttv_init_module();
 
cprintf("Init Done...\n");
 
for (i=0;i<100000000;i++);
 
FG_init(0,0,320,200,FG_RGB24,1);
 
for (i=0;i<100000000;i++);
 
sys_end();
return 0;
 
}
/demos/trunk/base/makefile
11,7 → 11,7
PROGS += aster aster1 aster2 aster3 aster4 aster5 aster6 aster7 aster8
PROGS += pcidemo talk mousfind keycode memtest
PROGS += jointest condtest intsem semdemo pidemo pcdemo srpdemo mdemo
PROGS += ego fly fly2 cabs sched
PROGS += ego fly fly2 cabs sched newpcidemo
 
include $(BASE)/config/example.mk
 
72,8 → 72,11
make -f $(SUBMAKE) APP=aster8 INIT= OTHEROBJS="iaster8.o" OTHERINCL= SHARKOPT=__OLDCHAR__
 
pcidemo:
make -f $(SUBMAKE) APP=pcidemo INIT= OTHEROBJS="ipcidemo.o" OTHERINCL= SHARKOPT="__LINUXC26__ __NEWPCI__"
make -f $(SUBMAKE) APP=pcidemo INIT= OTHEROBJS="initfile.o" OTHERINCL= SHARKOPT=__OLDCHAR__
 
newpcidemo:
make -f $(SUBMAKE) APP=newpcidemo INIT= OTHEROBJS="ipcidemo.o" OTHERINCL= SHARKOPT="__LINUXC26__ __NEWPCI__ __INPUT__ __I2C__ __FB__ __BTTV__"
 
talk:
make -f $(SUBMAKE) APP=talk INIT= OTHEROBJS="initfile.o" OTHERINCL= SHARKOPT=__OLDCHAR__
 
/demos/trunk/base/ipcidemo.c
20,6 → 20,10
#include "modules/sem.h"
#include "modules/hartport.h"
 
#include <drivers/shark_linuxc26.h>
#include <drivers/shark_input26.h>
#include <drivers/shark_keyb26.h>
 
/*+ sysyem tick in us +*/
#define TICK 0
 
31,6 → 35,16
#define INTDRIVE_T 10000
#define INTDRIVE_FLAG 0
 
void my_close(void *arg)
{
 
KEYB26_close();
INPUT26_close();
kern_printf("S.Ha.R.K. closed.\n\n");
 
}
 
TIME __kernel_register_levels__(void *arg)
{
struct multiboot_info *mb = (struct multiboot_info *)arg;
50,8 → 64,18
{
struct multiboot_info *mb = (struct multiboot_info *)arg;
 
KEYB_PARMS kparms = BASE_KEYB;
 
keyb_def_ctrlC(kparms, NULL);
 
HARTPORT_init();
 
LINUXC26_register_module();
//INPUT26_init();
//KEYB26_init(&kparms);
 
//sys_atrunlevel(my_close, NULL, RUNLEVEL_BEFORE_EXIT);
 
__call_main__(mb);
 
return (void *)0;
/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;
}