Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1655 | giacomo | 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: initfile.c,v 1.1.1.1 2004-05-24 18:03:39 giacomo Exp $ |
||
22 | |||
23 | File: $File$ |
||
24 | Revision: $Revision: 1.1.1.1 $ |
||
25 | Last update: $Date: 2004-05-24 18:03:39 $ |
||
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 | an EDF (Earliest Deadline First) level |
||
37 | a RR (Round Robin) level |
||
38 | a TBS (Total Bandwidth Server) level 0.1 Us |
||
39 | a TBS (Total Bandwidth Server) level 0.3 Us |
||
40 | a CBS (Constant Bandwidth Server) level |
||
41 | a Dummy level |
||
42 | |||
43 | The TBS bandwidth is TBS_NUM/TBS_DEN |
||
44 | |||
45 | |||
46 | It can accept these task models (into () the mandatory fields): |
||
47 | |||
48 | HARD_TASK_MODEL (wcet+mit) at level 0 |
||
49 | NRT_TASK_MODEL at level 1 |
||
50 | SOFT_TASK_MODEL (wcet, periodicity=APERIODIC) at level 2,3 |
||
51 | SOFT_TASK_MODEL (met,period) at level 4 |
||
52 | |||
53 | **/ |
||
54 | |||
55 | /* |
||
56 | * Copyright (C) 2000 Paolo Gai |
||
57 | * |
||
58 | * This program is free software; you can redistribute it and/or modify |
||
59 | * it under the terms of the GNU General Public License as published by |
||
60 | * the Free Software Foundation; either version 2 of the License, or |
||
61 | * (at your option) any later version. |
||
62 | * |
||
63 | * This program is distributed in the hope that it will be useful, |
||
64 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
65 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
66 | * GNU General Public License for more details. |
||
67 | * |
||
68 | * You should have received a copy of the GNU General Public License |
||
69 | * along with this program; if not, write to the Free Software |
||
70 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
71 | * |
||
72 | */ |
||
73 | |||
74 | |||
75 | |||
76 | #include "kernel/kern.h" |
||
77 | #include "modules/edf.h" |
||
78 | #include "modules/rr.h" |
||
79 | #include "modules/tbs.h" |
||
80 | #include "modules/cbs.h" |
||
81 | #include "modules/rrsoft.h" |
||
82 | #include "modules/dummy.h" |
||
83 | #include "drivers/keyb.h" |
||
84 | #include "modules/sem.h" |
||
85 | #include "modules/hartport.h" |
||
86 | |||
87 | /*+ sysyem tick in us +*/ |
||
88 | //#define TICK 300 |
||
89 | #define TICK 0 |
||
90 | |||
91 | #define RRTICK 5000 |
||
92 | #define TBS_NUM 1 |
||
93 | #define TBS_DEN 10 |
||
94 | |||
95 | |||
96 | TIME __kernel_register_levels__(void *arg) |
||
97 | { |
||
98 | struct multiboot_info *mb = (struct multiboot_info *)arg; |
||
99 | |||
100 | EDF_register_level(EDF_ENABLE_ALL); |
||
101 | RR_register_level(RRTICK, RR_MAIN_YES, mb); |
||
102 | TBS_register_level(TBS_ENABLE_ALL, 0, TBS_NUM, TBS_DEN); |
||
103 | TBS_register_level(TBS_ENABLE_ALL, 0, TBS_NUM*3, TBS_DEN); |
||
104 | CBS_register_level(CBS_ENABLE_ALL, 0); |
||
105 | |||
106 | /* RRSOFT_register_level(RRTICK, RR_MAIN_NO, mb, RRSOFT_ONLY_HARD); |
||
107 | RR_register_level(RRTICK, RR_MAIN_NO, mb); |
||
108 | RRSOFT_register_level(RRTICK, RR_MAIN_NO, mb, RRSOFT_ONLY_SOFT); //cbs |
||
109 | RRSOFT_register_level(RRTICK, RR_MAIN_NO, mb, RRSOFT_ONLY_SOFT); //tbs |
||
110 | RRSOFT_register_level(RRTICK, RR_MAIN_NO, mb, RRSOFT_ONLY_SOFT); //tbs |
||
111 | RR_register_level(RRTICK, RR_MAIN_YES, mb); |
||
112 | */ |
||
113 | |||
114 | dummy_register_level(); |
||
115 | |||
116 | SEM_register_module(); |
||
117 | |||
118 | return TICK; |
||
119 | } |
||
120 | |||
121 | TASK __init__(void *arg) |
||
122 | { |
||
123 | struct multiboot_info *mb = (struct multiboot_info *)arg; |
||
124 | |||
125 | HARTPORT_init(); |
||
126 | |||
127 | // KEYB_init(NULL); |
||
128 | |||
129 | __call_main__(mb); |
||
130 | |||
131 | return (void *)0; |
||
132 | } |
||
133 |