歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux基礎知識 >> 基礎知識 - 在linux下使用HPCD-Writer Plus 8210e (USB-接口)刻錄機

基礎知識 - 在linux下使用HPCD-Writer Plus 8210e (USB-接口)刻錄機

日期:2017/2/27 10:15:04   编辑:Linux基礎知識
在linux下使用HPCD-Writer Plus 8210e (USB-接口)刻錄機
2004-04-23 15:18 pm
來自:Linux文檔
現載:Www.8s8s.coM
地址:無名

內容: 如何在linux下使用 HP CD-Writer Plus 8210e (USB-接口)刻錄機
作者: Thomas Jaeger 翻譯SuperStar
Email:
Version: V1.1


目錄
1.0 介紹
1.1 先決條件
1.2 第一步
1.3 給Linux做准備工作
1.4 下面的步驟
1.5 試一下熱插拔
1.6 測試
1.7 准備好了嗎?刻錄了
1.8 鏈接

1.0 介紹
這是一篇詳細描述如何在linux下安裝使用HP CD-Writer Plus 8210e(USB-interface)這個刻錄機的文章。你會看到所有安裝所必須
的步驟。

1.1 先決條件
a. linux內核 >=V2.4.0-test8
b. cdrecord V1.10a4 (http://www.fokus.gmd.de/research/cc/glone/employees/joerg.schilling/private/cdrecord.html)
c. usbmgr V0.3.5 (http://www.wonder.ne.jp/~shuu/usbmgr/)
d. modutils-2.3.15 或者更新的版本 (非常重要!)
e. 裝有HP CD-Writer Plus 8210e刻錄機的電腦

1.2 第一步
請先查看你的BIOS裡面的設置,看是否已經允許使用usb接口。如果你用同一台電腦,並且在MS Win下面可以正常得使用這個刻錄機,
那你可以省去檢查BIOS這一步。

1.3 給Linux做准備工作
你必須對編譯和升級內核100%的熟悉。如果你對此是個新手的話,那你要當心。因為你可能造成舊內核的丟失或者不能引導等問題。
我建議使用模塊化的內核配置,因此你要對"insmod","lsmod","modprobe","depmod"等命令非常的熟悉。

1.3.1 menuconfig
下面的是我配置內核時所選的選項:
Code maturity level options -->-
[*] Prompt for development and/or incomplete code/drivers
Loadable module support --->
[*] Enable loadable module support
[*] Set version information on all module symbols
[*] Kernel module loader
Block devices --->
Loopback device support
SCSI support --->
SCSI support
SCSI disk support
SCSI CD-ROM support
[*] Enable vendor-specific extensions (for SCSI CDROM)
(2) Maximum number of CDROM devices that can be loaded as modules
SCSI generic support
[*] Enable extra checks in new queueing code
[*] Verbose SCSI error reporting (kernel size +=12K)
[*] SCSI logging facility
SCSI low-level drivers --->
deactivate any SCSI-Device you don have!
File systems --->
ISO 9660 CDROM file system support
[*] Microsoft Joliet CDROM extensions
[*] /proc file system support
UDF file system support (read only)
USB support --->
Support for USB
[*] USB verbose debug messages
[*] Preliminary USB device filesystem
[*] Enforce USB bandwidth allocation (EXPERIMENTAL)
--- USB Controllers
UHCI (Intel PIIX4, VIA, ...) support
<> OHCI (Compaq, iMacs, OPTi, SiS, ALi, ...) support
Select the correct USB Controller for your System!!!!!!
USB Mass Storage support

這些就是所以和配置使用我的HP CD-Writer Plus 8210e刻錄機有關的選項。我用的是V2.4.0-test8的內核。
編譯的時候會有大量的編譯調試信息,如果正常的話他們可以不管他們,但如果發生問題的時候,他們可以幫助你查找的原因。
再次警告:如果你對配置和安裝新內核不是很熟悉的話建議要當心,這樣是有一定風險的。

1.3.2安裝模塊
當你的新內核和模塊編譯完成後,你會在modules目錄下面發現下面這些模塊文件:
cd /lib/modules/2.4.0-test8
cd kernel
ls fs/isofs
isofs.o
ls drivers/cdrom
cdrom.o
ls drivers/scsi
scsi_mod.o sd.o sg.o sr_mod.o
ls drivers/usb
storage usb-uhci.o usbcore.o
ls drivers/usb/storage
usb-storage.o

重新啟動!

1.4 下面的步驟
下載usbmgr包,解壓縮並閱讀README文件。在解壓後的目錄裡用make進行編譯。然後make install。現在我們配置usbmgr的
配置文件usbmgr.conf,它放在/etc/usbmgr目錄下。編輯這個文件,進行下面幾步:
a) 去掉在HOST CONTROLLER這節裡面的某個host選項前面的注釋符"#".在我的計算機上是這樣設置的: host usb-uhci
b) 把下面三行加到STORAGE一節裡的vendor 0x3f0 product 0x107這個模塊的最後。
scsi_mod, sr_mod, usb-storage
現在你要運行"update_usbdb"這個命令:update_usedb usbmgr.conf
接下去運行"usbmgr"命令。這個命令在後台執行,所以你看不到任何結果輸出。但是你可以通過查看messages文件來查看運行情況:
tail -n50 /var/log/messages
正常的輸出應該像這樣的:
Sep 15 12:55:28 usbmgr[326]: start 0.3.5
Sep 15 12:55:28 usbmgr[328]: open error "/etc/usbmgr/preload.conf"
Sep 15 12:55:28 kernel: usb.c: registered new driver usbdevfs
Sep 15 12:55:28 kernel: usb.c: registered new driver hub
Sep 15 12:55:28 kernel: usb-uhci.c: $Revision: 1.237 $ time 11:07:02 Sep 10 2000
Sep 15 12:55:28 kernel: usb-uhci.c: High bandwidth mode enabled
Sep 15 12:55:28 kernel: usb-uhci.c: USB UHCI at I/O 0xfce0, IRQ 10
Sep 15 12:55:28 kernel: usb-uhci.c: Detected 2 ports
Sep 15 12:55:28 kernel: usb.c: new USB bus registered, assigned bus number 1
Sep 15 12:55:28 kernel: usb.c: USB new device connect, assigned device number 1
Sep 15 12:55:28 kernel: usb.c: kmalloc IF c2e1f760, numif 1
Sep 15 12:55:28 kernel: usb.c: new device strings: Mfr=0, Product=2, SerialNumber=1
Sep 15 12:55:28 kernel: usb.c: USB device number 1 default language ID 0x0
Sep 15 12:55:28 kernel: Product: USB UHCI Root Hub
Sep 15 12:55:28 kernel: SerialNumber: fce0
Sep 15 12:55:28 kernel: hub.c: USB hub found
Sep 15 12:55:28 kernel: hub.c: 2 ports detected
Sep 15 12:55:28 kernel: hub.c: ganged power switching
Sep 15 12:55:28 kernel: hub.c: standalone hub
Sep 15 12:55:28 kernel: hub.c: global over-current protection
Sep 15 12:55:28 kernel: hub.c: power on to power good time: 2ms
Sep 15 12:55:28 kernel: hub.c: hub controller current requirement: 0mA
Sep 15 12:55:28 kernel: hub.c: port 1 is removable
Sep 15 12:55:28 kernel: hub.c: port 2 is removable
Sep 15 12:55:28 kernel: hub.c: local power source is good
Sep 15 12:55:28 kernel: hub.c: no over-current condition exists
Sep 15 12:55:28 kernel: hub.c: enabling power on all ports
Sep 15 12:55:28 kernel: usb.c: hub driver claimed interface c2e1f760
Sep 15 12:55:28 kernel: usb.c: kusbd: /sbin/hotplug add 1
Sep 15 12:55:28 kernel: usb.c: kusbd policy returned 0x0
Sep 15 12:55:28 usbmgr[328]: "usb-uhci" was loaded
Sep 15 12:55:28 usbmgr[332]: mount /proc/bus/usb
Sep 15 12:55:28 usbmgr[328]: USB device is matched the configuration
Sep 15 12:55:28 usbmgr[328]: "none" isn loaded

