Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 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: rm1.c,v 1.1.1.1 2002-03-29 14:12:52 pj Exp $
22
 
23
 File:        $File$
24
 Revision:    $Revision: 1.1.1.1 $
25
 Last update: $Date: 2002-03-29 14:12:52 $
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 a set of scheduling modules, in a fixed or
35
 dynamic priority way...
36
 
37
 It can accept these task models:
38
 
39
 HARD_TASK_MODEL (wcet+mit) at level 0
40
 SOFT_TASK_MODEL (periodicity=APERIODIC) at level 1
41
 NRT_TASK_MODEL  at level 2
42
 SOFT_TASK_MODEL (periodicity=APERIODIC, wcet (only if TBS) ) at level 3,4
43
 
44
**/
45
 
46
/*
47
 * Copyright (C) 2000 Paolo Gai
48
 *
49
 * This program is free software; you can redistribute it and/or modify
50
 * it under the terms of the GNU General Public License as published by
51
 * the Free Software Foundation; either version 2 of the License, or
52
 * (at your option) any later version.
53
 *
54
 * This program is distributed in the hope that it will be useful,
55
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
56
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
57
 * GNU General Public License for more details.
58
 *
59
 * You should have received a copy of the GNU General Public License
60
 * along with this program; if not, write to the Free Software
61
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
62
 *
63
 */
64
 
65
 
66
 
67
#include "kernel/kern.h"
68
#include "modules/edf.h"
69
#include "modules/tbs.h"
70
 
71
#include "modules/rm.h"
72
#include "modules/rr.h"
73
#include "modules/ps.h"
74
 
75
#include "modules/dummy.h"
76
 
77
#include "modules/sem.h"
78
#include "modules/hartport.h"
79
 
80
#include "drivers/keyb.h"
81
 
82
#include <ll/stdio.h>
83
 
84
 
85
/*+ sysyem tick in us +*/
86
#define TICK      300
87
 
88
#define RRTICK    5000
89
 
90
 
91
TIME __kernel_register_levels__(void *arg)
92
{
93
  struct multiboot_info *mb = (struct multiboot_info *)arg;
94
 
95
//  EDF_register_level(EDF_ENABLE_ALL);
96
//  PS_register_level(2 /*PS_ENABLE_ALL_EDF*/,0,1000,100000);
97
//  RR_register_level(RRTICK, RR_MAIN_YES, mb);
98
//  TBS_register_level(TBS_ENABLE_ALL, 0, 1, 10);
99
//  PS_register_level(2,0,3000,10000);
100
//  TBS_register_level(TBS_ENABLE_ALL, 0, 3, 10);
101
 
102
 
103
  RM_register_level(RM_ENABLE_ALL);
104
  PS_register_level(4/*PS_ENABLE_ALL_RM*/,0,1000,100000);
105
  RR_register_level(RRTICK, RR_MAIN_YES, mb);
106
  PS_register_level(4,0,1000,10000);
107
  PS_register_level(4,0,3000,10000);
108
 
109
 
110
 
111
  dummy_register_level();
112
 
113
  SEM_register_module();
114
 
115
  return TICK;
116
}
117
 
118
SOFT_TASK_MODEL m;
119
 
120
TASK __init__(void *arg)
121
{
122
  struct multiboot_info *mb = (struct multiboot_info *)arg;
123
  KEYB_PARMS k = BASE_KEYB;
124
 
125
  soft_task_default_model(m);
126
  soft_task_def_wcet(m,2000);
127
  soft_task_def_met(m,800);
128
  soft_task_def_period(m,25000);
129
  soft_task_def_system(m);
130
  soft_task_def_aperiodic(m);
131
  soft_task_def_level(m,4);
132
  keyb_def_task(k,&m);
133
 
134
  HARTPORT_init();
135
 
136
  if (KEYB_init(&k) < 0)
137
    kern_printf("Error during the init of the Keyboard!!!");
138
 
139
  __call_main__(mb);
140
 
141
  return (void *)0;
142
}
143