Rev 1126 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1126 | 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 | ------------ |
||
1156 | giacomo | 21 | CVS : $Id: initfile.c,v 1.2 2003-04-28 11:51:11 giacomo Exp $ |
1126 | giacomo | 22 | |
23 | File: $File$ |
||
1156 | giacomo | 24 | Revision: $Revision: 1.2 $ |
25 | Last update: $Date: 2003-04-28 11:51:11 $ |
||
1126 | giacomo | 26 | ------------ |
27 | |||
28 | System initialization file |
||
29 | |||
30 | This file contains the 2 functions needed to initialize the system. |
||
31 | |||
32 | These functions register the following levels: |
||
33 | |||
34 | an EDF (Earliest Deadline First) level |
||
35 | a RR (Round Robin) level |
||
36 | a CBS (Costant Bandwidth Server) level |
||
37 | a Dummy level |
||
38 | |||
39 | It can accept these task models: |
||
40 | |||
41 | HARD_TASK_MODEL (wcet+mit) at level 0 |
||
42 | SOFT_TASK_MODEL (met, period) at level 1 |
||
43 | NRT_TASK_MODEL at level 2 |
||
44 | |||
45 | This file is similar to the configuration of kernel/init/hartik3.c |
||
46 | |||
47 | TICK is set to 0 (one-shot timer is used) |
||
48 | */ |
||
49 | |||
50 | /* |
||
51 | * Copyright (C) 2000 Paolo Gai |
||
52 | * |
||
53 | * This program is free software; you can redistribute it and/or modify |
||
54 | * it under the terms of the GNU General Public License as published by |
||
55 | * the Free Software Foundation; either version 2 of the License, or |
||
56 | * (at your option) any later version. |
||
57 | * |
||
58 | * This program is distributed in the hope that it will be useful, |
||
59 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
60 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
61 | * GNU General Public License for more details. |
||
62 | * |
||
63 | * You should have received a copy of the GNU General Public License |
||
64 | * along with this program; if not, write to the Free Software |
||
65 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
66 | * |
||
67 | */ |
||
68 | |||
69 | #include "kernel/kern.h" |
||
70 | #include "modules/edf.h" |
||
71 | #include "modules/cbs.h" |
||
72 | #include "modules/rr.h" |
||
73 | #include "modules/dummy.h" |
||
74 | |||
75 | #include "modules/sem.h" |
||
76 | #include "modules/hartport.h" |
||
77 | #include "modules/cabs.h" |
||
78 | |||
79 | #include "drivers/keyb.h" |
||
80 | |||
81 | |||
82 | /*+ sysyem tick in us +*/ |
||
1156 | giacomo | 83 | #define TICK 1000 |
1126 | giacomo | 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_init(&kparms); |
||
114 | |||
115 | __call_main__(mb); |
||
116 | |||
117 | return (void *)0; |
||
118 | } |
||
119 |