Subversion Repositories shark

Rev

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

Rev Author Line No. Line
1085 pj 1
 
2
#include <kernel/func.h>
3
 
4
#include <fs/bdevinit.h>
5
#include <fs/fsinit.h>
6
#include <fs/bdev.h>
7
 
8
#include <drivers/keyb.h>
9
 
10
#include <sys/mount.h>
11
 
12
#include <fcntl.h>
13
#include <unistd.h>
14
#include <errno.h>
15
 
16
/* -- */
17
 
18
int __register_sub_init(void)
19
{
20
  return 0;
21
}
22
 
23
/* -- */
24
 
25
int __bdev_sub_init(void)
26
{
27
  BDEV_PARMS bdev=BASE_BDEV;
28
 
29
  bdev_def_showinfo(bdev,TRUE);
30
  bdev_init(&bdev);
31
 
32
  return 0;
33
}
34
 
35
/* -- */
36
 
37
void ctrlc_exit(KEY_EVT *k)
38
{
39
  //sys_status(SCHED_STATUS);
40
  cprintf("CTRL-C pressed!\n");
41
  sys_end();
42
}
43
 
44
/* -- */
45
 
46
void showmessage(char *s)
47
{
48
  cputs(s);
49
  cprintf("Press [x] to begin...");
50
  while (keyb_getchar()!='x');
51
  cprintf("\n");
52
}
53
 
54
void waitend(void)
55
{
56
  int c;
57
  cprintf("Press [x] to exit...");
58
  while ((c=keyb_getchar())!='x');
59
  cprintf("\n");
60
}
61
 
62
/* -- */
63
 
64
void debug_dump_buffer(char *buf, int size)
65
{
66
  int i;
67
  for (i=0;i<size;i++) {
68
    if (i%16==0) {
69
      if (i!=0) cprintf("\n");
70
      cprintf("%04x: ",i);
71
    }
72
    cprintf("%02x ",(unsigned char)*(buf+i));
73
  }
74
  cprintf("\n");
75
}