Example #1
0
/* Common setup */
int __ansicon_open(struct file_info *fp)
{
    if (!ansicon_counter) {
	/* Are we disabled? */
	if (syslinux_serial_console_info()->flowctl & 0x8000) {
	    ti.disabled = 1;
	    ti.rows = 25;
	    ti.cols = 80;
	} else {
	    /* Force text mode */
	    firmware->o_ops->text_mode();

	    /* Initial state */
	    firmware->o_ops->get_mode(&ti.cols, &ti.rows);
	    __ansi_init(&ti);

	    /* Get cursor shape and position */
	    firmware->o_ops->get_cursor(&ti.ts->xy.x, &ti.ts->xy.y);
	}
    }

    fp->o.rows = ti.rows;
    fp->o.cols = ti.cols;

    ansicon_counter++;
    return 0;
}
Example #2
0
/* Common setup */
int __vesacon_open(struct file_info *fp)
{
    (void)fp;

    if (!vesacon_counter) {
	/* Are we disabled? */
	if (syslinux_serial_console_info()->flowctl & 0x8000) {
	    ti.disabled = 1;
	    ti.rows = 25;
	    ti.cols = 80;
	} else {
	    /* Switch mode */
	    if (__vesacon_init(vesacon_resolution.x, vesacon_resolution.y)) {
		vesacon_counter = -1;
		return EAGAIN;
	    }

	    /* Initial state */
	    __ansi_init(&ti);
	    ti.rows = __vesacon_text_rows;
	    ti.cols = __vesacon_text_cols;
	}
    } else if (vesacon_counter == -1) {
	return EAGAIN;
    }

    fp->o.rows = ti.rows;
    fp->o.cols = ti.cols;

    vesacon_counter++;
    return 0;
}
Example #3
0
/* Common setup */
int __ansicon_open(struct file_info *fp)
{
  static com32sys_t ireg;	/* Auto-initalized to all zero */
  com32sys_t oreg;

  if (!ansicon_counter) {
    /* Are we disabled? */
    if (syslinux_serial_console_info()->flowctl & 0x8000) {
      ti.disabled = 1;
      ti.rows = 25;
      ti.cols = 80;
    } else {
      /* Force text mode */
      ireg.eax.w[0] = 0x0005;
      __intcall(0x22, &ireg, NULL);

      /* Initial state */
      ti.rows = BIOS_ROWS ? BIOS_ROWS+1 : 25;
      ti.cols = BIOS_COLS;
      __ansi_init(&ti);

      /* Get cursor shape and position */
      ireg.eax.b[1] = 0x03;
      ireg.ebx.b[1] = BIOS_PAGE;
      __intcall(0x10, &ireg, &oreg);
      cursor_type = oreg.ecx.w[0];
      ti.ts->xy.x = oreg.edx.b[0];
      ti.ts->xy.y = oreg.edx.b[1];
    }
  }

  fp->o.rows = ti.rows;
  fp->o.cols = ti.cols;

  ansicon_counter++;
  return 0;
}