[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: e100boot for Windows available?



Sure, no problem! Here's some notes and a patch for e100boot.c

Patch your e100boot.c file from the R2_1_0 distribution(ie. from devboard_lx-R2_1_0.tgz) with the diff enclosed.

This change adds a new command line option, "--tofile xxx", which is used to capture ALL the packets that would normally be sent to the device as if it were in network boot mode. Note, it doesn't actually require a device in boot mode, it just creates a complete image of the data that would have been sent to the device over the network.

The resluting file should then be compressed with gzip and can then be copied over to the PC.

On the Windows side download the eboot.exe program sources from http://www.elphel.com/downloads/eboot_sources.zip and build the program using Visual Studio. This produces a command line program so you just need to launch a DOS box, copy the compressed image from your linux box, put the device to be programmed in network mode, and run the program. From that point on its the same as on a Linux machine.

NOTE: I took at look at the new tools distribution (tools-build-R2_0_5) that was mentioned recently as it would be nice to have the boot program be able to display the programming status over the network as the new version does. However, I tried making similar changes to the new file(s) that replace e100boot.c such as common.c and network.c and I was able to produce an image file that seems correct, but it did not work with the eboot.exe windows utility program. It seems to get stuck in a loop sending out the first few packets. I haven't had much time to investigate this issue much further but if I can get it to work (or someone else does!) I will post the changes. Perhaps the client side of the network boot has changed enough in the new version, that the windows loader program will need to be modified as well. I continue to investigate.

Regards,

--David Kilp


*** e100boot.c.SAVED	Fri Jan 31 13:24:27 2003
--- e100boot.c	Fri Jan 31 13:32:46 2003
***************
*** 13,16 ****
--- 13,21 ----
  *! Jul  3 2000  Johan Adolfsson    Added this header and added Log tag
  *! $Log: e100boot.c,v $
+ *! Revision 1.3  2003/01/30 19:43:13  dkilp
+ *! Adding new option "--tofile" which is used to save a copy of all 
+ *! network data that is sent to device for use by the Windows 
+ *! equivalent of this program, eboot.exe
+ *!
  *! Revision 1.17  2001/02/19 13:53:05  larsv
  *! Added "--pause" option from ASIC's version (needed to initialize SDRAM).
***************
*** 42,50 ****
  /* 
   * tools/e100boot/sbl/e100boot.c
!  * $Id: e100boot.c,v 1.17 2001/02/19 13:53:05 larsv Exp $ 
   */
  
  /**************************  Version  **************************************/
! char version[] = "Time-stamp: $Id: e100boot.c,v 1.17 2001/02/19 13:53:05 larsv Exp $";
  
  /**************************  Include files  ********************************/
--- 47,55 ----
  /* 
   * tools/e100boot/sbl/e100boot.c
!  * $Id: e100boot.c,v 1.3 2003/01/30 19:43:13 dkilp Exp $ 
   */
  
  /**************************  Version  **************************************/
! char version[] = "Time-stamp: $Id: e100boot.c,v 1.3 2003/01/30 19:43:13 dkilp Exp $";
  
  /**************************  Include files  ********************************/
***************
*** 151,154 ****
--- 156,162 ----
  
  int toFiles = FALSE;
+ char ofilename[256]; //Andrey
+ FILE *singlefd=NULL;	//Added by Andrey for writing a single file
+ 
  int one_id_only = TRUE;
  int all_ids = TRUE;
***************
*** 354,357 ****
--- 362,378 ----
    p = create_packet(0);
  
+   if (singlefd) { // added by Andrey
+     udword seq = 0;
+     while(p) {
+       if ((p = create_packet(seq++))) {
+         D();
+         SendToDevice(p->data, p->size);
+       }
+     }
+     fclose(singlefd);
+     printf ("Created file %s to be loaded by other eboot loader\n",ofilename);
+     exit(0);
+   }
+ 
    if (toFiles) {
      udword seq = 0;
***************
*** 916,919 ****
--- 937,949 ----
      }
  
+     else if (strncmp(argVect[argi], "--tofile", 8) == 0) { // added by Andrey - should be after "--tofiles?"
+       GetStringOption(&argi, argCount, argVect, 
+                       ofilename, "--tofile");
+       if ((singlefd = fopen(ofilename, "w+")) == NULL) {
+         printf("Cannot open/create '%s'. %s.\n", ofilename, strerror(errno));
+         exit(1);
+       }
+     }
+ 
      else if (strncmp(argVect[argi], "--to", 4) == 0) {
        if ((GetStringOption(&argi, argCount, argVect, host2, "--to") == 0)) {
***************
*** 1287,1290 ****
--- 1317,1321 ----
           "           [--5400]* [--5600]* [--testcard]* [--devboard]* \n"
           "           [--bootfile file] [--jump addr]\n"
+          "           [--tofile file]\n"
           "           [--help]\n"
           "\n"
***************
*** 1307,1310 ****
--- 1338,1342 ----
  	 "--verify   Verify that memory contains dword. If not loading will stop\n"
  	 "--bootfile Which boot image to send to Etrax100. \n"
+ 	 "--tofile   Generate a complete packet image for Windows eboot.exe flasher\n"
           "           The following internal images are available:\n");
    {
***************
*** 1542,1545 ****
--- 1574,1579 ----
      fclose(fd);
    }
+   // Added by Andrey - to write to a single file
+   else if (singlefd) fwrite(buf, padded_len, 1, singlefd);
    else if (sendto(sock_fd, buf, padded_len, 0, &sock_addr, sizeof(sock_addr)) < 0) {
      perror("Sendto failed:");



> -----Original Message-----
> From: Mikael Starvik [mailto:mikael.starvik@xxxxxxx.com]
> Sent: Friday, January 31, 2003 1:05 AM
> To: David Kilp; dev-etrax
> Subject: RE: e100boot for Windows available?
> 
> 
> Nice! Would it be possible for you to share the code with the rest
> of the world?
> 
> (e100boot has no license AFAIK and is not contaminated by GPL
> which means that you can choose to keep the code proprietary)
> 
> /Mikael
> 
> -----Original Message-----
> From: owner-dev-etrax@xxxxxxx.com]On">mailto:owner-dev-etrax@xxxxxxx.com]On
> Behalf Of David Kilp
> Sent: Thursday, January 30, 2003 11:31 PM
> To: dev-etrax
> Subject: RE: e100boot for Windows available?
> 
> 
> Thanks for the information. After a few minor tweaks to my 
> existing e100boot.c file, I was able to use this program and 
> perform a successful network upgrade from a Win-2K laptop. 
> 
> You certainly saved me a bunch of time! Thanks!
> 
> --David Kilp 
> 
> > -----Original Message-----
> > From: Mikael Starvik [mailto:starvik@xxxxxxx.com]
> > Sent: Thursday, January 30, 2003 1:19 AM
> > To: David Kilp; dev-etrax
> > Subject: RE: e100boot for Windows available?
> > 
> > 
> > One of our customers have made a flashing utility for windows.
> > http://www.elphel.com/downloads/index.html.
> > 
> > I have never tested it and I don' know how compatible it is
> > with e100boot. Otherwise I agree that I should be rater simple to
> >  port e100boot to windows with libpcap for windows or similar.
> > Maybe it I can be tricky to get it to work on all different
> > Windows versions.
> > 
> > /Mikael
> > 
> > -----Original Message-----
> > From: owner-dev-etrax@xxxxxxx.com]On">mailto:owner-dev-etrax@xxxxxxx.com]On
> > Behalf Of David Kilp
> > Sent: Wednesday, January 29, 2003 11:56 PM
> > To: dev-etrax
> > Subject: e100boot for Windows available?
> > 
> > 
> > Just wondering if anyone has ported the flashing utility, 
> > e100boot, to a Windows platform? There are times where it 
> > would be useful to reflash a unit without having a Linux box 
> > around (sad as that may seem....). 
> > 
> > Looking at the code, it seems like it's doable at least for 
> > the server-side portion (sbl). The client side part would 
> > still have to be built on the Linux side and the resulting 
> > images copied over but seems possible. Just thought I'd see 
> > if somebody has already done it and would like to share the results.
> > 
> > Thanks,
> > 
> > David Kilp
> > 
>