Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/runtime/kernel/boot.c
ViewVC logotype

Diff of /sml/trunk/src/runtime/kernel/boot.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 418, Fri Sep 3 23:51:27 1999 UTC revision 439, Wed Sep 15 16:37:27 1999 UTC
# Line 61  Line 61 
61   *   *
62   * Boot the system using the .bin files from binDir.   * Boot the system using the .bin files from binDir.
63   */   */
64  void BootML (const char *binDir, heap_params_t *heapParams,  void BootML (const char *binDir, heap_params_t *heapParams, const char *rtPID)
              const char *rtpid_spec)  
65  {  {
66      ml_state_t  *msp;      ml_state_t  *msp;
67      char        fname[512];      char        fname[512];
68    
69      if (rtpid_spec) {      if (rtPID != NIL(char *)) {
70        int i, l = strlen (rtpid_spec);          int i, l = strlen (rtPID);
71        for (i = 0; i < PERID_LEN; i++) {        for (i = 0; i < PERID_LEN; i++) {
72          int i2 = 2 * i;          int i2 = 2 * i;
73          if (i2 + 1 < l) {          if (i2 + 1 < l) {
74            int c1 = rtpid_spec [i2];                  int c1 = rtPID[i2];
75            int c2 = rtpid_spec [i2 + 1];                  int c2 = rtPID[i2 + 1];
76            RunTimePerID.bytes[i] = HEX (c1) * 16 + HEX (c2);  /* what if upper-case digits are used?? */
77                    RunTimePerID.bytes[i] = (HEX(c1) << 4) + HEX(c2);
78          }          }
79        }        }
80      }      }
# Line 341  Line 341 
341      binfile_hdr_t   hdr;      binfile_hdr_t   hdr;
342      pers_id_t       exportPerID;      pers_id_t       exportPerID;
343      Int32_t         thisSzB;      Int32_t         thisSzB;
344      size_t          archive_offset;      size_t          archiveOffset;
345      char            *atptr, *colonptr;      char            *atptr, *colonptr;
346      char            *objname = fname;      char            *objname = fname;
347    
348    
349      if ((atptr = strchr (fname, '@')) == NULL)      if ((atptr = strchr (fname, '@')) == NULL)
350        archive_offset = 0;          archiveOffset = 0;
351      else {      else {
352        if ((colonptr = strchr (atptr + 1, ':')) != NULL) {        if ((colonptr = strchr (atptr + 1, ':')) != NULL) {
353          objname = colonptr + 1;          objname = colonptr + 1;
354          *colonptr = '\0';          *colonptr = '\0';
355        }        }
356        /* not a lot of extensive checking here... */        /* not a lot of extensive checking here... */
357        archive_offset = strtoul (atptr + 1, NULL, 0);          archiveOffset = strtoul (atptr + 1, NULL, 0);
358        *atptr = '\0';        *atptr = '\0';
359      }      }
360    
# Line 367  Line 367 
367    
368    /* if an offset is given (i.e., we are probably dealing with a stable    /* if an offset is given (i.e., we are probably dealing with a stable
369     * archive), then seek to the beginning of the section that contains     * archive), then seek to the beginning of the section that contains
370     * the binfile */     * the binfile
371      if (archive_offset)     */
372        if (fseek (file, archive_offset, SEEK_SET) == -1)      if (archiveOffset != 0) {
373            if (fseek (file, archiveOffset, SEEK_SET) == -1)
374          Die ("cannot seek on archive file \"%s%c%s@%ul\"",          Die ("cannot seek on archive file \"%s%c%s@%ul\"",
375               binDir, PATH_ARC_SEP, fname, (unsigned long) archive_offset);                  binDir, PATH_ARC_SEP, fname, (unsigned long) archiveOffset);
376        }
377    
378    /* get the header */    /* get the header */
379      ReadBinFile (file, &hdr, sizeof(binfile_hdr_t), binDir, fname);      ReadBinFile (file, &hdr, sizeof(binfile_hdr_t), binDir, fname);
# Line 420  Line 422 
422    
423    /* seek to code section */    /* seek to code section */
424      {      {
425          long        off = archive_offset          long        off = archiveOffset
426                          + sizeof(binfile_hdr_t)                          + sizeof(binfile_hdr_t)
427                          + hdr.importSzB                          + hdr.importSzB
428                          + exportSzB                          + exportSzB

Legend:
Removed from v.418  
changed lines
  Added in v.439

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0