Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1655 giacomo 1
/*
2
 *
3
 * Project:
4
 *   Parallel Port S.Ha.R.K. Project
5
 *
6
 * Module:
7
 *   Initfile.c
8
 *
9
 * Description:
10
 *   System initialization file
11
 *
12
 * Coordinators:
13
 *   Giorgio Buttazzo    <giorgio@sssup.it>
14
 *   Paolo Gai           <pj@gandalf.sssup.it>
15
 *
16
 * Authors:
17
 *   Andrea Battistotti <btandrea@libero.it>
18
 *   Armando Leggio     <a_leggio@hotmail.com>
19
 *
20
 *
21
 * http://www.sssup.it
22
 * http://retis.sssup.it
23
 * http://shark.sssup.it
24
 *
25
 
26
 
27
 System initialization file
28
 
29
 This file contains the 2 functions needed to initialize the system.
30
 
31
 These functions register the following levels:
32
 
33
 an EDF (Earliest Deadline First) level
34
 a RR (Round Robin) level
35
 a CBS (Costant Bandwidth Server) level
36
 a Dummy level
37
 
38
 It can accept these task models:
39
 
40
 HARD_TASK_MODEL (wcet+mit) at level 0
41
 SOFT_TASK_MODEL (met, period) at level 1
42
 NRT_TASK_MODEL  at level 2
43
 
44
 This file is similar to the configuration of kernel/init/hartik3.c
45
 
46
 TICK is set to 0 (one-shot timer is used)
47
*/
48
 
49
/*
50
 * Copyright (C) 2000 Paolo Gai
51
 *
52
 * This program is free software; you can redistribute it and/or modify
53
 * it under the terms of the GNU General Public License as published by
54
 * the Free Software Foundation; either version 2 of the License, or
55
 * (at your option) any later version.
56
 *
57
 * This program is distributed in the hope that it will be useful,
58
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
59
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
60
 * GNU General Public License for more details.
61
 *
62
 * You should have received a copy of the GNU General Public License
63
 * along with this program; if not, write to the Free Software
64
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
65
 *
66
 */
67
 
68
#include "kernel/kern.h"
69
#include "modules/edf.h"
70
#include "modules/cbs.h"
71
#include "modules/rr.h"
72
#include "modules/dummy.h"
73
 
74
#include "modules/sem.h"
75
#include "modules/hartport.h"
76
#include "modules/cabs.h"
77
 
78
#include "drivers/keyb.h"
79
 
80
 
81
/*+ sysyem tick in us +*/
82
#define TICK 0 
83
/* #define TICK 100 */
84
 
85
/*+ RR tick in us +*/
86
#define RRTICK 10000
87
 
88
TIME __kernel_register_levels__(void *arg)
89
{
90
  struct multiboot_info *mb = (struct multiboot_info *)arg;
91
 
92
  EDF_register_level(EDF_ENABLE_ALL);
93
  CBS_register_level(CBS_ENABLE_ALL, 0);
94
  RR_register_level(RRTICK, RR_MAIN_YES, mb);
95
  dummy_register_level();
96
 
97
  SEM_register_module();
98
 
99
  CABS_register_module();
100
 
101
  return TICK;
102
}
103
 
104
TASK __init__(void *arg)
105
{
106
  struct multiboot_info *mb = (struct multiboot_info *)arg;
107
 
108
  KEYB_PARMS kparms = BASE_KEYB;
109
 
110
  HARTPORT_init();
111
 
112
  keyb_def_ctrlC(kparms, NULL);
113
  keyb_def_map(kparms,itaMap);
114
  KEYB_init(&kparms);
115
 
116
  __call_main__(mb);
117
 
118
  return (void *)0;
119
}
120