Changes between Version 14 and Version 15 of Internal/OpenFlow/QuantaSetup


Ignore:
Timestamp:
Mar 2, 2011, 7:34:43 PM (13 years ago)
Author:
akoshibe
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Internal/OpenFlow/QuantaSetup

    v14 v15  
    2121[[BR]]
    2222=== 1.2 Prerequisites ===
     23The things listed here are mostly for connecting to the switch via serial. The actual steps are covered [#uboot later on].
     24
    2325 * A PC running some *nix with a serial port
    24  * null modem cable 
     26 * RS232 to RJ45 null cable (a Cisco flat cable actually works) 
    2527 * packages on PC: ckermit, openssh 
    2628
     
    4648}}}
    4749
    48 As seen in the above "screenshot", XorPlus will be automatically loaded after 10 seconds, giving you the standard switch CLI. !XorPlus is a full-fledged switch configuration interface; Documentation for using XorPlus can be downloaded from the [http://www.pica8.org/documents/user-guide Pica8 website].
    49 
    50 The second choice, "!OpenFlow", gives you an outdated version of the Indigo interface, the "pure OpenFlow" switch firmware. The interface is essentially a standard Linux shell, plus !OpenFlow facilities such as `of-bcm-cli`. 
    51 
    52 The last choice, "System shell", lets you access the base system using the ash shell. This last mode is useful if you need to access the cf card contents (e.g. to try different versions of firmware without erasing stuff/dealing with flashing the switch).
    53 
     50As seen in the above "screenshot", !XorPlus will be automatically loaded after 10 seconds, giving you the standard switch CLI. !XorPlus is a full-fledged switch configuration interface; Documentation for using !XorPlus can be downloaded from the [http://www.pica8.org/documents/user-guide Pica8 website].
     51
     52The second choice, "!OpenFlow", gives you an outdated version of the Indigo interface, the "pure !OpenFlow" switch firmware. The interface is essentially a standard Linux shell, plus !OpenFlow facilities such as `of-bcm-cli`. 
     53
     54The last choice, "System shell", lets you access the base system using the ash shell. This last mode is useful if you need to access the cf card to test out a new image, or to check configuration scripts for !XorPlus or !OpenFlow.
    5455
    5556=== 2.2 The flash image ===
     
    7374There isn't much I can tell you about this interface, except that option [1 ] doesn't do anything, [7 ] reboots the switch, and [8 ] might be unsafe to do on a hard, inclined surface^1^.
    7475
    75 === 2.3 u-boot ===
     76=== 2.3 u-boot === #uboot
    7677u-boot is the second-stage boot loader that comes with the switch. It has enough smarts to allow you to flash the switch and inspect/configure various boot options, and in the case of !OpenFlow, set parameters that the switch will use to connect to the controller.   
    7778
     
    153154Each entry is a line of the form [variable name]=[parameters]. the parameters can be a combination of u-boot commands and other variables in a way similar to a simple shell script. 
    154155
     156The general case for these variables can be summarized as follows:
     157
     158 * syntax is `[name]=[parameters]`, where [parameter] is some string
     159 * `$[name]` returns the value of the separately defined variable, [name]
     160 * semicolon (;) delimits individual commands 
     161
    155162For example, note the first two entries in the "screen shot" above:
    156163{{{
     
    158165<entry 2> cfcard_bootcmd=setenv bootargs root=/dev/ram console=ttyS0,$baudrate; ext2load ide 0:1 0x1000000 /uImage;ext2load ide 0:1 0x2000000/uInitrd2m;ext2load ide 0:1 0x400000 /LB9A.dtb;bootm 1000000 2000000 400000
    159166}}}   
    160 they were part of the `run` commands mentioned earlier. The parameters to these variables create another variable called "bootargs" using command `setenv`. What follows are the parameters for this new variable:
     167they were part of the `run` commands mentioned earlier. The parameters to these variables create another variable called "bootargs" using command `setenv`. What follows are the parameters for this new variable (which are also environment variables):
     168
    161169 * `root=/dev/ram` - probably specifies where the root filesystem should be loaded^2^
    162  * `console=ttyS0` - set console
    163  * `$baudrate` - use the parameters specified in the variable "baudrate"
    164 The parameters that follow the semicolon after `$baudrate` differ a bit for the two variables. For the cfcard entry the `ext2load` cammands specifies where to fetch the kernel, ramdisk, and device tree files from, and finally issues the command `bootm` to load the image. 
    165 
     170 * `console=ttyS0` - set output to /dev/ttyS0
     171 * `$baudrate` - use the parameters specified in the variable "baudrate," which we can see above is set to 115200 (baud)
     172
     173The parameters that follow the semicolon after `$baudrate` differ a bit for the two variables. For the cfcard_bootcmd entry the `ext2load` commands specifies where to fetch the kernel, ramdisk, and device tree files from, respectively. The specific syntax for each `ext2load` command is:
     174
     175 `ext2load [interface] [memory address]`
     176
     177What is really important here are the memory location values. For the cf card, the values should be:
     178 * 0x1000000 for kernel image
     179 * 0x2000000 for filesystem
     180 * 0x400000 for the device tree
     181
     182The same follows for the flash image, with ffd00000, ff00000, and ffee0000 being the address locations where the kernel, ramdisk, and device tree files always begin, respectively. The current version of u-boot has some tools for inspecting flash memory. These will be discussed in the [#ts troubleshooting section].     
     183
     184Both script variables end with the `bootm` command, which loads the program files from the memory locations given by `ext2load` in the cf card or implied in the flash.   
     185
     186=== 3.2 modifying the environment variables list ===
     187`setenv` allows you to modify and create environment variables. In general:
     188
     189 * `setenv [name]`, where [name] is new, creates a new variable with that name.
     190 * `setenv [name]`, where [name] already exists, wipes out its previous parameters.
     191 * `setenv [name] [parameters]` sets parameters for the variable [name]. 
     192 
     193''Long parameters.'' For variables with whitespaces in its parameters (e.g. "script variables" like flash_bootcmd), the parameters have to be surrounded by single quotes to let u-boot know that everything is part of a single script. For example, to create and configure the variable dn_boot, we'd type this at the command line:
     194
     195{{{
     196setenv dn_boot 'dhcp; nfs ff000000 $nfsip:$rootpath/uInitrd2m; setenv bootargs root=/dev/ram console=ttyS0,$baudrate DEV_ADDR=$ipaddr ETH0_IP=$ipaddr $extra_boot_args rw; bootm ffd00000 ff000000 ffee0000'
     197}}} 
     198
     199Note the single quotes before `dhcp` and after `ffee0000`. Another important thing about long parameters is that they cannot contain newlines; The whole command must be typed in a single line.   
     200
     201=== 3.3 Some important variables ===
     202
     203=== 3.4 troubleshooting === #ts
    166204
    167205== IV OpenFlow Switching == #IV