2410linux终于可以使用文件系统了

原创作者:森森

不知不觉中买了realarm-2410开发板差不多有一个月了,好不容易WinCE4.2可以使用了,可是Linux2.42一直运行不了,越是着急越是用不了。可我一直都没有放弃,为此,不知道走了多少冤枉路。

为这,还把电脑串口给烧坏了。害了我又到珠江路去买了一个pci转双串口卡,可在Windows倒是有驱动,在LIniux操作系统却不知道怎么使用,不知道怎么搞驱动啊,好不容易泡在网上好几天才搞明白了,终于可以在Liunx操作系统中用PCI转串口了。下面是安装驱动的步骤及显示的内容:

[root@localhost root]# setserial /dev/ttyS0 -a
/dev/ttyS0, Line 0, UART: 16550A, Port: 0x03f8, IRQ: 4
        Baud_base: 115200, close_delay: 500, divisor: 0
        closing_wait: 30000
        Flags: spd_normal skip_test auto_irq

[root@localhost root]# setserial /dev/ttyS1 -a
/dev/ttyS1, Line 1, UART: 16550A, Port: 0x02f8, IRQ: 3
        Baud_base: 115200, close_delay: 500, divisor: 0
        closing_wait: 30000
        Flags: spd_normal skip_test auto_irq

[root@localhost root]# setserial /dev/ttyS2 -a
/dev/ttyS2, Line 2, UART: unknown, Port: 0x03e8, IRQ: 4
        Baud_base: 115200, close_delay: 500, divisor: 0
        closing_wait: 30000
        Flags: spd_normal skip_test auto_irq

[root@localhost root]# more /proc/pci
PCI devices found:
  Bus  0, device   0, function  0:
    Class 0600: PCI device 8086:2560 (rev 3).
      Prefetchable 32 bit memory at 0xe8000000 [0xebffffff].
  Bus  0, device   2, function  0:
    Class 0300: PCI device 8086:2562 (rev 3).
      IRQ 5.
      Prefetchable 32 bit memory at 0xe0000000 [0xe7ffffff].
      Non-prefetchable 32 bit memory at 0xec100000 [0xec17ffff].
  Bus  0, device  29, function  0:
    Class 0c03: PCI device 8086:24c2 (rev 2).
      IRQ 5.
      I/O at 0xd800 [0xd81f].
  Bus  0, device  29, function  1:
    Class 0c03: PCI device 8086:24c4 (rev 2).
      IRQ 11.
      I/O at 0xd000 [0xd01f].
  Bus  0, device  29, function  2:
    Class 0c03: PCI device 8086:24c7 (rev 2).
      IRQ 9.
      I/O at 0xd400 [0xd41f].
  Bus  0, device  29, function  7:
    Class 0c03: PCI device 8086:24cd (rev 2).
      IRQ 9.
      Non-prefetchable 32 bit memory at 0xec180000 [0xec1803ff].
  Bus  0, device  30, function  0:
    Class 0604: PCI device 8086:244e (rev 130).
      Master Capable.  No bursts.  Min Gnt=6.
  Bus  0, device  31, function  0:
    Class 0601: PCI device 8086:24c0 (rev 2).
  Bus  0, device  31, function  1:
    Class 0101: PCI device 8086:24cb (rev 2).
      IRQ 9.
      I/O at 0xf000 [0xf00f].
      Non-prefetchable 32 bit memory at 0x1f800000 [0x1f8003ff].
  Bus  0, device  31, function  3:
    Class 0c05: PCI device 8086:24c3 (rev 2).
      IRQ 11.
      I/O at 0x500 [0x51f].
  Bus  0, device  31, function  5:
    Class 0401: PCI device 8086:24c5 (rev 2).
      IRQ 11.
      I/O at 0xe000 [0xe0ff].
      I/O at 0xe400 [0xe43f].
      Non-prefetchable 32 bit memory at 0xec181000 [0xec1811ff].
      Non-prefetchable 32 bit memory at 0xec182000 [0xec1820ff].
  Bus  1, device   9, function  0:
    Class 0780: PCI device 9710:9835 (rev 1).
      IRQ 5.
      Master Capable.  Latency=32.
      I/O at 0xa000 [0xa007].
      I/O at 0xa400 [0xa407].
      I/O at 0xa800 [0xa807].
      I/O at 0xac00 [0xac07].
      I/O at 0xb000 [0xb007].
      I/O at 0xb400 [0xb40f].
  Bus  1, device  10, function  0:
    Class 0200: PCI device 10ec:8139 (rev 16).
      IRQ 11.
      Master Capable.  Latency=32.  Min Gnt=32.Max Lat=64.
      I/O at 0xb800 [0xb8ff].
      Non-prefetchable 32 bit memory at 0xec010000 [0xec0100ff].
  Bus  1, device  11, function  0:
    Class 0401: PCI device 125d:1969 (rev 1).
      IRQ 9.
      Master Capable.  Latency=32.  Min Gnt=2.Max Lat=24.
      I/O at 0xbc00 [0xbc3f].
      I/O at 0xc000 [0xc00f].
      I/O at 0xc400 [0xc40f].
      I/O at 0xc800 [0xc803].
      I/O at 0xcc00 [0xcc03].
