Subversion Repositories shark

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1668 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
   17 Giugno 2004 : commenti - da verificare - di Simone Mannori
21
 
22
*/
23
 
24
 
25
 
26
/*
27
 ------------
28
 CVS :        $Id: initfile.c,v 1.1 2004-08-05 11:34:34 pj Exp $
29
 
30
 File:        $File$
31
 Revision:    $Revision: 1.1 $
32
 Last update: $Date: 2004-08-05 11:34:34 $
33
 ------------
34
 
35
 System initialization file
36
 
37
 This file contains the 2 functions needed to initialize the system.
38
 
39
 These functions register the following levels:
40
 
41
 an EDF (Earliest Deadline First) level
42
 a RR (Round Robin) level
43
 a CBS (Costant Bandwidth Server) level
44
 a Dummy level
45
 
46
 It can accept these task models:
47
 
48
 HARD_TASK_MODEL (wcet+mit) at level 0
49
 SOFT_TASK_MODEL (met, period) at level 1
50
 NRT_TASK_MODEL  at level 2
51
 
52
 This file is similar to the configuration of kernel/init/hartik3.c
53
 
54
 TICK is set to 0 (one-shot timer is used)
55
*/
56
 
57
/*
58
 * Copyright (C) 2000 Paolo Gai
59
 *
60
 * This program is free software; you can redistribute it and/or modify
61
 * it under the terms of the GNU General Public License as published by
62
 * the Free Software Foundation; either version 2 of the License, or
63
 * (at your option) any later version.
64
 *
65
 * This program is distributed in the hope that it will be useful,
66
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
67
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
68
 * GNU General Public License for more details.
69
 *
70
 * You should have received a copy of the GNU General Public License
71
 * along with this program; if not, write to the Free Software
72
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
73
 *
74
 */
75
 
76
#include "kernel/kern.h"
77
#include "modules/edf.h"
78
#include "modules/cbs.h"
79
#include "modules/rr.h"
80
#include "modules/dummy.h"
81
 
82
#include "modules/sem.h"
83
#include "modules/hartport.h"
84
#include "modules/cabs.h"
85
 
86
#include "drivers/keyb.h"
87
 
88
 
89
/*+ sysyem tick in us +*/
90
#define TICK 0
91
 
92
/*+ RR tick in us +*/
93
#define RRTICK 10000
94
 
95
TIME __kernel_register_levels__(void *arg)
96
{
97
  struct multiboot_info *mb = (struct multiboot_info *)arg;
98
 
99
     EDF_register_level(EDF_ENABLE_ALL);            // 1 - scheduler EDF
100
 
101
     CBS_register_level(CBS_ENABLE_ALL, 0);         // 2 - scheduler CBS
102
 
103
     RR_register_level(RRTICK, RR_MAIN_YES, mb);    // 3 - round robin affettato @ 10 ms
104
 
105
     dummy_register_level();                        // il dummy task (!)
106
 
107
     SEM_register_module();                        // semafori
108
 
109
     CABS_register_module();                       // CABS
110
 
111
  return TICK;
112
}
113
 
114
TASK __init__(void *arg)
115
{
116
  struct multiboot_info *mb = (struct multiboot_info *)arg;
117
 
118
 
119
 
120
  KEYB_PARMS kparms = BASE_KEYB;
121
 
122
  HARTPORT_init();
123
 
124
  keyb_def_ctrlC(kparms, NULL);
125
  keyb_def_map(kparms,itaMap);
126
  KEYB_init(&kparms);
127
 
128
  __call_main__(mb);
129
 
130
  return (void *)0;
131
}
132