這裡還有兩個文件需要查看:
a) cat /proc/interrupts

CPU0
0: 991954 XT-PIC timer
1: 19880 XT-PIC keyboard
2: 0 XT-PIC cascade
8: 2 XT-PIC rtc
9: 14 XT-PIC Cirrus Logic PD 6832, Cirrus Logic PD 6832 (#2)
10: 42 XT-PIC usb-uhci
12: 243881 XT-PIC PS/2 Mouse
13: 0 XT-PIC fpu
14: 16314 XT-PIC ide0
NMI: 0
ERR: 0

結果:可以看到usb-uchi已經起來了,並且被分配了一個中斷:這裡是:int10

b) lsmod

usb-uhci 21708 0 (unused)
usbcore 49856 1 [usb-uhci]
nfsd 69928 4 (autoclean)
lockd 49340 1 (autoclean) [nfsd]
sunrpc 58244 1 (autoclean) [nfsd lockd]
unix 14372 37 (autoclean)

結果:模塊"usb-uhci"和"usbcore"應該在這裡羅列。

1.5. 試一下熱插拔
把帶電的HP CD-Writer Plus 8210e 刻錄機插到你主機的USB接口上。這樣就會觸動usbmgr程序來引導必須的模塊。讓我們
先查看一下:tail -n50 /var/log/messages。新的輸出應該是報告熱插拔這個事件的,所以顯示像下面這樣:
Sep 15 13:13:07 kernel: hub.c: port 1 connection change
Sep 15 13:13:07 kernel: hub.c: portstatus 101, change 1, 12 Mb/s
Sep 15 13:13:08 kernel: hub.c: portstatus 103, change 0, 12 Mb/s
Sep 15 13:13:08 kernel: usb.c: USB new device connect, assigned device number 2
Sep 15 13:13:08 kernel: usb.c: kmalloc IF c2e1f660, numif 1
Sep 15 13:13:08 kernel: usb.c: new device strings: Mfr=1, Product=2, SerialNumber=0
Sep 15 13:13:08 kernel: usb.c: USB device number 2 default language ID 0x409
Sep 15 13:13:08 kernel: Manufacturer: Shuttle Technology Inc.
Sep 15 13:13:08 kernel: Product: HP USB CD-Writer Plus
Sep 15 13:13:08 kernel: usb.c: unhandled interfaces on device
Sep 15 13:13:08 kernel: usb.c: USB device 2 (prod/vend 0x3f0/0x107) is not claimed [..]
Sep 15 13:13:08 kernel: Length = 18
Sep 15 13:13:08 kernel: DescriptorType = 01
Sep 15 13:13:08 kernel: USB version = 1.00
Sep 15 13:13:08 kernel: Vendor:Product = 03f0:0107
Sep 15 13:13:08 kernel: MaxPacketSize0 = 64
Sep 15 13:13:08 kernel: NumConfigurations = 1
Sep 15 13:13:08 kernel: Device version = 2.00
Sep 15 13:13:08 kernel: Device Class:SubClass:Protocol = 00:00:00
Sep 15 13:13:08 kernel: Per-interface classes
Sep 15 13:13:08 kernel: Configuration:
Sep 15 13:13:08 kernel: bLength = 9
Sep 15 13:13:08 kernel: bDescriptorType = 02
Sep 15 13:13:08 kernel: wTotalLength = 0027
Sep 15 13:13:08 kernel: bNumInterfaces = 01
Sep 15 13:13:08 kernel: bConfigurationValue = 01
Sep 15 13:13:08 kernel: iConfiguration = 03
Sep 15 13:13:08 kernel: bmAttributes = 40
Sep 15 13:13:08 kernel: MaxPower = 0mA
Sep 15 13:13:08 kernel:
Sep 15 13:13:08 kernel: Interface: 0
Sep 15 13:13:08 kernel: Alternate Setting: 0
Sep 15 13:13:08 kernel: bLength = 9
Sep 15 13:13:08 kernel: bDescriptorType = 04
Sep 15 13:13:08 kernel: bInterfaceNumber = 00
Sep 15 13:13:08 kernel: bAlternateSetting = 00
Sep 15 13:13:08 kernel: bNumEndpoints = 03
Sep 15 13:13:08 kernel: bInterface Class:SubClass:Protocol = ff:00:00
Sep 15 13:13:08 kernel: iInterface = 04
Sep 15 13:13:08 kernel: Endpoint:
Sep 15 13:13:08 kernel: bLength = 7
Sep 15 13:13:08 kernel: bDescriptorType = 05
Sep 15 13:13:08 kernel: bEndpointAddress = 01 (out)
Sep 15 13:13:08 kernel: bmAttributes = 02 (Bulk)
Sep 15 13:13:08 kernel: wMaxPacketSize = 0040
Sep 15 13:13:08 kernel: bInterval = 00
Sep 15 13:13:08 kernel: Endpoint:
Sep 15 13:13:08 kernel: bLength = 7
Sep 15 13:13:08 kernel: bDescriptorType = 05
Sep 15 13:13:08 kernel: bEndpointAddress = 82 (in)
Sep 15 13:13:08 kernel: bmAttributes = 02 (Bulk)
Sep 15 13:13:08 kernel: wMaxPacketSize = 0040
Sep 15 13:13:08 kernel: bInterval = 00
Sep 15 13:13:08 kernel: Endpoint:
Sep 15 13:13:08 kernel: bLength = 7
Sep 15 13:13:08 kernel: bDescriptorType = 05
Sep 15 13:13:08 kernel: bEndpointAddress = 83 (in)
Sep 15 13:13:08 kernel: bmAttributes = 03 (Interrupt)
Sep 15 13:13:08 kernel: wMaxPacketSize = 0002
Sep 15 13:13:08 kernel: bInterval = 20
Sep 15 13:13:08 kernel: usb.c: kusbd: /sbin/hotplug add 2
Sep 15 13:13:08 kernel: usb.c: kusbd policy returned 0x0
Sep 15 13:13:08 usbmgr[328]: USB device is matched the configuration
Sep 15 13:13:08 kernel: usb.c: registered new driver usb-storage
Sep 15 13:13:08 kernel: scsi0 : SCSI emulation for USB Mass Storage devices
Sep 15 13:13:08 kernel: scsi : 1 host.
Sep 15 13:15:55 kernel: Vendor: HP Model: CD-Writer+ 8200 Rev: 1.0f
Sep 15 13:15:55 kernel: Type: CD-ROM ANSI SCSI revision: 02
Sep 15 13:15:55 kernel: Detected scsi CD-ROM sr0 at scsi0, channel 0, id 0, lun 0
Sep 15 13:15:55 kernel: sr0: scsi3-mmc drive: 8x/24x writer cd/rw xa/form2 cdda tray
Sep 15 13:15:55 kernel: Uniform CD-ROM driver Revision: 3.11
Sep 15 13:13:08 kernel: WARNING: USB Mass Storage data integrity not assured
Sep 15 13:13:08 kernel: USB Mass Storage device found at 2
Sep 15 13:13:08 kernel: usb.c: usb-storage driver claimed interface c2e1f660
Sep 15 13:13:08 kernel: USB Mass Storage support registered.
Sep 15 13:13:08 usbmgr[328]: "scsi_mod" was loaded
Sep 15 13:13:08 usbmgr[328]: "sr_mod" was loaded
Sep 15 13:13:08 usbmgr[328]: "usb-storage" was loaded