[root@localhost root]#
[root@localhost root]# lspci -vv
00:00.0 Host bridge: Intel Corp. 82845G/GL[Brookdale-G]/GE/PE DRAM Controller/Ho st-Hub Interface (rev 03)
        Subsystem: PC Partner Limited: Unknown device 174b
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Step ping- SERR- FastB2B-
        Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort+ >SERR- <PERR-
        Latency: 0
        Region 0: Memory at e8000000 (32-bit, prefetchable)
        Capabilities: [e4] #09 [1105]

00:02.0 VGA compatible controller: Intel Corp. 82845G/GL[Brookdale-G]/GE Chipset  Integrated Graphics Device (rev 03) (prog-if 00 [VGA])
        Subsystem: PC Partner Limited: Unknown device 174b
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Step ping- SERR- FastB2B-
        Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
        Latency: 0
        Interrupt: pin A routed to IRQ 5
        Region 0: Memory at e0000000 (32-bit, prefetchable)
        Region 1: Memory at ec100000 (32-bit, non-prefetchable) [size=512K]
        Capabilities: [d0] Power Management version 1
                Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot -,D3cold-)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:1d.0 USB Controller: Intel Corp. 82801DB (ICH4) USB UHCI #1 (rev 02) (prog-if  00 [UHCI])
        Subsystem: PC Partner Limited: Unknown device 174b
        Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Step ping- SERR- FastB2B-
        Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort - <MAbort- >SERR- <PERR-
        Latency: 0
        Interrupt: pin A routed to IRQ 5
        Region 4: I/O ports at d800

00:1d.1 USB Controller: Intel Corp. 82801DB (ICH4) USB UHCI #2 (rev 02) (prog-if  00 [UHCI])
        Subsystem: PC Partner Limited: Unknown device 174b
        Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Step ping- SERR- FastB2B-
        Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort - <MAbort- >SERR- <PERR-
        Latency: 0
        Interrupt: pin B routed to IRQ 11
        Region 4: I/O ports at d000

00:1d.2 USB Controller: Intel Corp. 82801DB (ICH4) USB UHCI #3 (rev 02) (prog-if  00 [UHCI])
        Subsystem: PC Partner Limited: Unknown device 174b
        Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Step ping- SERR- FastB2B-
        Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort - <MAbort- >SERR- <PERR-
        Latency: 0
        Interrupt: pin C routed to IRQ 9
        Region 4: I/O ports at d400

