当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 26 篇帖子 ]  前往页数 1, 2  下一页

你成功了么?
成功 12%  12%  [ 3 ]
没有成功 8%  8%  [ 2 ]
成功但又问题bug 4%  4%  [ 1 ]
想试验但是没有条件 76%  76%  [ 19 ]
总计票数 : 25
作者 内容
1 楼 
 文章标题 : [转帖]敢做小白的来,多屏幕,多键盘,多鼠标,一主机,一托多配置方案
帖子发表于 : 2008-08-09 14:26 
头像

注册: 2005-09-06 20:34
帖子: 501
送出感谢: 3
接收感谢: 1
大家自己看吧,懒的翻译了,使用linux稍微有点时间的应该不难看懂.

找了好久,虽然资料久点,但在这个坛子好像还没有类似的,关键部分我用 红字体加粗 显示,给予简短解释,适合喜欢折腾的朋友,我没有硬件环境,要不我就自己做试验了


HOWTO: Multiple local XFree users under Linux
Multiple Local XFree Users Under Linux


Linux HOWTOs
Thursday, March 15, 2001 12:39:54 PM

Multiple local XFree users under Linux

Version 0.9 by Miguel Freitas <miguel@cetuc.puc-rio.br>

January 16, 2001




Keywords (for bots)

I've wasted a lot of time trying to find this kind of document in google, hotbot and so on. Let me add some keywords to help people finding it: true dual-head, multi-user support, XFree86 4.0, multiple keyboard, multiple mouse, multiple video card, dual user, XFree86 instances, dual keyboard, USB keyboard under X.



Motivation


I have one girlfriend and one computer. In normal conditions, we both couldn't use the computer at the same time, in spite of the fact that it usually has a lot of processing power available. I also have a spare monitor and a second video card for playing 3D games (voodoo) so this idea came to me as something very obvious. New XFree86 4.0 support for dualhead suggests that most of the hard work is already done. And it has to be on Linux, because no closed source OS would allow me to make the changes that I need.

As several reports confirm, Linux is been successfully used in educational institutions and projects due to it's great benefits and low cost. Using the same computer for two (or more) simultaneous students, workers, etc. is something that can reduce even more these costs.

This is also a great option for companies to simplify the management and upgrades of the shared resources (motherboard, processor, hds).

For everybody who may be asking: don't it get too slow? No. The performance difference is barely perceptible as most of the time the computer is waiting some command from the user. And if you haven't figured it out by yourself let me tell something: we live in a time of computing power in excess or do you think most of the users needs a GigaHertz Pentium 3 machine just to do their word processing and surf the web?


Problems


There are some problems that need to be addressed in order to support multiple XFree instances (and users):
VT handling - The Linux kernel Virtual Terminal scheme is a great hack these days. It used to be good in the past as a way to have multiple screens, but now it's something that needs to be completely rewritten (several Linux developers have shown interest in developing a better scheme for 2.5.x series). The main issue is that VT code doesn't understand that we may have multiple input and output devices which therefore may be completely independent. There's no way to associate a given set of VTs for each hardware so Linux kernel would know which VTs can be used simultaneously. If we dispatch multiple instances of XFree86 they would be on different VTs and the Linux kernel will inform them of all VT switching stuff. A switched out (graphic) VT must not use the hardware as it would normally mess with the other active VT, but this is no more true as we have two independent video cards.
Keyboard support - Multiple mouses on X are already a reality as we may specify the "device" option for each one. Unfortunately, the keyboard driver is still deeply rooted at XFree86 core, it's not a separated module and access console I/O functions to read the scancodes. Each XFree86 instance would have their keyboard access halted by VT switching. Besides, Linux is still lacking support for multiple keyboards in a well defined way. Let's wait for 2.5.x tree to see what will be done...

显卡需要驱动支持,键盘鼠标如今的2.6系内核应该没有问题

My solution

My hack is surely not the best one, I know thousands of things that could be better implemented in XFree86 and Linux Kernel to support true dual-head (and dual-input) in a clean way. But it works for me. Don't blame me if you spend your money and time buying videocards, monitors, keyboards, mouses and it doesn't work. You've been warned.

