1: #include <sys/param.h>
   2: #include <sys/ino.h>
   3: #include <sys/inode.h>
   4: #include <sys/filsys.h>
   5: #include <sys/dir.h>
   6: #include <saio.h>
   7: 
   8: 
   9: char line[100];
  10: 
  11: main()
  12: {
  13: int i;
  14:     segflag = 2;
  15: 
  16: 
  17:     printf("Boot\n");
  18:     do {
  19:         printf(": "); gets(line);
  20:         i = open(line,0);
  21:     } while (i < 0);
  22: 
  23: 
  24:     copyunix(i);
  25: 
  26: }
  27: 
  28: 
  29: copyunix(io)
  30: register io;
  31: {
  32: register addr,s;
  33: long phys;
  34: unsigned    txtsiz,datsiz,bsssiz;
  35: int magic;
  36: 
  37: 
  38:     lseek(io, (off_t)0, 0);
  39:     magic = getw(io);
  40:     txtsiz = getw(io);
  41:     datsiz = getw(io);
  42:     bsssiz = getw(io);
  43: 
  44: 
  45:     switch (magic) {
  46:     case 0411:
  47:         setseg(0);
  48:         lseek(io, (long)(020+txtsiz), 0);
  49: 
  50:         for(addr=0; addr!=datsiz; addr+=2)  {
  51:             mtpi(getw(io),addr);
  52:         }
  53: 
  54:         clrseg(addr,bsssiz);
  55: 
  56:         phys = (long)datsiz + (long)bsssiz + 63L;
  57:         phys =/ 64;
  58:         setseg((int)phys);
  59: 
  60:         lseek(io, 020L, 0);
  61: 
  62:         for(addr=0; addr!=txtsiz; addr+=2) {
  63:             mtpi(getw(io),addr);
  64:         }
  65:         return;
  66:     case 0407:
  67:         setseg(0);
  68:         /*
  69: 		 * space over the header. We do this instead of seeking
  70: 		 * because the input might be a tape which doesn't know
  71: 		 * how to seek.
  72: 		 */
  73:         getw(io); getw(io); getw(io); getw(io);
  74:         phys = txtsiz+datsiz;
  75:         for (addr = 0; addr != phys; addr += 2)
  76:             mtpi(getw(io),addr);
  77:         clrseg(addr, bsssiz);
  78:         return;
  79:     default:
  80:         printf("Can't load %o files\n", magic);
  81:         exit(1);
  82:     }
  83: }

Defined functions

copyunix defined in line 29; used 1 times
  • in line 24
main defined in line 11; never used

Defined variables

line defined in line 9; used 2 times
Last modified: 1979-01-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 566
Valid CSS Valid XHTML 1.0 Strict