請先檢查這行:USB device 2 (prod/vend 0x3f0/0x107)...,如果你得到的是同樣的ID號(0x3f0/0x107),那就說明你安裝
的是HP8210e,如果你得到的ID是(0x3f0/0x207),那麼說明你安裝的是HP8230e,它還沒有被支持。
下面的12行十分重要。在"scsi: 1 host:"之後顯示的是這個刻錄機的有關信息。
"Detected scsi CD-ROM sr0 at scsi0, channel 0, id 0, lun 0"這行告訴你你的刻錄機已經被系統發現,並且設備名稱是
/dev/sr0。在其他的linux版本裡可能會是/dev/scd0。這兩個是沒有區別的。看messages文件裡面顯示的什麼就是什麼了。
可能是我的電腦太舊了,有的時候這個過程不一定成功,如果你發現信息裡面沒有出現供應商的名稱,那你就需要重新插拔一次。兩三次
後應該就沒有問題了。

1.6 測試
初次的測試可以是放一張普通的光盤到刻錄機裡,然後mount上去:mount -r -t iso9660 /dev/sr0。
接下去就是測試刻錄了:(cdrtools-1.10a04 這個包應該事先已經裝好),用cdrecord -scanbus 可以查看刻錄機信息:
Cdrecord 1.10a04 (i586-pc-linux-gnu) Copyright (C) 1995-2000 J??Schilling
Linux sg driver version: 3.1.16
Using libscg version schily-0.4
scsibus0:
0,0,0 0) HP CD-Writer+ 8200 1.0f Removable CD-ROM
0,1,0 1) *
0,2,0 2) *
0,3,0 3) *
0,4,0 4) *
0,5,0 5) *
0,6,0 6) *
0,7,0 7) *
如果想看更多的信息,可以用:cdrecord -prcap -inq dev=0,0,0 返回的是:
Cdrecord 1.10a04 (i586-pc-linux-gnu) Copyright (C) 1995-2000 J??Schilling
scsidev: ,0,0
scsibus: 0 target: 0 lun: 0
Linux sg driver version: 3.1.16
Using libscg version schily-0.4
Device type : Removable CD-ROM
Version : 2
Response Format: 1
Vendor_info : HP
Identifikation : CD-Writer+ 8200
Revision : 1.0f
Device seems to be: Generic mmc CD-RW.
Drive capabilities, per page 2A:
Does read CD-R media
Does write CD-R media
Does read CD-RW media
Does write CD-RW media
Does not read DVD-ROM media
Does not read DVD-R media
Does not write DVD-R media
Does not read DVD-RAM media
Does not write DVD-RAM media
Does support test writing
Does read Mode 2 Form 1 blocks
Does read Mode 2 Form 2 blocks
Does read digital audio blocks
Does restart non-streamed digital audio reads accurately
Does not support BURN-Proof (Sanyo)
Does read multi-session CDs
Does read fixed-packet CD media using Method 2
Does not read CD bar code
Does not read R-W subcode information
Does read raw P-W subcode data from lead in
Does return CD media catalog number
Does return CD ISRC information
Does not support C2 error pointers
Does not deliver composite A/V data
Does play audio CDs
Number of volume control levels: 256
Does support individual volume control setting for each channel
Does support independent mute setting for each channel
Does not support digital output on port 1
Does not support digital output on port 2
Loading mechanism type: tray
Does support ejection of CD via START/STOP command
Does not lock media on power up via prevent jumper
Does allow media to be locked in the drive via PREVENT/ALLOW command
Is not currently in a media-locked state
Does not support changing side of disk
Does not have load-empty-slot-in-changer feature
Does not support Individual Disk Present feature
Maximum read speed in kB/s: 4234
Current read speed in kB/s: 4234
Maximum write speed in kB/s: 706
Current write speed in kB/s: 706
Buffer size in KB: 2048