Although I would love to see XFree86 supporting simultaneous layouts (without another instance) and a brand new keyboard driver, I don't have the necessary understanding of the project to implement it by myself. Anyway, my regards to the XFree86 developers for this great piece of software!
关键部分
My idea is to have two instances of XFree86. The first will be using a normal XFree86 server, it will initialize the main video card and attach it to a VT. It will also use the standard system AT keyboard and something (PS/2, serial, USB emulated as PS/2, whatever you want) as a mouse.

The second instance of XFree will be my modified X server. It does not support VT switching at all because it's been used to control a hardware that is not normally used by any other VT. Read my lips, this is very important: The video card can't be the primary one, the mouse can't be the same used by gpm and the keyboard must be USB and must not generate scancodes to the normal Linux console!

As the keyboard doesn't look like a normal AT keyboard (no keys to standard console) the keyboard driver of my modified X server must take care of USB events translating them to normal scancodes.
要注意X server关于USB的事件驱动解释

Procedure (step by step)


1) You need to get XFree 4.0.x (RedHat 7.0 and a lot of recent distros comes with it) and configure it for two video cards and monitors. I suggest that you first try it with Xinerama extension following this HowTo:http://linuxdocs.org/HOWTOs/Xinerama-HOWTO.html

Then modify your XF86Config or XF86Config-4 to separate your screens in two layouts, instead of using them with Xinerama extension. Don't know what I am talking about? Then it's time to read XF86Config, do a ``man XF86Config''

With two layouts your XF86Config should look like this:


代码:
Section "ServerLayout"
    Identifier "Layout0"
    Screen 0 "Screen0"
    InputDevice "Mouse0" "CorePointer"
    InputDevice "Keyboard0" "CoreKeyboard"
EndSection

Section "ServerLayout"
    Identifier "Layout1"
    Screen 0 "Screen1"
    InputDevice "Mouse0" "CorePointer"
    InputDevice "Keyboard0" "CoreKeyboard"
EndSection

Section "InputDevice"
    Identifier "Keyboard0"
    Driver "keyboard"
    # this is for supporting deadkeys
    Option "XkbRules" "xfree86"
    Option "XkbModel" "us"
    Option "XkbLayout" "br"
EndSection

Section "InputDevice"
    Identifier "Mouse0"
    Driver "mouse"
    Option "Device" "/dev/mouse"
    Option "Protocol" "IMPS/2"
    Option "Emulate3Buttons" "off"
    Option "ZAxisMapping" "4 5"
EndSection

Section "Monitor"
    Identifier "Plex17"
    VendorName "Unknown"
    ModelName "Unknown"
    HorizSync 31.5 - 79.0
    VertRefresh 50-90
EndSection

Section "Monitor"
    Identifier "Syncmaster3"
    HorizSync 31.5 - 79.0
    VertRefresh 50-70
EndSection

Section "Device"
    Identifier "FireGL 1000 PRO"
    Driver "glint"
    BusID "pci:1:0:0"
    BoardName "Unknown"
EndSection

Section "Device"
    Identifier "Voodoo"
    Driver "glide"
    BusID "pci:0:12:0"
EndSection

Section "Screen"
    Identifier "Screen0"
    Device "FireGL 1000 PRO"
    Monitor "Plex17"
    DefaultDepth 16
    Subsection "Display"
       Depth 16
       Modes "1024x768"
    EndSubSection
EndSection

Section "Screen"
    Identifier "Screen1"
    Device "Voodoo"
    Monitor "SyncMaster 3"
    DefaultDepth 16
    SubSection "Display"
       Depth 16
       Modes "800x600"
    EndSubSection
EndSection

This should be trivial to do because it's almost the same as Xinerama configuration but with two layouts. Then switch your box to runlevel 3 (init 3) and try both layouts, one at a time:

代码:
# XFree86 -layout Layout0
# XFree86 -layout Layout1

Pay attention to BusID settings as described in howto. Note that a dualhead board (like Matrox G400) should NOT work through the next steps, as we will be using 2 instances talking to the same hardware. But I haven't tried myself (I'd be happy to try it if any reader wants to donate such video card...).

