Esempio n. 1
1
int main(){
    init_serial();
    printk("f**k\n");
    //mem_test();
	blue_screen();
	hlt();
	return 0;
}
Esempio n. 2
0
int
abort(const char *fname, int line) {
	/* 当程序遇到不可恢复的错误时,首先将外部中断关闭以防其他错误发生,
     * 然后显示出错信息后,等待下一个中断到来(实际永远等不到)。*/
	disable_interrupt();
	blue_screen(fname, line);
	while (TRUE) {
		wait_for_interrupt();
	}
}
Esempio n. 3
0
t_anim		*load_anim(char			*paths,
			   int			delay)
{
  char		*p;
  char		*filename;
  t_anim	*anim = NULL;
  int		i;

  if (!paths || !*paths)
    return NULL;

  if (!(anim = malloc(sizeof (t_anim))))
    return NULL;

  anim->nr_img = 1;
  anim->current_img = 0;
  anim->delay = delay;
  anim->jiffies = 0;

  for (p = paths; *p; p++)
    if (*p == ' ')
      anim->nr_img++;

  if (!(anim->imgs = malloc (anim->nr_img * sizeof (t_image))))
    {
      free(anim);
      return NULL;
    }

  p = strdup(paths);

  for (i = 0; i < anim->nr_img; i++)
    {
      filename = p;

      while (*p && *p != ' ')
	p++;

      *p = '\0';
      p++;

      if (!(anim->imgs[i] = load_image(filename)))
	blue_screen("failed to load skater image");
    }

  return anim;
}
Esempio n. 4
0
void			switch_text(void)
{
  if (setvideo(VIDEO_TEXT))
    blue_screen ("Unable to switch to text mode");
  free (offbuffer);
}
Esempio n. 5
0
void			switch_graphic(void)
{
  if (setvideo(VIDEO_GRAPHIC))
    blue_screen ("Unable to switch to graphic mode");
  offbuffer = malloc (FB_SIZE);
}