Archive

Posts Tagged ‘Linux’

Wrapping up my previous job in Linux kernel device driver development

December 26, 2012 Leave a comment

My previous job was maintaining the zfcp device driver in the Linux kernel. Among cleaning up the code, implementing new features and answering support requests, i also gave presentations about using SCSI attachment with the s390 platform. Here are a few links to the publicly available slides and recordings:

The team authoring the Performance Measurement and Tuning Redbook kindly thanked me for contributing. While working in this position, i also co-authored the article IBM zEnterprise storage I/O advancements in the IBM Journal of Research and Development.

Since i am no longer working in that position, please not that this information might be outdated. Please see the official web page for the latest information and contact information.

Advertisements
Categories: Linux Tags: , ,

script

August 3, 2011 Leave a comment

script is a useful command for quickly capturing a terminal session, as i just learned here:

$ script test.log
Script started, file is test.log
$ mkdir x
$ ls x/
$ exit
exit
Script done, file is test.log
$ cat test.log 
Script started on Wed 03 Aug 2011 02:33:36 PM MST
$ mkdir x
$ ls x/
$ exit
exit

Script done on Wed 03 Aug 2011 02:33:41 PM MST
Categories: Linux Tags: ,

Ubuntu 10.04 (Lucid Lynx), Asus Eeepc 901 and wireless networking

March 5, 2011 10 comments

For the record: Ubuntu 10.04 (Lucid Lynx) is working great on the Asus Eeepc 901. Only the support for the RaLink RT2860 wireless chip is not that great, sometimes the system refuses to connect to a wireless network.  The best approach seems to be installing the backport package that brings a newer version of the driver:

sudo apt-get install linux-backports-modules-wireless-lucid-generic

or when the PAE kernel is being used:

sudo apt-get install linux-backports-modules-wireless-lucid-generic-pae

Connectivity is much better for me with the updated driver.

Categories: Linux Tags: , , , , , ,

Key ham radio transceiver from command line

October 3, 2009 2 comments

Related to the hamfax project, i have been asked how to key a ham radio transmitter that is connected to the serial port. So far this is fairly untested, i only put together what i think would solve the problem. Please use this as input for your own solutions if it helps you. If something is wrong, i would appreciate corrections.

Basically, this is just a simple program to make use of the circuit at http://www.baycom.org/~tom/pcf/ptt_circ/ptt.html#serial

C program serial_rts_set.c

#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <termios.h>

/*
  Usage: serial_rts_set device_file sleep/seconds
  e.g.   serial_rts_set /dev/ttyS0 10000
*/

int main(int argc, char** argv)
{
  char* devfile;
  int fd;
  int rc;
  int status;
  unsigned int seconds;

  if(argc<3) {
     puts("Not enough arguments.\n\n"
          "Usage: serial_rts_set devicefile timeout\n"
          "devicefile   Device file for serial port, e.g. /dev/ttyS0\n"
          "timeout      Timeout in seconds\n");
     exit(1);
  }

  devfile = argv[1];

  seconds = 0;
  sscanf(argv[2], "%d", &seconds);

  fd = open(devfile, O_RDWR);
  if(fd == -1) {
    perror("Could not open device file: ");
    exit(1);
  }

  rc = ioctl(fd, TIOCMGET,&status);
  if(rc == -1) {
    perror("Error during TIOCMGET: ");
    exit(1);
  }

  /* Set the RTS bit to raise the RTS line */
  status|=TIOCM_RTS;
  /* The reverse operation would be status&=~TIOCM_RTS; */

  rc = ioctl(fd, TIOCMSET, &status);
  if(rc == -1) {
    perror("Error during TIOCMSET: ");
    exit(1);
  }

  sleep(seconds);
}

Compile and use it with:

gcc -o serial_rts_set serial_rts_set.c

Test with

./serial_rts_set /dev/ttyS0 5

to set the RTS line for 5 seconds.

Running from a shell script

#!/bin/sh

# Start the RTS set program in the background and remember
# its process id (PID) for stopping it later. $! is the PID of the
# most recently executed background command.
#
# The time passed to sleep_rts_set has to be longer than the time
# that is actually used for keying the transmitter.
serial_rts_set /dev/ttyS0 20 &
RTS_PID=$!

# Do whatever is necessary while the transmitter is keyed
sleep 10

# Stop the transmit by stopping the RTS set program
kill $RTS_PID

References and more information

Categories: ham radio, Linux Tags: , ,

Ubuntu Jaunty, EeePC and Wireless

August 8, 2009 Leave a comment

Ubuntu Jaunty runs well on my EeePC 901. The main problem was that it would not connect to some encrypted. wireless networks. It seems that the problem is related to the device driver in the Linux kernel for the rta2860 wireless chip. The device driver is flagged as “staging” which means it is “not ready to be merged into the main portion of the Linux kernel tree at this point in time for various technical reasons”.

As it turns out, the driver is being  worked on and there is a patch that could fix the problem i am seeing. I did not want to compile the kernel and try to integrate it with the Ubuntu installation, but this is not necessary: The Ubuntu kernel team provides deb packages for current kernel releases and pre-releases. After downloading and installing the latest package (linux-image-2.6.31-020631rc5-generic_2.6.31-020631rc5_i386.deb as of the time of writing this) and booting into the new kernel, i can now connect to the wireless network i want to use.

Now i am happily wring this on the EeePC while being connected on the wireless network. The next release of Ubuntu (Karmic) will use the 2.6.31 version of the Linux kernel, which already has the wireless fix included.

Update: As it turns out, the mainline kernel packages for Ubuntu do not include the uvc webcam driver. So my plan B is to use the linux-image-generic package from karmic. Only this requires adding the kernel option nomodeset to the kopt= line in /boot/grub/menu.lst and running sudo /sbin/update-grub to get the change in the correct place in menu.lst. But now, both wireless and the webcam are working, i am hoping that no more tweaking is required.

Categories: Linux Tags: , , ,