Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1085 pj 1
/*
2
 * Project: S.Ha.R.K.
3
 *
4
 * Coordinators:
5
 *   Giorgio Buttazzo    <giorgio@sssup.it>
6
 *   Paolo Gai           <pj@gandalf.sssup.it>
7
 *
8
 * Authors     :
9
 *   Paolo Gai           <pj@gandalf.sssup.it>
10
 *   (see the web pages for full authors list)
11
 *
12
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
13
 *
14
 * http://www.sssup.it
15
 * http://retis.sssup.it
16
 * http://shark.sssup.it
17
 */
18
 
19
/**
20
 ------------
21
 CVS :        $Id: slshinit.c,v 1.1.1.1 2002-09-02 09:37:41 pj Exp $
22
 
23
 File:        $File$
24
 Revision:    $Revision: 1.1.1.1 $
25
 Last update: $Date: 2002-09-02 09:37:41 $
26
 ------------
27
 
28
 System initialization file
29
 
30
 The tick is set to TICK ms.
31
 
32
 This file contains the 2 functions needed to initialize the system.
33
 
34
 These functions register the following levels:
35
 
36
 a Slot Shifting level
37
 a Dummy level
38
 
39
 It can accept these task models:
40
 
41
 STATIC_TASK_MODEL
42
 HARD_TASK_MODEL(aperiodic)
43
 SOFT_TASK_MODEL
44
 
45
**/
46
 
47
/*
48
 * Copyright (C) 2000 Paolo Gai
49
 *
50
 * This program is free software; you can redistribute it and/or modify
51
 * it under the terms of the GNU General Public License as published by
52
 * the Free Software Foundation; either version 2 of the License, or
53
 * (at your option) any later version.
54
 *
55
 * This program is distributed in the hope that it will be useful,
56
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
57
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
58
 * GNU General Public License for more details.
59
 *
60
 * You should have received a copy of the GNU General Public License
61
 * along with this program; if not, write to the Free Software
62
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
63
 *
64
 */
65
 
66
 
67
 
68
#include "kernel/kern.h"
69
#include "slsh.h"
70
#include "modules/rr2.h"
71
#include "modules/sem.h"
72
#include "modules/hartport.h"
73
#include "drivers/keyb.h"
74
#include "modules/dummy.h"
75
 
76
/*+ sysyem tick in us +*/
77
#define TICK 300
78
 
79
/* define RR tick in us*/
80
#define RRTICK 10000
81
 
82
TIME __kernel_register_levels__(void *arg)
83
{
84
        struct multiboot_info *mb = (struct multiboot_info *)arg;
85
 
86
        SLSH_register_level();
87
        RR2_register_level(RRTICK, RR2_MAIN_YES, mb);
88
        dummy_register_level();
89
 
90
        SEM_register_module();
91
 
92
        return TICK;
93
}
94
 
95
NRT_TASK_MODEL nrt;
96
 
97
TASK __init__(void *arg)
98
{
99
        struct multiboot_info *mb = (struct multiboot_info *)arg;
100
 
101
        KEYB_PARMS k = BASE_KEYB;
102
 
103
        nrt_task_default_model(nrt);
104
        keyb_def_task(k,&nrt);
105
 
106
 
107
 
108
        HARTPORT_init();
109
 
110
        KEYB_init(NULL);
111
 
112
        __call_main__(mb);
113
 
114
        return 0;
115
}
116
 
117