uml/xen: make the vt subsystem a runtime option
Subsystems (7)
PATCH 1/2 uml/xen: make the vt subsystem a runtime option
Hi,
This patch enables the VT console to be disabled at runtime even if it is built into the kernel. The UML framebuffer driver (patch follows) depends on this. Xen will need that one too.
please apply,
Gerd
Subject: [patch] xen vt runtime
From: Ian Pratt <[email protected]>
This patch enables the VT console to be disabled at runtime even if it is built into the kernel. Arch xen needs this to avoid trying to initialise a VT in virtual machine that doesn't have access to the console hardware.
drivers/char/tty_io.c +6 -1
@@ -132,6 +132,8 @@ LIST_HEAD(tty_drivers); /* linked listvt.c for deeply disgusting hack reasons */ DECLARE_MUTEX (tty_sem); +int console_use_vt =1 ; +#ifdef CONFIG_UNIX98_PTYS extern struct tty_driver *ptm_driver;/* Unix98 pty masters; for /dev/ptmx */ extern int pty_limit;/* Config limit on Unix98 ptys */
@@ -1825,7 +1827,7 @@ retry_open: goto got_driver; }#ifdef CONFIG_VT -if (device ==MKDEV (TTY_MAJOR ,0 )) { +if (console_use_vt && device ==MKDEV (TTY_MAJOR ,0 )) {extern struct tty_driver *console_driver; driver = console_driver; index = fg_console;
@@ -3014,6 +3016,8 @@ static int __init tty_init(void)#endif #ifdef CONFIG_VT +if (!console_use_vt) + goto out_vt;cdev_init (&vc0_cdev, &console_fops);if (cdev_add (&vc0_cdev,MKDEV (TTY_MAJOR ,0 ),1 ) ||register_chrdev_region (MKDEV (TTY_MAJOR ,0 ),1 ,"/dev/vc/0" ) <0 )
@@ -3022,6 +3026,7 @@ static int __init tty_init(void)class_device_create (tty_class,NULL ,MKDEV (TTY_MAJOR ,0 ),NULL ,"tty0" );vty_init (); + out_vt:#endif return 0 ; }
PATCH 2/2 uml: Framebuffer driver for UML
Hi,
$subject says pretty much all: This adds a framebuffer driver for UML.
Output is rendered into an X11 window, X11 keyboard and mouse events are forwarded to the input system. The patch also enables several subsystems for UML (fb, input) which are needed for a working framebuffer console.
The driver is activated by "x11=<width>x<height>@<fps>" on the kernel commane line. width and height specify the size of the window and thus of the virtual framebuffer. fps is the update rate in frames per second (maximum rate, only hit if there are frequent screen updates ...).
please apply,
Gerd
Subject: [patch] uml: x11 fb
From: [email protected]
Framebuffer driver for UML
arch/um/Kconfig +10 -0
@@ -121,6 +121,16 @@ config NET recommended to read the NET-HOWTO, available from <http://www.tldp.org/docs.html#howto>. +source "drivers/input/Kconfig" +source "drivers/char/Kconfig" +source "drivers/video/Kconfig" + +config X11_FB + bool "X11 Framebuffer driver" + depends on FB && !MODE_TT && !STATIC_LINK + select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT source "fs/Kconfig.binfmt"
arch/um/drivers/Makefile +2 -0
@@ -16,6 +16,7 @@ hostaudio-objs := hostaudio_kern.o ubd-objs := ubd_kern.o ubd_user.o port-objs := port_kern.o port_user.o harddog-objs := harddog_kern.o harddog_user.o +x11-objs := x11_kern.o x11_user.o LDFLAGS_pcap.o := -r $(shell $(CC) $(CFLAGS) -print-file-name=libpcap.a)
@@ -48,6 +49,7 @@ obj-$(CONFIG_NULL_CHAN) += null.o obj-$(CONFIG_PORT_CHAN) += port.o obj-$(CONFIG_PTY_CHAN) += pty.o obj-$(CONFIG_TTY_CHAN) += tty.o +obj-$(CONFIG_X11_FB) += x11.o obj-$(CONFIG_XTERM_CHAN) += xterm.o xterm_kern.o obj-$(CONFIG_UML_WATCHDOG) += harddog.o obj-$(CONFIG_BLK_DEV_COW_COMMON) += cow_user.o
arch/um/drivers/x11_kern.c new file +549 -0
549 lines not on this page · raw message
arch/um/drivers/x11_user.c new file +514 -0
514 lines not on this page · raw message
arch/um/include/x11_kern.h new file +9 -0
@@ -0,0 +1,9 @@ +/* x11_kern */ + +struct x11_window ; +struct x11_kerndata ; + +void x11_kbd_input (struct x11_kerndata *kd,int key,int down); +void x11_mouse_input (struct x11_kerndata *kd,int key,int down, +int x,int y); +void x11_cad (struct x11_kerndata *kd);
arch/um/include/x11_user.h new file +15 -0
@@ -0,0 +1,15 @@ +/* x11_user */ + +struct x11_window ; +struct x11_kerndata ; + +struct x11_window *x11_open (int width,int height); +void x11_close (struct x11_window *win); +int x11_has_data (struct x11_window *win,struct x11_kerndata *kd); +int x11_blit_fb (struct x11_window *win,int y1,int y2); + +int x11_get_fd (struct x11_window *win); +struct fb_fix_screeninfo *x11_get_fix (struct x11_window *win); +struct fb_var_screeninfo *x11_get_var (struct x11_window *win); +void *x11_get_fbmem (struct x11_window *win); +
arch/um/kernel/um_arch.c +14 -8
@@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2000, 2002 Jeff Dike ([email protected]) * Licensed under the GPL */
@@ -14,6 +14,7 @@#include "linux/bootmem.h" #include "linux/spinlock.h" #include "linux/utsname.h" +#include "linux/console.h" #include "linux/sysrq.h" #include "linux/seq_file.h" #include "linux/delay.h"
@@ -58,7 +59,7 @@ static void add_arg(char *arg)strcat (command_line, arg); } -struct cpuinfo_um boot_cpu_data = { +struct cpuinfo_um boot_cpu_data = { .loops_per_jiffy =0 , .ipi_pipe = {-1 ,-1 } };
@@ -148,20 +149,20 @@ void set_cmdline(char *cmd) umid =get_umid (1 );if (umid !=NULL ){ -snprintf (argv1_begin, - (argv1_end - argv1_begin) *sizeof (*ptr), +snprintf (argv1_begin, + (argv1_end - argv1_begin) *sizeof (*ptr),"(%s) " , umid); ptr = &argv1_begin[strlen (argv1_begin)]; }else ptr = argv1_begin;snprintf (ptr, (argv1_end - ptr) *sizeof (*ptr),"[%s]" , cmd); -memset (argv1_begin +strlen (argv1_begin),'\0' , +memset (argv1_begin +strlen (argv1_begin),'\0' , argv1_end - argv1_begin -strlen (argv1_begin));#endif } -static char *usage_string = +static char *usage_string ="User Mode Linux v%s\n" " available at http://user-mode-linux.sourceforge.net/\n\n" ;
@@ -206,7 +207,7 @@ static int __init uml_ncpus_setup(char *__uml_setup ("ncpus=" , uml_ncpus_setup,"ncpus=<# of desired CPUs>\n" -" This tells an SMP kernel how many virtual processors to start.\n\n" +" This tells an SMP kernel how many virtual processors to start.\n\n" );#endif
@@ -387,7 +388,7 @@ int linux_main(int argc, char **argv) argv1_begin = argv[1 ]; argv1_end = &argv[1 ][strlen (argv[1 ])];#endif - + highmem =0 ; iomem_size = (iomem_size +PAGE_SIZE -1 ) &PAGE_MASK ; max_physmem =get_kmem_end () - uml_physmem - iomem_size -MIN_VMALLOC ;
@@ -456,6 +457,8 @@ static struct notifier_block panic_exit_ .priority = 0 }; +extern int console_use_vt;/* FIXME */ +void __init setup_arch (char **cmdline_p) {notifier_chain_register (&panic_notifier_list, &panic_exit_notifier);
@@ -463,6 +466,9 @@ void __init setup_arch(char **cmdline_p)strlcpy (saved_command_line, command_line,COMMAND_LINE_SIZE ); *cmdline_p = command_line;setup_hostinfo (); +#if defined(CONFIG_DUMMY_CONSOLE ) + console_use_vt =0 ; +#endif }void __init check_bugs (void )
drivers/video/fbmem.c +4 -0
@@ -1182,12 +1182,16 @@ fb_mmap(struct file *file, struct vm_are vma->vm_page_prot =pgprot_writecombine (vma->vm_page_prot); else vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); +#elif defined(CONFIG_UML ) +/* nothing */ #else #warning What do we have to do here??#endif +#ifndef CONFIG_UML if (io_remap_pfn_range (vma, vma->vm_start, off >>PAGE_SHIFT , vma->vm_end - vma->vm_start, vma->vm_page_prot))return -EAGAIN ; +#endif #endif /* !__sparc_v9__ */ return 0 ;#endif /* !sparc32 */
include/asm-um/irq.h +2 -1
@@ -15,8 +15,9 @@#define SIGIO_WRITE_IRQ 11#define TELNETD_IRQ 12#define XTERM_IRQ 13 +#define X11_IRQ 14 -#define LAST_IRQ XTERM_IRQ +#define LAST_IRQ X11_IRQ#define NR_IRQS (LAST_IRQ + 1)#endif
drivers/char/Kconfig +1 -1
@@ -59,7 +59,7 @@ config VT_CONSOLE config HW_CONSOLE bool - depends on VT && !S390 && !UML + depends on VT && !S390 default y config SERIAL_NONSTANDARD
arch/um/Makefile +11 -1
@@ -126,12 +126,22 @@ CPPFLAGS_vmlinux.lds = -U$(SUBARCH) \ #The wrappers will select whether using "malloc" or the kernel allocator. LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc +ifeq ($(SUBARCH),x86_64) + libdir = lib64 +else + libdir = lib +endif +UML_LIBS := -L/usr/$(libdir) -lutil +ifeq ($(CONFIG_X11_FB),y) +UML_LIBS += -L/usr/X11R6/$(libdir) -lX11 -lXext +endif + CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) define cmd_vmlinux__ $(CC) $(CFLAGS_vmlinux) -o $@ \ -Wl,-T,$(vmlinux-lds) $(vmlinux-init) \ -Wl,--start-group $(vmlinux-main) -Wl,--end-group \ - -lutil \ + $(UML_LIBS) \ $(filter-out $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) \ FORCE ,$^) ; rm -f linux endef
Re: [patch 2/2] uml: Framebuffer driver for UML
Quoted 5 lines · Gerd Knorr
$subject says pretty much all: This adds a framebuffer driver for UML.
please apply,
Gerd
Please don't. This patch fails to link for me in -rc5 - the errors start like
drivers/built-in.o(.text+0x18b): In function `vgacon_deinit':/home/jdike/linux/2.6/linux-2.6.15/drivers/video/console/vgacon.c:151: undefined reference to outw' drivers/built-in.o(.text+0x1a7):/home/jdike/linux/2.6/linux-2.6.15/drivers/video/console/vgacon.c:152: undefined reference to outw' drivers/built-in.o(.text+0x366): In function `vgacon_set_cursor_size':/home/jdike/linux/2.6/linux-2.6.15/drivers/video/console/vgacon.c:430: undefined reference to outb_p' drivers/built-in.o(.text+0x375):/home/jdike/linux/2.6/linux-2.6.15/drivers/video/console/vgacon.c:431: undefined reference to inb_p' drivers/built-in.o(.text+0x396):/home/jdike/linux/2.6/linux-2.6.15/drivers/video/console/vgacon.c:432: undefined reference to outb_p' drivers/built-in.o(.text+0x3a5):/home/jdike/linux/2.6/linux-2.6.15/drivers/video/console/vgacon.c:433: undefined reference to inb_p'
and go on for another couple hundred lines.
IIRC, I found fixes for these when I merged this into my tree. It's a nice addition, but there are aspects of this that I don't like, which is why I haven't sent it in myself. Again, IIRC, enabling this disables the normal consoles, which is fairly unfriendly.
Jeff
Re: [patch 2/2] uml: Framebuffer driver for UML
Quoted 11 lines · Jeff Dike
Quoted 5 lines · Gerd Knorr
$subject says pretty much all: This adds a framebuffer driver for UML.
please apply,
Gerd
Please don't. This patch fails to link for me in -rc5 - the errors start like
drivers/built-in.o(.text+0x18b): In function `vgacon_deinit':
/home/jdike/linux/2.6/linux-2.6.15/drivers/video/console/vgacon.c:151: undefined reference to `outw'
Uh, I havn't even tried to build vgacon, it doesn't make sense for UML anyway. It's not needed, my .config looks like this:
CONFIG_VT_CONSOLE=yCONFIG_HW_CONSOLE=y
# CONFIG_VGA_CONSOLE is not setCONFIG_DUMMY_CONSOLE=yCONFIG_FRAMEBUFFER_CONSOLE=y
Should be trivially fixable with some Kconfig tweaks, I'll have a look.
Quoted 2 lines
IIRC, I found fixes for these when I merged this into my tree. It's a nice addition, but there are aspects of this that I don't like, which is why I haven't sent it in myself.
What exactly?
Quoted 1 line
Again, IIRC, enabling this disables the normal consoles, which is fairly unfriendly.
Yep, there is no way around that because the uml consoles hijacked the vt subsystem's major #5. Unlike in older versions of that patch this isn't a compile time but a runtime option, so it's much less annonying. The uml consoles are present unless you activate the vt subsystem and the framebuffer console by boot the kernel with x11=something.
cheers,
Gerd
Re: [patch 2/2] uml: Framebuffer driver for UML
Quoted 4 lines
Quoted 2 lines
drivers/built-in.o(.text+0x18b): In function `vgacon_deinit':
/home/jdike/linux/2.6/linux-2.6.15/drivers/video/console/vgacon.c:151: undefined reference to `outw'Should be trivially fixable with some
Kconfigtweaks, I'll have a look.
Here we go, this patch disables vga console and the mouse/kbd hardware drivers on UML. Running a "allmodconfig" testbuild right now, but I hope that everything else is catched by PCI + ISA dependencies ...
cheers,
Gerd
drivers/input/keyboard/Kconfig +1 -1
@@ -10,7 +10,7 @@ menuconfig INPUT_KEYBOARD If unsure, say Y. -if INPUT_KEYBOARD +if INPUT_KEYBOARD && !UML config KEYBOARD_ATKBD tristate "AT keyboard" if !X86_PC
drivers/input/mouse/Kconfig +1 -1
@@ -10,7 +10,7 @@ menuconfig INPUT_MOUSE If unsure, say Y. -if INPUT_MOUSE +if INPUT_MOUSE && !UML config MOUSE_PS2 tristate "PS/2 mouse"
drivers/input/serio/Kconfig +1 -1
@@ -21,7 +21,7 @@ if SERIO config SERIO_I8042 tristate "i8042 PC Keyboard controller" if EMBEDDED || !X86 default y - depends on !PARISC && (!ARM || ARCH_SHARK || FOOTBRIDGE_HOST) && !M68K + depends on !PARISC && (!ARM || ARCH_SHARK || FOOTBRIDGE_HOST) && !M68K && !UML ---help--- i8042 is the chip over which the standard AT keyboard and PS/2 mouse are connected to the computer. If you use these devices,
drivers/video/console/Kconfig +1 -1
@@ -6,7 +6,7 @@ menu "Console display driver support" config VGA_CONSOLE bool "VGA text console" if EMBEDDED || !X86 - depends on !ARCH_ACORN && !ARCH_EBSA110 && !4xx && !8xx && !SPARC32 && !SPARC64 && !M68K && !PARISC && !ARCH_VERSATILE + depends on !ARCH_ACORN && !ARCH_EBSA110 && !4xx && !8xx && !SPARC32 && !SPARC64 && !M68K && !PARISC && !ARCH_VERSATILE && !UML default y help Saying Y here will allow you to use Linux in text mode through a
Re: [patch 2/2] uml: Framebuffer driver for UML
Quoted 3 lines
Quoted 1 line
Should be trivially fixable with some
Kconfigtweaks, I'll have a look.Here we go, this patch disables vga console and the mouse/kbd hardware drivers on UML. Running a "allmodconfig" testbuild right now, but I hope that everything else is catched by PCI + ISA dependencies ...
Unfortunaly not, there are a few more places which need fixing, updated patch attached, with that one applied on top of the uml framebuffer patch "ARCH=um allmodconfig" works again ...
cheers,
Gerd
drivers/input/keyboard/Kconfig +1 -1
@@ -10,7 +10,7 @@ menuconfig INPUT_KEYBOARD If unsure, say Y. -if INPUT_KEYBOARD +if INPUT_KEYBOARD && !UML config KEYBOARD_ATKBD tristate "AT keyboard" if !X86_PC
drivers/input/mouse/Kconfig +1 -1
@@ -10,7 +10,7 @@ menuconfig INPUT_MOUSE If unsure, say Y. -if INPUT_MOUSE +if INPUT_MOUSE && !UML config MOUSE_PS2 tristate "PS/2 mouse"
drivers/input/serio/Kconfig +1 -1
@@ -21,7 +21,7 @@ if SERIO config SERIO_I8042 tristate "i8042 PC Keyboard controller" if EMBEDDED || !X86 default y - depends on !PARISC && (!ARM || ARCH_SHARK || FOOTBRIDGE_HOST) && !M68K + depends on !PARISC && (!ARM || ARCH_SHARK || FOOTBRIDGE_HOST) && !M68K && !UML ---help--- i8042 is the chip over which the standard AT keyboard and PS/2 mouse are connected to the computer. If you use these devices,
drivers/video/console/Kconfig +1 -1
@@ -6,7 +6,7 @@ menu "Console display driver support" config VGA_CONSOLE bool "VGA text console" if EMBEDDED || !X86 - depends on !ARCH_ACORN && !ARCH_EBSA110 && !4xx && !8xx && !SPARC32 && !SPARC64 && !M68K && !PARISC && !ARCH_VERSATILE + depends on !ARCH_ACORN && !ARCH_EBSA110 && !4xx && !8xx && !SPARC32 && !SPARC64 && !M68K && !PARISC && !ARCH_VERSATILE && !UML default y help Saying Y here will allow you to use Linux in text mode through a
drivers/char/Kconfig +4 -2
@@ -64,6 +64,7 @@ config HW_CONSOLE config SERIAL_NONSTANDARD bool "Non-standard serial port support" + depends on !UML ---help--- Say Y here if you have any non-standard serial boards -- boards which aren't supported using the standard "dumb" serial driver.
@@ -687,7 +688,7 @@ config NVRAM config RTC tristate "Enhanced Real Time Clock Support" - depends on !PPC32 && !PARISC && !IA64 && !M68K + depends on !PPC32 && !PARISC && !IA64 && !M68K && !UML ---help--- If you say Y here and create a character special file /dev/rtc with major number 10 and minor number 135 using mknod ("man mknod"), you
@@ -735,7 +736,7 @@ config SGI_IP27_RTC config GEN_RTC tristate "Generic /dev/rtc emulation" - depends on RTC!=y && !IA64 && !ARM && !M32R && !SPARC32 && !SPARC64 + depends on RTC!=y && !IA64 && !ARM && !M32R && !SPARC32 && !SPARC64 && !UML ---help--- If you say Y here and create a character special file /dev/rtc with major number 10 and minor number 135 using mknod ("man mknod"), you
@@ -792,6 +793,7 @@ config COBALT_LCD config DTLK tristate "Double Talk PC internal speech card support" + depends on ISA help This driver is for the DoubleTalk PC, a speech synthesizer manufactured by RC Systems (<http://www.rcsys.com/>). It is also
drivers/char/ipmi/Kconfig +1 -0
@@ -5,6 +5,7 @@ menu "IPMI" config IPMI_HANDLER tristate 'IPMI top-level message handler' + depends on !UML help This enables the central IPMI message handler, required for IPMI to work.
drivers/char/tpm/Kconfig +1 -1
@@ -6,7 +6,7 @@ menu "TPM devices" config TCG_TPM tristate "TPM Hardware Support" - depends on EXPERIMENTAL + depends on EXPERIMENTAL && !UML ---help--- If you have a TPM security chip in your system, which implements the Trusted Computing Group's specification,
drivers/input/touchscreen/Kconfig +1 -1
@@ -9,7 +9,7 @@ menuconfig INPUT_TOUCHSCREEN If unsure, say Y. -if INPUT_TOUCHSCREEN +if INPUT_TOUCHSCREEN && !UML config TOUCHSCREEN_BITSY tristate "Compaq iPAQ H3600 (Bitsy) touchscreen"
drivers/serial/Kconfig +1 -0
@@ -11,6 +11,7 @@ menu "Serial drivers" config SERIAL_8250 tristate "8250/16550 and compatible serial support" depends on (BROKEN || !(SPARC64 || SPARC32)) + depends on !UML select SERIAL_CORE ---help--- This selects whether you want to include the driver for the standard
drivers/video/Kconfig +1 -1
@@ -602,7 +602,7 @@ config FB_EPSON1355 config FB_S1D13XXX tristate "Epson S1D13XXX framebuffer support" - depends on FB + depends on FB && !UML select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT
drivers/char/tty_io.c retry_open: · line 1830
Quoted 3 lines · Gerd Knorr
#ifdef
CONFIG_VTdrivers/char/tty_io.c +1
-1-if (device ==MKDEV (TTY_MAJOR ,0 )) { +if (console_use_vt && device ==MKDEV (TTY_MAJOR ,0 )) {
You don't register a cdev for this one below, so this can't be reached.
Quoted 6 lines · Christoph Hellwig
drivers/char/tty_io.c retry_open: · line 1830
Quoted 3 lines · Gerd Knorr
#ifdef
CONFIG_VTdrivers/char/tty_io.c +1
-1-if (device ==MKDEV (TTY_MAJOR ,0 )) { +if (console_use_vt && device ==MKDEV (TTY_MAJOR ,0 )) {You don't register a cdev for this one below, so this can't be reached.
It can be reached in uml kernels. Unless the vt subsystem is enabled the uml kernel registeres a uml-specific tty driver with major #5 (see arch/um/drivers/stdio_console.c).
cheers,
Gerd