Subversion Repositories shark

Rev

Rev 1375 | 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>
 *
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
 *
 * http://www.sssup.it
 * http://retis.sssup.it
 * http://shark.sssup.it
 */


/*
 *
 * 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 "unistd.h"

#include "drivers/shark_linuxc26.h"
#include "drivers/shark_pci26.h"

PID shutdown_task_PID;

int device_drivers_init() {
                                                                                                                             
        LINUXC26_register_module();
                                                                                                                             
        PCI26_init();

        return 0;
                                                                                                                             
}

int device_drivers_close() {

        return 0;

}

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();

        device_drivers_init();

        cprintf("Init Done...\n");

        sleep(5);
       
        task_activate(shutdown_task_PID);
 
        return 0;

}