Subversion Repositories shark

Rev

Rev 1624 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1624 giacomo 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
  cprintf("CTRL-C pressed!\n");
40
  sys_end();
41
}
42
 
43
/* -- */
44
 
45
void showmessage(char *s)
46
{
47
  cputs(s);
48
  cprintf("Press [x] to begin...");
49
  while (keyb_getchar()!='x');
50
  cprintf("\n");
51
}
52
 
53
void waitend(void)
54
{
55
  int c;
56
  cprintf("Press [x] to exit...");
57
  while ((c=keyb_getchar())!='x');
58
  cprintf("\n");
59
}
60
 
61
/* -- */
62
 
63
void debug_dump_buffer(char *buf, int size)
64
{
65
  int i;
66
  for (i=0;i<size;i++) {
67
    if (i%16==0) {
68
      if (i!=0) cprintf("\n");
69
      cprintf("%04x: ",i);
70
    }
71
    cprintf("%02x ",(unsigned char)*(buf+i));
72
  }
73
  cprintf("\n");
74
}