Wednesday, May 14, 2008

Burn CD with wodim

#!/bin/bash

function getkey()
{
read yourentry
}
DEV=/dev/scd0
TMP_FILE=/tmp/cd_data.raw

wodim dev=${DEV} -setdropts driveropts=singlesession
wodim dev=${DEV} -v -sao -dummy -data speed=18 $1
wodim dev=${DEV} -eject
wodim dev=${DEV} -load

Clone a CD in Linux with wodim

Here's the content of my ~/bin/copycd:


function getkey()
{
read yourentry
}
DEV=/dev/scd0
TMP_FILE=/tmp/cd_data.raw
echo Please enter the CD/DVD to copy from ....
getkey

readom dev=${DEV} -nocorr f=${TMP_FILE}
echo Please enter a blank CD/DVD and press enter when ready ....
getkey

#readom dev=${DEV} -w -nocorr f=${TMP_FILE}
wodim dev=${DEV} -setdropts driveropts=singlesession
wodim dev=${DEV} -dao -v ${TMP_FILE}


wodim -eject

Friday, May 9, 2008

Why VirtualBox is better

I'd tried to load up QEMU or Xen with no success on my OpenSUSE 64-bit ver 10.3 (I am running kernel version 2.6.25).  I then tried VirtualBox OSE (Open Source Edition) downloadable from www.virtualbox.de.  After installing all the needed libraries as instructed and compiled this VB, it worked as charm!

With QEMU or Xen, there were problems I couldn't fix (this because my Linux is heavily customized and not running kernel from openSuSE anymore).  I also tried the pre-compiled (proprietary/non-OSE) version, and this actually even better.  As mentioned on the website, the proprietary version supports USB and file sharing between host and guest O/S.

So far, I am able to run my Windows XP Pro SP3 under this Linux 64-bit with no problem.  I could print, browse internet and even play games (eventhough it is slower than running in native/standalon XP).  With file sharing, I could install Microsoft Office in the guest O/S and share the doc/xls/ppt files.

For the networking, the VB provides a firewall and NAT.  The subnet it gives is in 10.x.x.x subnet, but work with no issues. 

I still have small issue though as the screen resolution under XP is limited to 1024x968, eventhough the host O/S (Linux) has nvidia driver and was running resolution 1680x1050.  But interestingly, on my MacBook running OSX 10.4 Tiger, I could set the screen resolution as much as 1680x1050 (which is even beyond my laptop resolution).  Why?

With Windows XP as host O/S, I initially tried Microsoft Virtual PC.  The interface is good, but when I installed Linux OpenSUSE 10.3 (32-bit), the network worked sporadically and took almost a week to download necessary modules from opensuse.org!   I tried installed offline, the same issue happened.

After this painful waiting, finally I managed to install it, but everytime I rebooted the guest O/S it never came up correctly (the screen stayed blank after the initial OpenSUSE login screen).  I eventually dumped this stupid Virtualization tool completely and install VirtualBox.  Yes, as you might guess, it works like a charm on Windows XP too.  

I still need to try on Windows Vista though.  Will report it later.


What a tool!

Wednesday, April 23, 2008

VirtualBox 1.5.6 with Linux Kernel 2.6.25

While compiling VirtualBox was successful, the loading failed with kernel message (seen using dmesg | tail -f):

release/bin/src ; USER=root ; COMMAND=/sbin/modprobe vboxdrv
Apr 23 22:20:16 linux-hp kernel: vboxdrv: Unknown symbol change_page_attr


With the introduction of the new API, no driver nor non-archcore code needs to use change_page_attr anymore. What I did was to grep for "change_page_attr" in VirtualBox source directory:

grep -R --include=*.? "change_page_attr"

And comment out all calls to this procedure. Loading the module then succeeded:

release/bin/src ; USER=root ; COMMAND=/sbin/modprobe vboxdrv
Apr 23 22:27:53 linux-hp kernel: vboxdrv: Trying to deactivate the NMI watchdog permanently...
Apr 23 22:27:53 linux-hp kernel: vboxdrv: Successfully done.
Apr 23 22:27:53 linux-hp kernel: vboxdrv: TSC mode is 'synchronous', kernel timer mode is 'normal'.
Apr 23 22:27:53 linux-hp kernel: vboxdrv: Successfully loaded version 1.5.6_OSE (interface 0x00050002).

Monday, April 21, 2008

Canon 4200F is still unsupported on Linux

lsusb -d 04a9:221b -vvv


lsusb -d 04a9:221b -vvv

Bus 007 Device 002: ID 04a9:221b Canon, Inc.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 255 Vendor Specific Class
bDeviceSubClass 255 Vendor Specific Subclass
bDeviceProtocol 255 Vendor Specific Protocol
bMaxPacketSize0 64
idVendor 0x04a9 Canon, Inc.
idProduct 0x221b
bcdDevice 2.00
iManufacturer 3 Canon
iProduct 4 CanoScan
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 39
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
Self Powered
MaxPower 10mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0001 1x 1 bytes
bInterval 8
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 255 Vendor Specific Class
bDeviceSubClass 255 Vendor Specific Subclass
bDeviceProtocol 255 Vendor Specific Protocol
bMaxPacketSize0 64
bNumConfigurations 1
Device Status: 0x0001
Self Powered