Subversion Repositories shark

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

/*
 * Project: HARTIK (HA-rd R-eal TI-me K-ernel)
 *
 * Coordinators: Giorgio Buttazzo <giorgio@sssup.it>
 *               Gerardo Lamastra <gerardo@sssup.it>
 *
 * Authors     : Massimiliano Giorgi <massy@hartik.sssup.it>
 * (see authors.txt for full list of hartik's authors)
 *
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
 *
 * http://www.sssup.it
 * http://retis.sssup.it
 * http://hartik.sssup.it
 */


/*
 * Copyright (C) 2000 Massimiliano Giorgi
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */


/*
 * CVS :        $Id: simple.c,v 1.1.1.1 2002-09-02 09:37:48 pj Exp $
 *
 * File:        $File$
 * Revision:    $Revision: 1.1.1.1 $
 * Last update: $Date: 2002-09-02 09:37:48 $
 */


/*
 * Example of simple tracer initialization.
 */


#include <ll/i386/cons.h>

#include <kernel/func.h>
#include <kernel/trace.h>

#include <fs/bdevinit.h>
#include <fs/fsinit.h>
#include <fs/bdev.h>

#include <drivers/keyb.h>

#include <trace/trace.h>

#include <sys/mount.h>
#include <stddef.h>

#define ROOTDEVICE "ide/hda2"

int __register_sub_init_prologue(void)
{
  int res;
 
  /* tracer initialization phase 1 */
  res=TRC_init_phase1_standard();
  if (res!=0) {
    cprintf("tracer initialization error (%i)!!!\n",res);
    sys_end();
    return -1;
  }
 
  return 0;
}

int __register_sub_init(void)
{
  return 0;
}

__dev_t root_device;

int __bdev_sub_init(void)
{
  /* block device initialization */
  bdev_init(NULL);

  /* choose root device */
  root_device=bdev_find_byname(ROOTDEVICE);
  if (root_device<0) {
    cprintf("can't find root device to mount on /!!!\n");
    sys_end();
    return -1;
  }

  return 0;
}

int __fs_sub_init(void)
{
  FILESYSTEM_PARMS fs=BASE_FILESYSTEM;
  extern int libc_initialize(void);

  /* filesystems initialization */
  filesystem_def_rootdevice(fs,root_device);
  filesystem_def_fs(fs,FS_MSDOS);
  filesystem_def_showinfo(fs,FALSE);
  filesystem_init(&fs);

  /* libC initialization */
  libc_initialize();

  /* tracer initialization phase 2 */
  TRC_init_phase2_standard();
  return 0;
}

void ctrlc_exit(KEY_EVT *k)
{
  sys_end();
}

int main(int argc,char *argv[])
{
  cprintf("\nSimple hello world (with tracer)!\n\n");
  return 0;
}