Subversion Repositories shark

Rev

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

Rev Author Line No. Line
1085 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
 ------------
1192 giacomo 21
 CVS :        $Id: pinit.c,v 1.2 2003-10-07 09:30:18 giacomo Exp $
1085 pj 22
 
23
 File:        $File$
1192 giacomo 24
 Revision:    $Revision: 1.2 $
25
 Last update: $Date: 2003-10-07 09:30:18 $
1085 pj 26
 ------------
27
 
28
 This is a minimal initialization file for the PSE51 profile.
29
 
30
 It initializes the POSIX scheduler, the Hartik Ports and the Keyboard driver.
31
 
32
**/
33
 
34
/*
35
 * Copyright (C) 2000 Paolo Gai
36
 *
37
 * This program is free software; you can redistribute it and/or modify
38
 * it under the terms of the GNU General Public License as published by
39
 * the Free Software Foundation; either version 2 of the License, or
40
 * (at your option) any later version.
41
 *
42
 * This program is distributed in the hope that it will be useful,
43
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
44
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
45
 * GNU General Public License for more details.
46
 *
47
 * You should have received a copy of the GNU General Public License
48
 * along with this program; if not, write to the Free Software
49
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
50
 *
51
 */
52
 
53
 
54
 
55
#include "kernel/kern.h"
56
#include "modules/posix.h"
57
#include "modules/dummy.h"
58
 
59
#include "modules/pi.h"
60
#include "modules/pc.h"
61
 
62
#include "modules/sem.h"
63
#include "modules/hartport.h"
64
 
65
#include "drivers/keyb.h"
66
 
67
#include "pthread.h"
68
#include "time.h"
69
 
70
 
71
/*+ sysyem tick in us +*/
72
#define TICK 1000
73
 
74
/*+ RR tick in us +*/
75
#define RRTICK 10000
76
 
77
TIME __kernel_register_levels__(void *arg)
78
{
79
  struct multiboot_info *mb = (struct multiboot_info *)arg;
80
 
81
  POSIX_register_level(RRTICK, POSIX_MAIN_YES, mb, 32);
82
  dummy_register_level();
83
 
84
  PI_register_module();
85
  PC_register_module();
86
 
87
  SEM_register_module();
88
 
89
  /* for the Pthread library */
1192 giacomo 90
  PTHREAD_register_module(0, 0, 1);
1085 pj 91
 
92
  /* for the real time clock extensions */
93
  TIMER_register_module();
94
 
95
  return TICK;
96
}
97
 
98
TASK __init__(void *arg)
99
{
100
  struct multiboot_info *mb = (struct multiboot_info *)arg;
101
  NRT_TASK_MODEL m;   // the scheduling model for the Keyboard
102
 
103
  KEYB_PARMS k = BASE_KEYB;
104
  keyb_def_task(k, &m);
105
 
106
  nrt_task_default_model(m);
107
  nrt_task_def_arg(m,arg);
108
  nrt_task_def_usemath(m);
109
  nrt_task_def_ctrl_jet(m);
110
  nrt_task_def_save_arrivals(m);
111
  nrt_task_def_unjoinable(m);
112
  nrt_task_def_weight(m, sched_get_priority_max(SCHED_RR));
113
  nrt_task_def_policy(m,SCHED_RR);
114
  nrt_task_def_inherit(m,PTHREAD_EXPLICIT_SCHED);
115
  nrt_task_def_nokill(m);
116
  nrt_task_def_system(m);
117
 
118
  HARTPORT_init();
119
 
120
  if (KEYB_init(&k) < 0)
121
    kern_printf("Error during Keyboard Initialization!!!");
122
 
123
  __call_main__(mb);
124
 
125
  return (void *)0;
126
}