红联Linux门户
Linux帮助

求教:linux是怎样查找硬件设备的

发布时间:2009-05-06 15:10:04来源:红联作者:wdnyz_yf
比如我先用的是lcd显示器,它能自动查找并进行xorg.conf配置,后面我换成1个5寸的小屏,它还是能自动配置,到底是哪里的哪个文件进行的工作?求大大帮忙!!
文章评论

共有 13 条评论

  1. kinggo119 于 2009-06-02 18:53:00发表:

    学到不少东西

  2. xht0529 于 2009-06-02 18:16:32发表:

    学到不少东西

  3. wang7131984 于 2009-05-19 17:19:17发表:

    xorg server进程会首选你定义的第一分辨率,也就是xorg.conf中定义分辨率那个选项从左到右的第一个 如:
    xxx(什么选项不记得了) "1024*xxx" "800*640" "yyy*nnn"
    那么它会优先选择"1024*xxx,如果你的显示器不支持这个分辨率怎么办?作为一个程序员,我肯定会让它自动选择“800*640”,如果还不支持选择最后一个,再不支持就报错。
    这是通过一般的常识和基本的知识来猜测的,如果还想了解到底它怎么实现的,那只能看源码了

  4. xht0529 于 2009-05-19 17:10:23发表:

    来学习的

  5. lovemmlzy 于 2009-05-14 17:10:10发表:

    来学习的

  6. 微宝贝 于 2009-05-12 18:53:35发表:

    xorg有那么神奇吗?我没有试过是不是换个显示器它自己会修改分辨率,,,
    只知道xorg有很多分辨率配置在里面,也许它会自己检测并找到最佳的的分辨率。

  7. wdnyz_yf 于 2009-05-11 11:22:16发表:

    刚有人说用
    dmesg >>sysinfo.txt
    vim sysinfo.txt可以可以看到,我自己作了遍,没有看明白sysinfo.txt里面写的什么东西[code]Initializing cgroup subsys cpuset
    Initializing cgroup subsys cpu
    Linux version 2.6.25-14.fc9.i686 (mockbuild@) (gcc version 4.3.0 20080428 (Red Hat 4.3.0-8) (GCC) ) #1 SMP Thu May 1 06:28:41 EDT 2008
    BIOS-provided physical RAM map:
    BIOS-e820: 0000000000000000 - 000000000009e000 (usable)
    BIOS-e820: 000000000009e000 - 00000000000a0000 (reserved)
    BIOS-e820: 00000000000dc000 - 00000000000e0000 (reserved)
    BIOS-e820: 00000000000e4000 - 0000000000100000 (reserved)
    BIOS-e820: 0000000000100000 - 000000003f680000 (usable)
    BIOS-e820: 000000003f680000 - 000000003f690000 (ACPI data)
    BIOS-e820: 000000003f690000 - 000000003f700000 (ACPI NVS)
    BIOS-e820: 000000003f700000 - 0000000040000000 (reserved)
    BIOS-e820: 00000000fec00000 - 00000000fec10000 (reserved)
    BIOS-e820: 00000000fed1c000 - 00000000fed20000 (reserved)
    BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
    BIOS-e820: 00000000ff000000 - 0000000100000000 (reserved)
    118MB HIGHMEM available.
    896MB LOWMEM available.
    Scan SMP from c0000000 for 1024 bytes.
    Scan SMP from c009fc00 for 1024 bytes.
    Scan SMP from c00f0000 for 65536 bytes.
    found SMP MP-table at [c00f7190] 000f7190
    Using x86 segment limits to approximate NX protection
    Entering add_active_range(0, 0, 259712) 0 entries of 256 used
    Zone PFN ranges:
    DMA 0 -> 4096
    Normal 4096 -> 229376
    HighMem 229376 -> 259712
    Movable zone start PFN for each node
    early_node_map[1] active PFN ranges
    0: 0 -> 259712
    On node 0 totalpages: 259712
    DMA zone: 32 pages used for memmap
    DMA zone: 0 pages reserved
    DMA zone: 4064 pages, LIFO batch:0
    Normal zone: 1760 pages used for memmap
    Normal zone: 223520 pages, LIFO batch:31
    HighMem zone: 237 pages used for memmap
    HighMem zone: 30099 pages, LIFO batch:7
    Movable zone: 0 pages used for memmap
    DMI present.
    Using APIC driver default
    ACPI: RSDP 000F6FE0, 0014 (r0 LENOVO)
    ACPI: RSDT 3F6887B9, 003C (r1 LENOVO TC-2O 40 LTP 0)
    ACPI: FACP 3F68FE8E, 0074 (r1 LENOVO TC-2O 40 PTL 3)
    ACPI: DSDT 3F68A027, 5E67 (r1 INTEL BR_2OTER 40 MSFT 100000E)
    ACPI: FACS 3F692FC0, 0040
    ACPI: TCPA 3F68FF02, 0032 (r2 LENOVO THI2OCEN 40 PTL 1)
    ACPI: MCFG 3F68FF34, 003C (r1 PTLTD M2OG 40 LTP 0)
    ACPI: APIC 3F68FF70, 0068 (r1 PTLTD A2OC 40 LTP 0)
    ACPI: BOOT 3F68FFD8, 0028 (r1 PTLTD $SB2OBL$ 40 LTP 1)
    ACPI: SSDT 3F6887F5, 13EC (r1 PmRef CpuPm 3000 INTL 20050228)
    ACPI: PM-Timer IO Port: 0x1008
    ACPI: Local APIC address 0xfee00000
    ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled)
    Processor #0 6:15 APIC version 20
    ACPI: LAPIC (acpi_id[0x01] lapic_id[0x01] enabled)
    Processor #1 6:15 APIC version 20
    ACPI: LAPIC_NMI (acpi_id[0x00] high edge lint[0x1])
    ACPI: LAPIC_NMI (acpi_id[0x01] high edge lint[0x1])
    ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base[0])
    IOAPIC[0]: apic_id 2, version 32, address 0xfec00000, GSI 0-23
    ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 high edge)
    ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
    ACPI: IRQ0 used by override.
    ACPI: IRQ2 used by override.
    ACPI: IRQ9 used by override.
    Enabling APIC mode: Flat. Using 1 I/O APICs
    Using ACPI (MADT) for SMP configuration information
    Allocating PCI resources starting at 50000000 (gap: 40000000:bec00000)
    PM: Registered nosave memory: 000000000009e000 - 00000000000a0000
    PM: Registered nosave memory: 00000000000a0000 - 00000000000dc000
    PM: Registered nosave memory: 00000000000dc000 - 00000000000e0000
    PM: Registered nosave memory: 00000000000e0000 - 00000000000e4000
    PM: Registered nosave memory: 00000000000e4000 - 0000000000100000
    Built 1 zonelists in Zone order, mobility grouping on. Total pages: 257683
    Kernel command line: ro root=UUID=b16d9d3d-e89f-40cc-9550-47a1a6fec648
    mapped APIC to ffffb000 (fee00000)
    mapped IOAPIC to ffffa000 (fec00000)
    Enabling fast FPU save and restore... done.
    Enabling unmasked SIMD FPU exception support... done.
    Initializing CPU#0
    CPU 0 irqstacks, hard=c07b9000 soft=c0799000
    PID hash table entries: 4096 (order: 12, 16384 bytes)
    Detected 1862.055 MHz processor.
    Console: colour VGA+ 80x25
    console [tty0] enabled
    Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
    Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
    Memory: 1021924k/1038848k available (2236k kernel code, 16180k reserved, 1121k data, 284k init, 121344k highmem)
    virtual kernel memory layout:
    fixmap : 0xffc53000 - 0xfffff000 (3760 kB)
    pkmap : 0xff400000 - 0xff800000 (4096 kB)
    vmalloc : 0xf8800000 - 0xff3fe000 ( 107 MB)
    lowmem : 0xc0000000 - 0xf8000000 ( 896 MB)
    .init : 0xc074f000 - 0xc0796000 ( 284 kB)
    .data : 0xc062f37d - 0xc0747800 (1121 kB)
    .text : 0xc0400000 - 0xc062f37d (2236 kB)
    Checking if this processor honours the WP bit even in supervisor mode...Ok.
    CPA: page pool initialized 1 of 1 pages preallocated
    SLUB: Genslabs=12, HWalign=64, Order=0-1, MinObjects=4, CPUs=2, Nodes=1
    Calibrating delay using timer specific routine.. 3726.00 BogoMIPS (lpj=1863000)
    Security Framework initialized
    SELinux: Initializing.
    SELinux: Starting in permissive mode
    selinux_register_security: Registering secondary module capability
    Capability LSM initialized as secondary
    Mount-cache hash table entries: 512
    Initializing cgroup subsys ns
    Initializing cgroup subsys cpuacct
    CPU: L1 I cache: 32K, L1 D cache: 32K
    CPU: L2 cache: 2048K
    CPU: Physical Processor ID: 0
    CPU: Processor Core ID: 0
    Intel machine check architecture supported.
    Intel machine check reporting enabled on CPU#0.
    using mwait in idle threads.
    Compat vDSO mapped to ffffe000.
    Checking 'hlt' instruction... OK.
    ACPI: Core revision 20070126
    CPU0: Intel(R) Core(TM)2 CPU 6300 @ 1.86GHz stepping 02
    Booting processor 1/1 ip 4000
    CPU 1 irqstacks, hard=c07ba000 soft=c079a000
    Initializing CPU#1
    Calibrating delay using timer specific routine.. 3723.47 BogoMIPS (lpj=1861738)
    CPU: L1 I cache: 32K, L1 D cache: 32K
    CPU: L2 cache: 2048K
    CPU: Physical Processor ID: 0
    CPU: Processor Core ID: 1[/code]这是代码片段,整个代码有2000多行。

  8. wdnyz_yf 于 2009-05-11 08:37:55发表:

    来人阿,继续等:0w223dc

  9. wdnyz_yf 于 2009-05-07 16:36:48发表:

    引用:
    那是xorg自动检测的
    hantu 发表于 2009-5-6 18:36

    没有脚本什么的在中间起作用吗?

  10. wdnyz_yf 于 2009-05-07 16:27:08发表:

    引用:
    你问这个干什么,你是不是要开发新版本
    wangfeng819 发表于 2009-5-6 18:57

    昨天组长要我来找这个,可是我对这个一点不懂,好像是要开发个新的,但是又不是完全由自己开发

  11. angel.wing 于 2009-05-06 22:43:56发表:

    支持沙发

  12. wangfeng819 于 2009-05-06 18:57:32发表:

    你问这个干什么,你是不是要开发新版本

  13. hantu 于 2009-05-06 18:36:57发表:

    那是xorg自动检测的