Subversion Repositories shark

Rev

Rev 1625 | Blame | Compare with Previous | Last modification | View Log | RSS feed


#include <kernel/func.h>

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

#include <drivers/keyb.h>

#include <sys/mount.h>

#include <fcntl.h>
#include <unistd.h>
#include <errno.h>

/* -- */

int __register_sub_init(void)
{
  return 0;
}

/* -- */

int __bdev_sub_init(void)
{
  BDEV_PARMS bdev=BASE_BDEV;
 
  bdev_def_showinfo(bdev,TRUE);
  bdev_init(&bdev);

  return 0;
}

/* -- */

void ctrlc_exit(KEY_EVT *k)
{
  cprintf("CTRL-C pressed!\n");
  exit(1);
}

/* -- */

void showmessage(char *s)
{
  cputs(s);
  cprintf("Press [x] to begin...");
  while (keyb_getchar()!='x');
  cprintf("\n");
}

void waitend(void)
{
  int c;
  cprintf("Press [x] to exit...");
  while ((c=keyb_getchar())!='x');
  cprintf("\n");
}

/* -- */

void debug_dump_buffer(char *buf, int size)
{
  int i;
  for (i=0;i<size;i++) {
    if (i%16==0) {
      if (i!=0) cprintf("\n");
      cprintf("%04x: ",i);
    }
    cprintf("%02x ",(unsigned char)*(buf+i));
  }
  cprintf("\n");
}