Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1663 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: initfile.c,v 1.1 2004-07-05 14:17:17 pj Exp $
22
 
23
 File:        $File$
24
 Revision:    $Revision: 1.1 $
25
 Last update: $Date: 2004-07-05 14:17:17 $
26
 ------------
27
**/
28
 
29
/*
30
 * Copyright (C) 2001 Paolo Gai
31
 *
32
 * This program is free software; you can redistribute it and/or modify
33
 * it under the terms of the GNU General Public License as published by
34
 * the Free Software Foundation; either version 2 of the License, or
35
 * (at your option) any later version.
36
 *
37
 * This program is distributed in the hope that it will be useful,
38
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
39
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
40
 * GNU General Public License for more details.
41
 *
42
 * You should have received a copy of the GNU General Public License
43
 * along with this program; if not, write to the Free Software
44
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
45
 *
46
 */
47
 
48
#include "kernel/kern.h"
49
 
50
#include "modules/rr.h"
51
#include "modules/rr2.h"
52
#include "modules/dummy.h"
53
 
54
#include "modules/sem.h"
55
#include "modules/hartport.h"
56
 
57
#include "drivers/keyb.h"
58
 
59
#include "valmodel.h"
60
 
61
/*+ sysyem tick in us +*/
62
#define TICK 0
63
 
64
/*+ RR tick in us +*/
65
#define RRTICK 10000
66
 
67
int argc;
68
char *argv[100];
69
 
70
void read_myfile(char *name);
71
 
72
int main(int argc, char **argv);
73
 
74
TIME __kernel_register_levels__(void *arg)
75
{
76
  struct multiboot_info *mb = (struct multiboot_info *)arg;
77
 
78
  clear();
79
 
80
  RR2_register_level(RRTICK, RR2_MAIN_NO, mb);
81
  crunch_register_models(mb);
82
  RR_register_level(RRTICK, RR_MAIN_YES, mb);
83
  dummy_register_level();
84
 
85
  SEM_register_module();
86
 
87
  __compute_args__(mb, &argc, argv);
88
 
89
  if (argc == 2)
90
    read_myfile(argv[1]);
91
 
92
  return TICK;
93
}
94
 
95
NRT_TASK_MODEL keyb_model;
96
 
97
TASK __init__(void *arg)
98
{
99
  KEYB_PARMS kparms = BASE_KEYB;
100
 
101
  HARTPORT_init();
102
 
103
  nrt_task_default_model(keyb_model);
104
  nrt_task_def_system(keyb_model);
105
  nrt_task_def_nokill(keyb_model);
106
  keyb_def_task(kparms,(TASK_MODEL *)&keyb_model);
107
  KEYB_init(&kparms);
108
 
109
  if (argc == 2)
110
    main(argc,argv);
111
  else
112
    cprintf("Usage: x imagefile conffile\n");
113
 
114
  return (void *)0;
115
}
116