Subversion Repositories SvarDOS

Rev

Rev 571 | Rev 576 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 571 Rev 572
Line 37... Line 37...
37
#include "rmodinit.h"
37
#include "rmodinit.h"
38
#include "sayonara.h"
38
#include "sayonara.h"
39
 
39
 
40
#include "rmodcore.h" /* rmod binary inside a BUFFER array */
40
#include "rmodcore.h" /* rmod binary inside a BUFFER array */
41
 
41
 
-
 
42
/* this version byte is used to tag RMOD so I can easily make sure that
-
 
43
 * the RMOD struct I find in memory is one that I know. Should the version
-
 
44
 * mismatch, then it would likely mean that SvarCOM has been upgraded and
-
 
45
 * RMOD should not be accessed as its structure might no longer be in sync
-
 
46
 * with what I think it is.
-
 
47
 *          *** INCREMENT THIS AT EACH NEW SVARCOM RELEASE! ***          */
-
 
48
#define BYTE_VERSION 3
-
 
49
 
-
 
50
 
42
struct config {
51
struct config {
43
  unsigned char flags; /* command.com flags, as defined in rmodinit.h */
52
  unsigned char flags; /* command.com flags, as defined in rmodinit.h */
44
  char *execcmd;
53
  char *execcmd;
45
  unsigned short envsiz;
54
  unsigned short envsiz;
46
};
55
};
Line 736... Line 745...
736
      return(1);
745
      return(1);
737
    }
746
    }
738
    /* copy flags to rmod's storage (and enable ECHO) */
747
    /* copy flags to rmod's storage (and enable ECHO) */
739
    rmod->flags = cfg.flags | FLAG_ECHOFLAG;
748
    rmod->flags = cfg.flags | FLAG_ECHOFLAG;
740
    /* printf("rmod installed at %Fp\r\n", rmod); */
749
    /* printf("rmod installed at %Fp\r\n", rmod); */
-
 
750
    rmod->version = BYTE_VERSION;
741
  } else {
751
  } else {
742
    /* printf("rmod found at %Fp\r\n", rmod); */
752
    /* printf("rmod found at %Fp\r\n", rmod); */
743
    /* if I was spawned by rmod and FLAG_EXEC_AND_QUIT is set, then I should
753
    /* if I was spawned by rmod and FLAG_EXEC_AND_QUIT is set, then I should
744
     * die asap, because the command has been executed already, so I no longer
754
     * die asap, because the command has been executed already, so I no longer
745
     * have a purpose in life */
755
     * have a purpose in life */
746
    if (rmod->flags & FLAG_EXEC_AND_QUIT) sayonara(rmod);
756
    if (rmod->flags & FLAG_EXEC_AND_QUIT) sayonara(rmod);
-
 
757
    /* */
-
 
758
    if (rmod->version != BYTE_VERSION) {
-
 
759
      outputnl("SVARCOM VERSION CHANGED. SYSTEM HALTED. PLEASE REBOOT YOUR COMPUTER.");
-
 
760
      _asm {
-
 
761
        HALT:
-
 
762
        hlt
-
 
763
        jmp HALT
-
 
764
      }
-
 
765
    }
747
  }
766
  }
748
 
767
 
749
  /* install a few guardvals in memory to detect some cases of overflows */
768
  /* install a few guardvals in memory to detect some cases of overflows */
750
  memguard_set(cmdlinebuf);
769
  memguard_set(cmdlinebuf);
751
 
770