現在我們准備刻錄了。我用的是cdrtools-1.10a04軟件包。當然事先要看一下README文件。做的第一個測試是:(先放一張新的刻錄盤)
mkisofs -L -l -J -r file1 file2 dir1 dir2 | cdrecord -v -pad -eject -dummy -nofix fs=4m speed=4 dev=0,0,0 -
這個命令把file1,file2,dir1,dir2做成一個iso9660格式的鏡像文件,它使用了-J,-r參數,並通過管道直接傳給cdrecord程序。
cdrecord程序會按照冗余模式測試寫完整個光盤。但這個只是測試,並沒有真正的寫到刻錄盤上。這個命令使用了4M的RAM作為buff,
並使用了4速刻錄,使用的設備是scsi-device 0,0,0.請注意最後的那個破折號"-",它告訴cdrecord數據是來自於管道的。請查看這個
測試刻錄是不是有問題。請記住一點:一張光盤的最大容量是650M,在你刻錄前請先查看要刻錄的容量。

真正的刻錄命令應該是:
mkisofs -L -l -J -r file1 file2 dir1 dir2 | cdrecord -v -pad -eject fs=4m speed=4 dev=0,0,0 -
你要把-dummy -nofix 這兩個參數去掉。
如果你用新的CD-RW光盤就需要用下面這個命令:
mkisofs -L -l -J -r file1 file2 dir1 dir2 | cdrecord -v -pad -eject blank=fast fs=4m speed=4 dev=0,0,0 -
這個命令中的blank=fast參數將把CD-RW上的數據全部抹去,所以要當心使用。還要注意:千萬不要在刻錄的時候進行熱插拔。
這樣會造成光盤甚至你的linux系統的破壞。所以記住在拔掉前一定要先取出光盤,以防萬一。

1.8 鏈接
Linux USB-ProjectLinux-CD-Writing-HOWTO

Copyright © Linux教程網 All Rights Reserved