00:1d.7 USB Controller: Intel Corp. 82801DB (ICH4) USB2 EHCI Controller (rev 02)  (prog-if 20 [EHCI])
        Subsystem: PC Partner Limited: Unknown device 174b
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Step ping- SERR- FastB2B-
        Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort - <MAbort- >SERR- <PERR-
        Latency: 0
        Interrupt: pin D routed to IRQ 9
        Region 0: Memory at ec180000 (32-bit, non-prefetchable)
        Capabilities: [50] Power Management version 2
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA PME(D0+,D1-,D2-,D3h ot+,D3cold+)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:1e.0 PCI bridge: Intel Corp. 82801BA/CA/DB/EB/ER Hub interface to PCI Bridge (rev 82) (prog-if 00 [Normal decode])
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Step ping- SERR+ FastB2B-
        Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR+
        Latency: 0
        Bus: primary=00, secondary=01, subordinate=01, sec-latency=32
        I/O behind bridge: 0000a000-0000cfff
        Memory behind bridge: ec000000-ec0fffff
        BridgeCtl: Parity- SERR+ NoISA+ VGA- MAbort- >Reset- FastB2B-

00:1f.0 ISA bridge: Intel Corp. 82801DB (ICH4) LPC Bridge (rev 02)
        Control: I/O+ Mem+ BusMaster+ SpecCycle+ MemWINV- VGASnoop- ParErr- Step ping- SERR- FastB2B-
        Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort - <MAbort- >SERR- <PERR-
        Latency: 0

00:1f.1 IDE interface: Intel Corp. 82801DB (ICH4) Ultra ATA 100 Storage Controll er (rev 02) (prog-if 8a [Master SecP PriP])
        Subsystem: PC Partner Limited: Unknown device 174b
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Step ping- SERR- FastB2B-
        Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort - <MAbort- >SERR- <PERR-
        Latency: 0
        Interrupt: pin A routed to IRQ 9
        Region 0: I/O ports at <unassigned>
        Region 1: I/O ports at <unassigned>
        Region 2: I/O ports at <unassigned>
        Region 3: I/O ports at <unassigned>
        Region 4: I/O ports at f000
        Region 5: Memory at 1f800000 (32-bit, non-prefetchable) [size=1K]

00:1f.3 SMBus: Intel Corp. 82801DB/DBM (ICH4) SMBus Controller (rev 02)
        Subsystem: PC Partner Limited: Unknown device 174b
        Control: I/O+ Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Step ping- SERR- FastB2B-
        Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort - <MAbort- >SERR- <PERR-
        Interrupt: pin B routed to IRQ 11
        Region 4: I/O ports at 0500

00:1f.5 Multimedia audio controller: Intel Corp. 82801DB (ICH4) AC'97 Audio Cont roller (rev 02)
        Subsystem: Unknown device 414c:4730
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Step ping- SERR- FastB2B-
        Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort - <MAbort- >SERR- <PERR-
        Latency: 0
        Interrupt: pin B routed to IRQ 11
        Region 0: I/O ports at e000
        Region 1: I/O ports at e400
        Region 2: Memory at ec181000 (32-bit, non-prefetchable)
        Region 3: Memory at ec182000 (32-bit, non-prefetchable)
        Capabilities: [50] Power Management version 2
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA PME(D0+,D1-,D2-,D3h ot+,D3cold+)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-

01:09.0 Communication controller: NetMos Technology PCI 9835 Multi-I/O Controlle r (rev 01)
        Subsystem: LSI Logic / Symbios Logic 1P2S
        Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Step ping- SERR- FastB2B-
        Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort - <MAbort- >SERR- <PERR-
        Interrupt: pin A routed to IRQ 5
        Region 0: I/O ports at a000
        Region 1: I/O ports at a400
        Region 2: I/O ports at a800
        Region 3: I/O ports at ac00
        Region 4: I/O ports at b000
        Region 5: I/O ports at b400

