tools/build-R2_19_3/cmdline/cmdline.cpp

Go to the documentation of this file.
00001 #include <string.h>
00002 #include <iostream>
00003 
00004 //#include <linux/autoconf.h>
00005 
00006 using namespace std;
00007 
00008 #define MAGIC   0x63951087
00009 
00010 int main(int argc, char *argv[]) {
00011         char buf[256];
00012         unsigned long magic=MAGIC;
00013         memset(buf, '\0', 256);
00014         memcpy(buf, (void *)&magic, 4);
00015 //      string cmdline = CONFIG_ETRAX_CMDLINE;
00016         string cmdline = "root=/dev/mtdblock3 init=/linuxrc rootfstype=jffs2";
00017         cmdline += " ";
00018         if(argc > 1) {
00019                 cmdline += argv[1];
00020 //              cout << "|" << cmdline << "|" << endl;
00021         }
00022         int l = cmdline.length();
00023         l++;
00024         if(l + 4 > 256)
00025                 l = 256 - 4;
00026         memcpy(&buf[4], cmdline.c_str(), l);
00027 /*      while(argc) {
00028                 cout << "|" << argv[argc] << "|" << endl;
00029                 argc--;
00030         }
00031 */
00032 //      for(int i = 0; i < argc; i++)
00033 //              cout << "|" << argv[i] << "|" << endl;
00034         cout.write(buf, 256);
00035         return 0;
00036 }

Generated on Fri Nov 28 00:06:25 2008 for elphel by  doxygen 1.5.1