Example #1
0
/*Initialise the virtual consoles*/
void terminal_vt_init(void) { 
  int i;
  for(i = 0; i < MAX_CONSOLES; ++i) {
    struct term *console = consoles + i;
    #ifndef VESA
    text_init(console);
    #else
    vesa_init(console);
    #endif
  }
}
static int vesa_test(void)
{

    if ((getenv("IOPERM") == NULL) && ((iopl(3) < 0)||(ioperm(0,0x400,1)<0))) {
	printf("svgalib(vesa): Cannot get I/O permissions.\n");
	exit(-1);
    }
    
    lrmi_inited=1;
    __svgalib_LRMI_init();
    vesa_data.info = __svgalib_LRMI_alloc_real(sizeof(struct vbe_info_block)
	 + sizeof(struct vbe_mode_info_block));
    vesa_data.mode = (struct vbe_mode_info_block *)(vesa_data.info + 1);
    vesa_r.eax = 0x4f00;
    vesa_r.es = (unsigned int)vesa_data.info >> 4;
    vesa_r.edi = 0;

    __svgalib_LRMI_int(0x10, &vesa_r);
    if (vesa_r.eax!=0x4f) return 0;
    return !vesa_init(0,0,0);
}