Chinaunix首页 | 论坛 | 博客
  • 博客访问: 25857
  • 博文数量: 9
  • 博客积分: 198
  • 博客等级: 入伍新兵
  • 技术积分: 100
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-10 12:34
文章分类
文章存档

2011年(5)

2010年(4)

最近访客

分类:

2011-02-23 22:32:39

了解hwinfo的用法是因为。 我在做ppc64移值的时候。 公司买来一台ppc64机器,用自已移植出来的光盘没办认出光驱来。因为用光盘启动系统的时候,加载完内核后开始mount rootfs.根据自已配置的yaboot.conf中 root=/dev/cdrom.走到VFS的时候 不知道cdrom,系统无法运行下去,而提示只认出sda硬盘来。因为到了这里就报错了,也不知道光驱被系统认成什么了,当然也有可能认不着,又没有shell给我看。用suse系统查看认出来的是sr0,crux认出来的是hda.ubutntu的也是sr0。自已跟着这个结果试了我好几次,结果都不是,报废了我好几张dvd,后来想办让它引导到sda6中去。 因为sda6中有我编包的最小环境。也可以说相当于一个系统了。修改了rc.local文件加入bash,目的就是想让系统 把sda6当root mount 上后能让我有一个shell可以用。当mount 上的时候, 高兴死我了。 进dev一人,  我去了,没有。查看proc/sys/也没有cdrom 这东西。 这下好了, 我配制的内核没有把这个光驱驱动编进去,又不知道是什么类型的驱动。 后来hwinfo就用上了。下面对hwinfo用法说明:
hwinfo -h
 Usage: hwinfo [options]
Probe for hardware.
  --short        just a short listing
  --log logfile  write info to logfile
  --debug level  set debuglevel
  --version      show libhd version
  --dump-db n    dump hardware data base, 0: external, 1: internal
  --hw_item      probe for hw_item
  hw_item is one of:
   all, bios, block, bluetooth, braille, bridge, camera, cdrom, chipcard,
   cpu, disk, dsl, dvb, fingerprint, floppy, framebuffer, gfxcard, hub,
   ide, isapnp, isdn, joystick, keyboard, memory, modem, monitor, mouse,
   netcard, network, partition, pci, pcmcia, pcmcia-ctrl, pppoe, printer,
   scanner, scsi, smp, sound, storage-ctrl, sys, tape, tv, usb, usb-ctrl,
   vbe, wlan, zip

  Note: debug info is shown only in the log file. (If you specify a
  log file the debug level is implicitly set to a reasonable value.)
hwinfo 可以查看那么多硬件的信息(hw_item is one of 那行下面的都是)。 下面拿cdrom 为例说明

用指令hwinfo --cdrom
[Created at block.247]
  UDI: /org/freedesktop/Hal/devices/storage_model_DVD_RW__DVR_218L
  Unique ID: KD9E.FQCdxVfyfu6
  Parent ID: 7EWs.d7Jg0Ujuy3F
  SysFS ID: /class/block/sr0
  SysFS BusID: 2:0:0:0
  SysFS Device Link: /devices/pci0000:00/0000:00:11.0/host2/target2:0:0/2:0:0:0
  Hardware Class: cdrom
  Model: "PIONEER DVD-RW  DVR-218L"
  Vendor: "PIONEER"
  Device: "DVD-RW  DVR-218L"
  Revision: "1.02"
  Driver: "ahci", "sr"
  Driver Modules: "ahci"
  Device File: /dev/sr0 (/dev/sg0)
  Device Files: /dev/sr0, /dev/block/11:0, /dev/scd0, /dev/disk/by-path/pci-0000:00:11.0-scsi-0:0:0:0, /dev/cdrom, /dev/cdrw, /dev/dvd, /dev/dvdrw
  Device Number: block 11:0 (char 21:0)
  Features: CD-R, CD-RW, DVD, DVD-R, DVD-RW, DVD+R, DVD+RW, DVD+DL, DVDRAM
  Drive status: no medium
  Config Status: cfg=new, avail=yes, need=no, active=unknown
  Attached to: #4 (SATA controller)
  Drive Speed: 24
看这两行
Driver: "ahci", "sr"
Driver Modules: "ahci"
下面去内核文件去找吧。 find . -name "ahci" 发现
 ./drivers/ata/ahci.c
当然找驱动的进候,结果dmesg一起用,结果会更加精确。
然后编内核吧。
阅读(2305) | 评论(0) | 转发(0) |
0

上一篇:/Proc 目录详解

下一篇:suse 包管理工具

给主人留下些什么吧!~~