Not all video cards can be used with XFree86 dualhead support. Don't email me saying that you couldn't get your cards to work up to here or you will burn in hell! Read the Xinerama HowTo instead, thanks.


2) Plug your second mouse on the system and configure XF86Config to use it in the second layout. This mouse must not be used by any other program, like gpm. XF86Config will look like this (only the changed sections):

第二个键盘鼠标的配置
代码:
Section "ServerLayout"
    Identifier "Layout1"
    Screen 0 "Screen1"
    InputDevice "Mouse1" "CorePointer"
    InputDevice "Keyboard0" "CoreKeyboard"
EndSection

 
Section "InputDevice"
    Identifier "Mouse1"
    Driver "mouse"
    Option "Device" "/dev/ttyS1"
    Option "Protocol" "Microsoft"
EndSection


Again, test this layout to make sure it's working.


3) Get Linux Kernel 2.4.0 so we can play with USB support. Some 2.2.x kernels may work as they have backported USB support, but in doubt, stick with 2.4.0.

In the kernel configuration, enable USB support (CONFIG_USB) and keyboard (either CONFIG_USB_HID or CONFIG_USB_KBD if your don't need USB mouse support). You must enable "input core support" (CONFIG_INPUT) and MUST NOT enable "keyboard support" (CONFIG_INPUT_KEYBDEV) as we don't want the USB one to be the system keyboard. Also enable "event interface" (CONFIG_INPUT_EVDEV) as I will use it to receive scancodes.

Compile and install the kernel. Now plug your USB keyboard, once the kernel enters you should not see any pressed keys from it at the console. Now try reading the keyboard events (assuming the keyboard is the only USB device you have):
不需要编译内核了,如今2.6系官方内核都默认支持了
代码:
# cat /dev/input/event0


You should see some garbage on the screen as you type. That's all right, your keyboard is working. If you don't see anything or get "No such device", something is wrong with your USB system. Read Documentation/usb in your kernel sources for more information.


4) Get the sources of your XFree86 4.0.x if you haven't already done so. The sources are available from www.xfree86.org. There should be 3 or 4 big .tgz files, but you will only need the first one.

Expand the tree and apply my patch, which can be downloaded here (4.0.1) and here (4.0.2). Follow the instructions from the package to build the X server (make World). You should get a new XFree86 executable on directory xc/programs/Xserver. Copy it to your /usr/X11R6/bin with another name (like XFree86-2nd).

Or if you like the easy way, try one of my XFree86-2nd servers (compiled against glibc-2.1):

XFree86-4.0.1-2nd.gz

XFree86-4.0.2-2nd.gz

This server supports only USB keyboards and do not grab a VT. The only VT code it has is to switch to a given console through XFree86-2nd vtxx parameter.

Applying the patch is intended only for developers that can help me improving this scheme. It will also require you hundreds of MB of disk space. If my provided X servers doesn't work with your system there's little I can do about it. If you can, try to discover the problem and fix it.
xorg这些都支持了吧,这步没有必要了

5) Modify the second layout to use the USB keyboard. This will require you to use the protocol "usbev" I created and specify the /dev/input/eventx you like as the device. The XF86Config should now look like this (only the changed sections):
让第二个鼠标键盘,输出到第二个显示器上
代码:
Section "ServerLayout"
    Identifier "Layout1"
    Screen 0 "Screen1"
    InputDevice "Mouse1" "CorePointer"
    InputDevice "Keyboard1" "CoreKeyboard"
EndSection
 
Section "InputDevice"
    Identifier "Keyboard1"
    Driver "keyboard"
    Option "Protocol" "usbev"
    Option "Device" "/dev/input/event0"
EndSection


Now try this X server with the command:

代码:
# XFree86-2nd -layout Layout1


It should initialize your second video card, the second mouse and the usb keyboard without interfering with your console. You can even do this from a xterm window inside your running X server. Yes! It works! Now move on to the grand finale...


