Пример #1
0
/*
 * consinit:
 * initialize the system console.
 * XXX - shouldn't deal with this initted thing, but then,
 * it shouldn't be called from init386 either.
 */
void
consinit(void)
{
	static int initted = 0;
	union xen_cmdline_parseinfo xcp;

	if (initted) {
		return;
	}
	initted = 1;
	xen_parse_cmdline(XEN_PARSE_CONSOLE, &xcp);
	
#if (NVGA > 0)
	if (xendomain_is_privileged()) {
#ifdef CONS_OVERRIDE
		if (strcmp(default_consinfo.devname, "tty0") == 0 ||
		    strcmp(default_consinfo.devname, "pc") == 0) {
#else
		if (strcmp(xcp.xcp_console, "tty0") == 0 || /* linux name */
		    strcmp(xcp.xcp_console, "pc") == 0) { /* NetBSD name */
#endif /* CONS_OVERRIDE */
			int error;
			vga_cnattach(x86_bus_space_io, x86_bus_space_mem,
			    -1, 1);
			error = ENODEV;
#if (NPCKBC > 0)
			error = pckbc_cnattach(x86_bus_space_io, IO_KBD, KBCMDP,
			    PCKBC_KBD_SLOT, 0);
#endif
#if (NUKBD > 0)
			if (error)
				error = ukbd_cnattach();
#endif
			if (error)
				printf("WARNING: no console keyboard, "
				    "error=%d\n", error);
			return;
		}
	}
#endif /* NVGA */
#if NXENCONS > 0
	xenconscn_attach();
	return;
#endif /* NXENCONS */
	panic("consinit: no console");
}

#ifdef KGDB
void
kgdb_port_init(void)
{
#if (NCOM > 0)
	if(!strcmp(kgdb_devname, "com")) {
		bus_space_tag_t tag = x86_bus_space_io;

		com_kgdb_attach(tag, comkgdbaddr, comkgdbrate, COM_FREQ, 
		    COM_TYPE_NORMAL, comkgdbmode);
	}
#endif
}
Пример #2
0
int
vga_jazzio_cnattach(char *name)
{
	bus_space_tag_t iot, memt;

	if (vga_jazzio_init_tag(name, &iot, &memt))
		return ENXIO;
	return vga_cnattach(iot, memt, WSDISPLAY_TYPE_JAZZVGA, 1);
}
Пример #3
0
/*
 * consinit:
 * initialize the system console.
 * XXX - shouldn't deal with this initted thing, but then,
 * it shouldn't be called from init_x86_64 either.
 */
void
consinit()
{
    const struct btinfo_console *consinfo;
    static int initted;

    if (initted)
        return;
    initted = 1;

#ifndef CONS_OVERRIDE
    consinfo = lookup_bootinfo(BTINFO_CONSOLE);
    if (!consinfo)
#endif
        consinfo = &default_consinfo;

#if (NPC > 0) || (NVGA > 0) || (NEGA > 0) || (NPCDISPLAY > 0)
    if (!strcmp(consinfo->devname, "pc")) {
#if (NVGA > 0)
        if (!vga_cnattach(X86_64_BUS_SPACE_IO, X86_64_BUS_SPACE_MEM,
                          -1, 1))
            goto dokbd;
#endif
#if (NEGA > 0)
        if (!ega_cnattach(X86_64_BUS_SPACE_IO, X86_64_BUS_SPACE_MEM))
            goto dokbd;
#endif
#if (NPCDISPLAY > 0)
        if (!pcdisplay_cnattach(X86_64_BUS_SPACE_IO, X86_64_BUS_SPACE_MEM))
            goto dokbd;
#endif
#if (NPC > 0)
        pccnattach();
#endif
        if (0) goto dokbd; /* XXX stupid gcc */
dokbd:
#if (NPCKBC > 0)
        pckbc_cnattach(X86_64_BUS_SPACE_IO, IO_KBD, KBCMDP,
                       PCKBC_KBD_SLOT);
#endif
        return;
    }
#endif /* PC | VT | VGA | PCDISPLAY */
#if (NCOM > 0)
    if (!strcmp(consinfo->devname, "com")) {
        bus_space_tag_t tag = X86_64_BUS_SPACE_IO;

        if (comcnattach(tag, consinfo->addr, consinfo->speed,
                        COM_FREQ, comcnmode))
            panic("can't init serial console @%x", consinfo->addr);

        return;
    }
#endif
    panic("invalid console device %s", consinfo->devname);
}
Пример #4
0
/*
 * Configure the display part of the console.
 */
void
wscn_video_init()
{
#if (NVGA > 0)
	if (vga_cnattach(X86_BUS_SPACE_IO, X86_BUS_SPACE_MEM, -1, 1) == 0)
		return;
#endif
#if (NPCDISPLAY > 0)
	if (pcdisplay_cnattach(X86_BUS_SPACE_IO, X86_BUS_SPACE_MEM) == 0)
		return;
#endif
}
Пример #5
0
void
wscninit(struct consdev *cp)
{
static int initted;

	if (initted)
		return;

	initted = 1;

	if (!vga_cnattach(&sys_config.pci_io[0], &sys_config.pci_mem[0],
	    WSDISPLAY_TYPE_PCIVGA, 1)) {
		ukbd_cnattach();
	}
	return;
}
Пример #6
0
int
vga_isa_cnattach(bus_space_tag_t iot, bus_space_tag_t memt)
{

    return (vga_cnattach(iot, memt, WSDISPLAY_TYPE_ISAVGA, 1));
}
Пример #7
0
/*
 * consinit:
 * initialize the system console.
 * XXX - shouldn't deal with this initted thing, but then,
 * it shouldn't be called from init386 either.
 */
void
consinit(void)
{
	const struct btinfo_console *consinfo;
#if (NGENFB > 0)
	const struct btinfo_framebuffer *fbinfo;
#endif
	static int initted;
#if (NCOM > 0)
	int rv;
#endif

	if (initted)
		return;
	initted = 1;

#ifndef CONS_OVERRIDE
	consinfo = lookup_bootinfo(BTINFO_CONSOLE);
	if (!consinfo)
#endif
		consinfo = &default_consinfo;

#if (NGENFB > 0)
	fbinfo = lookup_bootinfo(BTINFO_FRAMEBUFFER);
#endif

	if (!strcmp(consinfo->devname, "pc")) {
		int error;
#if (NGENFB > 0)
		if (fbinfo && fbinfo->physaddr > 0) {
			if (x86_genfb_cnattach() == -1) {
				initted = 0;	/* defer */
				return;
			}
			genfb_cnattach();
			goto dokbd;
		}
		genfb_disable();
#endif
#if (NVGA > 0)
		if (!vga_cnattach(x86_bus_space_io, x86_bus_space_mem,
				  -1, 1))
			goto dokbd;
#endif
#if (NEGA > 0)
		if (!ega_cnattach(x86_bus_space_io, x86_bus_space_mem))
			goto dokbd;
#endif
#if (NPCDISPLAY > 0)
		if (!pcdisplay_cnattach(x86_bus_space_io, x86_bus_space_mem))
			goto dokbd;
#endif
		if (0) goto dokbd; /* XXX stupid gcc */
dokbd:
		error = ENODEV;
#if (NPCKBC > 0)
		error = pckbc_cnattach(x86_bus_space_io, IO_KBD, KBCMDP,
		    PCKBC_KBD_SLOT, 0);
#endif
#if (NUKBD > 0)
		if (error)
			error = ukbd_cnattach();
#endif
		if (error)
			printf("WARNING: no console keyboard, error=%d\n",
			       error);
		return;
	}
#if (NCOM > 0)
	if (!strcmp(consinfo->devname, "com")) {
		int addr = consinfo->addr;
		int speed = consinfo->speed;

#if (NCOM_PUC > 0) && defined(PUC_CNAUTO)
		puc_cnprobe(NULL);
		rv = puc_cninit(NULL);
		if (rv == 0)
			return;
#endif

		if (addr == 0)
			addr = CONADDR;
		if (speed == 0)
			speed = CONSPEED;

		rv = comcnattach(x86_bus_space_io, addr, speed,
				 COM_FREQ, COM_TYPE_NORMAL, comcnmode);
		if (rv != 0)
			panic("can't init serial console @%x", consinfo->addr);
		return;
	}
#endif
	panic("invalid console device %s", consinfo->devname);
}
Пример #8
0
/*
 * consinit
 * Initialize system console.
 */
void
consinit(void)
{
	struct btinfo_console *consinfo;
	static int initted = 0;
#if (NGTEN > 0)
	struct prep_pci_chipset pc;
#endif

	if (initted)
		return;
	initted = 1;

	consinfo = (struct btinfo_console *)lookup_bootinfo(BTINFO_CONSOLE);
	if (!consinfo)
		panic("not found console information in bootinfo");

#if (NPFB > 0)
	if (!strcmp(consinfo->devname, "fb")) {
		pfb_cnattach(consinfo->addr);
#if (NPCKBC > 0)
		pckbc_cnattach(&genppc_isa_io_space_tag, IO_KBD, KBCMDP,
		    PCKBC_KBD_SLOT);
#endif
		return;
	}
#endif

#if (NVGA > 0) || (NGTEN > 0)
	if (!strcmp(consinfo->devname, "vga")) {
#if (NGTEN > 0)
		prep_pci_get_chipset_tag(&pc);
#endif
#if (NGTEN > 0)
		if (!gten_cnattach(&pc, &prep_mem_space_tag))
			goto dokbd;
#endif
#if (NVGA > 0)
		if (!vga_cnattach(&prep_io_space_tag, &prep_mem_space_tag,
				-1, 1))
			goto dokbd;
#endif
dokbd:
#if (NPCKBC > 0)
		pckbc_cnattach(&genppc_isa_io_space_tag, IO_KBD, KBCMDP,
		    PCKBC_KBD_SLOT);
#endif
		return;
	}
#endif /* VGA | GTEN */

#if (NCOM > 0)
	if (!strcmp(consinfo->devname, "com")) {
		bus_space_tag_t tag = &genppc_isa_io_space_tag;

		if(comcnattach(tag, consinfo->addr, consinfo->speed, COM_FREQ,
		    COM_TYPE_NORMAL,
		    ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8)))
			panic("can't init serial console");

		return;
	}
#endif
	panic("invalid console device %s", consinfo->devname);
}