Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1376 → Rev 1377

/demos/trunk/base/pcidemo.c
13,7 → 13,6
*/
 
/*
* 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
32,10 → 31,13
*/
 
#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();
52,21 → 54,45
 
}
 
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[])
{
 
unsigned long long i;
set_shutdown_task();
 
device_drivers_init();
 
cprintf("Init Done...\n");
 
for (i=0;i<100000000;i++);
 
device_drivers_close();
 
sys_end();
sleep(5);
task_activate(shutdown_task_PID);
return 0;