Subversion Repositories shark

Rev

Rev 1347 | Rev 1389 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1347 giacomo 1
/*
2
 * Project: HARTIK (HA-rd R-eal TI-me K-ernel)
3
 *
4
 * Coordinators: Giorgio Buttazzo <giorgio@sssup.it>
5
 *               Gerardo Lamastra <gerardo@sssup.it>
6
 *
7
 * Authors     : Mauro Marinoni <mauro.marinoni@unipv.it>
8
 * (see authors.txt for full list of hartik's authors)
9
 *
10
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
11
 *
12
 * http://www.sssup.it
13
 * http://retis.sssup.it
14
 * http://hartik.sssup.it
15
 */
16
 
17
/*
18
 * Copyright (C) 2000 Paolo Gai
19
 *
20
 * This program is free software; you can redistribute it and/or modify
21
 * it under the terms of the GNU General Public License as published by
22
 * the Free Software Foundation; either version 2 of the License, or
23
 * (at your option) any later version.
24
 *
25
 * This program is distributed in the hope that it will be useful,
26
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
28
 * GNU General Public License for more details.
29
 *
30
 * You should have received a copy of the GNU General Public License
31
 * along with this program; if not, write to the Free Software
32
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
33
 *
34
 */
35
 
36
#include <kernel/kern.h>
37
 
38
#include "modules/edf.h"
39
#include "modules/cbs.h"
40
#include "modules/rr.h"
41
#include "modules/dummy.h"
42
#include "modules/intdrive.h"
43
 
44
#include <semaphore.h>
45
#include "modules/sem.h"
46
#include "modules/hartport.h"
47
 
48
#include <drivers/shark_linuxc26.h>
49
#include <drivers/shark_input26.h>
50
#include <drivers/shark_mouse26.h>
51
#include <drivers/shark_keyb26.h>
52
#include <drivers/shark_spk26.h>
1363 mauro 53
#include <drivers/shark_joy26.h>
1347 giacomo 54
 
1363 mauro 55
#include <drivers/shark_fb26.h>
56
 
1347 giacomo 57
/*+ sysyem tick in us +*/
58
#define TICK 0
59
 
60
/*+ RR tick in us +*/
61
#define RRTICK 10000
62
 
1363 mauro 63
/*+ Interrup Server */
64
#define INTDRIVE_Q 1000
65
#define INTDRIVE_T 10000
66
#define INTDRIVE_FLAG 0
67
 
68
#define FRAME_BUFFER_DEVICE 0
69
 
1347 giacomo 70
void my_close(void *arg)
71
{
1363 mauro 72
        mouse_grxcursor(DISABLE, 0);
73
 
74
        FB26_close(FRAME_BUFFER_DEVICE);
75
 
76
        MOUSE26_close();
1347 giacomo 77
        KEYB26_close();
78
        SPEAK26_close();
1363 mauro 79
        JOY26_close();
1347 giacomo 80
        INPUT26_close();
81
 
82
        kern_printf("S.Ha.R.K. closed.\n\n");
83
}
84
 
85
TIME __kernel_register_levels__(void *arg)
86
{
87
        struct multiboot_info *mb = (struct multiboot_info *)arg;
88
 
1363 mauro 89
        INTDRIVE_register_level(INTDRIVE_Q, INTDRIVE_T, INTDRIVE_FLAG);
1347 giacomo 90
        EDF_register_level(EDF_ENABLE_ALL);
91
        CBS_register_level(CBS_ENABLE_ALL, 1);
92
        RR_register_level(RRTICK, RR_MAIN_YES, mb);
93
        dummy_register_level();
94
 
95
        SEM_register_module();
96
 
97
        return TICK;
98
}
99
 
100
TASK __init__(void *arg)
101
{
102
        struct multiboot_info *mb = (struct multiboot_info *)arg;
103
        KEYB_PARMS  kparms = BASE_KEYB;
104
        MOUSE_PARMS mparms = BASE_MOUSE;
105
 
106
        HARTPORT_init();
107
 
1363 mauro 108
        /* keyb_def_map(kparms, KEYMAP_IT);*/
1347 giacomo 109
        keyb_def_ctrlC(kparms, NULL);
1363 mauro 110
 
111
        mouse_def_threshold(mparms, 5);
112
        mouse_def_xmin(mparms, 0);
113
        mouse_def_ymin(mparms, 0);
114
        mouse_def_xmax(mparms, 639);
115
        mouse_def_ymax(mparms, 479);
116
 
1347 giacomo 117
        LINUXC26_register_module();
118
        INPUT26_init();
1363 mauro 119
        MOUSE26_init(&mparms);
1347 giacomo 120
        KEYB26_init(&kparms);
121
        SPEAK26_init();
1363 mauro 122
        JOY26_init();
123
 
1347 giacomo 124
        //sys_atrunlevel(my_close, NULL, RUNLEVEL_BEFORE_EXIT);
125
 
126
        __call_main__(mb);
127
 
128
        return (void *)0;
129
}