reproduces selected output from the kernel boot messages to demonstrate this. This output has been formatted (many lines omitted and whitespace added) for readability.

Listing 12-9. Booting with NFS Root Mount

 Uncompressing Kernel Image ... OK

    Linux version 2.6.14 (chris@pluto) (gcc version 3.3.3 (DENX ELDK 3.1.1 3.3.3-10)) #1 Mon Jan 2 11:58:48 EST 2006

    .

    .

    Kernel command line: console=ttyS0,115200 root=/dev/nfs rw nfsroot=192.168.1.9:/home /chris/sandbox/pdna-target ip=dhcp

    .

    .

    Sending DHCP requests ... OK

    IP-Config: Got DHCP answer from 192.168.1.9, my address is 192.168.1.68

    IP-Config: Complete:

          device=eth0, addr=192.168.1.68, mask=255.255.255.0,

          gw=255.255.255.255, host=192.168.1.68, domain=,

          nis-domain=(none), bootserver=192.168.1.9,

          rootserver=192.168.1.9,

          rootpath=/home/chris/sandbox/pdna-target

    .

    .

    Looking up port of RPC 100003/2 on 192.168.1.9

    Looking up port of RPC 100005/1 on 192.168.1.9

    VFS: Mounted root (nfs filesystem).

    .

    .

    BusyBox v0.60.5 (2005.06.07-07:03+0000) Built-in shell (msh)

    Enter 'help' for a list of built-in commands.

    #

From Listing 12-9, first we see the kernel banner followed by the kernel command line. We specified four items in this kernel command line:

• Console device (/dev/console)

• Root device (/dev/nfs)

• NFS root path (/home/chris/sandbox/pdna-target)

• IP kernel-level autoconfiguration method (dhcp)

Shortly thereafter, we see the kernel attempting kernel-level autoconfiguration via DHCP. When the server responds and the DHCP exchange completes, the kernel displays the detected configuration in the following lines. You can see from this listing that the DHCP server has assigned the target the IP address 192.168.1.68. Compare the detected settings with those specified in Listing 12-6. That was similar to the DHCP server configuration that resulted in this configuration.

When the kernel has completed the IP autoconfiguration, it is capable of mounting the root file system using the supplied parameters. You can see this from the three lines ending with the VFS (virtual file subsystem) message announcing that it has mounted the root NFS file system. After the NFS root file system has been mounted, initialization completes as described in Chapter 5, 'Kernel Initialization.'

It is also possible to pass target IP settings to the kernel in a static fashion instead of having the kernel obtain IP settings from a DHCP or BOOTP server. IP settings can be passed via the kernel command line directly. In this case, the kernel command line might look similar to this:

console=console=ttyS0,115200 ip=192.168.1.68:192.168.1.9::255.255.255.0:pdna:eth0:off

 root=/dev/nfs rw nfsroot=192.168.1.9:/home/chris/pdna-target

12.4. Chapter Summary

• Many features of a development environment greatly facilitate efficiency for embedded cross- development. Most of these fall under the category of tools and utilities. We cover this aspect in detail in the next chapter, where we cover development tools.

• A properly configured development host is a critical asset for the embedded developer.

• Toolchains employed for cross-development must be properly configured to match your host system's target Linux environment.

• Your development host must have target components installed that your toolchain and binary utilities can reference. These components include target header files, libraries, target binaries, and their associated configuration files. In short, you need to assemble or obtain an embedded Linux distribution.

• Configuring target servers such as TFTP, DHCP, and NFS will greatly increase your productivity as an embedded Linux developer. This chapter introduced configuration examples for each.

12.4.1. Suggestions for Additional Reading

GCC online documentation

http://gcc.gnu.org/onlinedocs/

Building and testing gcc/glibc cross toolchains

http://kegel.com/crosstool/

The TFTP Protocol, Version 2

RFC 1350

www.ietf.org/rfc/rfc1350.txt?number=1350

Bootstrap Protocol (BOOTP)

RFC 951

www.ietf.org/rfc/rfc0951.txt?number=951

Dynamic Host Configuration Protocol

RFC 2131

www.ietf.org/rfc/rfc2131.txt?number=2131

Добавить отзыв
ВСЕ ОТЗЫВЫ О КНИГЕ В ИЗБРАННОЕ

0

Вы можете отметить интересные вам фрагменты текста, которые будут доступны по уникальной ссылке в адресной строке браузера.

Отметить Добавить цитату