📄 help.c
字号:
\r\n\SYNOPSIS\r\n\ help <command>\r\n\\r\n\DESCRIPTION\r\n\ Shows the usage for I-Boot commands. The list of all the\r\n\ supported commands will be displayed if <command> is not specified.\r\n\\r\n\ARGUMENTS\r\n\ command - User command to show help for.\r\n\"},{"info","\NAME\r\n\ info - Display information about I-Boot.\r\n\\r\n\SYNOPSIS\r\n\ info\r\n\\r\n\DESCRIPTION\r\n\ Displays important information concerning the device.\r\n\"},{"jump","\NAME\r\n\ jump - Start running a program in memory.\r\n\\r\n\SYNOPSIS\r\n\ jump <start> [<arg> ...]\r\n\\r\n\DESCRIPTION\r\n\ Jumps to a program loaded somewhere in memory.\r\n\\r\n\ARGUMENTS\r\n\ start - Address of program.\r\n\ arg - Numeric argument passed into program.\r\n\\r\n\USAGE\r\n\ jump 0xc0008000 0 31 0\r\n\"},{"memtest","\NAME\r\n\ memtest - Test RAM.\r\n\\r\n\SYNOPSIS\r\n\ memtest <start> <end>\r\n\\r\n\DESCRIPTION\r\n\ Tests RAM from the <start> to the <end> address.\r\n\\r\n\ARGUMENTS\r\n\ start - Base address to test.\r\n\ end - Last address to test.\r\n\\r\n\USAGE\r\n\ memtest 0xc0000000 0xc01F8000\r\n\"},{"ping","\NAME\r\n\ ping - Determine if a remote host is reachable.\r\n\\r\n\SYNOPSIS\r\n\ ping <ip>\r\n\\r\n\DESCRIPTION\r\n\ Sends an ICMP echo request message to a remote host. If the host is\r\n\ up and reachable, it should send an echo response message which is\r\n\ displayed when it is received.\r\n\\r\n\ARGUMENTS\r\n\ ip - Valid IP address.\r\n\\r\n\USAGE\r\n\ ping 192.168.1.123\r\n\"},{"reboot","\NAME\r\n\ reboot - Reboots the machine.\r\n\\r\n\SYNOPSIS\r\n\ reboot\r\n\\r\n\DESCRIPTION\r\n\ Restarts the machine.\r\n\"},{"runce","\NAME\r\n\ runce - Downloads and runs a WinCE .bin file.\r\n\\r\n\SYNOPSIS\r\n\ runce\r\n\\r\n\DESCRIPTION\r\n\ Downloads and starts a WinCE .bin file. The .bin file is stored in\r\n\ RAM, and is lost on reboot.\r\n\"},{"set","\NAME\r\n\ set - Change settings of attributes.\r\n\\r\n\SYNOPSIS\r\n\ set [<attribute> [<value>]]\r\n\\r\n\DESCRIPTION\r\n\ Adjusts the settings of an attribute. To get a list of all the\r\n\ settable attributes, run set without any arguments. To get the current\r\n\ value for a particular attribute, type\r\n\ set <attribute>\r\n\\r\n\ To get help for a particular attribute, type\r\n\ help set <attribute>\r\n\\r\n\ARGUMENTS\r\n\ attribute - Setting to change.\r\n\ value - New value to set attribute to.\r\n\"},{"set gw","\NAME\r\n\ set gw - Set the gateway address used by the device.\r\n\\r\n\SYNOPSIS\r\n\ set gw <ip>\r\n\\r\n\DESCRIPTION\r\n\ Sets the network gateway address used by the device.\r\n\\r\n\ARGUMENTS\r\n\ ip - Gateway IP address.\r\n\\r\n\USAGE\r\n\ set gw 192.168.1.1\r\n\"},{"set ip","\NAME\r\n\ set ip - Set the IP address of the device.\r\n\\r\n\SYNOPSIS\r\n\ set ip [<ip> | dhcp | bootp | zeroconf]\r\n\\r\n\DESCRIPTION\r\n\ Sets the static IP address for the device, or obtains one via the\r\n\ DHCP, BOOTP, or Zeroconf protocols.\r\n\\r\n\ARGUMENTS\r\n\ ip - Valid IP address.\r\n\\r\n\USAGE\r\n\ set ip 192.168.1.123\r\n\"},{"set mac","\NAME\r\n\ set mac - Set the MAC address of the Ethernet device.\r\n\\r\n\SYNOPSIS\r\n\ set mac [<mac> [<num>]]\r\n\\r\n\DESCRIPTION\r\n\ Sets the MAC address of the Ethernet device; you will be prompted\r\n\ to confirm before it proceeds. This command will normally never\r\n\ be needed.\r\n\\r\n\ CAUTION: You can cause network problems if you set an invalid\r\n\ MAC address.\r\n\\r\n\ARGUMENTS\r\n\ mac - MAC address\r\n\ num - 0 or 1, if the hardware supports two Ethernet ports\r\n\\r\n\USAGE\r\n\ set mac 000103123456\r\n\"},{"set mask","\NAME\r\n\ set mask - Set the subnet mask of the device.\r\n\\r\n\SYNOPSIS\r\n\ set mask [<mask>]\r\n\\r\n\DESCRIPTION\r\n\ Sets the subnet mask of the device.\r\n\\r\n\ARGUMENTS\r\n\ mask - Subnet mask.\r\n\\r\n\USAGE\r\n\ set mask 255.255.255.0\r\n\"},{"set server","\NAME\r\n\ set server - Set the server address.\r\n\\r\n\SYNOPSIS\r\n\ set server [<ip>]\r\n\\r\n\DESCRIPTION\r\n\ Sets the default server address used by the device.\r\n\\r\n\ARGUMENTS\r\n\ ip - Server IP address.\r\n\\r\n\USAGE\r\n\ set server 192.168.0.1\r\n\"},{"set speed","\NAME\r\n\ set speed - Set the CPU speed.\r\n\\r\n\SYNOPSIS\r\n\ set speed <speed>\r\n\\r\n\DESCRIPTION\r\n\ Sets the CPU's clock frequency to the given speed in Mhz. If the\r\n\ speed given not supported, the next lowest allowable speed is\r\n\ set instead.\r\n\\r\n\ARGUMENTS\r\n\ speed - CPU clock speed in MHz.\r\n\\r\n\USAGE\r\n\ set speed 200\r\n\"},{"setbyte","\NAME\r\n\ setbyte - Write byte(s) at specified address.\r\n\ setword - Write word(s) at specified address.\r\n\ setdword - Write double word(s) at specified address.\r\n\\r\n\SYNOPSIS\r\n\ setbyte <address> <value> [<length>]\r\n\ setword <address> <value> [<length>]\r\n\ setdword <address> <value> [<length>]\r\n\\r\n\DESCRIPTION\r\n\ Write specified <value> of the specified size at the\r\n\ <address>. If <length> is specified, then the\r\n\ specified <value> will be filled to the specified <length>.\r\n\\r\n\ARGUMENTS\r\n\ address - Memory location to read from.\r\n\ value - Byte, word or double word value.\r\n\ length - Number of values to read.\r\n\\r\n\USAGE\r\n\ setdword 0xc0030000 0xffff 0x100\r\n\"},{"updatece","\NAME\r\n\ updatece - Downloads and flashes a WinCE .bin file.\r\n\\r\n\SYNOPSIS\r\n\ updatece\r\n\\r\n\DESCRIPTION\r\n\ Downloads and flashes a WinCE .bin file. The .bin file can\r\n\ be started with the boot command.\r\n\"},{NULL,"No help available for that command\r\n"}};#ifndef DUMP_HELPstatic inline char const *find_help(char const *cmd){ int i = 0; while (helpText[i].cmd != NULL) { int offset = 0; char const *cur_page = helpText[i].cmd; /* Set and get have a second argument, so ignore extra whitespace */ if (cmpstr(cmd, "set") && *(cmd + sizeof("set") - 1) == ' ') { offset = (next_token(cmd) - cmd); cur_page = next_token(cur_page); } if (cmpstr(cmd + offset, cur_page)) { break; // found the command } else { i++; } } return helpText[i].helpText;}voidprint_help(char const *arg){ while (*arg && *arg <= ' ') arg++; //skip leading whitespace if (!*arg) { list_commands(); return; }//special cases for setbyte/setword/setdword and getbyte/getword/getdword. if (itc_strcmp("set", arg) && *(arg + sizeof("set") - 1) != ' ' && *(arg + sizeof("set") - 1) != '\0') { arg = "setbyte"; } else if (itc_strcmp("get", arg) && *(arg + sizeof("get") - 1) != ' ' && *(arg + sizeof("get") - 1) != '\0') { arg = "getbyte"; } itc_printf("%s", find_help(arg));}#else/* * Dump all help text to stdout so it can be placed into a text file. * Compile with: * cc -Wall -DDUMP_HELP -DTAGGED_EEPROM -I../../include -o help help.c */#include <stdio.h>#include <config.h>intmain(void){ THelpText const *help; printf("I-Boot Command Reference\r\n"); printf("Copyright 2001-2002 Intrinsyc Software Inc.\r\n"); for (help = helpText; help->cmd; ++help) { printf("\r\n----------------\r\n"); printf("%s", help->helpText); } return 0;}#endif // DUMP_HELP
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -