Compile the kernel to support simultaneous modification of PS

Source: Internet
Author: User
Article title: compile the kernel to allow it to support simultaneous modification of PS. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
The PS parallel port modification handle is connected to the printer port, compared to the traditional analog handle connected to the sound card MIDI multi-function port, it is pure digital, therefore, the positioning is correct (you do not need to adjust the analog handle to locate it correctly), and more than 10 buttons are supported (much more than the analog handle ), it can fully meet the needs of any game; because it is a digital handle, the handle circuit is very simple, low price, here in Guangzhou, a pair of PS modified handle is only 16, all traffic is sold, but the effect is very good! (I believe many of my friends use it too !)
  
PS controller has a lot of WIN drivers, but in linux, the support for it has been very lacking, and no one has mentioned it on the network; since I often play a variety of simulators in linux, I have been worried that I cannot support controllers. recently, I accidentally discovered that the kernel has already provided support for a long time. I tried it and read the built-in kernel documentation to finally test it! The following describes the methods:
  
System: Hongqi 3.0 desktop and kernel 2.4.18 (earlier may also be supported, but I have not tried it yet)
  
1. because the PS parallel port handle uses the parallel port and is a handle device, check whether/dev/parport *,/dev/js *, /dev/input/js * devices, if any, can ignore this step. if not, create the device first:
Cd/dev
Rm js *
Mkdir input
Mknod input/js0 c 13 0
Mknod input/js1 c 13 1
Mknod input/js2 c 13 2
Mknod input/js3 c 13 3
Ln-s input/js0 js0
Ln-s input/js1 js1
Ln-s input/js2 js2
Ln-s input/js3 js3
  
2. enter the directory where your kernel source code file is located (for example, my directory is/usr/src/2.4.1, and execute the make xconfig command to configure the kernel (marked as a large option changed during the configuration process)
  
Configure the parallel port first: 2. it is best to set the standard to Y in the marked place. you can select M, but it is not recommended. in this way, the parallel port support function is built into the kernel, when the kernel is started, the parallel port is automatically detected and/dev/parport * takes effect.
  
3. configure input core support. 3. select M for the marked place. in this way, configure the handle function as a module and enable/dev/js0 to take effect when loading; although the help document of input core support says that USB devices are configured, in fact, these are general controllers. if this is not configured, the next step cannot be configured (I did not configure this at the beginning, as a result, the options of joystice are gray and cannot be configured.) ---- after this step is configured, the input will be generated. o and joydev. o these two modules
  
4. configure joystick: click the joystick option (2) in character device to enter the handle configuration window (,), and select M for the marked place, one is to configure the MIDI port on the sound card (this should be omitted. according to the kernel documentation, it provides support for analog controllers and is useless for digital controllers, but I have not tried it yet ), one is the support of the PSX handle. this step will generate gameport after compilation. o and gamecon. o these two modules
  
5. Save the configuration and exit, re-compile the kernel and modules, and install the modules. here, we will not bother with it. there are a lot of "technical forums" on this site for kernel compilation.
  
6. go to the "/lib/modules/your kernel/drivers/" directory (for example, my directory is/lib/modules/2.4.18/kernel/drivers, the input directory contains input. o and joydev. o two modules; the char/joystick directory should contain gamecon. o and gameport. o module; see
  
7. edit the/etc/modules. conf file and add the following two statements:
Alias ps3gamecon
Options gamecon gc = 0, 7, 7, 7
The first line indicates gamecon. o this module uses the alias ps3, and then you can use the modprobe ps3command to load it. The second line means to add the gc parameter to the gamecon module, where, 7, 7 "" 0 "indicates that the handle is connected to the first printer port (/dev/parport0). If your handle is connected to the second, use 1, and so on; the first "7" at the end represents the first handle, the type is modified by the PS handle, and the second "7" represents the second handle, and the type is also the PS handle, because the parallel port can be connected with five controllers at the same time, there are five 7 controllers. if you only have one connection, you can write only one "7, 2 represents the red and white machine modified handle, 6 represents the N64 modified handle, 7 represents the PS modified handle); these two lines are very important, especially the second line, if this parameter is not added, the error message "Parameter error" is returned when the gamecon module is loaded! ()
  
8. start up, use the new kernel. during startup, you will find that there is a parallel port detection information, because the parallel port support function already plays a role in the kernel. after entering the system, open a terminal window, execute the following commands in sequence:
Modprobe input
Modprobe joydev
Modprobe PS3
If there is no error message, you can see a similar output in lsmod. check that there are input, joydev, and gamecon modules. the gameport is generally automatically loaded with the sound card driver.
  
9. run jstest/dev/js0 (if your system does not have this command, search for the joystick keyword on www.rpmfind.net and install joystickxxx. rpm Package is available), you can see the output, then you press the handle button, if the screen output has a corresponding change, then, congratulations, the handle drive is completely successful!
  
10. now you can run a simulator or other games. you can use the gamepsxe simulator to set it immediately, you can use the ammo joydevice pad driver plug-in () and configure (1) to use it./dev/js0 indicates the first handle, /dev/js1 indicates the second handle, and so on! After my own test, any exit program that can apply the handle can normally implement the handle function, and the effect is first-class! In the future, you can add the modprobe command of the three load modules in step 1 to rc. local so that it can be loaded with startup. then you can use the controller after entering the system! Or write it as a script. you can execute it again!
  
Many of the above information comes from the instructions of the kernel. if you do not understand anything, please read the documents joystick.txtand joystick-parport.txt in the Documentation/inputdirectory under the kernel source code directory. you can paste them back!
  
  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.