Aloin tässä pari päivää sitten käyttää ion2-ikkunointiohjelmaa vanhan kunnon
Gnomen sijaan. Näppärä ja kaikkea, mutta ainoa ongelma oletusasetuksissa on
se, että komentonäppäimenä toimii Alt, jota tarttee aika moneen muuhunkin
juttuun. Siispä muokkaamaan /etc/X11/ion2/ion.lua -tiedostoa, jossa
DEFAULT_MOD=”Mod1+” muutetaan muotoon “Mod4″ (tai Mod3+, riippuen vähän X:n
asetuksista). Kas näin saadaan se turha Windows-nappula hyötykäyttöön.
Configuring PLIP in Linux
There are quite a few web pages that contain information on configuring a
LapLink connection between two Linux machines, but none of them contain all
the information needed. I had to rummage around quite a bit to get
everything working, so I decided to write it all down so others might get
PLIP activated more easily.
Hardware
To get a PLIP connection working, you need a LapLink cable, which is
basically a parallel cable with male connectors on either end. You can get
more information on building your own cable (although I suggest buying one -
they’re not that expensive) in the PLIP mini-HOWTO. Of course, you need two
computers with free parallel ports to make this work. If you want to also
use a parallel printer, then things get a bit more complicated. I’ll not
talk much about that, since I did not need such an installation. The normal
steps presented here will only need minor modifications, though, so read on.
Before doing anything else, please check and write down the I/O address and
IRQ of the parallel port on both machines. This information is in the BIOS
setup screen. If you haven’t enabled IRQ support, do that now, since without
it the transfer speed will really crawl.
Loading and configuring the modules
First of all you need to load the appropriate modules into the kernel. I
suggest using modules instead of building the code into the kernel, as
you’ll have an easier time changing the settings if need be.
There are basically two possible module configurations. In the kernel
configuration you’ll have to make the following selections:
- General setup
- CONFIG_PARPORT: Y (to get the parallel port support)
- CONFIG_PARPORT_PC: Y (if you’re using a PC machine – for other you probably
need CONFIG_PARPORT_OTHER)
- Network device support
- CONFIG_NETDEVICES: Y (well, if you want to have any kind of
networking) - CONFIG_PLIP: M/Y (for PLIP support; M for module gives you more
flexibility)
- CONFIG_NETDEVICES: Y (well, if you want to have any kind of
After configuration run a “make dep;make modules;make modules_install” and
you should have in /lib/modules/…/misc/ either the modules “parport.o” and
“parport_pc.o” or just “parport_probe.o”, depending on your kernel version.
If you have the two modules parport and parport_pc, you’ll need to load them
into memory. Start with parport_pc and give it the correct I/O and IRQ
values:
insmod parport_pc io=0x37b irq=7
After this just load parport without any parameters. If you have
parport_probe, just load it without any parameters.
When you have the parallel port module(s) loaded, load the plip module:
insmod plip
If you get an error message like this:
/lib/modules/2.2.10/net/plip.o: init_module: Device or resource busy parport: Device or resource busy
Then you basically need to tell plip the IRQ of the parallel port. You
cannot give it as a module parameter (which is weird), so you’ll need to
specify it in the /proc file system:
echo 7 >/proc/parport/0/irq
(assuming the IRQ is 7 and you’re using the first parallel port). After this
change (check with “cat /proc/parport/0/irq” that the change actually is
there) you should probably unload the parallel port modules (with rmmod) and
then reload them with insmod and retry loading the plip module.
When your modules load without errors, you might want to enter their
configurations into /etc/modules.conf. In Debian you should add a file for
each module into /etc/modutils and then run update-modules, which will
create the modules.conf file. So for each module that you need to specify
parameters for, add an option line, like this:
options parport_pc io=0x37b irq=7
If you need any special command entered before or after a module load, you
can use the pre-install, post-install, pre-remove and post-remove commands:
pre-install parport_pc echo 7 >/proc/parport/0/irq
Network interface specification
When the modules are loaded without error (on both machines) you just need
to activate the plip network interface and set up routing rules. Defining a
network interface depends quite a bit on your distribution. On SuSE you can
use yast to specify the interface. On Debian you’ll get the basic interface
information in /etc/network/interfaces.
The basic commands to activate the interface and routing are as follows.
Replace [CLIENT] and [SERVER] with the IP addresses of the client machine
(whose only network connection is the plip interface) and the server (that
provides the plip connection and has connections to other networks as well).
#on the client machine: ifconfig plip0 CLIENT pointopoint SERVER route add default gw SERVER # #on the server machine: ifconfig plip0 SERVER pointopoint CLIENT
After the ifconfig command, running “ifconfig plip0″ should produce an
output resembling this:
plip0 Link encap:Ethernet HWaddr FC:FC:C0:A8:01:62
inet addr:192.168.1.98 P-t-P:192.168.1.99 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:110956 errors:0 dropped:68 overruns:0 frame:0
TX packets:184524 errors:602 dropped:0 overruns:0 carrier:602
collisions:26 txqueuelen:10
Interrupt:7 Base address:0x378
Troubleshooting
Error “Device or resource busy” when trying to
load the plip module.
You either have the module loaded already or (more likely) the IRQ setting
is missing. Apparently setting it into the /proc system is only needed in
kernels 2.2.x. The older 2.0.x kernels work fine without it. So execute
echo 7 >/proc/parport/0/irq
before loading the parallel port modules.
Error “Unkown host” etc. when trying to connect to a server using http
etc.
If you can access a host using its IP address instead of its host name, your
DNS configuration is faulty. The easiest way (if you’re not running your own
named) is to add the IP address of the name server into /etc/resolv.conf:
nameserver xxx.xxx.xxx.xxx
Error “Network unreachable”
This usually points to a routing problem. Make sure you’ve specified in the
client machine that all traffic should go through the plip interface. Check
out the sample configuration commands above.
Nothing happens when trying to use the network.
First of all start a ping from the client machine to the plip server. If
this works, then the problem is somewhere else. If this also fails (gives an
error or does nothing), then the plip connection has a problem.
Execute the command “screen -d ifconfig plip0″ on both plip machines in one
virtual terminal (or x-terminal). This will keep displaying the plip0
interface information and highlighting any changes. The lines you’ll want to
keep an eye on are the RX and TX lines and their error counts.
Now start a ping from the client machine and see what happens. If you get a
carrier error for each ping, then you’ve loaded the plip module, but the
parport_probe module is not loaded. The fix is to shutdown the plip0
interface (“ifconfig plip0 down”), unload plip (“rmmod plip”) and then
install the parallel port module(s), load plip and start the interface again.
In conclusion
This document contained just the information I had to use to make my
connection work. For additional information, search for other pages with
suitable keywords. The information is there, you just have to find it.
My plip connection works quite nicely with a speed of around 40 kBps. The
connection produces “receive timeouts” on the client machine, but that
hasn’t caused any problems on network use.
Installing and configuring Linux on IBM Thinkpad 760C
This page contains information I needed to dig from the Internet to get an
old IBM Thinkpad 760C to work with Linux. I also go through the experiences
and problems I ran into when trying to get the thing to work.
IBM Thinkpad 760C has a 12.1″ LCD display, 2.1GB hard drive trackpoint
mouse, floppy drive, serial and parallel ports, level 2 PCMCIA slot and a
docking station connection. No CD drive. I had no docking station either nor
a PCMCIA network adapter, so getting Linux into the machine wasn’t too easy.
Using PLIP for networking
What I did have was an intranet firewall/server with a free parallel port
and a LapLink cable. So I decided to create a network using the parallel
ports. First of all trying to get the PLIP connection to work was a task in
its own right. Check out my article on configuring PLIP for more information.
Selecting the distribution
First I tried to install SuSE Linux 7.2, since I had had success installing
SuSE on my desktop machine over the network. So I fetched the installation
floppy images, wrote them on floppies and started out. When specifying a
network installation, you need to load the correct driver modules into
memory. The SuSE PLIP module loaded without problems once I specified the
correct I/O and IRQ values to it.
The problem, however, was that the installation started thrashing when it
started to check through the list of installable packages. I let it run for
a day or so, then gave up on it. The installation program had only got
something like 10 minutes of processor time in 24 hours, the rest was used
mainly in swapping. My laptop was boosted to 40 MB of RAM, but the 16 MB
ramdrive and the SuSE installation program (which is huge) apparently needed
more.
OK, so SuSE didn’t work. Then I downloaded Debian installation floppy images
and wrote them on top of the SuSE floppies. This worked better. Selecting
the PLIP interface was a breeze and the installation proceeded quite nicely.
I have to admit that the Debian installation is significantly smarter than
SuSE’s installation. While SuSE might do a better job of identifying all the
hardware and configuring them (Debian requires a bit more manual work), the
installation itself is more graceful. For example, Debian first installs
just the basic system (downloadable size around 12MB) after which you have a
running Linux and in one virtual console you’re installing other packages as
needed.
For anyone migrating from any RedHat based distribution to Debian, I
recommend a tutorial
which explains the installation in sufficient detail.
Thinkpad 760C special issues: APM
Basic Debian installation isn’t a problem, but getting it to work with a
thinkpad requires some extra work. For a start, you need to get a suitable
kernel. The best way is to get the latest Debian patched sources with
“dselect” and make your own kernel. Make sure you’ve also installed ncurses
with “dselect” so you can use “make menuconfig”.
Activate APM features. Without these your thinkpad can suspend itself, but
if Linux cannot handle this, you will get kernel panic.
After you’ve changed to your optimal kernel, it’s time to install the
Thinkpad control utilities, which do the same that PS2.EXE does for DOS and
the Thinkpad tools do for Windows. The Linux version goes by the name tpctl.
With Debian you can just get them as normal deb-packages. More information
is at the tpctl site. The
utilities consist of two parts – the programs that are simple to install,
and the modules, which have to be compiled. So to compile the modules you’ll
need at least the kernel header files, but having the entire kernel isn’t a
problem.
tpctl is packaged for Debian. RedHat users will have to work with a tarball.
The modules however are always in source code format. In Debian you install
the package, which provides a tpctl.tar.gz file in /usr/src/. Change to
/usr/src/linux and execute “tar xzvf ../tpctl.tar.gz” to unpack the tarball.
The files should drop into a modules-subdirectory under /usr/src/linux. Now
run “make-kpgp modules” to make the modules and package them into a
deb-file. This file will appear in /usr/src. Then install the package with
“dpkg -i debfilename”. After this you can install and configure the tpctl
package. After it’s finished, you’re done.
Now you have the command tpctl, which you can use to control the power
saving features of the BIOS. Remember, though, that tpctl does not save any
changes to BIOS, so you’ll need to rerun them if you power off the machine.
You can of course setup the necessary configuration commands to be executed
upon initialization.
In order to get hibernation to work, you’ll need to create the hibernation
file where the memory contents are to be stored. If you’ve created a double
boot with Windows or DOS, then you’re ok. In my case I did not need Windows
for anything, but for the hibernation you need to have a FAT partition.
Boring… Well, I had some slack in my partition table, so I created a FAT
partition (non-bootable) and used a DOS boot floppy to access it. I
downloaded the PS2 utility from IBM’s site and installed it to the FAT
partition. Then I set up the hibernation file using PS2. And that’s the last
time I needed to use DOS. You can optimize and create the FAT partition so
that it can just contain the hibernation file (size equals your RAM size)
plus a few megabytes for the PS2 utility.
Thinkpad 760C special issues: X
Getting X to work isn’t straightforward. I’ve heard you can get resolutions
up to 1024×768, but I’ve been content to work with 800×600. Check out my
working XF86Config file if you want to. Basically you can use 640×480 and
800×600 without any major hassle. You just need to specify the monitor’s
horizontal sync rate (31.5-37.9) and vertical refresh rate (50-90) and the
screen modes in the file are automatically filtered to contain only those
that the monitor can handle.
Notice that I use a finnish keyboard layout, so you’ll need to at least
change the layout statement to match your own keyboard. Another issue is the
trackpoint. I use gpm to get mouse functionality in the virtual terminals
and only occasionally use X. This is the contents of my /etc/gpm.conf:
device=/dev/psaux responsiveness= repeat_type=ms3 type=ps2 append=""
The trackpoint uses the PS/2 protocol, which has to be given to GPM. The
device file turned out to be /dev/psaux at least in my configuration. When
using X, you can shutdown the gpm daemon and use the same settings in
XF86Config, or you can setup gpm to “repeat” the events. I tried to repeat
them using the same protocol (ps2) but that failed for some reason. Using
Microsoft mouse protocol (version 3) worked quite nicely. So specifying
repeat_type=ms3 then requires that in XF86Config the Pointer section’s
Protocol is “Microsoft”.
GPM sends its repeat data to /dev/gpmdata. You can either specify that in
XF86Config’s Pointer section’s Device statement, or you can use something
like /dev/mouse and then symlink it to /dev/gpmdata, which is probably the
better solution.
Remember that if you’ve stretched the text mode to a full screen (with
Fn-F8), starting X will give you a blank screen. Pressing Fn-F8 to switch to
unstreched mode will show the graphical screen normally.
Twitter
LinkedIn
Facebook
Youtube
Flickr
SlideShare
Google