Example #1
0
File: tty.c Project: fchai/cnix
int getc (void)
    {
    struct bioscall_para para;

    init_bioscall_para (&para);
    bioscall (0x16, &para);

    return (int) para.al;
    }
Example #2
0
/*
 * We can obtain the information about MCA bus presence via
 * GET CONFIGURATION BIOS call - int 0x15, function 0xc0.
 * The call returns a pointer to memory place with the configuration block
 * in es:bx (on AT-compatible, e.g. all we care about, computers).
 *
 * Configuration block contains block length (2 bytes), model
 * number (1 byte), submodel number (1 byte), BIOS revision
 * (1 byte) and up to 5 feature bytes. We only care about
 * first feature byte.
 */
void
mca_busprobe(void)
{
	struct bioscallregs regs;
	struct bios_config *scp;
	paddr_t             paddr;
	char buf[80];

	memset(&regs, 0, sizeof(regs));
	regs.AH = 0xc0;
	bioscall(0x15, &regs);

	if ((regs.EFLAGS & PSL_C) || regs.AH != 0) {
		aprint_verbose("BIOS CFG: Not supported. Not AT-compatible?\n");
		return;
	}

	paddr = (regs.ES << 4) + regs.BX;
	scp = (struct bios_config *)ISA_HOLE_VADDR(paddr);

	bitmask_snprintf((scp->feature2 << 8) | scp->feature1,
		"\20"
		"\01MCA+ISA"
		"\02MCA"
		"\03EBDA"
		"\04WAITEV"
		"\05KBDINT"
		"\06RTC"
		"\07IC2"
		"\010DMA3B"
		"\011res"
		"\012DSTR"
		"\013n8042"
		"\014CPUF"
		"\015MMF"
		"\016GPDF"
		"\017KBDF"
		"\020DMA32\n",
		buf, sizeof(buf));

	aprint_verbose("BIOS CFG: Model-SubM-Rev: %02x-%02x-%02x, 0x%s\n",
		scp->model, scp->submodel, scp->bios_rev, buf);

	MCA_system = (scp->feature1 & FEATURE_MCABUS) ? 1 : 0;
}
Example #3
0
File: tty.c Project: fchai/cnix
int putc (char ch)
    {
    struct bioscall_para para;
    int    n = 0;

    if (ch == '\n')
        n += putc ('\r');

    init_bioscall_para (&para);

    para.ah = 0xe;
    para.al = ch;
    para.bx = 7;
    para.cx = 1;

    bioscall (0x10, &para);

    return n + 1;
    }