Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1085 pj 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     : Massimiliano Giorgi <massy@hartik.sssup.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 Massimiliano Giorgi
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
/*
37
 * CVS :        $Id: simple.c,v 1.1.1.1 2002-09-02 09:37:48 pj Exp $
38
 *
39
 * File:        $File$
40
 * Revision:    $Revision: 1.1.1.1 $
41
 * Last update: $Date: 2002-09-02 09:37:48 $
42
 */
43
 
44
/*
45
 * Example of simple tracer initialization.
46
 */
47
 
48
#include <ll/i386/cons.h>
49
 
50
#include <kernel/func.h>
51
#include <kernel/trace.h>
52
 
53
#include <fs/bdevinit.h>
54
#include <fs/fsinit.h>
55
#include <fs/bdev.h>
56
 
57
#include <drivers/keyb.h>
58
 
59
#include <trace/trace.h>
60
 
61
#include <sys/mount.h>
62
#include <stddef.h>
63
 
64
#define ROOTDEVICE "ide/hda2"
65
 
66
int __register_sub_init_prologue(void)
67
{
68
  int res;
69
 
70
  /* tracer initialization phase 1 */
71
  res=TRC_init_phase1_standard();
72
  if (res!=0) {
73
    cprintf("tracer initialization error (%i)!!!\n",res);
74
    sys_end();
75
    return -1;
76
  }
77
 
78
  return 0;
79
}
80
 
81
int __register_sub_init(void)
82
{
83
  return 0;
84
}
85
 
86
__dev_t root_device;
87
 
88
int __bdev_sub_init(void)
89
{
90
  /* block device initialization */
91
  bdev_init(NULL);
92
 
93
  /* choose root device */
94
  root_device=bdev_find_byname(ROOTDEVICE);
95
  if (root_device<0) {
96
    cprintf("can't find root device to mount on /!!!\n");
97
    sys_end();
98
    return -1;
99
  }
100
 
101
  return 0;
102
}
103
 
104
int __fs_sub_init(void)
105
{
106
  FILESYSTEM_PARMS fs=BASE_FILESYSTEM;
107
  extern int libc_initialize(void);
108
 
109
  /* filesystems initialization */
110
  filesystem_def_rootdevice(fs,root_device);
111
  filesystem_def_fs(fs,FS_MSDOS);
112
  filesystem_def_showinfo(fs,FALSE);
113
  filesystem_init(&fs);
114
 
115
  /* libC initialization */
116
  libc_initialize();
117
 
118
  /* tracer initialization phase 2 */
119
  TRC_init_phase2_standard();
120
  return 0;
121
}
122
 
123
void ctrlc_exit(KEY_EVT *k)
124
{
125
  sys_end();
126
}
127
 
128
int main(int argc,char *argv[])
129
{
130
  cprintf("\nSimple hello world (with tracer)!\n\n");
131
  return 0;
132
}