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: pinit.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 the following levels: |
||
35 | |||
36 | an EDF (Earliest Deadline First) level |
||
37 | a POSIX (32 levels RR/FIFO) level |
||
38 | a CBS (Costant Bandwidth Server) level |
||
39 | a Dummy level |
||
40 | |||
41 | It can accept these task models: |
||
42 | |||
43 | HARD_TASK_MODEL (wcet+mit) at level 0 |
||
44 | NRT_TASK_MODEL at level 1 |
||
45 | SOFT_TASK_MODEL (met, period) at level 2 |
||
46 | |||
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 | |||
69 | |||
70 | #include "kernel/kern.h" |
||
71 | #include "modules/edf.h" |
||
72 | #include "modules/cbs.h" |
||
73 | #include "modules/posix.h" |
||
74 | #include "modules/rr.h" |
||
75 | #include "modules/dummy.h" |
||
76 | |||
77 | #include "modules/pi.h" |
||
78 | #include "modules/pc.h" |
||
79 | |||
80 | #include "modules/sem.h" |
||
81 | #include "modules/hartport.h" |
||
82 | #include "modules/cabs.h" |
||
83 | |||
84 | #include "drivers/keyb.h" |
||
85 | |||
86 | #include "pthread.h" |
||
87 | #include "time.h" |
||
88 | |||
89 | |||
90 | /*+ sysyem tick in us +*/ |
||
91 | #define TICK 1000 |
||
92 | |||
93 | /*+ RR tick in us +*/ |
||
94 | #define RRTICK 10000 |
||
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 | POSIX_register_level(RRTICK, POSIX_MAIN_YES, mb, 32); |
||
103 | CBS_register_level(CBS_ENABLE_ALL, 0); |
||
104 | dummy_register_level(); |
||
105 | |||
106 | PI_register_module(); |
||
107 | PC_register_module(); |
||
108 | |||
109 | SEM_register_module(); |
||
110 | |||
111 | CABS_register_module(); |
||
112 | |||
113 | PTHREAD_register_module(1, 0, 1); |
||
114 | |||
115 | TIMER_register_module(); |
||
116 | |||
117 | return TICK; |
||
118 | } |
||
119 | |||
120 | TASK __init__(void *arg) |
||
121 | { |
||
122 | struct multiboot_info *mb = (struct multiboot_info *)arg; |
||
123 | |||
124 | HARTPORT_init(); |
||
125 | |||
126 | KEYB_init(NULL); |
||
127 | |||
128 | __call_main__(mb); |
||
129 | |||
130 | return (void *)0; |
||
131 | } |
||
132 |