嵌入式linux中文站在线图书

  Previous section   Next section


Booting the Brightstar Engineering MediaEngine

Before you can boot the MediaEngine, you need to compile the kernel for it. The buildtoolchain script in Chapter 3 configured the kernel and the kernel headers but didn't compile the kernel. This section describes how to compile the 2.4.2 kernel for the MediaEngine, generate a RAM disk, download the kernel and RAM disk using TFTP, and then boot the MediaEngine. Booting the MediaEngine differs from booting the RPX-CLLF in that the kernel and RAM files are downloaded separately.

Here are the steps for booting the MediaEngine:

  1. Change directory to the ARM kernel source:

    root@tbdev1[553]: cd /usr/src/arm-linux
    
  2. The MediaEngine and Brightstar Engineering's nanoEngine share the same default configuration file: arch/arm/def-config/nanoengine. Configure the kernel by using this default config file and two make commands:

    root@tbdev1[554]: make nanoengine_config
    root@tbdev1[555]: make oldconfig
    
  3. The RAM disk defaults to 8192KB, so you don't need to change that with make menuconfig.

  4. Compile the kernel:

    root@tbdev1[555]: make zImage
    
  5. The new kernel image is arch/arm/boot/zImage. Copy it to the /tftpboot directory:

    root@tbdev1[556]: cp arch/arm/boot/zImage /tftpboot/arm-zImage
    
  6. Make the ARM target root filesystem by using the buildrootfilesystem script:

    root@tbdev1[557]: cd /root/cross/buildrootfilesystem
    root@tbdev1[558]: buildrootfilesystem arm ramdisk
    buildrootfilesystem will create the ARM target root filesystem file called /tftpboot/
    graphics/ccc.gifarm-ramdisk.gz
    
  7. Connect the MediaEngine's serial port to tbdev1's COM1 port. Run minicom and then reboot the MediaEngine. Look for the Brightstar Engineering (BSE) banner

    Boot: BSE 2001 R1.0 SN# 00:50:15:03:00:19
    >
    
  8. Set the MediaEngine's IP address, TFTP server, and netmask addresses by using these commands:

    >set myip 192.168.1.21
    >set serverip 192.168.1.11
    >set netmask 255.255.255.0
    
  9. Download the ARM RAM disk file:

    >load arm-ramdisk.gz c0800000
    loading ... 1699015 bytes loaded cksum 0000D9C8
     done
    
  10. Download the ARM kernel file:

    >load arm-zImage c0008000
    loading ... 646240 bytes loaded cksum 00004DF2
     done
    
  11. Boot the kernel by executing go at memory address c0008000:

    >go c0008000
    
  12. The MediaEngine should boot, and you should see this:

    Uncompressing Linux.......................... done, booting the kernel.
    Linux version 2.4.2-rmk1-np2-bse (root@tbdev1) (gcc version 2.95.3 20010315 (release)) #1 
    graphics/ccc.gifFri Aug 24 14:53:14 MST 2001
    
    Processor: Intel StrongARM-1110 revision 6
    Architecture: BSE nanoEngine
    On node 0 totalpages: 8192
    zone(0): 8192 pages.
    zone(1): 0 pages.
    zone(2): 0 pages.
    Kernel command line: root=/dev/ram
    Calibrating delay loop... 194.15 BogoMIPS
    Memory: 32MB = 32MB total
    Memory: 26496KB available (1268K code, 260K data, 60K init)
    Dentry-cache hash table entries: 4096 (order: 3, 32768 bytes)
    Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)
    Page-cache hash table entries: 8192 (order: 3, 32768 bytes)
    Inode-cache hash table entries: 2048 (order: 2, 16384 bytes)
    POSIX conformance testing by UNIFIX
    Linux NET4.0 for Linux 2.4
    Based upon Swansea University Computer Society NET3.039
    Starting kswapd v1.8
    pty: 256 Unix98 ptys configured
    block: queued sectors max/low 17530kB/5843kB, 64 slots per queue
    RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
    Uniform Multi-Platform E-IDE driver Revision: 6.31
    ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
    cerf89x0:cerf89x0_probe()
    cerf89x0.c: (kernel 2.3.99) Russell Nelson, Andrew Morton
    eth0: cs8900 rev J Base 0xF0000300<6>, IRQ 0, MAC 00:50:15:03:00:19
    bad dev id: got 0x19001900, expected 0x12098086 (0)
    bad dev id: got 0x19001900, expected 0x12098086 (0)
    RAMDISK: Compressed image found at block 0
    Freeing initrd memory: 4096K
    loop: loaded (max 8 devices)
    Serial driver version 5.02 (2000-08-09) with no serial options enabled
    Testing ttyS0 (0x0300, 0x0000)...
    ttyS03 at 0x0300 (irq = 10) is a 16550A
    SA1100 serial driver version 1.3
    ttyS0 on SA1100 UART1 (irq 15)
    ttyS1 on SA1100 UART2 (irq 16)
    ttyS2 on SA1100 UART3 (irq 17)
    SA1100 Real Time Clock Driver v0.02
    PPP generic driver version 2.4.1
    PPP Deflate Compression module registered
    PPP BSD Compression module registered
    Linux PCMCIA Card Services 3.1.22
      options:  none
    SA-1100 PCMCIA (CS release 3.1.22)
    NET4: Linux TCP/IP 1.0 for NET4.0
    IP Protocols: ICMP, UDP, TCP
    IP: routing cache hash table of 512 buckets, 4Kbytes
    TCP: Hash tables configured (established 2048 bind 2048)
    IP-Config: Incomplete network configuration information.
    NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
    NetWinder Floating Point Emulator V0.95 (c) 1998-1999 Rebel.com
    VFS: Mounted root (ext2 filesystem).
    Freeing init memory: 60K
    INIT: version 2.78 booting
    INIT: Entering runlevel: 2
    Starting Network
    bash-2.04#
    

    You are now at the bash prompt on the MediaEngine.

  13. Try out the network connection and check for proper DNS configuration:

    bash-2.04# ping yahoo.com
    PING yahoo.com (216.115.108.245): 56 data bytes
    64 bytes from 216.115.108.245: icmp_seq=0 ttl=246 time=49.7 ms
    64 bytes from 216.115.108.245: icmp_seq=1 ttl=246 time=55.5 ms
    64 bytes from 216.115.108.245: icmp_seq=2 ttl=246 time=57.8 ms
    64 bytes from 216.115.108.245: icmp_seq=3 ttl=246 time=100.8 ms
    --- yahoo.com ping statistics ---
    4 packets transmitted, 4 packets received, 0% packet loss
    round-trip min/avg/max = 49.7/65.9/100.8 ms
    

    Pinging yahoo.com returns the IP address 216.115.108.245, which confirms proper DNS configuration. Pings are returned, so you know the network is running.

  14. Run helloworld, which is located in the /tmp directory:

    bash-2.04# cd /tmp
    bash-2.04# ls -l
    total 24
    -rwxr-xr-x    1 0        0   22266 Aug 24  2001 helloworld-arm-linux
    -rw-r--r--    1 0        0     120 Aug 24  2001 helloworld.c
    bash-2.04# ./helloworld-arm-linux
    Hello world 1 times!
    Hello world 2 times!
    Hello world 3 times!
    Hello world 4 times!
    Hello world 5 times!
    Hello world 6 times!
    Hello world 7 times!
    Hello world 8 times!
    Hello world 9 times!
    

