Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1377 → Rev 1376

/demos/trunk/base/pcidemo.c
13,6 → 13,7
*/
 
/*
* 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
31,13 → 32,10
*/
 
#include "kernel/kern.h"
#include "unistd.h"
 
#include "drivers/shark_linuxc26.h"
#include "drivers/shark_pci26.h"
 
PID shutdown_task_PID;
 
int device_drivers_init() {
LINUXC26_register_module();
54,45 → 52,21
 
}
 
TASK shutdown_task_body(void *arg) {
 
device_drivers_close();
 
sys_shutdown_message("-- S.Ha.R.K. Closed --\n");
 
sys_end();
 
return NULL;
 
}
 
void set_shutdown_task() {
 
NRT_TASK_MODEL nrt;
 
nrt_task_default_model(nrt);
 
shutdown_task_PID = task_create("Shutdown Task",shutdown_task_body,&nrt,NULL);
if (shutdown_task_PID == NIL) {
sys_shutdown_message("Error: Cannot create shutdown task\n");
sys_end();
}
 
}
 
 
int main (int argc, char *argv[])
{
 
set_shutdown_task();
unsigned long long i;
 
device_drivers_init();
 
cprintf("Init Done...\n");
 
sleep(5);
task_activate(shutdown_task_PID);
for (i=0;i<100000000;i++);
 
device_drivers_close();
 
sys_end();
return 0;