01:0a.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139 C+ (rev 10)
        Subsystem: Realtek Semiconductor Co., Ltd. RT8139
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Step ping- SERR- FastB2B-
        Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort - <MAbort- >SERR- <PERR-
        Latency: 32 (8000ns min, 16000ns max)
        Interrupt: pin A routed to IRQ 11
        Region 0: I/O ports at b800
        Region 1: Memory at ec010000 (32-bit, non-prefetchable)
        Capabilities: [50] Power Management version 2
                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0-,D1+,D2+,D3h ot+,D3cold+)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-

01:0b.0 Multimedia audio controller: ESS Technology ES1969 Solo-1 Audiodrive (re v 01)
        Subsystem: ESS Technology Solo-1 Audio Adapter
        Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Step ping- SERR- FastB2B-
        Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort - <MAbort- >SERR- <PERR-
        Latency: 32 (500ns min, 6000ns max)
        Interrupt: pin A routed to IRQ 9
        Region 0: I/O ports at bc00
        Region 1: I/O ports at c000
        Region 2: I/O ports at c400
        Region 3: I/O ports at c800
        Region 4: I/O ports at cc00
        Capabilities: [c0] Power Management version 1
                Flags: PMEClk- DSI+ D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot -,D3cold-)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-

[root@localhost root]# setserial /dev/ttyS2 port 0xa400 UART 16550A irq 5 baud_base 115200
[root@localhost root]# setserial /dev/ttyS3 port 0xa800 UART 16550A irq 5 baud_base 115200
[root@localhost root]# setserial /dev/ttyS2 -a
/dev/ttyS2, Line 2, UART: 16550A, Port: 0xa400, IRQ: 5
        Baud_base: 115200, close_delay: 5000, divisor: 0
        closing_wait: 37856
        Flags: spd_normal skip_test auto_irq

[root@localhost root]# setserial /dev/ttyS3 -a
/dev/ttyS3, Line 3, UART: 16550A, Port: 0xa800, IRQ: 5
        Baud_base: 115200, close_delay: 5000, divisor: 0
        closing_wait: 37856
        Flags: spd_normal auto_irq

[root@localhost root]#


启用nfs时需要注意的如下:

这是原来的命令:

#root from nfs
param set linux_cmd_line "console=ttyS0 root=/dev/nfs nfsroot=192.168.253.1:/real2410/root_nfs ip=192.168.253.8:192.168.253.1:192.168.253.1:255.255.255.0:www.realembed.com:eth0:off"

由于我用的是pci转的串口,用的是ttyS2,于是我便把console=ttyS0,改成了console=ttyS2.

param set linux_cmd_line "console=ttyS2 root=/dev/nfs nfsroot=192.168.253.1:/real2410/root_nfs ip=192.168.253.8:192.168.253.1:192.168.253.1:255.255.255.0:www.realembed.com:eth0:off"

结果一直运行不正确,今天晚上才发现console=ttyS0指的应该是开发板的串口。可还是运行不正确。开开minicom里提示的信息,应该是root配置不正确,于是我便将原来的etc/exports 里面按照说明书所加的那一句:

/real2410/root_nfs       *(rw,sync,no_root_squash)

改为

/usr/local/arm/real2410/root_nfs       *(rw,sync,no_root_squash)

同时也将vivi的参数命令也改成全目录的如下

#root from nfs
param set linux_cmd_line "console=ttyS0 root=/dev/nfs nfsroot=192.168.1.17:/usr/local/arm/real2410/root_nfs ip=192.168.1.100:192.168.1.17:192.168.1.17:255.255.255.0:www.realembed.com:eth0:off"

#root from mtd
param set linux_cmd_line "noinitrd root=/dev/mtdblock/2 init=/linuxrc console=ttyS0"


/home/pengsen/rootnfs    *(rw,sync)
/usr/local/arm/real2410/root_nfs    shi   *(rw,sync,no_root_squash)

经过这样改动便可以实现运行2410运行linux了。