6) If you use gdm as display manager and to provide you a graphical login, you can edit the file
/etc/X11/gdm/gdm.conf as follows:
编辑gdm的配置文件
代码:
[servers]
0=/usr/bin/X11/XFree86-2nd -delay -layout layout1 vt07
1=/usr/bin/X11/X vt07


Getting this one to work may be a major challenge. It took me a lot of trial and error until I got this stable configuration. I had to add a option "-delay" (my hack) to cause a 10 second delay at one of the servers so they would not initialize the hardware at the same time. I don't know why this is needed. Playing with the order they are initialized (by exchanging 0= and 1=) also does the trick.


Known Bugs


This thing mess up with my text console. I have to switch between the VTs a couple of times before the text looks good again. Fell free to give me a solution.

Also a main problem may be that the whole thing does not work with other hardware and you may be wasting your time reading all this. But the idea is here and I can guarantee that it worked for me. So it must be some little issue that I'm sure will be quickly resolved by another developer somewhere....


Updates

Price study

Brad Midgley pointed that support for Matrox G400 and similar dualhead cards should be possible using framebuffer interface. I still don't have the hardware to do any tests on this, but if you want to try please note that I may have removed something important for framebuffer from the init routines. Please check for any mistakes the patch might have. Any updates on this issue are greatly appreciated...


Contact


Miguel Freitas <miguel@cetuc.puc-rio.br >
Center for Telecommunications Studies of the
Catholic University of Rio de Janeiro (CETUC/PUC-Rio)
Brazil

参考链接:
http://cs.senecac.on.ca/~ctyler/ruby/
http://linuxplanet.com/linuxplanet/tutorials/3100/1/


附件:
three-heads.jpg
three-heads.jpg [ 27.46 KiB | 被浏览 2311 次 ]



_________________
arch
awesome
blog
+github
freebsd handbook中文版


最后由 jarodlau 编辑于 2008-09-07 12:58,总共编辑了 1 次
页首
 用户资料  
 
2 楼 
 文章标题 :
帖子发表于 : 2008-08-09 15:32 
头像

注册: 2008-02-17 23:47
帖子: 22109
地址: 美丽富饶的那啥星球
送出感谢: 11
接收感谢: 82
暴强!
:shock: :shock: :shock:


_________________
明天就换大三八!
——8核CPU、8G内存、8T硬盘……
8卡交火,80寸大屏放8个……
IPv8的光纤要8条……

---------------------------------------------------------------------------------
[图片版]新手当自强(续)FAQ
[新手进阶]挂载、fstab、调整linux分区
[图片版]E17桌面环境配置手把手


页首
 用户资料  
 
3 楼 
 文章标题 :
帖子发表于 : 2008-08-09 16:17 
头像

注册: 2006-09-02 18:58
帖子: 474
地址: 深圳
送出感谢: 0 次
接收感谢: 0 次
真是多用户同时使用啊


_________________
------
ThinkPad·R60i-0657LN1
Ubuntu 8.04 . Hardy Heron+XP
------


页首
 用户资料  
 
4 楼 
 文章标题 :
帖子发表于 : 2008-08-09 18:49 
头像

注册: 2006-01-18 12:55
帖子: 1347
地址: 也许真的没有人理解
送出感谢: 0 次
接收感谢: 1
我比较担心硬盘会不会吃不消……


_________________
MacBook Pro 15" User
Cocoa Programmer


页首
 用户资料  
 
5 楼 
 文章标题 :
帖子发表于 : 2008-08-09 18:55 
头像

注册: 2005-09-06 20:34
帖子: 501
送出感谢: 3
接收感谢: 1
JangMunho 写道:
我比较担心硬盘会不会吃不消……



别怕,搞个raid阵列.... :lol:


_________________
arch
awesome
blog
+github
freebsd handbook中文版


页首
 用户资料  
 
6 楼 
 文章标题 :
帖子发表于 : 2008-08-09 19:08 
头像

注册: 2006-01-18 12:55
帖子: 1347
地址: 也许真的没有人理解
送出感谢: 0 次
接收感谢: 1
能不能搞个50个显示器、50个鼠标和50个键盘,这样非洲小朋友就有福了……


_________________
MacBook Pro 15" User
Cocoa Programmer


页首
 用户资料  
 
