Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1665 | pj | 1 | ////////////////////////////////////////////////////////////////// |
2 | // Pong |
||
3 | // Written for CS 324, UIUC |
||
4 | // Spencer Hoke |
||
5 | // James Kim |
||
6 | // Tao Luo |
||
7 | // |
||
8 | // Last Modified: April 29, 2004 |
||
9 | // |
||
10 | // System initialization file |
||
11 | // |
||
12 | // This file contains the 2 functions needed to initialize the system. |
||
13 | // |
||
14 | // These functions register the following levels: |
||
15 | // |
||
16 | // an EDF (Earliest Deadline First) level |
||
17 | // a RR (Round Robin) level |
||
18 | // a CBS (Costant Bandwidth Server) level |
||
19 | // a Dummy level |
||
20 | // |
||
21 | // It can accept these task models: |
||
22 | // |
||
23 | // HARD_TASK_MODEL (wcet+mit) at level 0 |
||
24 | // SOFT_TASK_MODEL (met, period) at level 1 |
||
25 | // NRT_TASK_MODEL at level 2 |
||
26 | // |
||
27 | // This file is similar to the configuration of in demos/base |
||
28 | // |
||
29 | // TICK is set to 0 (one-shot timer is used) |
||
30 | |||
31 | |||
32 | #include "kernel/kern.h" |
||
33 | #include "modules/edf.h" |
||
34 | #include "modules/cbs.h" |
||
35 | #include "modules/rr.h" |
||
36 | #include "modules/dummy.h" |
||
37 | |||
38 | #include "modules/sem.h" |
||
39 | #include "modules/hartport.h" |
||
40 | #include "modules/cabs.h" |
||
41 | #include "modules/pi.h" |
||
42 | |||
43 | #include "drivers/keyb.h" |
||
44 | |||
45 | |||
46 | // sysyem tick in us |
||
47 | #define TICK 0 |
||
48 | |||
49 | /*+ RR tick in us +*/ |
||
50 | //#define RRTICK 10000 |
||
51 | #define RRTICK 2000 |
||
52 | |||
53 | TIME __kernel_register_levels__(void *arg) |
||
54 | { |
||
55 | struct multiboot_info *mb = (struct multiboot_info *)arg; |
||
56 | |||
57 | EDF_register_level(EDF_ENABLE_WCET_CHECK); |
||
58 | CBS_register_level(CBS_ENABLE_ALL, 0); |
||
59 | RR_register_level(RRTICK, RR_MAIN_YES, mb); |
||
60 | dummy_register_level(); |
||
61 | |||
62 | SEM_register_module(); // needed for keyboard |
||
63 | CABS_register_module(); |
||
64 | PI_register_module(); |
||
65 | |||
66 | return TICK; |
||
67 | } |
||
68 | |||
69 | TASK __init__(void *arg) |
||
70 | { |
||
71 | struct multiboot_info *mb = (struct multiboot_info *)arg; |
||
72 | |||
73 | KEYB_PARMS kparms = BASE_KEYB; |
||
74 | |||
75 | HARTPORT_init(); |
||
76 | |||
77 | keyb_def_ctrlC(kparms, NULL); |
||
78 | keyb_def_map(kparms,itaMap); |
||
79 | KEYB_init(&kparms); |
||
80 | |||
81 | __call_main__(mb); |
||
82 | |||
83 | return (void *)0; |
||
84 | } |
||
85 |