Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1085 pj 1
/*
2
 * Copyright (C) 2001 G. Vadruccio
3
 *
4
 * This program is free software; you can redistribute it and/or modify
5
 * it under the terms of the GNU General Public License as published by
6
 * the Free Software Foundation; either version 2 of the License, or
7
 * (at your option) any later version.
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program; if not, write to the Free Software
16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
 *
18
 */
19
 
20
// INITFILE.C per il programma SIMLIGHT
21
// Progetto SHARK
22
// Contiene le funzioni necessarie per inizializzare il sistema.
23
// Le funzioni registrano i moduli:
24
// EDF (Earliest Deadline First) level
25
// RR (Round Robin) level
26
// CBS (Costant Bandwidth Server) level
27
// Dummy level
28
// Task attivabili:
29
// HARD_TASK_MODEL (wcet+mit) at level 0
30
// SOFT_TASK_MODEL (met, period) at level 1
31
// NRT_TASK_MODEL  at level 2
32
 
33
#include "kernel/kern.h"
34
#include "modules/edf.h"
35
#include "modules/cbs.h"
36
#include "modules/rr.h"
37
#include "modules/dummy.h"
38
 
39
#include "modules/sem.h"
40
#include "modules/hartport.h"
41
#include "modules/cabs.h"
42
 
43
#include "drivers/keyb.h"
44
 
45
 
46
/*+ sysyem tick in us +*/
47
#define TICK 1000
48
 
49
/*+ RR tick in us +*/
50
#define RRTICK 1000
51
 
52
void    read_file(void);
53
 
54
TIME __kernel_register_levels__(void *arg)
55
{
56
  struct multiboot_info *mb = (struct multiboot_info *)arg;
57
 
58
  EDF_register_level(EDF_ENABLE_ALL);
59
  CBS_register_level(CBS_ENABLE_ALL, 0);
60
  RR_register_level(RRTICK, RR_MAIN_YES, mb);
61
  dummy_register_level();
62
 
63
  SEM_register_module();
64
 
65
  CABS_register_module();
66
 
67
  read_file();
68
 
69
  return TICK;
70
}
71
 
72
TASK __init__(void *arg)
73
{
74
  struct multiboot_info *mb = (struct multiboot_info *)arg;
75
 
76
  KEYB_PARMS kparms = BASE_KEYB;
77
 
78
  HARTPORT_init();
79
 
80
  keyb_def_ctrlC(kparms, NULL);
81
  keyb_def_map(kparms,itaMap);
82
  KEYB_init(&kparms);
83
 
84
  __call_main__(mb);
85
 
86
  return (void *)0;
87
}
88