First, the generated VxWorks must support the script startup component:
Next, in BSP/config. H, [the script to be started in Boot linestores, Which is suffixed with start.txt:
You must have a path name before start.txt of startup scripts. Otherwise, the script file cannot be found!
After the modification, create the bootrom. sys
At the end, create a start.txt text file with the following content (for example, input each command under the VX command line, but execute these commands together ):
ld 1,0,”/ata0a/myLoad.out” myLoad(“/ata0a/apps.out”, “Test1”)
Copy the file to the boot drive root directory (same location as bootrom. sys)
Note supported in script files:
/*... Fast comments... */#... Line comment...
(The preceding script statement means: load a file named myload. the out executable file. A function named myload is opened in this file and two parameters are accepted. The first function can load another out executable file, the second parameter is the name of the executable function in the loaded out. The call of the above two statements is equivalent to executing the test1 function in apps. Out !)
Just like this start.txt, you can modify the VxWorks every time you compile it. Instead, you can modify the commands in start.txt!
Appendix: boot line structure:
typedef struct {char bootDev [BOOT_DEV_LEN]; char hostName [BOOT_HOST_LEN]; char targetName [BOOT_HOST_LEN]; char ead [BOOT_ADDR_LEN]; char bad [BOOT_ADDR_LEN]; char had [BOOT_ADDR_LEN]; char gad [BOOT_ADDR_LEN]; char bootFile [BOOT_FILE_LEN]; char startupScript [BOOT_FILE_LEN]; char usr [BOOT_USR_LEN]; char passwd [BOOT_PASSWORD_LEN]; char other [BOOT_OTHER_LEN]; int procNum; int unitNum; int flags; } BOOT_PARAMS;
bootDev(unitNum,procNum) hostname:bootFile e=ead b=bad h=had g=gad u=username pw=password f=flags tn=targetName s=startupScript o=other
This is why the preceding statement "s =/ata0a/start.txt" exists!