The Brightstar Engineering MediaEngine is now up and running.

Brightstar Engineering MediaEngine Target PBR Review

In this section, the seven PBRs are reviewed for the MediaEngine. The output from the "Booting the Brightstar Engineering MediaEngine" section earlier in the chapter provides all the information necessary for this review. Remember that each target board needs to fulfill the seven PBRs in order to be used in Project Trailblazer.

PBR-1 for Brightstar Engineering MediaEngine

The target board should use Linux kernel 2.4 or greater. Here's the MediaEngine console output during the boot process:

Linux version 2.4.2-rmk1-np2-bse (root@tbdev1) (gcc version 2.95.3 20010315 (release)) #1 
graphics/ccc.gifFri Aug 24 14:53:14 MST 2001
Processor: Intel StrongARM-1110 revision 6
Architecture: BSE nanoEngine

PBR-1 is fulfilled because Linux version 2.4.2 boots.

PBR-2 for Brightstar Engineering MediaEngine

The target board will execute the bash shell. Exiting from the bash shell re-executes the bash shell. On the MediaEngine console, exit from the bash shell by using the exit command:

bash-2.04# exit
exit
bash-2.04#

PBR-2 is fulfilled because exiting from bash respawns bash. init is properly configured.

PBR-3 for Brightstar Engineering MediaEngine

The system should execute the bash shell without security authentication. Here's the MediaEngine console output during the boot process:

INIT: version 2.78 booting
INIT: Entering runlevel: 2
Starting Network
bash-2.04#

PBR-3 is fulfilled because init starts bash without authentication.

PBR-4 for Brightstar Engineering MediaEngine

The system should boot, initialize the Ethernet hardware, set a static IP address, and be configured to use DNS. At the bash prompt, use ifconfig to display the Ethernet hardware configuration and use ping to verify proper DNS configuration:

bash-2.04# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:50:15:03:00:19
          inet addr:192.168.1.21  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5 errors:0 dropped:2 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          Base address:0x300
bash-2.04# ping yahoo.com
PING yahoo.com (216.115.108.243): 56 data bytes
64 bytes from 216.115.108.243: icmp_seq=0 ttl=246 time=66.3 ms
64 bytes from 216.115.108.243: icmp_seq=1 ttl=246 time=68.8 ms

PBR-4 is fulfilled because the Ethernet hardware is initialized. The target board's resolver translated yahoo.com to 216.115.108.243. This verifies proper DNS configuration.

PBR-5 for Brightstar Engineering MediaEngine

The system should contain the ping program to debug network programs:

bash-2.04# ping yahoo.com
PING yahoo.com (216.115.108.243): 56 data bytes
64 bytes from 216.115.108.243: icmp_seq=0 ttl=246 time=66.3 ms
64 bytes from 216.115.108.243: icmp_seq=1 ttl=246 time=68.8 ms

PBR-5 is fulfilled because the yahoo.com ping is successful.

PBR-6 for Brightstar Engineering MediaEngine

The system should be capable of executing the Project Trailblazer compiled version of helloworld. At the bash prompt, execute the cross-compiled helloworld program:

bash-2.04# ./helloworld-arm-linux
Hello world 1 times!
Hello world 2 times!
Hello world 3 times!
. . .

PBR-6 is fulfilled because the cross-compiled version of helloworld executes.

PBR-7 for Brightstar Engineering MediaEngine

The system should use the current version of GNU glibc. At the bash prompt, list the library directory and confirm the current versions:

bash-2.04# ls /lib
ld-2.2.3.so libncurses.so.5.2 libresolv.so.2
ld-linux.so.2 libnss_dns-2.2.3.so librt-2.2.3.so
libc-2.2.3.so libnss_dns.so.2 librt.so.1
libc.so.6 libnss_files-2.2.3.so libstdc++-3-libc6.1-2-2.10.0.so
libdl-2.2.3.so libnss_files.so.2 libstdc++-libc6.1-2.so.3
libdl.so.2 libproc.so.2.0.7 libutil-2.2.3.so
libm-2.2.3.so libpthread-0.9.so libutil.so.1
libm.so.6 libpthread.so.0
libncurses.so.5 libresolv-2.2.3.so

PBR-7 is fulfilled because target boots with the current version of GNU glibc.

The Brightstar Engineering MediaEngine fulfills all the PBRs.


      Previous section   Next section
    Top