7 楼 
 文章标题 :
帖子发表于 : 2008-08-09 19:17 
头像

注册: 2005-09-06 20:34
帖子: 501
送出感谢: 3
接收感谢: 1
貌似没有可以装50块显卡的主板吧??? :ema4


_________________
arch
awesome
blog
+github
freebsd handbook中文版


页首
 用户资料  
 
8 楼 
 文章标题 :
帖子发表于 : 2008-08-09 19:25 
头像

注册: 2007-03-13 11:23
帖子: 1343
送出感谢: 0 次
接收感谢: 0 次
很简单嘛,可是我没有双头显卡


_________________
"We are all in the mud, but some of us are looking at the stars." (Oscar Wilde)
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/


页首
 用户资料  
 
9 楼 
 文章标题 :
帖子发表于 : 2008-08-09 23:48 
头像

注册: 2008-01-25 9:55
帖子: 285
地址: 深圳中學高中部
送出感谢: 0 次
接收感谢: 1
充分運用系統資源的好辦法 :D


_________________
唉,在中國高中苦了三年,本來應該晉升到中國的大學好好耍個四年的...
結果「不知爲了什麼」愣是考去了美帝。現在日子天天如高三:各種考試、各種作業、各種...


页首
 用户资料  
 
10 楼 
 文章标题 :
帖子发表于 : 2008-08-09 23:51 

注册: 2008-01-09 22:41
帖子: 18311
送出感谢: 0 次
接收感谢: 6
kofshower 写道:
很简单嘛,可是我没有双头显卡


还好我有 :em09

可是优派的那个crt不支持这个插口

而dell的这个霸占了唯一一个crt支持的……


页首
 用户资料  
 
11 楼 
 文章标题 :
帖子发表于 : 2008-08-10 0:36 
头像

注册: 2005-08-14 21:55
帖子: 58428
地址: 长沙
送出感谢: 4
接收感谢: 272
哦。真有人搞这个。
只是这和我理解的不同的,我以前和别人讨论的,是在同一桌面。不是2个X


_________________
● 鸣学


页首
 用户资料  
 
12 楼 
 文章标题 :
帖子发表于 : 2008-08-10 9:53 
头像

注册: 2007-10-06 18:40
帖子: 4313
送出感谢: 0 次
接收感谢: 5
:arrow: 系统安装和升级


_________________
E=m c^2


页首
 用户资料  
 
13 楼 
 文章标题 :
帖子发表于 : 2008-08-10 16:00 
头像

注册: 2007-03-13 11:23
帖子: 1343
送出感谢: 0 次
接收感谢: 0 次
我的笔记本可以~试验了一下


_________________
"We are all in the mud, but some of us are looking at the stars." (Oscar Wilde)
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/


页首
 用户资料  
 
14 楼 
 文章标题 :
帖子发表于 : 2008-08-10 16:07 
头像

注册: 2007-04-25 13:12
帖子: 2838
送出感谢: 0 次
接收感谢: 0 次
..只有一个屏幕,一个键盘,一个鼠标的人飘过


_________________
♜♞♝♛♚♝♞♜
♟♟♟♟♟♟♟♟
♙♙♙♙♙♙♙♙
♖♘♗♕♔♗♘♖

☠☯⚔⚓☣☦☃☕
☹☻☪☭☬⚖⚛⚜
ℜℳℬ™ ℋℯℓ℘ ℳℭ
sƂɐʍ рǀɹoʍ əɥʇ oS


页首
 用户资料  
 
15 楼 
 文章标题 :
帖子发表于 : 2008-08-10 16:16 
头像

注册: 2006-12-23 13:46
帖子: 9203
地址: Azores Islands
送出感谢: 0 次
接收感谢: 1
eexpress 写道:
哦。真有人搞这个。
只是这和我理解的不同的,我以前和别人讨论的,是在同一桌面。不是2个X


印度人比较穷,所以印度人开发的多人同时使用的软件就是在同一桌面的。


_________________
no security measure is worth anything if an attacker has physical access to the machine


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 26 篇帖子 ]  前往页数 1, 2  下一页

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 4 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译