Subversion Repositories shark

Rev

Rev 1655 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1655 giacomo 1
#include <drivers/keyb.h>
2
 
3
void ctrlc_exit(KEY_EVT *k)
4
{
5
  extern void dump_sem_table(void);
6
  extern void dump_nop_table(void);
7
  grx_close();
8
  cprintf("CTRL-C pressed!\n");
9
  grx_modeinfo();
10
  sys_end();
11
}
12
 
13
#include <fs/bdevinit.h>
14
#include <fs/fsinit.h>
15
#include <fs/bdev.h>
16
 
17
#include <sys/types.h>
18
#include <sys/mount.h>
19
 
20
int __register_sub_init_prologue(void)
21
{
22
  return 0;
23
}
24
 
25
int __register_sub_init(void)
26
{
27
  return 0;
28
}
29
 
30
dev_t root_device;
31
 
32
int choose_root_callback(dev_t dev,u_int8_t fs)
33
{
34
  if (fs==FS_MSDOS) return dev;
35
  return -1;
36
}
37
 
38
int __bdev_sub_init(void)
39
{
40
  BDEV_PARMS bdev=BASE_BDEV;
41
 
42
  bdev_def_showinfo(bdev,TRUE);
43
  bdev_init(&bdev);
44
 
45
  root_device=bdev_scan_devices(choose_root_callback);
46
  if (root_device<0) {
47
    cprintf("can't find root device to mount on /!!!\n");
48
    sys_end();
49
    return -1;
50
  }
51
 
52
  return 0;
53
}
54
 
55
extern int libc_initialize(void);
56
 
57
int __fs_sub_init(void)
58
{
59
  FILESYSTEM_PARMS fs=BASE_FILESYSTEM;
60
  //struct mount_opts opts;
61
 
62
  //memset(&opts,0,sizeof(struct mount_opts));
63
  //opts.flags=MOUNT_FLAG_RW;
64
 
65
  filesystem_def_rootdevice(fs,root_device);
66
  filesystem_def_fs(fs,FS_MSDOS);
67
  filesystem_def_showinfo(fs,TRUE);
68
  filesystem_init(&fs);
69
 
70
  libc_initialize();
71
 
72
  return 0;
73
}
74