Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1664 | pj | 1 | /*--------------------------------------------------------------*/ |
2 | /* SIMULATION OF THE HUNGRY SNAKE'S GAME */ |
||
3 | |||
4 | /* AUTHOR : SUNDARA PRABU THESINGU RAJAN |
||
5 | |||
6 | EMAIL : Y2KPRABU@YAHOO.COM |
||
7 | |||
8 | DEVELOPED SYSTEM : AMD DURON 1.1GHz 128MB RAM SVGA MONITOR |
||
9 | OS : SHARK |
||
10 | GCC : 3.1 (DJGPP VERSION) |
||
11 | |||
12 | UNDER THE GUIDANCE OF PROFESSORS: |
||
13 | Mr. Giorgio Buttazzo <giorgio@sssup.it> |
||
14 | Mr. Giuseppe Lipari <lipari@sssup.it> |
||
15 | Mr. Paolo Gai <pj@gandalf.sssup.it> |
||
16 | |||
17 | |||
18 | --------------------------------------------------------------*/ |
||
19 | |||
20 | /* System initialization file |
||
21 | |||
22 | This file contains the 2 functions needed to initialize the system. |
||
23 | |||
24 | These functions register the following levels: |
||
25 | |||
26 | an EDF (Earliest Deadline First) level |
||
27 | a RR (Round Robin) level |
||
28 | a CBS (Costant Bandwidth Server) level |
||
29 | a Dummy level |
||
30 | |||
31 | It can accept these task models: |
||
32 | |||
33 | HARD_TASK_MODEL (wcet+mit) at level 0 |
||
34 | SOFT_TASK_MODEL (met, period) at level 1 |
||
35 | NRT_TASK_MODEL at level 2 |
||
36 | |||
37 | This file is similar to the configuration of kernel/init/hartik3.c |
||
38 | |||
39 | TICK is set to 0 (one-shot timer is used) |
||
40 | |||
41 | * Copyright (C) 2002 Y2KPRABU */ |
||
42 | |||
43 | #include "kernel/kern.h" |
||
44 | #include "modules/edf.h" |
||
45 | #include "modules/cbs.h" |
||
46 | #include "modules/rr.h" |
||
47 | #include "modules/dummy.h" |
||
48 | |||
49 | #include "modules/sem.h" |
||
50 | #include "modules/hartport.h" |
||
51 | #include "modules/cabs.h" |
||
52 | |||
53 | #include "drivers/keyb.h" |
||
54 | |||
55 | |||
56 | /*+ sysyem tick in us +*/ |
||
57 | #define TICK 0 |
||
58 | |||
59 | /*+ RR tick in us +*/ |
||
60 | #define RRTICK 10000 |
||
61 | |||
62 | TIME __kernel_register_levels__(void *arg) |
||
63 | { |
||
64 | struct multiboot_info *mb = (struct multiboot_info *)arg; |
||
65 | |||
66 | EDF_register_level(EDF_ENABLE_ALL); |
||
67 | CBS_register_level(CBS_ENABLE_ALL, 0); |
||
68 | RR_register_level(RRTICK, RR_MAIN_YES, mb); |
||
69 | dummy_register_level(); |
||
70 | |||
71 | SEM_register_module(); |
||
72 | |||
73 | CABS_register_module(); |
||
74 | |||
75 | return TICK; |
||
76 | } |
||
77 | |||
78 | TASK __init__(void *arg) |
||
79 | { |
||
80 | struct multiboot_info *mb = (struct multiboot_info *)arg; |
||
81 | |||
82 | KEYB_PARMS kparms = BASE_KEYB; |
||
83 | HARTPORT_init(); |
||
84 | keyb_def_ctrlC(kparms, NULL); |
||
85 | keyb_def_map(kparms,itaMap); |
||
86 | KEYB_init(&kparms); |
||
87 | |||
88 | __call_main__(mb); |
||
89 | |||
90 | return (void *)0; |
||
91 | } |
||
92 |