Difference between revisions of "Booting Linux Kernel"

From DAVE Developer's Wiki
Jump to: navigation, search
(Boot configurations)
Line 4: Line 4:
  
 
= Boot configurations =
 
= Boot configurations =
The default environment provides two configurations that are explained in more detail in the following sections.
+
 
 +
[[:Category:U-Boot|U-Boot]] is used to boot the Linux kernel and by setting some environment variables it's possible to select how to perform the boot process. The default U-boot environment provides two boot configurations that are explained in more detail in the following sections.
  
 
== Configuration flash_self==
 
== Configuration flash_self==
  
This configuration is conceived for standalone operation. Both the kernel and the root file system are retrieved from Flash. Once U-Boot has transferred the control to Linux, its job is completed. From now on Linux kernel has the control of the hardware. At the end of Linux boot process, the user can interact with the system with the typical Unix-like shell through the same serial connection used for U-Boot. To run this configuration just issue the command run flash_self.
+
This configuration is conceived for standalone operation. Both the kernel and the root file system are retrieved from Flash. Once U-Boot has transferred the control to Linux, its job is completed. From now on Linux kernel has the control of the hardware. At the end of Linux boot process, the user can interact with the system with the typical Unix-like shell through the same serial connection used for U-Boot. To run this configuration just issue the command  
 +
 
 +
<pre>run flash_self</pre>
  
 
Ethernet interface will be enabled by default. To disable it, just remove addip variable from the flash_self variable.
 
Ethernet interface will be enabled by default. To disable it, just remove addip variable from the flash_self variable.
Line 20: Line 23:
 
* has a proper subnet IP address
 
* has a proper subnet IP address
  
If your system does not match this configuration, just change the necessary variables and store them permanently with the u-boot setenv/saveenv commands.  
+
If your system does not match this configuration, just change the necessary variables and store them permanently with the u-boot <pre>setenv/saveenv</pre> commands.  
 +
 
 +
To run this configuration just issue the command
  
To run this configuration just issue the command run net_nfs.
+
<pre>run net_nfs</pre>
  
 
== Automatic boot ==
 
== Automatic boot ==
If you wish Lizard system to automatically boot with one of the above configurations, just set up and store the bootcmd variable. For example, for the flash_self configuration, issue the following commands:
+
If you wish Lizard system to automatically boot with one of the above configurations, just set up and store the <pre>bootcmd</pre> variable. For example, for the <pre>flash_self</pre> configuration, issue the following commands:
=> setenv setenv bootcmd $(flash_self)
+
 
=> setenv serverip 192.168.0.72
+
<pre>
=> saveenv
+
setenv setenv bootcmd ${flash_self}
 +
saveenv
 +
</pre>
  
Next time the system boots, U-Boot will wait for three seconds (to stop the wait just press any key in the console) before executing the commands stored in the bootcmd variable. This time can be changed by setting the bootdelay variable. Generally speaking the whole boot process can be further and heavily customized. For more details please refer to the doc/README.autoboot file in the U-Boot sources.
+
Next time the system boots, U-Boot will wait for three seconds (to stop the wait just press any key in the console) before executing the commands stored in the <pre>bootcmd</pre> variable. This time can be changed by setting the <pre>bootdelay</pre> variable. Generally speaking the whole boot process can be further and heavily customized. For more details please refer to the doc/README.autoboot file in the U-Boot sources.

Revision as of 13:21, 9 May 2012

Info Box
Tux.png Applies to Linux

Boot configurations[edit | edit source]

U-Boot is used to boot the Linux kernel and by setting some environment variables it's possible to select how to perform the boot process. The default U-boot environment provides two boot configurations that are explained in more detail in the following sections.

Configuration flash_self[edit | edit source]

This configuration is conceived for standalone operation. Both the kernel and the root file system are retrieved from Flash. Once U-Boot has transferred the control to Linux, its job is completed. From now on Linux kernel has the control of the hardware. At the end of Linux boot process, the user can interact with the system with the typical Unix-like shell through the same serial connection used for U-Boot. To run this configuration just issue the command

run flash_self

Ethernet interface will be enabled by default. To disable it, just remove addip variable from the flash_self variable.

Configuration net_nfs[edit | edit source]

This configuration is very helpful during the software development (both for kernel and applications). The kernel image is downloaded via TFTP while the root file system is remotely mounted via NFS from the host. It is assumed that the development host:

  • is connected with the target host board through an Ethernet LAN
  • exports the directory containing the root file system for the target through the NFS server
  • runs a TFTP server.
  • has a proper subnet IP address

If your system does not match this configuration, just change the necessary variables and store them permanently with the u-boot

setenv/saveenv

commands.

To run this configuration just issue the command

run net_nfs

Automatic boot[edit | edit source]

If you wish Lizard system to automatically boot with one of the above configurations, just set up and store the

bootcmd

variable. For example, for the

flash_self

configuration, issue the following commands:

setenv setenv bootcmd ${flash_self}
saveenv

Next time the system boots, U-Boot will wait for three seconds (to stop the wait just press any key in the console) before executing the commands stored in the

bootcmd

variable. This time can be changed by setting the

bootdelay

variable. Generally speaking the whole boot process can be further and heavily customized. For more details please refer to the doc/README.autoboot file in the U-Boot sources.