home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_0399 / 326 / diff14.zoo / diffs14
Encoding:
Text File  |  1993-06-23  |  88.9 KB  |  3,407 lines

  1. *** 1.4    1993/03/08 21:36:20
  2. --- makefile    1993/04/15 00:35:08
  3. ***************
  4. *** 36,43 ****
  5.   
  6.   # add -DMULTITOS for a MultiTOS kernel
  7.   # add -DONLY030 for a version of MiNT that needs a 680x0, x>=3
  8.   
  9. ! DEFS = -DMULTITOS
  10.   #DEFS030 = -DMULTITOS -DONLY030
  11.   DEFS030 = -DONLY030
  12.   
  13. --- 36,44 ----
  14.   
  15.   # add -DMULTITOS for a MultiTOS kernel
  16.   # add -DONLY030 for a version of MiNT that needs a 680x0, x>=3
  17. + # add -DDEBUG_INFO for debugging information
  18.   
  19. ! DEFS = -DMULTITOS -DDEBUG_INFO
  20.   #DEFS030 = -DMULTITOS -DONLY030
  21.   DEFS030 = -DONLY030
  22.   
  23. ***************
  24. *** 73,79 ****
  25.   OBJS = $(COBJS) $(SOBJS)
  26.   OBJS030 = $(COBJS030) $(SOBJS030)
  27.   
  28. ! all: mint.prg mint030.prg
  29.   
  30.   mint.prg: $(OBJS)
  31.       $(CC) $(CFLAGS) -o mint.prg $(OBJS) $(LIBS)
  32. --- 74,80 ----
  33.   OBJS = $(COBJS) $(SOBJS)
  34.   OBJS030 = $(COBJS030) $(SOBJS030)
  35.   
  36. ! #all: mint.prg mint030.prg
  37.   
  38.   mint.prg: $(OBJS)
  39.       $(CC) $(CFLAGS) -o mint.prg $(OBJS) $(LIBS)
  40. *** 1.4    1993/03/08 21:36:20
  41. --- makefile.lcc    1993/05/25 16:59:14
  42. ***************
  43. *** 36,44 ****
  44.   
  45.   # add -DMULTITOS for a MultiTOS kernel
  46.   # add -DONLY030 for a version of MiNT that needs a 680x0, x>=3
  47.   
  48. ! DEFS =
  49. ! DEFS030 = -DONLY030
  50.   
  51.   SYMS = -Hmint.sym
  52.   
  53. --- 36,45 ----
  54.   
  55.   # add -DMULTITOS for a MultiTOS kernel
  56.   # add -DONLY030 for a version of MiNT that needs a 680x0, x>=3
  57. + # add -DDEBUG_INFO for debugging information
  58.   
  59. ! DEFS = -DDEBUG_INFO
  60. ! DEFS030 = -DONLY030 -DDEBUG_INFO
  61.   
  62.   SYMS = -Hmint.sym
  63.   
  64. ***************
  65. *** 56,62 ****
  66.   COPTS = $(OPTS) $(MODEL) $(ERRORS) $(DEFS)
  67.   CFLAGS = $(COPTS) $(SYMS)
  68.   ASFLAGS = $(ASOPTS) $(DEFS)
  69. ! CFLAGS030 = $(OPTS) $(MODEL030) $(ERRORS) $(DEFS030)
  70.   ASFLAGS030 = -m3 $(ASOPTS) $(DEFS030)
  71.   
  72.   LDFLAGS = -t=
  73. --- 57,64 ----
  74.   COPTS = $(OPTS) $(MODEL) $(ERRORS) $(DEFS)
  75.   CFLAGS = $(COPTS) $(SYMS)
  76.   ASFLAGS = $(ASOPTS) $(DEFS)
  77. ! COPTS030 = $(OPTS) $(MODEL030) $(ERRORS) $(DEFS030)
  78. ! CFLAGS030 = $(COPTS030) $(SYMS)
  79.   ASFLAGS030 = -m3 $(ASOPTS) $(DEFS030)
  80.   
  81.   LDFLAGS = -t=
  82. ***************
  83. *** 213,219 ****
  84.   #
  85.   # macros for cleaning up
  86.   #
  87. ! GENFILES= $(OBJS) $(OBJS030) $(ATRANSOBJ) $(ATRANS) $(GENMAGICPRG) $(YTABC) $(YTABH) magic.i __asm.o
  88.   EXTRAS= asmtab.c asmtab.h mint.prg mint030.prg mint.sym
  89.   
  90.   clean:
  91. --- 215,222 ----
  92.   #
  93.   # macros for cleaning up
  94.   #
  95. ! GENFILES= $(OBJS) $(OBJS030) $(ATRANSOBJ) $(ATRANS) $(GENMAGICPRG) \
  96. !     $(YTABC) $(YTABH) magic.i __asm.o genmagic.o
  97.   EXTRAS= asmtab.c asmtab.h mint.prg mint030.prg mint.sym
  98.   
  99.   clean:
  100. *** 1.4    1993/03/08 21:36:20
  101. --- asm.y    1993/05/25 16:40:10
  102. ***************
  103. *** 73,78 ****
  104. --- 73,90 ----
  105.                   free($1); free($3); free($5); }
  106.       | basic '{' basic ':' basic '}' {$$ = bitfield($1, $3, $5);
  107.               free($1); free($3); free($5); }
  108. +     | '(' '[' basic ',' basic ']' ',' basic ',' basic ')'
  109. +        { $$=postindex($3,$5,$8,$10); 
  110. +          free($3); free($5); free($8); free($10); }        
  111. +     | '(' '[' basic ',' basic ',' basic ']' ',' basic ')'
  112. +        { $$=preindex($3,$5,$7,$10); 
  113. +          free($3); free($5); free($7); free($10); }        
  114. +     | '(' '[' basic ']' ')'
  115. +        { $$=postindex0($3); 
  116. +          free($3); }
  117. +     | '(' '[' basic ']' ','  basic ')'
  118. +        { $$=postindex1($3,$6); 
  119. +          free($3); free($6); }                          
  120.   ;
  121.   
  122.   basic: basexpr { $$ = $1; }
  123. ***************
  124. *** 126,132 ****
  125.       jmp_buf save;
  126.       FILE *oldin, *f;
  127.   
  128. !     f = fopen(file, "r");
  129.       if (!f) {
  130.           perror(file);
  131.           return;
  132. --- 138,144 ----
  133.       jmp_buf save;
  134.       FILE *oldin, *f;
  135.   
  136. !     f = fopen(file, "rt");
  137.       if (!f) {
  138.           perror(file);
  139.           return;
  140. ***************
  141. *** 186,192 ****
  142.                   fprintf(stderr, "missing argument to -o\n");
  143.                   usage();
  144.               }
  145. !             f = fopen(*argv, "w");
  146.               if (!f)
  147.                   perror(*argv);
  148.               else
  149. --- 198,204 ----
  150.                   fprintf(stderr, "missing argument to -o\n");
  151.                   usage();
  152.               }
  153. !             f = fopen(*argv, "wt");
  154.               if (!f)
  155.                   perror(*argv);
  156.               else
  157. ***************
  158. *** 232,238 ****
  159.           yyparse();
  160.       } else {
  161.           while(*argv) {
  162. !         if (!(f = fopen(*argv, "r")))
  163.               perror(*argv);
  164.           else {
  165.               infile = f;
  166. --- 244,250 ----
  167.           yyparse();
  168.       } else {
  169.           while(*argv) {
  170. !         if (!(f = fopen(*argv, "rt")))
  171.               perror(*argv);
  172.           else {
  173.               infile = f;
  174. *** 1.4    1993/03/08 21:36:20
  175. --- asmtab.c    1993/05/25 17:16:14
  176. ***************
  177. *** 47,71 ****
  178.   
  179.   
  180.   
  181. ! #define    YYFINAL        87
  182.   #define    YYFLAG        -32768
  183. ! #define    YYNTBASE    25
  184.   
  185. ! #define YYTRANSLATE(x) ((unsigned)(x) <= 267 ? yytranslate[x] : 35)
  186.   
  187.   static const char yytranslate[] = {     0,
  188.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  189.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  190.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  191. !      2,     2,     2,     2,    15,    22,     2,     2,     2,    16,
  192. !     17,    23,    18,    13,    19,     2,    24,     2,     2,     2,
  193.        2,     2,     2,     2,     2,     2,     2,    14,     2,     2,
  194.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  195.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  196.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  197.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  198.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  199. -      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  200.        2,     2,    20,     2,    21,     2,     2,     2,     2,     2,
  201.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  202.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  203. --- 47,71 ----
  204.   
  205.   
  206.   
  207. ! #define    YYFINAL        108
  208.   #define    YYFLAG        -32768
  209. ! #define    YYNTBASE    27
  210.   
  211. ! #define YYTRANSLATE(x) ((unsigned)(x) <= 267 ? yytranslate[x] : 37)
  212.   
  213.   static const char yytranslate[] = {     0,
  214.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  215.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  216.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  217. !      2,     2,     2,     2,    15,    24,     2,     2,     2,    16,
  218. !     17,    25,    18,    13,    19,     2,    26,     2,     2,     2,
  219.        2,     2,     2,     2,     2,     2,     2,    14,     2,     2,
  220.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  221.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  222.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  223. +     22,     2,    23,     2,     2,     2,     2,     2,     2,     2,
  224.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  225.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  226.        2,     2,    20,     2,    21,     2,     2,     2,     2,     2,
  227.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  228.        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  229. ***************
  230. *** 88,114 ****
  231.        0,     1,     4,     6,     9,    12,    16,    21,    26,    33,
  232.       40,    45,    50,    53,    56,    59,    64,    68,    74,    76,
  233.       80,    82,    85,    87,    90,    94,    99,   104,   109,   114,
  234. !    121,   128,   130,   134,   137,   139,   142,   144,   146,   148
  235.   };
  236.   
  237.   #endif
  238.   
  239.   static const short yyrhs[] = {    -1,
  240. !     25,    26,     0,     5,     0,    30,     5,     0,    27,     5,
  241. !      0,    30,    27,     5,     0,     8,     4,     6,     5,     0,
  242.        8,     4,     3,     5,     0,     7,     4,     3,     4,     6,
  243. !      5,     0,     7,     4,     3,     4,    31,     5,     0,     9,
  244.        4,     3,     5,     0,    10,     4,     3,     5,     0,    11,
  245. !      5,     0,    12,     5,     0,     4,    29,     0,     4,    29,
  246. !      4,    28,     0,     3,     4,    29,     0,     3,     4,    29,
  247. !      4,    28,     0,    31,     0,    31,    13,    28,     0,     3,
  248. !      0,     3,    14,     0,    32,     0,    15,    32,     0,    16,
  249. !     32,    17,     0,    16,    32,    17,    18,     0,    19,    16,
  250. !     32,    17,     0,    32,    16,    32,    17,     0,    16,    32,
  251. !     17,     3,     0,    32,    16,    32,    13,    32,    17,     0,
  252. !     32,    20,    32,    14,    32,    21,     0,    33,     0,    33,
  253. !     34,    32,     0,    19,    32,     0,     3,     0,    22,     3,
  254. !      0,    18,     0,    19,     0,    23,     0,    24,     0
  255.   };
  256.   
  257.   #if YYDEBUG != 0
  258. --- 88,119 ----
  259.        0,     1,     4,     6,     9,    12,    16,    21,    26,    33,
  260.       40,    45,    50,    53,    56,    59,    64,    68,    74,    76,
  261.       80,    82,    85,    87,    90,    94,    99,   104,   109,   114,
  262. !    121,   128,   140,   152,   158,   166,   168,   172,   175,   177,
  263. !    180,   182,   184,   186
  264.   };
  265.   
  266.   #endif
  267.   
  268.   static const short yyrhs[] = {    -1,
  269. !     27,    28,     0,     5,     0,    32,     5,     0,    29,     5,
  270. !      0,    32,    29,     5,     0,     8,     4,     6,     5,     0,
  271.        8,     4,     3,     5,     0,     7,     4,     3,     4,     6,
  272. !      5,     0,     7,     4,     3,     4,    33,     5,     0,     9,
  273.        4,     3,     5,     0,    10,     4,     3,     5,     0,    11,
  274. !      5,     0,    12,     5,     0,     4,    31,     0,     4,    31,
  275. !      4,    30,     0,     3,     4,    31,     0,     3,     4,    31,
  276. !      4,    30,     0,    33,     0,    33,    13,    30,     0,     3,
  277. !      0,     3,    14,     0,    34,     0,    15,    34,     0,    16,
  278. !     34,    17,     0,    16,    34,    17,    18,     0,    19,    16,
  279. !     34,    17,     0,    34,    16,    34,    17,     0,    16,    34,
  280. !     17,     3,     0,    34,    16,    34,    13,    34,    17,     0,
  281. !     34,    20,    34,    14,    34,    21,     0,    16,    22,    34,
  282. !     13,    34,    23,    13,    34,    13,    34,    17,     0,    16,
  283. !     22,    34,    13,    34,    13,    34,    23,    13,    34,    17,
  284. !      0,    16,    22,    34,    23,    17,     0,    16,    22,    34,
  285. !     23,    13,    34,    17,     0,    35,     0,    35,    36,    34,
  286. !      0,    19,    34,     0,     3,     0,    24,     3,     0,    18,
  287. !      0,    19,     0,    25,     0,    26,     0
  288.   };
  289.   
  290.   #if YYDEBUG != 0
  291. ***************
  292. *** 116,136 ****
  293.       22,    23,    26,    29,    30,    31,    33,    34,    35,    37,
  294.       39,    40,    41,    42,    45,    46,    49,    50,    55,    56,
  295.       60,    63,    65,    66,    67,    68,    69,    70,    71,    72,
  296. !     74,    78,    79,    80,    82,    83,    86,    87,    88,    89
  297.   };
  298.   
  299.   static const char * const yytname[] = {   "$","error","$illegal.","WORD","WHITESP",
  300.   "EOLN","STRING","DEFINECMD","INCLUDECMD","IFDEFCMD","IFNDEFCMD","ELSECMD","ENDIFCMD",
  301. ! "','","':'","'#'","'('","')'","'+'","'-'","'{'","'}'","'$'","'*'","'/'","input",
  302. ! "line","opline","ops","opcode","label","operand","basic","basexpr","op",""
  303.   };
  304.   #endif
  305.   
  306.   static const short yyr1[] = {     0,
  307. !     25,    25,    26,    26,    26,    26,    26,    26,    26,    26,
  308. !     26,    26,    26,    26,    27,    27,    27,    27,    28,    28,
  309. !     29,    30,    31,    31,    31,    31,    31,    31,    31,    31,
  310. !     31,    32,    32,    32,    33,    33,    34,    34,    34,    34
  311.   };
  312.   
  313.   static const short yyr2[] = {     0,
  314. --- 121,144 ----
  315.       22,    23,    26,    29,    30,    31,    33,    34,    35,    37,
  316.       39,    40,    41,    42,    45,    46,    49,    50,    55,    56,
  317.       60,    63,    65,    66,    67,    68,    69,    70,    71,    72,
  318. !     74,    76,    79,    82,    85,    90,    91,    92,    94,    95,
  319. !     98,    99,   100,   101
  320.   };
  321.   
  322.   static const char * const yytname[] = {   "$","error","$illegal.","WORD","WHITESP",
  323.   "EOLN","STRING","DEFINECMD","INCLUDECMD","IFDEFCMD","IFNDEFCMD","ELSECMD","ENDIFCMD",
  324. ! "','","':'","'#'","'('","')'","'+'","'-'","'{'","'}'","'['","']'","'$'","'*'",
  325. ! "'/'","input","line","opline","ops","opcode","label","operand","basic","basexpr",
  326. ! "op",""
  327.   };
  328.   #endif
  329.   
  330.   static const short yyr1[] = {     0,
  331. !     27,    27,    28,    28,    28,    28,    28,    28,    28,    28,
  332. !     28,    28,    28,    28,    29,    29,    29,    29,    30,    30,
  333. !     31,    32,    33,    33,    33,    33,    33,    33,    33,    33,
  334. !     33,    33,    33,    33,    33,    34,    34,    34,    35,    35,
  335. !     36,    36,    36,    36
  336.   };
  337.   
  338.   static const short yyr2[] = {     0,
  339. ***************
  340. *** 137,143 ****
  341.        0,     2,     1,     2,     2,     3,     4,     4,     6,     6,
  342.        4,     4,     2,     2,     2,     4,     3,     5,     1,     3,
  343.        1,     2,     1,     2,     3,     4,     4,     4,     4,     6,
  344. !      6,     1,     3,     2,     1,     2,     1,     1,     1,     1
  345.   };
  346.   
  347.   static const short yydefact[] = {     1,
  348. --- 145,152 ----
  349.        0,     2,     1,     2,     2,     3,     4,     4,     6,     6,
  350.        4,     4,     2,     2,     2,     4,     3,     5,     1,     3,
  351.        1,     2,     1,     2,     3,     4,     4,     4,     4,     6,
  352. !      6,    11,    11,     5,     7,     1,     3,     2,     1,     2,
  353. !      1,     1,     1,     1
  354.   };
  355.   
  356.   static const short yydefact[] = {     1,
  357. ***************
  358. *** 144,207 ****
  359.        0,     0,     0,     3,     0,     0,     0,     0,     0,     0,
  360.        2,     0,     0,     0,    22,    21,    15,     0,     0,     0,
  361.        0,    13,    14,     5,     0,     4,     0,    17,     0,     0,
  362. !      0,     0,     0,     0,     6,     0,    35,     0,     0,     0,
  363. !      0,    16,    19,    23,    32,     0,     8,     7,    11,    12,
  364. !     18,     0,    24,     0,     0,    34,    36,     0,     0,     0,
  365. !     37,    38,    39,    40,     0,     0,     0,    25,     0,    20,
  366. !      0,     0,    33,     9,    10,    29,    26,    27,     0,    28,
  367. !      0,     0,     0,    30,    31,     0,     0
  368.   };
  369.   
  370.   static const short yydefgoto[] = {     1,
  371. !     11,    12,    42,    17,    13,    43,    44,    45,    65
  372.   };
  373.   
  374.   static const short yypact[] = {-32768,
  375. !     47,     1,     3,-32768,    44,    49,    56,    57,    58,    59,
  376. ! -32768,    60,     8,     3,-32768,-32768,    62,    64,    30,    65,
  377. !     66,-32768,-32768,-32768,    67,-32768,    68,    70,    13,    71,
  378. !     72,    73,    74,    75,-32768,    13,-32768,    27,    27,    15,
  379. !     69,-32768,    63,   -12,    21,     4,-32768,-32768,-32768,-32768,
  380. ! -32768,    27,-32768,    45,    27,-32768,-32768,    13,    27,    27,
  381. ! -32768,-32768,-32768,-32768,    27,    76,    77,     6,    53,-32768,
  382. !     25,    78,-32768,-32768,-32768,-32768,-32768,-32768,    27,-32768,
  383. !     27,    79,    80,-32768,-32768,    83,-32768
  384.   };
  385.   
  386.   static const short yypgoto[] = {-32768,
  387. ! -32768,    81,   -33,    84,-32768,    38,   -38,-32768,-32768
  388.   };
  389.   
  390.   
  391. ! #define    YYLAST        101
  392.   
  393.   
  394.   static const short yytable[] = {    53,
  395. !     54,    56,    51,    59,    14,    16,    37,    60,    76,    66,
  396. !     25,     3,    26,    56,    15,    37,    69,    37,    38,    39,
  397. !     71,    72,    40,    77,    70,    41,    73,    38,    39,    37,
  398. !     55,    40,    31,    52,    41,    32,    41,    79,    61,    62,
  399. !     82,    80,    83,    63,    64,    52,    86,    18,    41,     2,
  400. !      3,     4,    19,     5,     6,     7,     8,     9,    10,    20,
  401. !     21,    68,    22,    23,    24,    29,    30,    33,    34,    78,
  402. !     14,    57,    35,    36,    46,    58,    47,    48,    49,    50,
  403. !     74,    75,    87,    67,     0,     0,     0,     0,     0,     0,
  404. !      0,    81,     0,    27,     0,    84,     0,    28,     0,     0,
  405. !     85
  406.   };
  407.   
  408.   static const short yycheck[] = {    38,
  409. !     39,    40,    36,    16,     4,     3,     3,    20,     3,     6,
  410. !      3,     4,     5,    52,    14,     3,    55,     3,    15,    16,
  411. !     59,    60,    19,    18,    58,    22,    65,    15,    16,     3,
  412. !     16,    19,     3,    19,    22,     6,    22,    13,    18,    19,
  413. !     79,    17,    81,    23,    24,    19,     0,     4,    22,     3,
  414. !      4,     5,     4,     7,     8,     9,    10,    11,    12,     4,
  415. !      4,    17,     5,     5,     5,     4,     3,     3,     3,    17,
  416. !      4,     3,     5,     4,     4,    13,     5,     5,     5,     5,
  417. !      5,     5,     0,    46,    -1,    -1,    -1,    -1,    -1,    -1,
  418. !     -1,    14,    -1,    13,    -1,    17,    -1,    14,    -1,    -1,
  419. !     21
  420.   };
  421.   /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
  422.   #line 3 "bison.simple"
  423. --- 153,222 ----
  424.        0,     0,     0,     3,     0,     0,     0,     0,     0,     0,
  425.        2,     0,     0,     0,    22,    21,    15,     0,     0,     0,
  426.        0,    13,    14,     5,     0,     4,     0,    17,     0,     0,
  427. !      0,     0,     0,     0,     6,     0,    39,     0,     0,     0,
  428. !      0,    16,    19,    23,    36,     0,     8,     7,    11,    12,
  429. !     18,     0,    24,     0,     0,     0,    38,    40,     0,     0,
  430. !      0,    41,    42,    43,    44,     0,     0,     0,     0,    25,
  431. !      0,    20,     0,     0,    37,     9,    10,     0,     0,    29,
  432. !     26,    27,     0,    28,     0,     0,     0,    34,     0,     0,
  433. !      0,     0,     0,    30,    31,     0,     0,    35,     0,     0,
  434. !      0,     0,     0,     0,    33,    32,     0,     0
  435.   };
  436.   
  437.   static const short yydefgoto[] = {     1,
  438. !     11,    12,    42,    17,    13,    43,    44,    45,    66
  439.   };
  440.   
  441.   static const short yypact[] = {-32768,
  442. !     62,     3,     6,-32768,    40,    48,    54,    64,    70,    76,
  443. ! -32768,    77,    74,     6,-32768,-32768,    79,     7,    24,    81,
  444. !     82,-32768,-32768,-32768,    83,-32768,    84,    86,    22,    87,
  445. !     88,    89,    90,    91,-32768,    22,-32768,    36,    12,    32,
  446. !     85,-32768,    73,    34,   -13,     5,-32768,-32768,-32768,-32768,
  447. ! -32768,    36,-32768,    36,    75,    36,-32768,-32768,    22,    36,
  448. !     36,-32768,-32768,-32768,-32768,    36,    92,    93,    19,     1,
  449. !     94,-32768,    44,    95,-32768,-32768,-32768,    36,    63,-32768,
  450. ! -32768,-32768,    36,-32768,    36,    20,    36,-32768,    96,    78,
  451. !     36,    97,    98,-32768,-32768,    80,    36,-32768,    99,   101,
  452. !     36,    36,   100,   102,-32768,-32768,   104,-32768
  453.   };
  454.   
  455.   static const short yypgoto[] = {-32768,
  456. ! -32768,   103,   -33,   106,-32768,    55,   -38,-32768,-32768
  457.   };
  458.   
  459.   
  460. ! #define    YYLAST        120
  461.   
  462.   
  463.   static const short yytable[] = {    53,
  464. !     55,    57,    51,    80,    62,    63,    14,    37,    16,    30,
  465. !     67,    64,    65,    57,    37,    69,    15,    71,    81,    38,
  466. !     39,    73,    74,    40,    37,    72,    31,    75,    41,    32,
  467. !     52,    78,    91,    54,    37,    41,    38,    39,    37,    86,
  468. !     40,    79,    92,    18,    89,    41,    90,    56,    93,    60,
  469. !     52,    19,    96,    61,    52,    41,    83,    20,   100,    41,
  470. !     84,   107,   103,   104,     2,     3,     4,    21,     5,     6,
  471. !      7,     8,     9,    10,    22,    87,    25,     3,    26,    88,
  472. !     23,    24,    29,    33,    34,    59,    14,    58,    35,    36,
  473. !     46,    70,    47,    48,    49,    50,    76,    77,    95,     0,
  474. !     68,     0,    99,   108,     0,     0,     0,     0,    85,    97,
  475. !     82,   101,    94,   102,    98,    27,   105,     0,   106,    28
  476.   };
  477.   
  478.   static const short yycheck[] = {    38,
  479. !     39,    40,    36,     3,    18,    19,     4,     3,     3,     3,
  480. !      6,    25,    26,    52,     3,    54,    14,    56,    18,    15,
  481. !     16,    60,    61,    19,     3,    59,     3,    66,    24,     6,
  482. !     19,    13,    13,    22,     3,    24,    15,    16,     3,    78,
  483. !     19,    23,    23,     4,    83,    24,    85,    16,    87,    16,
  484. !     19,     4,    91,    20,    19,    24,    13,     4,    97,    24,
  485. !     17,     0,   101,   102,     3,     4,     5,     4,     7,     8,
  486. !      9,    10,    11,    12,     5,    13,     3,     4,     5,    17,
  487. !      5,     5,     4,     3,     3,    13,     4,     3,     5,     4,
  488. !      4,    17,     5,     5,     5,     5,     5,     5,    21,    -1,
  489. !     46,    -1,    23,     0,    -1,    -1,    -1,    -1,    14,    13,
  490. !     17,    13,    17,    13,    17,    13,    17,    -1,    17,    14
  491.   };
  492.   /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
  493.   #line 3 "bison.simple"
  494. ***************
  495. *** 770,808 ****
  496.               free(yyvsp[-5]); free(yyvsp[-3]); free(yyvsp[-1]); ;
  497.       break;}
  498.   case 32:
  499. ! #line 78 "asm.y"
  500. ! { yyval = yyvsp[0]; ;
  501.       break;}
  502.   case 33:
  503. ! #line 79 "asm.y"
  504. ! { yyval = concat3(yyvsp[-2], yyvsp[-1], yyvsp[0]); free(yyvsp[-2]); free(yyvsp[-1]); free(yyvsp[0]); ;
  505.       break;}
  506.   case 34:
  507. ! #line 80 "asm.y"
  508. ! { yyval = concat("-", yyvsp[0]); free(yyvsp[0]); ;
  509.       break;}
  510.   case 35:
  511. ! #line 82 "asm.y"
  512. ! {yyval = wordlookup(yyvsp[0]); free(yyvsp[0]); ;
  513.       break;}
  514.   case 36:
  515. ! #line 83 "asm.y"
  516. ! {yyval = hexop(yyvsp[0]); free(yyvsp[0]);;
  517.       break;}
  518.   case 37:
  519. ! #line 86 "asm.y"
  520. ! { yyval = strdup("+"); ;
  521.       break;}
  522.   case 38:
  523. ! #line 87 "asm.y"
  524. ! { yyval = strdup("-"); ;
  525.       break;}
  526.   case 39:
  527. ! #line 88 "asm.y"
  528. ! { yyval = strdup("*"); ;
  529.       break;}
  530.   case 40:
  531. ! #line 89 "asm.y"
  532.   { yyval = strdup("/"); ;
  533.       break;}
  534.   }
  535. --- 785,843 ----
  536.               free(yyvsp[-5]); free(yyvsp[-3]); free(yyvsp[-1]); ;
  537.       break;}
  538.   case 32:
  539. ! #line 77 "asm.y"
  540. ! { yyval=postindex(yyvsp[-8],yyvsp[-6],yyvsp[-3],yyvsp[-1]); 
  541. !          free(yyvsp[-8]); free(yyvsp[-6]); free(yyvsp[-3]); free(yyvsp[-1]); ;
  542.       break;}
  543.   case 33:
  544. ! #line 80 "asm.y"
  545. ! { yyval=preindex(yyvsp[-8],yyvsp[-6],yyvsp[-4],yyvsp[-1]); 
  546. !          free(yyvsp[-8]); free(yyvsp[-6]); free(yyvsp[-4]); free(yyvsp[-1]); ;
  547.       break;}
  548.   case 34:
  549. ! #line 83 "asm.y"
  550. ! { yyval=postindex0(yyvsp[-2]); 
  551. !          free(yyvsp[-2]); ;
  552.       break;}
  553.   case 35:
  554. ! #line 86 "asm.y"
  555. ! { yyval=postindex1(yyvsp[-4],yyvsp[-1]); 
  556. !          free(yyvsp[-4]); free(yyvsp[-1]); ;
  557.       break;}
  558.   case 36:
  559. ! #line 90 "asm.y"
  560. ! { yyval = yyvsp[0]; ;
  561.       break;}
  562.   case 37:
  563. ! #line 91 "asm.y"
  564. ! { yyval = concat3(yyvsp[-2], yyvsp[-1], yyvsp[0]); free(yyvsp[-2]); free(yyvsp[-1]); free(yyvsp[0]); ;
  565.       break;}
  566.   case 38:
  567. ! #line 92 "asm.y"
  568. ! { yyval = concat("-", yyvsp[0]); free(yyvsp[0]); ;
  569.       break;}
  570.   case 39:
  571. ! #line 94 "asm.y"
  572. ! {yyval = wordlookup(yyvsp[0]); free(yyvsp[0]); ;
  573.       break;}
  574.   case 40:
  575. ! #line 95 "asm.y"
  576. ! {yyval = hexop(yyvsp[0]); free(yyvsp[0]);;
  577. !     break;}
  578. ! case 41:
  579. ! #line 98 "asm.y"
  580. ! { yyval = strdup("+"); ;
  581. !     break;}
  582. ! case 42:
  583. ! #line 99 "asm.y"
  584. ! { yyval = strdup("-"); ;
  585. !     break;}
  586. ! case 43:
  587. ! #line 100 "asm.y"
  588. ! { yyval = strdup("*"); ;
  589. !     break;}
  590. ! case 44:
  591. ! #line 101 "asm.y"
  592.   { yyval = strdup("/"); ;
  593.       break;}
  594.   }
  595. ***************
  596. *** 1000,1006 ****
  597.     yystate = yyn;
  598.     goto yynewstate;
  599.   }
  600. ! #line 91 "asm.y"
  601.   
  602.   #include <setjmp.h>
  603.   
  604. --- 1035,1041 ----
  605.     yystate = yyn;
  606.     goto yynewstate;
  607.   }
  608. ! #line 103 "asm.y"
  609.   
  610.   #include <setjmp.h>
  611.   
  612. ***************
  613. *** 1039,1045 ****
  614.       jmp_buf save;
  615.       FILE *oldin, *f;
  616.   
  617. !     f = fopen(file, "r");
  618.       if (!f) {
  619.           perror(file);
  620.           return;
  621. --- 1074,1080 ----
  622.       jmp_buf save;
  623.       FILE *oldin, *f;
  624.   
  625. !     f = fopen(file, "rt");
  626.       if (!f) {
  627.           perror(file);
  628.           return;
  629. ***************
  630. *** 1099,1105 ****
  631.                   fprintf(stderr, "missing argument to -o\n");
  632.                   usage();
  633.               }
  634. !             f = fopen(*argv, "w");
  635.               if (!f)
  636.                   perror(*argv);
  637.               else
  638. --- 1134,1140 ----
  639.                   fprintf(stderr, "missing argument to -o\n");
  640.                   usage();
  641.               }
  642. !             f = fopen(*argv, "wt");
  643.               if (!f)
  644.                   perror(*argv);
  645.               else
  646. ***************
  647. *** 1145,1151 ****
  648.           yyparse();
  649.       } else {
  650.           while(*argv) {
  651. !         if (!(f = fopen(*argv, "r")))
  652.               perror(*argv);
  653.           else {
  654.               infile = f;
  655. --- 1180,1186 ----
  656.           yyparse();
  657.       } else {
  658.           while(*argv) {
  659. !         if (!(f = fopen(*argv, "rt")))
  660.               perror(*argv);
  661.           else {
  662.               infile = f;
  663. *** 1.4    1993/03/08 21:36:20
  664. --- asmtrans.h    1993/05/25 16:40:12
  665. ***************
  666. *** 36,41 ****
  667. --- 36,43 ----
  668.   char *concat4 P_((char *, char *, char *, char *));
  669.   char *concat5 P_((char *,char *, char *, char *, char *));
  670.   char *concat6 P_((char *,char *,char *, char *, char *, char *));
  671. + char *concat8 P_((char *,char *,char *, char *, char *, char *, char *, char *));
  672. + char *concat9 P_((char *,char *,char *, char *, char *, char *, char *, char *, char *));
  673.   void do_define P_((char *, char *));
  674.   void do_ifdef P_((char *));
  675.   void do_ifndef P_((char *));
  676. ***************
  677. *** 47,52 ****
  678. --- 49,55 ----
  679.   
  680.   char *wordlookup P_((char *));
  681.   char *changesiz P_((char *));
  682. + char *changesiz2 P_((char *));
  683.   char *fixupword P_((char *));
  684.   void emit P_((char *));
  685.   
  686. ***************
  687. *** 57,63 ****
  688.   char *indexed P_((char *, char *));
  689.   char *sizedop P_((char *, char *));
  690.   char *twoindex P_((char *, char *, char *));
  691. ! char *bitfield  P_((char *, char *, char *));
  692.   char *do_ops P_((char *, char *, char *, char *));
  693.   char *hexop P_((char *));
  694.   
  695. --- 60,70 ----
  696.   char *indexed P_((char *, char *));
  697.   char *sizedop P_((char *, char *));
  698.   char *twoindex P_((char *, char *, char *));
  699. ! char *postindex P_((char *, char *, char *, char *));
  700. ! char *postindex0 P_((char *));
  701. ! char *postindex1 P_((char *, char *));
  702. ! char *preindex P_((char *, char *, char *, char *));
  703. ! char *bitfield P_((char *, char *, char *));
  704.   char *do_ops P_((char *, char *, char *, char *));
  705.   char *hexop P_((char *));
  706.   
  707. *** 1.4    1993/03/08 21:36:20
  708. --- basepage.h    1993/04/15 00:32:00
  709. ***************
  710. *** 29,35 ****
  711.       char        p_cmdlin[128];    /* command line image */
  712.   }    BASEPAGE;
  713.   
  714. ! #ifdef __TURBOC__
  715.   # include <basepage.h>
  716.   # define _base (BASEPAGE *)(_BasPag)
  717.   #else
  718. --- 29,35 ----
  719.       char        p_cmdlin[128];    /* command line image */
  720.   }    BASEPAGE;
  721.   
  722. ! #if defined(__TURBOC__) && !defined(__MINT__)
  723.   # include <basepage.h>
  724.   # define _base (BASEPAGE *)(_BasPag)
  725.   #else
  726. *** 1.4    1993/03/08 21:36:20
  727. --- bios.c    1993/06/23 16:44:08
  728. ***************
  729. *** 21,26 ****
  730. --- 21,27 ----
  731.   /* BIOS device definitions */
  732.   #define CONSDEV 2
  733.   #define AUXDEV 1
  734. + #define PRNDEV 0
  735.   
  736.   /* BIOS devices 0..MAX_BHANDLE-1 can be redirected to GEMDOS files */
  737.   #define MAX_BHANDLE    4
  738. ***************
  739. *** 33,38 ****
  740. --- 34,40 ----
  741.   extern struct tty con_tty, aux_tty, midi_tty;
  742.   
  743.   extern int tosvers;    /* from main.c */
  744.   char *kbshft;        /* set in main.c */
  745.   
  746.   /* some BIOS vectors; note that the routines at these vectors may do nasty
  747. ***************
  748. *** 43,49 ****
  749.   #define MEDIACH *((long *)0x47eL)
  750.   #define GETBPB *((long *)0x472L)
  751.   
  752. - #define is_falcon ((mch & 0xffff0000L) == 0x00030000L)
  753.   
  754.   #if 1
  755.   /* these are supposed to be tables holding the addresses of the
  756. --- 45,50 ----
  757. ***************
  758. *** 58,73 ****
  759.   #define xconout    ((long *)0x57eL)
  760.   
  761.   #define BCOSTAT(dev) \
  762. !     ((tosvers >= 0x0102 && (unsigned)dev <= 4) ? \
  763.          (int)callout1(xcostat[dev], dev) : Bcostat(dev))
  764.   #define BCONOUT(dev, c) \
  765. !     ((tosvers >= 0x0102 && (unsigned)dev <= 4) ? \
  766.          callout2(xconout[dev], dev, c) : Bconout(dev, c))
  767.   #define BCONSTAT(dev) \
  768. !     ((tosvers >= 0x0102 && (unsigned)dev <= 4) ? \
  769.          (int)callout1(xconstat[dev], dev) : Bconstat(dev))
  770.   #define BCONIN(dev) \
  771. !     ((tosvers >= 0x0102 && (unsigned)dev <= 4) ? \
  772.          callout1(xconin[dev], dev) : Bconin(dev))
  773.   #else
  774.   #define BCOSTAT(dev) Bcostat(dev)
  775. --- 59,74 ----
  776.   #define xconout    ((long *)0x57eL)
  777.   
  778.   #define BCOSTAT(dev) \
  779. !     ((tosvers > 0x0102 && (unsigned)dev <= 4) ? \
  780.          (int)callout1(xcostat[dev], dev) : Bcostat(dev))
  781.   #define BCONOUT(dev, c) \
  782. !     ((tosvers > 0x0102 && (unsigned)dev <= 4) ? \
  783.          callout2(xconout[dev], dev, c) : Bconout(dev, c))
  784.   #define BCONSTAT(dev) \
  785. !     ((tosvers > 0x0102 && (unsigned)dev <= 4) ? \
  786.          (int)callout1(xconstat[dev], dev) : Bconstat(dev))
  787.   #define BCONIN(dev) \
  788. !     ((tosvers > 0x0102 && (unsigned)dev <= 4) ? \
  789.          callout1(xconin[dev], dev) : Bconin(dev))
  790.   #else
  791.   #define BCOSTAT(dev) Bcostat(dev)
  792. ***************
  793. *** 132,141 ****
  794.       if (dev == AUXDEV && has_bconmap)
  795.           dev = curproc->bconmap;
  796.   
  797. - /* compensate for a bug in the Falcon BIOS */
  798. -     if (dev == 7 && is_falcon)
  799. -         return Bconstat(1);
  800.       return BCONSTAT(dev);
  801.   }
  802.   
  803. --- 133,138 ----
  804. ***************
  805. *** 184,194 ****
  806.           if (dev == AUXDEV && has_bconmap)
  807.               dev = curproc->bconmap;
  808.   
  809. -         if (dev == 7 && is_falcon) {
  810. -             while (!Bconstat(1))
  811. -                 yield();
  812. -             return Bconin(1);
  813. -         }
  814.           if (dev > 0) {
  815.               while (!BCONSTAT(dev)) {
  816.                   yield();
  817. --- 181,186 ----
  818. ***************
  819. *** 257,266 ****
  820.           statdev = 4;
  821.       } else if (dev == 4) {
  822.           statdev = 3;
  823. -     } else if (dev == 7 && is_falcon) {
  824. - /* Falcon BIOS bug */
  825. -         (void)Bconout(1,c);
  826. -         return 1;
  827.       } else {
  828.           statdev = dev;
  829.       }
  830. --- 249,254 ----
  831. ***************
  832. *** 278,285 ****
  833.   
  834.   /* special case: many text accelerators return a bad value from
  835.    * Bconout, so we ignore the returned value for the console
  836.    */
  837. !     if (dev != CONSDEV) {
  838.   /* NOTE: if your compiler complains about the next line, then Bconout is
  839.    * improperly declared in your osbind.h header file. it should be returning
  840.    * a long value; some libraries incorrectly have Bconout returning void
  841. --- 266,275 ----
  842.   
  843.   /* special case: many text accelerators return a bad value from
  844.    * Bconout, so we ignore the returned value for the console
  845. +  * Sigh. serptch2 and hsmodem1 also screw this up, so for now let's
  846. +  * only count on it being correct for the printer.
  847.    */
  848. !     if (dev == PRNDEV) {
  849.   /* NOTE: if your compiler complains about the next line, then Bconout is
  850.    * improperly declared in your osbind.h header file. it should be returning
  851.    * a long value; some libraries incorrectly have Bconout returning void
  852. ***************
  853. *** 419,425 ****
  854.   /* we can't trust the Getbpb routine to accurately save all registers,
  855.    * so we do it ourselves
  856.    */
  857. !     r = callout(GETBPB, dev);
  858.   /* 
  859.    * There is a bug in the  TOS  disk handling routines (well several actually).
  860.    * If the directory size of Getbpb() is returned as zero then the drive 'dies'
  861. --- 409,415 ----
  862.   /* we can't trust the Getbpb routine to accurately save all registers,
  863.    * so we do it ourselves
  864.    */
  865. !     r = callout1(GETBPB, dev);
  866.   /* 
  867.    * There is a bug in the  TOS  disk handling routines (well several actually).
  868.    * If the directory size of Getbpb() is returned as zero then the drive 'dies'
  869. ***************
  870. *** 478,486 ****
  871.       else if (dev == 3) dev = 4;
  872.       else if (dev == 4) dev = 3;
  873.   
  874. - /* correct for a bug in the Falcon BIOS */
  875. -     if (dev == 7 && is_falcon)
  876. -         return Bcostat(1);
  877.       return BCOSTAT(dev);
  878.   }
  879.   
  880. --- 468,473 ----
  881. ***************
  882. *** 945,950 ****
  883. --- 932,939 ----
  884.               unhook(v, where);
  885.           }
  886.       }
  887. + #else
  888. +     UNUSED(start); UNUSED(end);
  889.   #endif
  890.   }
  891.   
  892. *** 1.4    1993/03/08 21:36:20
  893. --- biosfs.c    1993/04/28 18:22:58
  894. ***************
  895. *** 1046,1064 ****
  896.           ws->ws_col = *((short *)(aline - 44)) + 1;
  897.       } else if (mode == TIOCIBAUD || mode == TIOCOBAUD) {
  898.           long oldbaud, newbaud;
  899.           dev = f->fc.aux;
  900.   
  901.           newbaud = *r;
  902.           if (dev == 1 || dev >= 6) {
  903.               if (has_bconmap)
  904. !                 mapin((dev == 1) ? curproc->bconmap : dev);
  905.               i = (int)rsconf(-2, -1, -1, -1, -1, -1);
  906.               if (i < 0 || i >= MAXBAUD)
  907.                   oldbaud = -1L;
  908.               else
  909.                   oldbaud = baudmap[i];
  910.               *r = oldbaud;
  911. !             if (newbaud > 0) {
  912.       /* BUG: assert DTR works only on modem1 */
  913.                   if (dev == 1 || dev == 6) {
  914.                       Offgibit(0xef);
  915. --- 1046,1070 ----
  916.           ws->ws_col = *((short *)(aline - 44)) + 1;
  917.       } else if (mode == TIOCIBAUD || mode == TIOCOBAUD) {
  918.           long oldbaud, newbaud;
  919. +         int oldmap;
  920.           dev = f->fc.aux;
  921.   
  922.           newbaud = *r;
  923.           if (dev == 1 || dev >= 6) {
  924. + /* trick rsconf into setting the correct port (it uses curproc->bconmap) */
  925. +             oldmap = curproc->bconmap;
  926.               if (has_bconmap)
  927. !                 curproc->bconmap = 
  928. !                     (dev == 1) ? curproc->bconmap : dev;
  929.               i = (int)rsconf(-2, -1, -1, -1, -1, -1);
  930.               if (i < 0 || i >= MAXBAUD)
  931.                   oldbaud = -1L;
  932.               else
  933.                   oldbaud = baudmap[i];
  934.               *r = oldbaud;
  935. !             if (newbaud > 0 && newbaud != oldbaud) {
  936.       /* BUG: assert DTR works only on modem1 */
  937.                   if (dev == 1 || dev == 6) {
  938.                       Offgibit(0xef);
  939. ***************
  940. *** 1066,1077 ****
  941. --- 1072,1086 ----
  942.                   for (i = 0; i < MAXBAUD; i++) {
  943.                       if (baudmap[i] == newbaud) {
  944.                           rsconf(i, -1, -1, -1, -1, -1);
  945. +                         curproc->bconmap = oldmap;
  946.                           return 0;
  947.                       } else if (baudmap[i] < newbaud) {
  948.                           *r = baudmap[i];
  949. +                         curproc->bconmap = oldmap;
  950.                           break;
  951.                       }
  952.                   }
  953. +                 curproc->bconmap = oldmap;
  954.                   return ERANGE;
  955.               } else if (newbaud == 0L) {
  956.       /* BUG: drop DTR: works only on modem1 */
  957. ***************
  958. *** 1079,1084 ****
  959. --- 1088,1094 ----
  960.                       Ongibit(0x10);
  961.                   }
  962.               }
  963. +             curproc->bconmap = oldmap;
  964.               return 0;
  965.           } else if (dev == 2 || dev == 5) {
  966.               /* screen: assume 9600 baud */
  967. *** 1.4    1993/03/08 21:36:20
  968. --- debug.c    1993/06/10 18:37:04
  969. ***************
  970. *** 1,6 ****
  971.   /*
  972.   Copyright 1990,1991,1992 Eric R. Smith.
  973. ! Copyright 1992 Atari Corporation.
  974.   All rights reserved.
  975.   */
  976.   
  977. --- 1,6 ----
  978.   /*
  979.   Copyright 1990,1991,1992 Eric R. Smith.
  980. ! Copyright 1992,1993 Atari Corporation.
  981.   All rights reserved.
  982.   */
  983.   
  984. ***************
  985. *** 517,522 ****
  986. --- 517,531 ----
  987.   }
  988.   
  989.   
  990. + static char *rebootmsg[MAXLANG] = {
  991. + "FATAL ERROR. You must reboot the system.\r\n",
  992. + "FATAL ERROR. You must reboot the system.\r\n",        /* German */
  993. + "FATAL ERROR. You must reboot the system.\r\n",        /* French */
  994. + "FATAL ERROR. You must reboot the system.\r\n",        /* UK */
  995. + "FATAL ERROR. You must reboot the system.\r\n",        /* Spanish */
  996. + "FATAL ERROR. You must reboot the system.\r\n"        /* Italian */
  997. + };
  998.   EXITING 
  999.   void HALT()
  1000.   {
  1001. ***************
  1002. *** 528,534 ****
  1003. --- 537,547 ----
  1004.       extern EXITING _exit P_((int));
  1005.   #endif
  1006.       restr_intr();    /* restore interrupts to normal */
  1007. + #ifdef DEBUG_INFO
  1008.       debug_ws("Fatal MiNT error: adjust debug level and hit a key...\r\n");
  1009. + #else
  1010. +     debug_ws(rebootmsg[gl_lang]);
  1011. + #endif
  1012.       sys_q[READY_Q] = 0;    /* prevent context switches */
  1013.   
  1014.       for(;;) {
  1015. ***************
  1016. *** 543,553 ****
  1017.           }
  1018.       }
  1019.       for(;;) {
  1020. !     debug_ws("System halted. Press 'x' to exit, or else reboot\r\n");
  1021.           r = Bconin(2);
  1022.   
  1023.           if ( (r & 0x0ff) == 'x' ) {
  1024.               close_filesys();
  1025.               (void)Super((void *)tosssp);    /* gratuitous (void *) for Lattice */
  1026.   #ifdef PROFILING
  1027.               _exit(0);
  1028. --- 556,569 ----
  1029.           }
  1030.       }
  1031.       for(;;) {
  1032. !         debug_ws(rebootmsg[gl_lang]);
  1033.           r = Bconin(2);
  1034.   
  1035.           if ( (r & 0x0ff) == 'x' ) {
  1036. +             extern int no_mem_prot;
  1037.               close_filesys();
  1038. +             if (!no_mem_prot)
  1039. +                 restr_mmu();
  1040.               (void)Super((void *)tosssp);    /* gratuitous (void *) for Lattice */
  1041.   #ifdef PROFILING
  1042.               _exit(0);
  1043. ***************
  1044. *** 577,583 ****
  1045.       case UNDO:
  1046.           killgroup(con_tty.pgrp, SIGQUIT);
  1047.           break;
  1048. ! #ifndef NO_DEBUG_INFO
  1049.       case 0x3b:        /* F1: increase debugging level */
  1050.           debug_level++;
  1051.           break;
  1052. --- 593,599 ----
  1053.       case UNDO:
  1054.           killgroup(con_tty.pgrp, SIGQUIT);
  1055.           break;
  1056. ! #ifdef DEBUG_INFO
  1057.       case 0x3b:        /* F1: increase debugging level */
  1058.           debug_level++;
  1059.           break;
  1060. *** 1.4    1993/03/08 21:36:20
  1061. --- dos.c    1993/04/15 00:33:24
  1062. ***************
  1063. *** 69,75 ****
  1064.   long ARGS_ON_STACK t_setdate(date)
  1065.       int date;
  1066.   {
  1067. !     long r = Tsetdate(date);
  1068.       datestamp = Tgetdate();
  1069.       return r;
  1070.   }
  1071. --- 69,80 ----
  1072.   long ARGS_ON_STACK t_setdate(date)
  1073.       int date;
  1074.   {
  1075. !     long r;
  1076. ! /* Only the superuser may set date or time */
  1077. !     if (curproc->euid != 0)
  1078. !         return EACCDN;
  1079. !     r = Tsetdate(date);
  1080.       datestamp = Tgetdate();
  1081.       return r;
  1082.   }
  1083. ***************
  1084. *** 77,83 ****
  1085.   long ARGS_ON_STACK t_settime(time)
  1086.       int time;
  1087.   {
  1088. !     long r = Tsettime(time);
  1089.       timestamp = Tgettime();
  1090.       return r;
  1091.   }
  1092. --- 82,92 ----
  1093.   long ARGS_ON_STACK t_settime(time)
  1094.       int time;
  1095.   {
  1096. !     long r;
  1097. !     if (curproc->euid != 0)
  1098. !         return EACCDN;
  1099. !     r = Tsettime(time);
  1100.       timestamp = Tgettime();
  1101.       return r;
  1102.   }
  1103. *** 1.4    1993/03/08 21:36:20
  1104. --- dosfile.c    1993/04/28 18:06:22
  1105. ***************
  1106. *** 1,6 ****
  1107.   /*
  1108.   Copyright 1990,1991,1992 Eric R. Smith.
  1109. ! Copyright 1992 Atari Corporation.
  1110.   All rights reserved.
  1111.   */
  1112.   
  1113. --- 1,6 ----
  1114.   /*
  1115.   Copyright 1990,1991,1992 Eric R. Smith.
  1116. ! Copyright 1992,1993 Atari Corporation.
  1117.   All rights reserved.
  1118.   */
  1119.   
  1120. ***************
  1121. *** 414,419 ****
  1122. --- 414,420 ----
  1123.           f = do_open("u:\\dev\\null", O_RDWR|O_CREAT|O_TRUNC, 0,
  1124.                    (XATTR *)0);
  1125.           proc->handle[i] = f;
  1126. +         proc->fdflags[i] = FD_CLOEXEC;
  1127.           return i+offset;
  1128.       }
  1129.       if (attrib & (FA_LABEL|FA_DIR)) {
  1130. ***************
  1131. *** 428,433 ****
  1132. --- 429,435 ----
  1133.           return mint_errno;
  1134.       }
  1135.       proc->handle[i] = f;
  1136. +     proc->fdflags[i] = FD_CLOEXEC;
  1137.       i += offset;
  1138.       TRACE(("Fcreate: returning %d", i));
  1139.       return i;
  1140. ***************
  1141. *** 468,474 ****
  1142.       } else
  1143.           f = 0;
  1144.   
  1145. !     if (f) f->links++;
  1146.       proc->handle[fh] = f;
  1147.       return r;
  1148.   }
  1149. --- 470,479 ----
  1150.       } else
  1151.           f = 0;
  1152.   
  1153. !     if (f) {
  1154. !         f->links++;
  1155. !         proc->fdflags[fh] = 0;
  1156. !     }
  1157.       proc->handle[fh] = f;
  1158.       return r;
  1159.   }
  1160. ***************
  1161. *** 668,673 ****
  1162. --- 673,681 ----
  1163.   
  1164.       (void)do_close(curproc->handle[newh]);
  1165.       curproc->handle[newh] = f;
  1166. +     /* set default file descriptor flags */
  1167. +     if (newh >= 0)
  1168. +         curproc->fdflags[newh] = (newh >= MIN_OPEN) ? FD_CLOEXEC : 0;
  1169.       f->links++;
  1170.   /*
  1171.    * special: for a tty, if this is becoming a control terminal and the
  1172. ***************
  1173. *** 680,686 ****
  1174.           if (!tty->pgrp)
  1175.               tty->pgrp = curproc->pgrp;
  1176.       }
  1177. !     return newh;
  1178.   }
  1179.   
  1180.   long ARGS_ON_STACK
  1181. --- 688,694 ----
  1182.           if (!tty->pgrp)
  1183.               tty->pgrp = curproc->pgrp;
  1184.       }
  1185. !     return 0;
  1186.   }
  1187.   
  1188.   long ARGS_ON_STACK
  1189. ***************
  1190. *** 978,984 ****
  1191.       mask = 1L;
  1192.       for (i = 0; i < MAX_OPEN; i++) {
  1193.           if ( ((rfd & mask) || (wfd & mask)) && !(p->handle[i]) ) {
  1194. !             DEBUG(("Fselect: invalid handle"));
  1195.               return EIHNDL;
  1196.           }
  1197.           mask = mask << 1L;
  1198. --- 986,992 ----
  1199.       mask = 1L;
  1200.       for (i = 0; i < MAX_OPEN; i++) {
  1201.           if ( ((rfd & mask) || (wfd & mask)) && !(p->handle[i]) ) {
  1202. !             DEBUG(("Fselect: invalid handle: %d", i));
  1203.               return EIHNDL;
  1204.           }
  1205.           mask = mask << 1L;
  1206. *** 1.4    1993/03/08 21:36:20
  1207. --- dosmem.c    1993/06/22 16:54:58
  1208. ***************
  1209. *** 1,6 ****
  1210.   /*
  1211.   Copyright 1990,1991,1992 Eric R. Smith.
  1212. ! Copyright 1992 Atari Corporation.
  1213.   All rights reserved.
  1214.   */
  1215.   
  1216. --- 1,6 ----
  1217.   /*
  1218.   Copyright 1990,1991,1992 Eric R. Smith.
  1219. ! Copyright 1992,1993 Atari Corporation.
  1220.   All rights reserved.
  1221.   */
  1222.   
  1223. ***************
  1224. *** 102,108 ****
  1225.   {
  1226.       long r, r1;
  1227.       int protmode;
  1228. ! #ifndef NO_DEBUG_INFO
  1229.       int origmode = mode;
  1230.   #endif
  1231.   
  1232. --- 102,108 ----
  1233.   {
  1234.       long r, r1;
  1235.       int protmode;
  1236. ! #ifdef DEBUG_INFO
  1237.       int origmode = mode;
  1238.   #endif
  1239.   
  1240. ***************
  1241. *** 337,342 ****
  1242. --- 337,343 ----
  1243.           /* fall through */
  1244.       case 4:
  1245.           mkwait = mkgo = 1;
  1246. +         thread = (mode == 4);
  1247.           tfmt = "Pexec(%d,%lx,BP:%lx,%lx)";
  1248.           tail_offs = 0;
  1249.           break;
  1250. ***************
  1251. *** 439,447 ****
  1252. --- 440,462 ----
  1253.           else
  1254.               env = 0;
  1255.           if (!env) {
  1256. +             DEBUG(("Pexec: memory not owned by parent"));
  1257.               if (p) dispose_proc(p);
  1258.               return EIMBA;
  1259.           }
  1260. + #if 0
  1261. +       /* make sure that the PC we are about to use is in a region which is
  1262. +        * attached to the process; this is most commonly a problem for
  1263. +        * shared text segment programs.
  1264. +        * BUG: we should verify that the PC is in a region to which the
  1265. +        * child process should legitimately have access.
  1266. +        */
  1267. +               text = addr2region(((BASEPAGE *)base->loc)->p_tbase);
  1268. +               if (text == base) {
  1269. +               /* text segment is part of base region */
  1270. +                       text = NULL;
  1271. +               }
  1272. + #endif
  1273.       }
  1274.   
  1275.   /* make a local copy of the name, in case we are overlaying the current
  1276. *** 1.4    1993/03/08 21:36:20
  1277. --- fasttext.c    1993/04/15 00:34:06
  1278. ***************
  1279. *** 1,6 ****
  1280.   /*
  1281. ! Copyright 1992,1992 Eric R. Smith.
  1282. ! Copyright 1992 Atari Corporation.
  1283.   All rights reserved.
  1284.   */
  1285.   
  1286. --- 1,6 ----
  1287.   /*
  1288. ! Copyright 1991,1992 Eric R. Smith.
  1289. ! Copyright 1992,1993 Atari Corporation.
  1290.   All rights reserved.
  1291.   */
  1292.   
  1293. ***************
  1294. *** 64,69 ****
  1295. --- 64,70 ----
  1296.   INLINE static void insert_line P_((SCREEN *, int));
  1297.   static void setbgcol P_((SCREEN *, int));
  1298.   static void setfgcol P_((SCREEN *, int));
  1299. + static void setcurs P_((SCREEN *, int));
  1300.   static void putesc P_((SCREEN *, int));
  1301.   static void escy1_putch P_((SCREEN *, int));
  1302.   INLINE static void put_ch P_((SCREEN *, int));
  1303. ***************
  1304. *** 889,894 ****
  1305. --- 890,910 ----
  1306.   }
  1307.   
  1308.   static void
  1309. + setcurs(v, c)
  1310. +     SCREEN *v;
  1311. +     int c;
  1312. + {
  1313. +     c -= ' ';
  1314. +     if (!c) {
  1315. +         v->flags &= ~CURS_FLASH;
  1316. +     } else {
  1317. +         v->flags |= CURS_FLASH;
  1318. +         v->period = (unsigned char) c;
  1319. +     }
  1320. +     state = normal_putch;
  1321. + }
  1322. + static void
  1323.   quote_putch(v, c)
  1324.       SCREEN *v;
  1325.       int c;
  1326. ***************
  1327. *** 974,980 ****
  1328.           v->cursaddr = base + *(long *)(rowoff + i);
  1329.           delete_line(v, cy);
  1330.           break;
  1331. !     case 'Q':        /* quote-next-char */
  1332.           state = quote_putch;
  1333.           return;
  1334.       case 'Y':
  1335. --- 990,996 ----
  1336.           v->cursaddr = base + *(long *)(rowoff + i);
  1337.           delete_line(v, cy);
  1338.           break;
  1339. !     case 'Q':        /* EXTENSION: quote-next-char */
  1340.           state = quote_putch;
  1341.           return;
  1342.       case 'Y':
  1343. ***************
  1344. *** 1021,1026 ****
  1345. --- 1037,1045 ----
  1346.       case 'q':        /* reverse video off */
  1347.           v->flags &= ~FINVERSE;
  1348.           break;
  1349. +     case 't':        /* EXTENSION: set cursor flash rate */
  1350. +         state = setcurs;
  1351. +         return;
  1352.       case 'v':        /* wrap on */
  1353.           v->flags |= FWRAP;
  1354.           break;
  1355. ***************
  1356. *** 1101,1107 ****
  1357.               return;
  1358.           case '\t':
  1359.               if (v->cx < v->maxx) {
  1360. !                 register union {
  1361.                       long l;
  1362.                       short i[2];
  1363.                   } j;
  1364. --- 1120,1127 ----
  1365.               return;
  1366.           case '\t':
  1367.               if (v->cx < v->maxx) {
  1368. !             /* this can't be register for an ANSI compiler */
  1369. !                 union {
  1370.                       long l;
  1371.                       short i[2];
  1372.                   } j;
  1373. *** 1.4    1993/03/08 21:36:20
  1374. --- file.h    1993/06/10 20:25:32
  1375. ***************
  1376. *** 1,6 ****
  1377.   /*
  1378.   Copyright 1991,1992 Eric R. Smith.
  1379. ! Copyright 1992 Atari Corporation.
  1380.   All rights reserved.
  1381.   */
  1382.   
  1383. --- 1,6 ----
  1384.   /*
  1385.   Copyright 1991,1992 Eric R. Smith.
  1386. ! Copyright 1992,1993 Atari Corporation.
  1387.   All rights reserved.
  1388.   */
  1389.   
  1390. ***************
  1391. *** 9,14 ****
  1392. --- 9,15 ----
  1393.   
  1394.   struct filesys;        /* forward declaration */
  1395.   struct devdrv;        /* ditto */
  1396. + struct timeout;        /* and ditto */
  1397.   
  1398.   typedef struct f_cookie {
  1399.       struct filesys *fs;    /* filesystem that knows about this cookie */
  1400. ***************
  1401. *** 237,246 ****
  1402.   
  1403.   /* file system utility functions */
  1404.       int    ARGS_ON_STACK (*denyshare) P_((FILEPTR *, FILEPTR *));
  1405.   
  1406.   /* reserved for future use */
  1407. !     LOCK *    ARGS_ON_STACK (*denylock) P_((LOCK *, LOCK *));
  1408. !     long    res2[9];
  1409.   };
  1410.   
  1411.   /* flags for open() modes */
  1412. --- 238,251 ----
  1413.   
  1414.   /* file system utility functions */
  1415.       int    ARGS_ON_STACK (*denyshare) P_((FILEPTR *, FILEPTR *));
  1416. +     LOCK *    ARGS_ON_STACK (*denylock) P_((LOCK *, LOCK *));
  1417.   
  1418. + /* functions for adding/cancelling timeouts */
  1419. +     struct timeout * ARGS_ON_STACK (*addtimeout) P_((long, void (*)()));
  1420. +     void    ARGS_ON_STACK (*canceltimeout) P_((struct timeout *));
  1421. +  
  1422.   /* reserved for future use */
  1423. !     long    res2[7];
  1424.   };
  1425.   
  1426.   /* flags for open() modes */
  1427. *** 1.4    1993/03/08 21:36:20
  1428. --- filesys.c    1993/06/17 22:56:00
  1429. ***************
  1430. *** 1,6 ****
  1431.   /*
  1432.   Copyright 1990,1991,1992 Eric R. Smith.
  1433. ! Copyright 1992 Atari Corp.
  1434.   All rights reserved.
  1435.   */
  1436.   
  1437. --- 1,6 ----
  1438.   /*
  1439.   Copyright 1990,1991,1992 Eric R. Smith.
  1440. ! Copyright 1992,1993 Atari Corp.
  1441.   All rights reserved.
  1442.   */
  1443.   
  1444. ***************
  1445. *** 188,193 ****
  1446. --- 188,194 ----
  1447.           }
  1448.       }
  1449.   
  1450. + #if 0
  1451.   /* here, we invalidate all old drives EXCEPT for ones we're already using (at
  1452.    * this point, only the bios devices should be open)
  1453.    * this gives newly loaded file systems a chance to replace the
  1454. ***************
  1455. *** 197,202 ****
  1456. --- 198,204 ----
  1457.           if (d_lock(1, i) == 0)    /* lock if possible */
  1458.               d_lock(0, i);    /* and then unlock */
  1459.       }
  1460. + #endif
  1461.   }
  1462.   
  1463.   void
  1464. ***************
  1465. *** 333,339 ****
  1466.    * check for media change: if the drive has changed, call changedrv to
  1467.    * invalidate any open files and file handles associated with it, and
  1468.    * call the file system's media change routine.
  1469. !  * returns: 0 if no change, 1 if change
  1470.    */
  1471.   
  1472.   int
  1473. --- 335,341 ----
  1474.    * check for media change: if the drive has changed, call changedrv to
  1475.    * invalidate any open files and file handles associated with it, and
  1476.    * call the file system's media change routine.
  1477. !  * returns: 0 if no change, 1 if change, negative number for error
  1478.    */
  1479.   
  1480.   int
  1481. ***************
  1482. *** 369,379 ****
  1483.    * PROBLEM: AHDI may get upset if the drive isn't valid.
  1484.    * SOLUTION: don't change the default PSEUDODRIVES setting!
  1485.    */
  1486. !     r = mediach(d);
  1487.       if (r == 1) {        /* drive _may_ have changed */
  1488.           r = rwabs(0, tmpbuf, 1, 0, d, 0L);    /* check the BIOS */
  1489.           if (r != E_CHNG) {            /* nope, no change */
  1490. !             return 0;
  1491.           }
  1492.           r = 2;            /* drive was definitely changed */
  1493.       }
  1494. --- 371,386 ----
  1495.    * PROBLEM: AHDI may get upset if the drive isn't valid.
  1496.    * SOLUTION: don't change the default PSEUDODRIVES setting!
  1497.    */
  1498. ! TRACE(("calling mediach(%d)",d));
  1499. !     r = (int)mediach(d);
  1500. ! TRACE(("mediach(%d) == %ld", d, r));
  1501. !     if (r < 0) return r;
  1502.       if (r == 1) {        /* drive _may_ have changed */
  1503.           r = rwabs(0, tmpbuf, 1, 0, d, 0L);    /* check the BIOS */
  1504.           if (r != E_CHNG) {            /* nope, no change */
  1505. !             return (r < 0) ? r : 0;
  1506.           }
  1507.           r = 2;            /* drive was definitely changed */
  1508.       }
  1509. ***************
  1510. *** 520,529 ****
  1511.    * path2cookie will restart the search automatically; other functions
  1512.    * that call relpath2cookie directly will have to fail gracefully
  1513.    */
  1514. !     if (disk_changed(dir.dev)) {
  1515.           release_cookie(&dir);
  1516. ! PATH2COOKIE_DB(("relpath2cookie: returning %d", E_CHNG));
  1517. !         return E_CHNG;
  1518.       }
  1519.   
  1520.   
  1521. --- 527,537 ----
  1522.    * path2cookie will restart the search automatically; other functions
  1523.    * that call relpath2cookie directly will have to fail gracefully
  1524.    */
  1525. !     if ((r = disk_changed(dir.dev)) != 0) {
  1526.           release_cookie(&dir);
  1527. !         if (r > 0) r = E_CHNG;
  1528. ! PATH2COOKIE_DB(("relpath2cookie: returning %d", r));
  1529. !         return r;
  1530.       }
  1531.   
  1532.   
  1533. *** 1.4    1993/03/08 21:36:20
  1534. --- inline.h    1993/04/15 00:34:40
  1535. ***************
  1536. *** 1,5 ****
  1537. --- 1,6 ----
  1538.   /*
  1539.   Copyright 1992 Eric R. Smith.
  1540. + Copyright 1993 Atari Corporation.
  1541.   All rights reserved.
  1542.    */
  1543.   
  1544. ***************
  1545. *** 76,81 ****
  1546. --- 77,83 ----
  1547.       retvalue;                \
  1548.   })
  1549.   
  1550. + #define flush_pmmu() __asm__ volatile("pflusha");
  1551.   #endif
  1552.   
  1553.   #ifdef LATTICE
  1554. *** 1.4    1993/03/08 21:36:20
  1555. --- main.c    1993/06/16 17:29:22
  1556. ***************
  1557. *** 67,73 ****
  1558.   }
  1559.   #endif
  1560.   
  1561. ! #ifdef __GNUC__
  1562.   long _stksize = STACK;
  1563.   #ifndef PROFILING
  1564.   #include <minimal.h>
  1565. --- 67,73 ----
  1566.   }
  1567.   #endif
  1568.   
  1569. ! #if defined(__GNUC__) || defined(__MINT__)
  1570.   long _stksize = STACK;
  1571.   #ifndef PROFILING
  1572.   #include <minimal.h>
  1573. ***************
  1574. *** 121,129 ****
  1575.   
  1576.   /* program to run at startup */
  1577.   #ifdef MULTITOS
  1578. ! static int init_is_gemsys = 1;    /* set to 1 if init is gem.sys */
  1579.   #else
  1580. ! static int init_is_gemsys = 0;    /* set to 1 if init is gem.sys */
  1581.   #endif
  1582.   static const char *init_prg = 0;
  1583.   
  1584. --- 121,129 ----
  1585.   
  1586.   /* program to run at startup */
  1587.   #ifdef MULTITOS
  1588. ! static int init_is_gem = 1;    /* set to 1 if init_prg is GEM */
  1589.   #else
  1590. ! static int init_is_gem = 0;    /* set to 1 if init_prg is GEM */
  1591.   #endif
  1592.   static const char *init_prg = 0;
  1593.   
  1594. ***************
  1595. *** 192,198 ****
  1596.       strnicmp, stricmp, strlwr, strupr, ksprintf,
  1597.       ms_time, unixtim, dostim,
  1598.       nap, sleep, wake, wakeselect,
  1599. !     denyshare, denylock
  1600.   };
  1601.   
  1602.   /* table of processor frame sizes in _words_ (not used on MC68000) */
  1603. --- 192,198 ----
  1604.       strnicmp, stricmp, strlwr, strupr, ksprintf,
  1605.       ms_time, unixtim, dostim,
  1606.       nap, sleep, wake, wakeselect,
  1607. !     denyshare, denylock, addtimeout, canceltimeout
  1608.   };
  1609.   
  1610.   /* table of processor frame sizes in _words_ (not used on MC68000) */
  1611. ***************
  1612. *** 274,285 ****
  1613.    * bus error right after the Mshrink call!
  1614.    */
  1615.       setstack(basepage+500L);
  1616. ! #ifdef __TURBOC__
  1617.       Mshrink(0, (void *)basepage, 512L);
  1618.   #else
  1619.       Mshrink((void *)basepage, 512L);
  1620.   #endif
  1621. !     r = Pexec(200, init_prg, init_tail, init_env);
  1622.       Pterm(r);
  1623.   }
  1624.   
  1625. --- 274,285 ----
  1626.    * bus error right after the Mshrink call!
  1627.    */
  1628.       setstack(basepage+500L);
  1629. ! #if defined(__TURBOC__) && !defined(__MINT__)
  1630.       Mshrink(0, (void *)basepage, 512L);
  1631.   #else
  1632.       Mshrink((void *)basepage, 512L);
  1633.   #endif
  1634. !     r = (int) Pexec(200, (char *)init_prg, init_tail, init_env);
  1635.       Pterm(r);
  1636.   }
  1637.   
  1638. ***************
  1639. *** 549,555 ****
  1640.       }
  1641.   }
  1642.   
  1643. ! #ifdef __GNUC__
  1644.   int
  1645.   main(argc, argv, envp)
  1646.       int argc;
  1647. --- 549,555 ----
  1648.       }
  1649.   }
  1650.   
  1651. ! #if defined(__GNUC__) || defined(__MINT__)
  1652.   int
  1653.   main(argc, argv, envp)
  1654.       int argc;
  1655. ***************
  1656. *** 572,577 ****
  1657. --- 572,581 ----
  1658.       long yn;
  1659.       FILEPTR *f;
  1660.   
  1661. + #if defined(__GNUC__) || defined(__MINT__)
  1662. +     UNUSED(envp);
  1663. + #endif
  1664.   /* figure out what kind of machine we're running on */
  1665.   /* biosfs wants to know this; also sets no_mem_prot */
  1666.   /* 920625 kbad put it here so memprot_warning can be intelligent */
  1667. ***************
  1668. *** 700,707 ****
  1669.    */
  1670.   /* set the current directory for the current process */
  1671.       (void)Dgetpath(curpath, 0);
  1672.       tosssp = (long)Super(0L);    /* enter supervisor mode */
  1673.   
  1674.   /* get GEMDOS pointer to current basepage */
  1675.   /* 0x4f2 points to the base of the OS; here we can find the OS compilation
  1676. --- 704,716 ----
  1677.    */
  1678.   /* set the current directory for the current process */
  1679.       (void)Dgetpath(curpath, 0);
  1680. !     if (!*curpath) {
  1681. !         curpath[0] = '\\';
  1682. !         curpath[1] = 0;
  1683. !     }
  1684.       tosssp = (long)Super(0L);    /* enter supervisor mode */
  1685. +     if (!no_mem_prot)
  1686. +         save_mmu();        /* save current MMU setup */
  1687.   
  1688.   /* get GEMDOS pointer to current basepage */
  1689.   /* 0x4f2 points to the base of the OS; here we can find the OS compilation
  1690. ***************
  1691. *** 723,732 ****
  1692.           kbshft = (char *) sysbase[9];
  1693.       }
  1694.   
  1695.   /* The TT TOS release notes are wrong... this is the real way to test
  1696.    * for Bconmap ability
  1697.    */
  1698. !     has_bconmap = (Bconmap(0) == 0);
  1699.   
  1700.   /* initialize memory */
  1701.       init_mem();
  1702. --- 732,744 ----
  1703.           kbshft = (char *) sysbase[9];
  1704.       }
  1705.   
  1706. +     if (tosvers >= 0x0400 && tosvers <= 0x404)
  1707. +         has_bconmap = 0;    /* Falcon BIOS Bconmap is busted */
  1708. +     else
  1709.   /* The TT TOS release notes are wrong... this is the real way to test
  1710.    * for Bconmap ability
  1711.    */
  1712. !         has_bconmap = (Bconmap(0) == 0);
  1713.   
  1714.   /* initialize memory */
  1715.       init_mem();
  1716. ***************
  1717. *** 799,807 ****
  1718.       }
  1719.   
  1720.   /* load external file systems */
  1721. !     if (*curpath) {
  1722. !         (void)d_setpath(curpath);
  1723. !     }
  1724.       
  1725.   #ifndef PROFILING
  1726.   /* load_filesys causes media changes :-( */
  1727. --- 811,820 ----
  1728.       }
  1729.   
  1730.   /* load external file systems */
  1731. ! /* set path first to make sure that MiNT's directory matches
  1732. !  * GEMDOS's
  1733. !  */
  1734. !     (void)d_setpath(curpath);
  1735.       
  1736.   #ifndef PROFILING
  1737.   /* load_filesys causes media changes :-( */
  1738. ***************
  1739. *** 811,819 ****
  1740.   /* note that load_filesys changed the
  1741.    * directory on us!!
  1742.    */
  1743. !     if (*curpath) {
  1744. !         (void)d_setpath(curpath);
  1745. !     }
  1746.       
  1747.   /* load the configuration file */
  1748.       load_config();
  1749. --- 824,830 ----
  1750.   /* note that load_filesys changed the
  1751.    * directory on us!!
  1752.    */
  1753. !     (void)d_setpath(curpath);
  1754.       
  1755.   /* load the configuration file */
  1756.       load_config();
  1757. ***************
  1758. *** 831,839 ****
  1759.       }
  1760.   
  1761.   /* if we are MultiTOS, we're running in the AUTO folder, and our INIT is
  1762. !  * called GEM.SYS, take the exec_os() vector
  1763.    */
  1764. !     if (!gem_active && init_is_gemsys) {
  1765.           xbra_install(&old_execos, EXEC_OS, (long ARGS_ON_STACK (*)())do_exec_os);
  1766.       }
  1767.   
  1768. --- 842,851 ----
  1769.       }
  1770.   
  1771.   /* if we are MultiTOS, we're running in the AUTO folder, and our INIT is
  1772. !  * in fact GEM, take the exec_os() vector. (We know that INIT is GEM
  1773. !  * if the user told us so by using GEM= instead of INIT=.)
  1774.    */
  1775. !     if (!gem_active && init_is_gem) {
  1776.           xbra_install(&old_execos, EXEC_OS, (long ARGS_ON_STACK (*)())do_exec_os);
  1777.       }
  1778.   
  1779. ***************
  1780. *** 844,856 ****
  1781.   /* if that program is in fact GEM, we start it via exec_os, otherwise
  1782.    * we do it with Pexec.
  1783.    * the logic is: if the user specified init_prg, and it is not
  1784. !  * a gem.sys file, then we try to execute it; if it *is* a gem.sys
  1785. !  * file, we try to execute it if gem is already active, otherwise
  1786.    * we jump through the exec_os vector (which we grabbed above) in
  1787.    * order to start it. We *never* go through exec_os if we're not in
  1788.    * the AUTO folder.
  1789.    */
  1790. !     if (init_prg && (!init_is_gemsys || gem_active)) {
  1791.           r = p_exec(0, (char *)init_prg, init_tail, init_env);
  1792.       } else if (!gem_active) {   
  1793.           BASEPAGE *bp; int pid;
  1794. --- 856,868 ----
  1795.   /* if that program is in fact GEM, we start it via exec_os, otherwise
  1796.    * we do it with Pexec.
  1797.    * the logic is: if the user specified init_prg, and it is not
  1798. !  * GEM, then we try to execute it; if it *is* GEM (e.g. gem.sys),
  1799. !  * then we try to execute it if gem is already active, otherwise
  1800.    * we jump through the exec_os vector (which we grabbed above) in
  1801.    * order to start it. We *never* go through exec_os if we're not in
  1802.    * the AUTO folder.
  1803.    */
  1804. !     if (init_prg && (!init_is_gem || gem_active)) {
  1805.           r = p_exec(0, (char *)init_prg, init_tail, init_env);
  1806.       } else if (!gem_active) {   
  1807.           BASEPAGE *bp; int pid;
  1808. ***************
  1809. *** 886,897 ****
  1810.       shutdown();
  1811.   
  1812.   /* put everything back and exit */
  1813. !     if (!gem_active && init_is_gemsys) {
  1814.       /* we stole exec_os above */
  1815.           *((long *)EXEC_OS) = (long)old_execos.next;
  1816.       }
  1817.       restr_intr();
  1818.       close_filesys();
  1819.   
  1820.       (void)Super((void *)tosssp);    /* gratuitous (void *) for Lattice */
  1821.       Cconws("leaving MiNT\r\n");
  1822. --- 898,911 ----
  1823.       shutdown();
  1824.   
  1825.   /* put everything back and exit */
  1826. !     if (!gem_active && init_is_gem) {
  1827.       /* we stole exec_os above */
  1828.           *((long *)EXEC_OS) = (long)old_execos.next;
  1829.       }
  1830.       restr_intr();
  1831.       close_filesys();
  1832. +     if (!no_mem_prot)
  1833. +         restr_mmu();
  1834.   
  1835.       (void)Super((void *)tosssp);    /* gratuitous (void *) for Lattice */
  1836.       Cconws("leaving MiNT\r\n");
  1837. ***************
  1838. *** 974,979 ****
  1839. --- 988,1000 ----
  1840.           i++;
  1841.       }
  1842.   
  1843. + /* jr: install PMMU cookie if memory protection is used */
  1844. +     if (!no_mem_prot) {
  1845. +         strncpy(newcookie[i].tag.aschar, "PMMU", 4);
  1846. +         newcookie[i].value = 0;
  1847. +         i++;
  1848. +     }
  1849.   /* the last cookie should have a 0 tag, and a value indicating the number
  1850.    * of slots, total
  1851.    */
  1852. ***************
  1853. *** 1026,1031 ****
  1854. --- 1047,1057 ----
  1855.                   Pterm(2);
  1856.               } else if (!strncmp(jar->tag.aschar, "_AKP",4)) {
  1857.                   gl_lang = (int) ((jar->value >> 8) & 0x00ff);
  1858. +             } else if (!strncmp(jar->tag.aschar, "PMMU",4)) {
  1859. +                 /* jr: if PMMU cookie exists, someone else is
  1860. +                    already using the PMMU */
  1861. +                 Cconws ("MiNT: PMMU already in use, memory protection turned off.\r\n");
  1862. +                 no_mem_prot = 1;
  1863.               }
  1864.               jar++;
  1865.           }
  1866. ***************
  1867. *** 1059,1064 ****
  1868. --- 1085,1093 ----
  1869.           }
  1870.       }
  1871.       
  1872. +     if (gl_lang >= MAXLANG || gl_lang < 0)
  1873. +         gl_lang = 0;
  1874.       return 0L;
  1875.   }
  1876.   
  1877. ***************
  1878. *** 1068,1074 ****
  1879.    * # anything        -- comment
  1880.    * INIT=file        -- specify boot program
  1881.    * CON=file        -- specify initial file/device for handles -1, 0, 1
  1882. !  * PRN=file        -- specify initial file for handle 2
  1883.    * BIOSBUF=[yn]        -- if 'n' or 'N' then turn off BIOSBUF feature
  1884.    * DEBUG_LEVEL=n    -- set debug level to (decimal number) n
  1885.    * DEBUG_DEVNO=n    -- set debug device number to (decimal number) n
  1886. --- 1097,1103 ----
  1887.    * # anything        -- comment
  1888.    * INIT=file        -- specify boot program
  1889.    * CON=file        -- specify initial file/device for handles -1, 0, 1
  1890. !  * PRN=file        -- specify initial file for handle 3
  1891.    * BIOSBUF=[yn]        -- if 'n' or 'N' then turn off BIOSBUF feature
  1892.    * DEBUG_LEVEL=n    -- set debug level to (decimal number) n
  1893.    * DEBUG_DEVNO=n    -- set debug device number to (decimal number) n
  1894. ***************
  1895. *** 1096,1106 ****
  1896.       char *t;
  1897.   
  1898.       if (!strcmp(name, "GEM")) {
  1899. !         init_is_gemsys = 1;
  1900.           goto setup_init;
  1901.       } 
  1902.       if (!strcmp(name, "INIT")) {
  1903. !         init_is_gemsys = 0;
  1904.   setup_init:
  1905.           t = kmalloc(strlen(val)+1);
  1906.           if (!t) return;
  1907. --- 1125,1135 ----
  1908.       char *t;
  1909.   
  1910.       if (!strcmp(name, "GEM")) {
  1911. !         init_is_gem = 1;
  1912.           goto setup_init;
  1913.       } 
  1914.       if (!strcmp(name, "INIT")) {
  1915. !         init_is_gem = 0;
  1916.   setup_init:
  1917.           t = kmalloc(strlen(val)+1);
  1918.           if (!t) return;
  1919. ***************
  1920. *** 1136,1144 ****
  1921.   
  1922.           f = do_open(val, O_RDWR|O_CREAT|O_TRUNC, 0, (XATTR *)0);
  1923.           if (f) {
  1924. !             do_close(curproc->handle[2]);
  1925.               do_close(curproc->prn);
  1926. !             curproc->prn = curproc->handle[2] = f;
  1927.               f->links = 2;
  1928.           }
  1929.           return;
  1930. --- 1165,1173 ----
  1931.   
  1932.           f = do_open(val, O_RDWR|O_CREAT|O_TRUNC, 0, (XATTR *)0);
  1933.           if (f) {
  1934. !             do_close(curproc->handle[3]);
  1935.               do_close(curproc->prn);
  1936. !             curproc->prn = curproc->handle[3] = f;
  1937.               f->links = 2;
  1938.           }
  1939.           return;
  1940. ***************
  1941. *** 1348,1353 ****
  1942. --- 1377,1385 ----
  1943.       }
  1944.       FORCE("syntax error in mint.cnf near: %s", cmd);
  1945.   }
  1946. + #undef BUF
  1947. + #undef LINE
  1948.   
  1949.   #define BUF 512
  1950.   #define LINE 256
  1951. *** 1.4    1993/03/08 21:36:20
  1952. --- mem.c    1993/04/15 00:35:26
  1953. ***************
  1954. *** 184,194 ****
  1955.           }
  1956.       }
  1957.       if (mxalloc)
  1958. !         return Mxalloc(amt, mode);
  1959.       else if (mode == 1)
  1960.           return 0L;
  1961.       else
  1962. !         return Malloc(amt);
  1963.   }
  1964.   
  1965.   static void
  1966. --- 184,194 ----
  1967.           }
  1968.       }
  1969.       if (mxalloc)
  1970. !         return (long) Mxalloc(amt, mode);
  1971.       else if (mode == 1)
  1972.           return 0L;
  1973.       else
  1974. !         return (long) Malloc(amt);
  1975.   }
  1976.   
  1977.   static void
  1978. ***************
  1979. *** 254,260 ****
  1980.           if (temp) {
  1981.               (void)Setscreen((void *)-1L,
  1982.                       (void *)((temp+511)&(0xffffff00L)), -1);
  1983. !             if ((long)Physbase() != (temp+511)&(0xffffff00L)) {
  1984.                   scrnsize = 0x7fffffffUL;
  1985.                   scrndone = 1;
  1986.               }
  1987. --- 254,260 ----
  1988.           if (temp) {
  1989.               (void)Setscreen((void *)-1L,
  1990.                       (void *)((temp+511)&(0xffffff00L)), -1);
  1991. !             if ((long)Physbase() != ((temp+511)&(0xffffff00L))) {
  1992.                   scrnsize = 0x7fffffffUL;
  1993.                   scrndone = 1;
  1994.               }
  1995. ***************
  1996. *** 1295,1301 ****
  1997.   
  1998.       r = load_and_reloc(f, fh, (char *)m->loc, 0, fh->ftext, &b);
  1999.       if (r) {
  2000. -         m->links = 0;
  2001.           detach_region(curproc, m);
  2002.           kfree(s);
  2003.           return 0;
  2004. --- 1295,1300 ----
  2005. ***************
  2006. *** 1615,1621 ****
  2007.   DUMPMEM(map)
  2008.       MMAP map;
  2009.   {
  2010. ! #ifndef NO_DEBUG_INFO
  2011.       MEMREGION *m;
  2012.   
  2013.       m = *map;
  2014. --- 1614,1620 ----
  2015.   DUMPMEM(map)
  2016.       MMAP map;
  2017.   {
  2018. ! #ifdef DEBUG_INFO
  2019.       MEMREGION *m;
  2020.   
  2021.       m = *map;
  2022. ***************
  2023. *** 1626,1631 ****
  2024. --- 1625,1632 ----
  2025.               m->links, m->next);
  2026.           m = m->next;
  2027.       }
  2028. + #else
  2029. +     UNUSED(map);
  2030.   #endif
  2031.   }
  2032.   
  2033. *** 1.4    1993/03/08 21:36:20
  2034. --- memprot.c    1993/04/15 00:35:42
  2035. ***************
  2036. *** 91,96 ****
  2037. --- 91,97 ----
  2038.   static void _dump_tree P_((long_desc tbl, int level));
  2039.   
  2040.   extern int debug_level;        /* see debug.c */
  2041. + extern long mcpu;        /* in main.c */
  2042.   
  2043.   /*
  2044.    * You can turn this whole module off, and the stuff in context.s,
  2045. ***************
  2046. *** 103,116 ****
  2047.   /*
  2048.    * PMMU stuff
  2049.    */
  2050. - #if 1
  2051. - #define flush_pmmu(start, end) __asm("pflusha")
  2052. - #else
  2053. - /* in cpu.spp is a new "cpush" function that can selectively flush
  2054. -  * the cache
  2055. -  */
  2056. - #define flush_pmmu(start, len) cpush((void *)(start), (long)(len))
  2057. - #endif
  2058.   
  2059.   /*
  2060.    * This is one global TC register that is copied into every process'
  2061. --- 104,109 ----
  2062. ***************
  2063. *** 155,161 ****
  2064.   page_type invalid_page;
  2065.   page_type page_ptr;
  2066.   
  2067. ! page_type *proto_page_type[] =
  2068.       { &invalid_page, &g_page, &s_page, &readable_page, &invalid_page };
  2069.   /*    private         global    super    private/read    invalid */
  2070.   
  2071. --- 148,154 ----
  2072.   page_type invalid_page;
  2073.   page_type page_ptr;
  2074.   
  2075. ! page_type *const proto_page_type[] =
  2076.       { &invalid_page, &g_page, &s_page, &readable_page, &invalid_page };
  2077.   /*    private         global    super    private/read    invalid */
  2078.   
  2079. ***************
  2080. *** 297,312 ****
  2081.    */
  2082.   
  2083.   /*
  2084. !             invalid---v
  2085. !           private/gr---v  |
  2086. !             super-------v  |  |
  2087. !         global-------v  |  |  |
  2088. !     private-------v     |  |  |  |
  2089. !               |     |  |  |  |
  2090.   */
  2091. ! ushort other_dt[] = { 0, 1, 1, 1, 0 };
  2092. ! ushort other_s[] = {  0, 0, 1, 0, 0 };
  2093. ! ushort other_wp[] = { 0, 0, 0, 1, 0 };
  2094.   
  2095.   
  2096.   /*
  2097. --- 290,305 ----
  2098.    */
  2099.   
  2100.   /*
  2101. !                 invalid---v
  2102. !               private/gr---v  |
  2103. !                 super-------v  |  |
  2104. !             global-------v  |  |  |
  2105. !         private-------v     |  |  |  |
  2106. !                   |     |  |  |  |
  2107.   */
  2108. ! const ushort other_dt[]    =   { 0, 1, 1, 1, 0 };
  2109. ! const ushort other_s[] =    { 0, 0, 1, 0, 0 };
  2110. ! const ushort other_wp[] =   { 0, 0, 0, 1, 0 };
  2111.   
  2112.   
  2113.   /*
  2114. ***************
  2115. *** 464,479 ****
  2116.       start += EIGHT_K;
  2117.       }
  2118.   
  2119. ! #if 0
  2120. !     /*
  2121. !      * Flush the mmu address translation cache only if we changed curproc's
  2122. !      * table.
  2123.        */
  2124. !     if (proc == curproc) flush_pmmu(oldstart, oldlen);
  2125. ! #else
  2126. !     flush_pmmu(oldstart, oldlen);
  2127. ! #endif
  2128.   }
  2129.   
  2130.   /* get_prot_mode(r): returns the type of protection region r
  2131. --- 457,472 ----
  2132.       start += EIGHT_K;
  2133.       }
  2134.   
  2135. !     flush_pmmu();
  2136. !     if (mcpu <= 30) {
  2137. !     /* On the '020 & '030 we have a logical cache, i.e. the DC & IC are on
  2138. !      * the CPU side of the MMU, hence on an MMU context switch we must flush
  2139. !      * them too. On the '040, by comparison, we have a physical cache, i.e.
  2140. !      * the DC & IC are on the memory side of the MMU, so no DC/IC cache flush
  2141. !      * is needed.
  2142.        */
  2143. !     cpush((void *)oldstart, oldlen);
  2144. !     }
  2145.   }
  2146.   
  2147.   /* get_prot_mode(r): returns the type of protection region r
  2148. ***************
  2149. *** 532,538 ****
  2150.           MP_DEBUG(("mark_region: pid %d is an OS special!",proc->pid));
  2151.           goto owner;
  2152.       }
  2153. !     if (0 != (mr = proc->mem)) {
  2154.           for (i = 0; i < proc->num_reg; i++, mr++) {
  2155.           if (*mr == region) {
  2156.               MP_DEBUG(("mark_region: pid %d is an owner",proc->pid));
  2157. --- 525,531 ----
  2158.           MP_DEBUG(("mark_region: pid %d is an OS special!",proc->pid));
  2159.           goto owner;
  2160.       }
  2161. !     if ((mr = proc->mem) != 0) {
  2162.           for (i = 0; i < proc->num_reg; i++, mr++) {
  2163.           if (*mr == region) {
  2164.               MP_DEBUG(("mark_region: pid %d is an owner",proc->pid));
  2165. ***************
  2166. *** 604,610 ****
  2167.       }
  2168.       else {
  2169.       mark_pages(curproc->page_table,loc,len,
  2170. !             mode&3,mode&4,mode&8,curproc);
  2171.       return 0;
  2172.       }
  2173.   }
  2174. --- 597,603 ----
  2175.       }
  2176.       else {
  2177.       mark_pages(curproc->page_table,loc,len,
  2178. !             mode&3,(mode&4)>>2,(mode&8)>>3,curproc);
  2179.       return 0;
  2180.       }
  2181.   }
  2182. ***************
  2183. *** 866,872 ****
  2184.   {
  2185.       int i, j;
  2186.       long_desc *p;
  2187. !     static char spaces[9] = "        ";
  2188.   
  2189.       /* print the level and display the table descriptor */
  2190.       FORCE("\r%s s:%x wp:%x dt:%x a:%08lx",
  2191. --- 859,865 ----
  2192.   {
  2193.       int i, j;
  2194.       long_desc *p;
  2195. !     static const char spaces[9] = "        ";
  2196.   
  2197.       /* print the level and display the table descriptor */
  2198.       FORCE("\r%s s:%x wp:%x dt:%x a:%08lx",
  2199. ***************
  2200. *** 901,907 ****
  2201.       }
  2202.   }
  2203.   
  2204. ! static char modesym[] = { 'p', 'g', 's', 'r', 'i' };
  2205.   
  2206.   void
  2207.   QUICKDUMP()
  2208. --- 894,900 ----
  2209.       }
  2210.   }
  2211.   
  2212. ! static const char modesym[] = { 'p', 'g', 's', 'r', 'i' };
  2213.   
  2214.   void
  2215.   QUICKDUMP()
  2216. ***************
  2217. *** 1032,1038 ****
  2218.   int bigone;
  2219.   PROC *proc;
  2220.   {
  2221. ! #ifndef NO_DEBUG_INFO
  2222.       char linebuf[128];
  2223.       char *lp = linebuf;
  2224.       MEMREGION *mp, **mr, **map;
  2225. --- 1025,1031 ----
  2226.   int bigone;
  2227.   PROC *proc;
  2228.   {
  2229. ! #ifdef DEBUG_INFO
  2230.       char linebuf[128];
  2231.       char *lp = linebuf;
  2232.       MEMREGION *mp, **mr, **map;
  2233. ***************
  2234. *** 1096,1102 ****
  2235.       tbl.tbl_address = proc->ctxt[CURRENT].crp.tbl_address;
  2236.       _dump_tree(tbl,0);
  2237.       }
  2238. ! #endif /* NO_DEBUG_INFO */
  2239.   }
  2240.   
  2241.   
  2242. --- 1089,1095 ----
  2243.       tbl.tbl_address = proc->ctxt[CURRENT].crp.tbl_address;
  2244.       _dump_tree(tbl,0);
  2245.       }
  2246. ! #endif /* DEBUG_INFO */
  2247.   }
  2248.   
  2249.   
  2250. *** 1.4    1993/03/08 21:36:20
  2251. --- mint.h    1993/06/10 18:34:40
  2252. ***************
  2253. *** 1,6 ****
  2254.   /*
  2255.   Copyright 1990,1991,1992 Eric R. Smith.
  2256. ! Copyright 1992 Atari Corporation.
  2257.   All rights reserved.
  2258.   */
  2259.   
  2260. --- 1,6 ----
  2261.   /*
  2262.   Copyright 1990,1991,1992 Eric R. Smith.
  2263. ! Copyright 1992,1993 Atari Corporation.
  2264.   All rights reserved.
  2265.   */
  2266.   
  2267. ***************
  2268. *** 174,184 ****
  2269.   #endif
  2270.   
  2271.   /* is debugging info included? */
  2272. ! #ifdef MULTITOS
  2273. ! #define NO_DEBUG_INFO
  2274.   #endif
  2275.   
  2276. ! #ifdef NO_DEBUG_INFO
  2277.   #define TRACELOW(x)
  2278.   #define TRACE(x)
  2279.   #define DEBUG(x)
  2280. --- 174,184 ----
  2281.   #endif
  2282.   
  2283.   /* is debugging info included? */
  2284. ! #ifndef MULTITOS
  2285. ! #define DEBUG_INFO
  2286.   #endif
  2287.   
  2288. ! #ifndef DEBUG_INFO
  2289.   #define TRACELOW(x)
  2290.   #define TRACE(x)
  2291.   #define DEBUG(x)
  2292. ***************
  2293. *** 220,225 ****
  2294. --- 220,228 ----
  2295.   
  2296.   extern int has_bconmap;    /* set in main() */
  2297.   extern int curbconmap;  /* see xbios.c */
  2298. + #define MAXLANG 6    /* languages supported */
  2299. + extern int gl_lang;    /* set in main.c */
  2300.   
  2301.   /*
  2302.    * load some inline functions, perhaps
  2303. *** 1.4    1993/03/08 21:36:20
  2304. --- proc.c    1993/05/24 23:13:42
  2305. ***************
  2306. *** 534,543 ****
  2307. --- 534,545 ----
  2308.   /*
  2309.    * restore per-process variables here
  2310.    */
  2311. + #ifndef MULTITOS
  2312.   #ifdef FASTTEXT
  2313.           if (!hardscroll)
  2314.   #endif
  2315.               *((void **)0x44eL) = curproc->logbase;
  2316. + #endif
  2317.           do_wakeup_things();
  2318.           return;
  2319.       }
  2320. ***************
  2321. *** 544,553 ****
  2322. --- 546,557 ----
  2323.   /*
  2324.    * save per-process variables here
  2325.    */
  2326. + #ifndef MULTITOS
  2327.   #ifdef FASTTEXT
  2328.       if (!hardscroll)
  2329.   #endif
  2330.           curproc->logbase = *((void **)0x44eL);
  2331. + #endif
  2332.       curproc->ctxt[CURRENT].regs[0] = 1;
  2333.       curproc = p;
  2334.       proc_clock = TIME_SLICE;    /* fresh time */
  2335. ***************
  2336. *** 622,628 ****
  2337.    * at all, so I consider all that stack info wasted space.  -- AKP
  2338.    */
  2339.   
  2340. ! #ifndef NO_DEBUG_INFO
  2341.   static const char *qstring[] = {
  2342.       "run", "ready", "wait", "iowait", "zombie", "tsr", "stop", "select"
  2343.   };
  2344. --- 626,632 ----
  2345.    * at all, so I consider all that stack info wasted space.  -- AKP
  2346.    */
  2347.   
  2348. ! #ifdef DEBUG_INFO
  2349.   static const char *qstring[] = {
  2350.       "run", "ready", "wait", "iowait", "zombie", "tsr", "stop", "select"
  2351.   };
  2352. ***************
  2353. *** 634,640 ****
  2354.   void
  2355.   DUMPPROC()
  2356.   {
  2357. ! #ifndef NO_DEBUG_INFO
  2358.       PROC *p = curproc;
  2359.   
  2360.       for (curproc = proclist; curproc; curproc = curproc->gl_next) {
  2361. --- 638,644 ----
  2362.   void
  2363.   DUMPPROC()
  2364.   {
  2365. ! #ifdef DEBUG_INFO
  2366.       PROC *p = curproc;
  2367.   
  2368.       for (curproc = proclist; curproc; curproc = curproc->gl_next) {
  2369. *** 1.4    1993/03/08 21:36:20
  2370. --- proc.h    1993/06/10 20:23:36
  2371. ***************
  2372. *** 1,6 ****
  2373.   /*
  2374.   Copyright 1990,1991,1992 Eric R. Smith.
  2375. ! Copyright 1992 Atari Corporation.
  2376.   All rights reserved.
  2377.   */
  2378.   
  2379. --- 1,6 ----
  2380.   /*
  2381.   Copyright 1990,1991,1992 Eric R. Smith.
  2382. ! Copyright 1992,1993 Atari Corporation.
  2383.   All rights reserved.
  2384.   */
  2385.   
  2386. *** 1.4    1993/03/08 21:36:20
  2387. --- procfs.c    1993/04/15 00:36:32
  2388. ***************
  2389. *** 1,6 ****
  2390.   /*
  2391.   Copyright 1991,1992 Eric R. Smith.
  2392. ! Copyright 1992 Atari Corporation.
  2393.   All rights reserved.
  2394.    */
  2395.   
  2396. --- 1,6 ----
  2397.   /*
  2398.   Copyright 1991,1992 Eric R. Smith.
  2399. ! Copyright 1992,1993 Atari Corporation.
  2400.   All rights reserved.
  2401.    */
  2402.   
  2403. ***************
  2404. *** 252,257 ****
  2405. --- 252,265 ----
  2406.       if (!p)
  2407.           return EFILNF;
  2408.   
  2409. + /* this check is necessary because the Fdelete code checks for
  2410. +  * write permission on the directory, not on individual
  2411. +  * files
  2412. +  */
  2413. +     if (curproc->euid && curproc->ruid != p->ruid) {
  2414. +         DEBUG(("proc_remove: wrong user"));
  2415. +         return EACCDN;
  2416. +     }
  2417.       post_sig(p, SIGTERM);
  2418.       check_sigs();        /* it might have been us */
  2419.       return 0;
  2420. ***************
  2421. *** 386,392 ****
  2422.       case DP_PATHMAX:
  2423.           return PATH_MAX;    /* max. path length */
  2424.       case DP_NAMEMAX:
  2425. !         return PNAMSIZ;        /* max. length of individual name */
  2426.       case DP_ATOMIC:
  2427.           return UNLIMITED;    /* all writes are atomic */
  2428.       case DP_TRUNC:
  2429. --- 394,401 ----
  2430.       case DP_PATHMAX:
  2431.           return PATH_MAX;    /* max. path length */
  2432.       case DP_NAMEMAX:
  2433. !         return PNAMSIZ + 4;    /* max. length of individual name */
  2434. !                     /* the "+4" is for the pid: ".123" */
  2435.       case DP_ATOMIC:
  2436.           return UNLIMITED;    /* all writes are atomic */
  2437.       case DP_TRUNC:
  2438. ***************
  2439. *** 579,586 ****
  2440.                   p->ptracer = 0;
  2441.                   p->ctxt[CURRENT].ptrace = 0;
  2442.                   p->ctxt[SYSCALL].ptrace = 0;
  2443. !             }
  2444. !             else if (p == curproc) {
  2445.                   p->ptracer = pid2proc(p->ppid);
  2446.               } else {
  2447.                   p->ptracer = curproc;
  2448. --- 588,599 ----
  2449.                   p->ptracer = 0;
  2450.                   p->ctxt[CURRENT].ptrace = 0;
  2451.                   p->ctxt[SYSCALL].ptrace = 0;
  2452. !         /* if the process is stopped, restart it */
  2453. !                 if (p->wait_q == STOP_Q) {
  2454. !                     p->sigpending &= ~STOPSIGS;
  2455. !                     post_sig(p, SIGCONT);
  2456. !                 }
  2457. !             } else if (p == curproc) {
  2458.                   p->ptracer = pid2proc(p->ppid);
  2459.               } else {
  2460.                   p->ptracer = curproc;
  2461. *** 1.4    1993/03/08 21:36:20
  2462. --- proto.h    1993/06/10 18:04:02
  2463. ***************
  2464. *** 192,198 ****
  2465.   void restr_intr P_((void));
  2466.   void ARGS_ON_STACK enter_kernel P_((void));
  2467.   void ARGS_ON_STACK leave_kernel P_((void));
  2468. ! #ifdef __GNUC__
  2469.   int main P_((int argc, char **argv, char **envp));
  2470.   #else
  2471.   int main P_((int argc, char **argv));
  2472. --- 192,198 ----
  2473.   void restr_intr P_((void));
  2474.   void ARGS_ON_STACK enter_kernel P_((void));
  2475.   void ARGS_ON_STACK leave_kernel P_((void));
  2476. ! #if defined(__GNUC__) || defined (__MINT__)
  2477.   int main P_((int argc, char **argv, char **envp));
  2478.   #else
  2479.   int main P_((int argc, char **argv));
  2480. ***************
  2481. *** 269,277 ****
  2482.   void haltcpv P_((void));
  2483.   
  2484.   /* timeout.c */
  2485. ! TIMEOUT *addtimeout P_((long delta, void (*func)(PROC *p)));
  2486. ! void cancelalltimeouts P_((void));
  2487. ! void canceltimeout P_((TIMEOUT *which));
  2488.   void ARGS_ON_STACK timeout P_((void));
  2489.   void checkalarms P_((void));
  2490.   void ARGS_ON_STACK nap P_((unsigned n));
  2491. --- 269,277 ----
  2492.   void haltcpv P_((void));
  2493.   
  2494.   /* timeout.c */
  2495. ! TIMEOUT * ARGS_ON_STACK addtimeout P_((long delta, void (*func)(PROC *p)));
  2496. ! void ARGS_ON_STACK cancelalltimeouts P_((void));
  2497. ! void ARGS_ON_STACK canceltimeout P_((TIMEOUT *which));
  2498.   void ARGS_ON_STACK timeout P_((void));
  2499.   void checkalarms P_((void));
  2500.   void ARGS_ON_STACK nap P_((unsigned n));
  2501. *** 1.4    1993/03/08 21:36:20
  2502. --- rendez.c    1993/04/15 00:37:02
  2503. ***************
  2504. *** 406,414 ****
  2505.               return EACCDN;
  2506.               }
  2507.               else {
  2508. !             if (mode == 3) s->owner = -1;    /* make it free, or */
  2509. !             else *q = s->next;        /* delete from list */
  2510.               /* wake up anybody who's waiting for a semaphore */
  2511.               wake(WAIT_Q,WAIT_SEMA);
  2512.               return E_OK;
  2513. --- 406,417 ----
  2514.               return EACCDN;
  2515.               }
  2516.               else {
  2517. !             if (mode == 3) {
  2518. !                 s->owner = -1;    /* make it free, or */
  2519. !             } else {
  2520. !                 *q = s->next;        /* delete from list */
  2521. !                 kfree(s);        /* and free it */
  2522. !             }
  2523.               /* wake up anybody who's waiting for a semaphore */
  2524.               wake(WAIT_Q,WAIT_SEMA);
  2525.               return E_OK;
  2526. *** 1.4    1993/03/08 21:36:20
  2527. --- signal.c    1993/05/25 17:03:00
  2528. ***************
  2529. *** 1,6 ****
  2530.   /*
  2531.   Copyright 1990,1991,1992 Eric R. Smith.
  2532. ! Copyright 1992 Atari Corporation.
  2533.   All rights reserved.
  2534.   */
  2535.   
  2536. --- 1,6 ----
  2537.   /*
  2538.   Copyright 1990,1991,1992 Eric R. Smith.
  2539. ! Copyright 1992,1993 Atari Corporation.
  2540.   All rights reserved.
  2541.   */
  2542.   
  2543. ***************
  2544. *** 76,81 ****
  2545. --- 76,85 ----
  2546.       p->sigpending |= sigm;
  2547.   
  2548.   /* if the signal is masked, do nothing further */
  2549. + /* note: some signals can't be masked, and we handle those elsewhere so
  2550. +  * that p->sigmask is always valid. SIGCONT is among the unmaskable
  2551. +  * signals
  2552. +  */
  2553.       if ( (p->sigmask & sigm) != 0 )
  2554.           return;
  2555.   
  2556. ***************
  2557. *** 116,122 ****
  2558.           for (i = 1; i < NSIG; i++) {
  2559.               if (sigs & sigm) {
  2560.                   curproc->sigpending &= ~sigm;
  2561. !                 if (curproc->ptracer && !deliversig) {
  2562.                       TRACE(("tracer being notified of signal %d", i));
  2563.                       stop(i);
  2564.           /* the parent may reset our pending signals, so check again */
  2565. --- 120,127 ----
  2566.           for (i = 1; i < NSIG; i++) {
  2567.               if (sigs & sigm) {
  2568.                   curproc->sigpending &= ~sigm;
  2569. !                 if (curproc->ptracer && !deliversig &&
  2570. !                     i != SIGCONT) {
  2571.                       TRACE(("tracer being notified of signal %d", i));
  2572.                       stop(i);
  2573.           /* the parent may reset our pending signals, so check again */
  2574. ***************
  2575. *** 252,258 ****
  2576.   {
  2577.       long oldstack, newstack;
  2578.       long *stack;
  2579. !     CONTEXT *call, oldsysctxt, newcurrent;
  2580.       extern void sig_return();
  2581.   
  2582.       if (curproc->sighandle[sig] == SIG_IGN)
  2583. --- 257,266 ----
  2584.   {
  2585.       long oldstack, newstack;
  2586.       long *stack;
  2587. !     CONTEXT *call, contexts[2];
  2588. ! #define oldsysctxt (contexts[0])
  2589. ! #define newcurrent (contexts[1])
  2590.       extern void sig_return();
  2591.   
  2592.       if (curproc->sighandle[sig] == SIG_IGN)
  2593. ***************
  2594. *** 351,357 ****
  2595.   
  2596.   /* set a new system stack, with a bit of buffer space */
  2597.           oldstack = curproc->sysstack;
  2598. !         newstack = ((long) ( (&newcurrent) - 3 )) - 12;
  2599.   
  2600.           if (newstack < (long)curproc->stack + ISTKSIZE + 256) {
  2601.               ALERT("stack overflow");
  2602. --- 359,365 ----
  2603.   
  2604.   /* set a new system stack, with a bit of buffer space */
  2605.           oldstack = curproc->sysstack;
  2606. !         newstack = ((long) ( (&newcurrent) - 2 )) - 12;
  2607.   
  2608.           if (newstack < (long)curproc->stack + ISTKSIZE + 256) {
  2609.               ALERT("stack overflow");
  2610. ***************
  2611. *** 427,432 ****
  2612. --- 435,442 ----
  2613.           curproc->ctxt[SYSCALL] = oldsysctxt;
  2614.           assert(curproc->magic == CTXT_MAGIC);
  2615.       }
  2616. + #undef oldsysctxt
  2617. + #undef newcurrent
  2618.   }
  2619.   
  2620.   /*
  2621. ***************
  2622. *** 476,482 ****
  2623.       }
  2624.       else {
  2625.           valid_return = 0;
  2626. !         oldctxt = ((CONTEXT *)(&frame[2])) + 3;
  2627.           if (oldctxt->regs[0] != CTXT_MAGIC) {
  2628.               FATAL("p_sigreturn: corrupted context");
  2629.           }
  2630. --- 486,492 ----
  2631.       }
  2632.       else {
  2633.           valid_return = 0;
  2634. !         oldctxt = ((CONTEXT *)(&frame[2])) + 2;
  2635.           if (oldctxt->regs[0] != CTXT_MAGIC) {
  2636.               FATAL("p_sigreturn: corrupted context");
  2637.           }
  2638. ***************
  2639. *** 552,558 ****
  2640.   void
  2641.   sigbus()
  2642.   {
  2643. !     report_buserr();
  2644.       exception(SIGBUS);
  2645.   }
  2646.   
  2647. --- 562,569 ----
  2648.   void
  2649.   sigbus()
  2650.   {
  2651. !     if (curproc->sighandle[SIGBUS] == SIG_DFL)
  2652. !         report_buserr();
  2653.       exception(SIGBUS);
  2654.   }
  2655.   
  2656. *** 1.4    1993/03/08 21:36:20
  2657. --- sproto.h    1993/04/15 00:37:28
  2658. ***************
  2659. *** 3,9 ****
  2660.    */
  2661.   
  2662.   /* context.s */
  2663. - void ARGS_ON_STACK set_mmu P_((crp_reg, tc_reg));
  2664.   long ARGS_ON_STACK build_context P_((CONTEXT *sav, int fmt));
  2665.   long ARGS_ON_STACK save_context P_((CONTEXT *sav));
  2666.   void ARGS_ON_STACK restore_context P_((CONTEXT *sav));
  2667. --- 3,8 ----
  2668. ***************
  2669. *** 10,17 ****
  2670. --- 9,20 ----
  2671.   void ARGS_ON_STACK change_context P_((CONTEXT *sav));
  2672.   
  2673.   /* cpu.s */
  2674. + void ARGS_ON_STACK set_mmu P_((crp_reg, tc_reg));
  2675. + void ARGS_ON_STACK save_mmu P_((void));
  2676. + void ARGS_ON_STACK restr_mmu P_((void));
  2677.   void ARGS_ON_STACK cpush P_((const void *base, long size));
  2678.   void ARGS_ON_STACK setstack P_((long));
  2679. + void ARGS_ON_STACK flush_pmmu P_((void));
  2680.   
  2681.   /* intr.s */
  2682.   void ARGS_ON_STACK reboot P_((void));
  2683. *** 1.4    1993/03/08 21:36:20
  2684. --- timeout.c    1993/06/10 18:04:16
  2685. ***************
  2686. *** 1,6 ****
  2687.   /*
  2688.   Copyright 1990,1991,1992 Eric R. Smith.
  2689. ! Copyright 1992 Atari Corporation.
  2690.   All rights reserved.
  2691.   */
  2692.   
  2693. --- 1,6 ----
  2694.   /*
  2695.   Copyright 1990,1991,1992 Eric R. Smith.
  2696. ! Copyright 1992,1993 Atari Corporation.
  2697.   All rights reserved.
  2698.   */
  2699.   
  2700. ***************
  2701. *** 34,40 ****
  2702.   #define newtimeout() (TIMEOUT *)kmalloc(SIZEOF(TIMEOUT))
  2703.   #define disposetimeout(t) kfree(t)
  2704.   
  2705. ! TIMEOUT *
  2706.   addtimeout(delta, func)
  2707.       long delta;
  2708.       void (*func) P_((PROC *));
  2709. --- 34,40 ----
  2710.   #define newtimeout() (TIMEOUT *)kmalloc(SIZEOF(TIMEOUT))
  2711.   #define disposetimeout(t) kfree(t)
  2712.   
  2713. ! TIMEOUT * ARGS_ON_STACK
  2714.   addtimeout(delta, func)
  2715.       long delta;
  2716.       void (*func) P_((PROC *));
  2717. ***************
  2718. *** 77,83 ****
  2719.    * process
  2720.    */
  2721.   
  2722. ! void
  2723.   cancelalltimeouts()
  2724.   {
  2725.       TIMEOUT *cur, **prev, *old;
  2726. --- 77,83 ----
  2727.    * process
  2728.    */
  2729.   
  2730. ! void ARGS_ON_STACK
  2731.   cancelalltimeouts()
  2732.   {
  2733.       TIMEOUT *cur, **prev, *old;
  2734. ***************
  2735. *** 110,116 ****
  2736.    * find it there!
  2737.    */
  2738.   
  2739. ! void
  2740.   canceltimeout(this)
  2741.       TIMEOUT *this;
  2742.   {
  2743. --- 110,116 ----
  2744.    * find it there!
  2745.    */
  2746.   
  2747. ! void ARGS_ON_STACK
  2748.   canceltimeout(this)
  2749.       TIMEOUT *this;
  2750.   {
  2751. *** 1.4    1993/03/08 21:36:20
  2752. --- tosfs.c    1993/04/15 00:37:50
  2753. ***************
  2754. *** 1,6 ****
  2755.   /*
  2756.   Copyright 1991,1992 Eric R. Smith.
  2757. ! Copyright 1992 Atari Corporation.
  2758.   All rights reserved.
  2759.   */
  2760.   
  2761. --- 1,6 ----
  2762.   /*
  2763.   Copyright 1991,1992 Eric R. Smith.
  2764. ! Copyright 1992,1993 Atari Corporation.
  2765.   All rights reserved.
  2766.   */
  2767.   
  2768. ***************
  2769. *** 1339,1350 ****
  2770.       ti = gl_ti;
  2771.       for (i = 0; i < NUM_INDICES; i++, ti++) {
  2772.           if (ti->name && ti->name[0] == dlet) {
  2773. !             kfree(ti->name);
  2774. !             ti->name = 0;
  2775. !             nextf = ti->open;
  2776. !             while ( (f = nextf) != 0 ) {
  2777. !                 nextf = f->next;
  2778. !                 f->next = 0;
  2779.               }
  2780.               ti->open = 0;
  2781.       /* if there are any cookies pointing at this name, they're not
  2782. --- 1339,1360 ----
  2783.       ti = gl_ti;
  2784.       for (i = 0; i < NUM_INDICES; i++, ti++) {
  2785.           if (ti->name && ti->name[0] == dlet) {
  2786. ! #ifdef NEWWAY
  2787. !     /* only free the name if this index not used by any cookie */
  2788. !             if (ti->links != 0)
  2789. !                 ti->valid = 0;
  2790. !             else
  2791. ! #endif /* NEWWAY */
  2792. !             {
  2793. !                 kfree(ti->name);
  2794. !                 ti->name = 0;
  2795. !             }
  2796. !             if (!(ti->attr & FA_DIR)) {
  2797. !                 nextf = ti->open;
  2798. !                 while ( (f = nextf) != 0 ) {
  2799. !                     nextf = f->next;
  2800. !                     f->next = 0;
  2801. !                 }
  2802.               }
  2803.               ti->open = 0;
  2804.       /* if there are any cookies pointing at this name, they're not
  2805. *** 1.4    1993/03/08 21:36:20
  2806. --- trans.c    1993/05/25 16:40:28
  2807. ***************
  2808. *** 76,82 ****
  2809.       char *disp, *base, *index;
  2810.   {
  2811.       if (syntax == GAS) {
  2812. !         return concat6(base, "@(", disp, ",", changesiz(index), ")");
  2813.       } else {
  2814.           return concat6(disp, "(", base, ",", index, ")");
  2815.       }
  2816. --- 76,82 ----
  2817.       char *disp, *base, *index;
  2818.   {
  2819.       if (syntax == GAS) {
  2820. !         return concat6(base, "@(", disp, ",", changesiz2(index), ")");
  2821.       } else {
  2822.           return concat6(disp, "(", base, ",", index, ")");
  2823.       }
  2824. ***************
  2825. *** 94,99 ****
  2826. --- 94,143 ----
  2827.   }
  2828.   
  2829.   char *
  2830. + postindex(bd, an , index, od)
  2831. +     char *bd, *an, *index , *od;
  2832. + {
  2833. +     if (syntax == GAS) {
  2834. +         return concat8(an, "@(", bd, ")@(", od, ",", changesiz2(index), ")");
  2835. +     } else {
  2836. +         return concat9("([",an, ",", bd, "],", index, ",", od ,")");
  2837. +     }
  2838. + }
  2839. + char *
  2840. + postindex0(bd)
  2841. +     char *bd;
  2842. + {
  2843. +     if (syntax == GAS) {
  2844. +         return concat3("@(", bd, ")");
  2845. +     } else {
  2846. +         return concat3("([", bd, "])");
  2847. +     }
  2848. + }
  2849. + char *
  2850. + postindex1(bd,od)
  2851. +     char *bd, *od;
  2852. + {
  2853. +     if (syntax == GAS) {
  2854. +         return concat5("@(", bd, ")@(", od, ")");
  2855. +     } else {
  2856. +         return concat5("([", bd, "],", od, ")");
  2857. +     }
  2858. + }
  2859. + char *
  2860. + preindex(bd, an , index, od)
  2861. +     char *bd, *an, *index , *od;
  2862. + {
  2863. +     if (syntax == GAS) {
  2864. +         return concat8(an, "@(", bd, ",", changesiz2(index), ")@(", od, ")");
  2865. +     } else {
  2866. +         return concat9("([",an, ",", bd, ",", index, "],", od, ")");
  2867. +     }
  2868. + }
  2869. + char *
  2870.   do_ops(label, opcode, space, operand)
  2871.       char *label, *opcode, *space, *operand;
  2872.   {
  2873. ***************
  2874. *** 180,185 ****
  2875. --- 224,244 ----
  2876.   
  2877.       while (*op) {
  2878.           if (*op == '.') *op = ':';
  2879. +         op++;
  2880. +     }
  2881. +     return r;
  2882. + }
  2883. + char *
  2884. + changesiz2(op)        /* rw: hack for scaled index    */
  2885. +     char *op;
  2886. + {
  2887. +     char *r = op;
  2888. +     if (syntax != GAS) return op;
  2889. +     while (*op) {
  2890. +         if (*op == '.' || *op == '*' ) *op = ':';
  2891.           op++;
  2892.       }
  2893.       return r;
  2894. *** 1.4    1993/03/08 21:36:20
  2895. --- trutil.c    1993/05/25 16:40:30
  2896. ***************
  2897. *** 101,106 ****
  2898. --- 101,152 ----
  2899.       return r;
  2900.   }
  2901.   
  2902. + char *concat8(s1, s2, s3, s4, s5, s6, s7, s8)
  2903. +     char *s1, *s2, *s3, *s4, *s5, *s6, *s7, *s8;
  2904. + {
  2905. +     size_t siz = strlen(s1) + strlen(s2) + strlen(s3)
  2906. +             + strlen(s4) + strlen(s5) + strlen(s6) 
  2907. +             + strlen(s7) + strlen(s8) + 1;
  2908. +     char *r;
  2909. +     r = malloc(siz);
  2910. +     if (!r) return 0;
  2911. +     strcpy(r, s1);
  2912. +     strcat(r, s2);
  2913. +     strcat(r, s3);
  2914. +     strcat(r, s4);
  2915. +     strcat(r, s5);
  2916. +     strcat(r, s6);
  2917. +     strcat(r, s7);
  2918. +     strcat(r, s8);
  2919. +     return r;
  2920. + }
  2921. + char *concat9(s1, s2, s3, s4, s5, s6, s7, s8, s9)
  2922. +     char *s1, *s2, *s3, *s4, *s5, *s6, *s7, *s8, *s9;
  2923. + {
  2924. +     size_t siz = strlen(s1) + strlen(s2) + strlen(s3)
  2925. +             + strlen(s4) + strlen(s5) + strlen(s6) 
  2926. +             + strlen(s7) + strlen(s8) + strlen(s9) + 1;
  2927. +     char *r;
  2928. +     r = malloc(siz);
  2929. +     if (!r) return 0;
  2930. +     strcpy(r, s1);
  2931. +     strcat(r, s2);
  2932. +     strcat(r, s3);
  2933. +     strcat(r, s4);
  2934. +     strcat(r, s5);
  2935. +     strcat(r, s6);
  2936. +     strcat(r, s7);
  2937. +     strcat(r, s8);
  2938. +     strcat(r, s9);
  2939. +     return r;
  2940. + }
  2941.   static int is_word_sym(c)
  2942.       int c;
  2943.   {
  2944. *** 1.4    1993/03/08 21:36:20
  2945. --- tty.c    1993/04/15 00:38:10
  2946. ***************
  2947. *** 648,658 ****
  2948.       }
  2949.   
  2950.   /* job control check */
  2951. !     if (tty->pgrp == 0) {
  2952. !     /* nobody owned the terminal, so now it's ours */
  2953. !         tty->pgrp = 0;
  2954. !     }
  2955. !     else if (tty->pgrp != curproc->pgrp) {
  2956.           TRACE(("job control: tty pgrp is %d proc pgrp is %d",
  2957.               tty->pgrp, curproc->pgrp));
  2958.           killgroup(curproc->pgrp, SIGTTIN);
  2959. --- 648,655 ----
  2960.       }
  2961.   
  2962.   /* job control check */
  2963. !     if (tty->pgrp && tty->pgrp != curproc->pgrp) {
  2964.           TRACE(("job control: tty pgrp is %d proc pgrp is %d",
  2965.               tty->pgrp, curproc->pgrp));
  2966.           killgroup(curproc->pgrp, SIGTTIN);
  2967. *** 1.4    1993/03/08 21:36:20
  2968. --- version.h    1993/04/15 23:42:30
  2969. ***************
  2970. *** 1,5 ****
  2971.   #define MAJ_VERSION    1
  2972. ! #define MIN_VERSION    4
  2973.   
  2974.   #ifndef MULTITOS
  2975.   #define BETA
  2976. --- 1,5 ----
  2977.   #define MAJ_VERSION    1
  2978. ! #define MIN_VERSION    6
  2979.   
  2980.   #ifndef MULTITOS
  2981.   #define BETA
  2982. *** 1.4    1993/03/08 21:36:20
  2983. --- welcome.c    1993/06/10 18:33:38
  2984. ***************
  2985. *** 47,53 ****
  2986.    * "boot MultiTOS?" messages, in various langauges:
  2987.    */
  2988.   
  2989. - #define MAXLANG 6
  2990.   
  2991.   struct yn_message {
  2992.       const char *message;    /* message to print */
  2993. --- 47,52 ----
  2994. ***************
  2995. *** 75,82 ****
  2996.       struct yn_message *msg;
  2997.       int y;
  2998.   
  2999. -     if (gl_lang >= MAXLANG || gl_lang < 0)
  3000. -         gl_lang = 0;
  3001.       msg = &boot_it[gl_lang];
  3002.       Cconws(msg->message);
  3003.       y = (int) Cconin();
  3004. --- 74,79 ----
  3005. *** 1.4    1993/03/08 21:36:20
  3006. --- xbios.c    1993/06/10 20:30:40
  3007. ***************
  3008. *** 1,6 ****
  3009.   /*
  3010.   Copyright 1990,1991,1992 Eric R. Smith.
  3011. ! Copyright 1992 Atari Corporation.
  3012.   All rights reserved.
  3013.   */
  3014.   
  3015. --- 1,6 ----
  3016.   /*
  3017.   Copyright 1990,1991,1992 Eric R. Smith.
  3018. ! Copyright 1992,1993 Atari Corporation.
  3019.   All rights reserved.
  3020.   */
  3021.   
  3022. ***************
  3023. *** 164,176 ****
  3024.           mapin(curproc->bconmap);
  3025.   
  3026.   #ifndef DONT_ONLY030_THIS
  3027. ! /* Note: in theory, the code below shouldn't be necessary
  3028. ! if we're running on a 68030 chip; after all, in such a case
  3029. ! we MUST have TOS 1.6 or better...
  3030. ! However, the code breaks if we comment this out, even though
  3031. ! tosvers is indeed > 0x0104. Must be a compiler bug, but it's
  3032. ! nothing obvious!
  3033. ! */
  3034.   
  3035.   /*
  3036.     If this is an old TOS, try to rearrange things to support
  3037. --- 164,172 ----
  3038.           mapin(curproc->bconmap);
  3039.   
  3040.   #ifndef DONT_ONLY030_THIS
  3041. ! /* Note: the code below must be included, even on a 68030, thanks to a bug
  3042. !  * in the gcc and mntlib osbind.h file.
  3043. !  */
  3044.   
  3045.   /*
  3046.     If this is an old TOS, try to rearrange things to support
  3047. ***************
  3048. *** 263,268 ****
  3049. --- 259,291 ----
  3050.         (*f->dev->ioctl)(f, TCURSOFF+cmd, &op);
  3051.   }
  3052.   
  3053. + long
  3054. + dosound(ptr)
  3055. +     char *ptr;
  3056. + {
  3057. +     char c;
  3058. +     MEMREGION *r;
  3059. +     if (!no_mem_prot) {
  3060. +     /* check that this process has access to the memory */
  3061. +     /* (if not, the next line will cause a bus error) */
  3062. +         c = *((volatile char *)ptr);
  3063. +     /* OK, now make sure that interrupt routines will have access,
  3064. +      * too
  3065. +      */
  3066. +         r = addr2region((virtaddr)ptr);
  3067. +         if (r && get_prot_mode(r) == PROT_P) {
  3068. +             DEBUG(("Dosound: changing protection to Super"));
  3069. +             mark_region(r, PROT_S);
  3070. +         }
  3071. +     }
  3072. +     Dosound(ptr);
  3073. +     return 0;
  3074. + }
  3075.   void
  3076.   init_xbios()
  3077.   {
  3078. ***************
  3079. *** 272,277 ****
  3080. --- 295,301 ----
  3081.       xbios_tab[0x0e] = uiorec;
  3082.       xbios_tab[0x0f] = rsconf;
  3083.       xbios_tab[0x15] = cursconf;
  3084. +     xbios_tab[0x20] = dosound;
  3085.       xbios_tab[0x26] = supexec;
  3086.       xbios_tab[0x2c] = bconmap;
  3087.   }
  3088. *** 1.4    1993/03/08 21:36:20
  3089. --- context.spp    1993/04/21 23:52:20
  3090. ***************
  3091. *** 1,6 ****
  3092.   ;
  3093.   ; Copyright 1992 Eric R. Smith
  3094. ! ; Copyright 1992 Atari Corporation
  3095.   ; All rights reserved.
  3096.   
  3097.   %include "magic.i"
  3098. --- 1,6 ----
  3099.   ;
  3100.   ; Copyright 1992 Eric R. Smith
  3101. ! ; Copyright 1992,1993 Atari Corporation
  3102.   ; All rights reserved.
  3103.   
  3104.   %include "magic.i"
  3105. ***************
  3106. *** 48,81 ****
  3107.       XDEF     _save_context
  3108.       XDEF    _restore_context
  3109.       XDEF    _change_context
  3110. -     XDEF    _set_mmu
  3111.   
  3112.       XREF    _fpu
  3113.       XREF    _framesizes
  3114.       XREF    _new_trace    ; from intr.s
  3115.       XREF    _no_mem_prot    
  3116. - ;
  3117. - ; set_mmu(crp,tc): called once, the first time a page table is built, to 
  3118. - ; switch away from the MMU setup that came from the ROM and into the setup 
  3119. - ; that we just built.  The CRP is actually on the stack, and it's 8 bytes.
  3120. - ; The TC is four bytes at sp@(0xc).  "Nulls" is here because we need to
  3121. - ; shove zeros into a few places.
  3122. - ;
  3123. - ; nulltc is in the data segment because otherwise GAS assembles PC-relative
  3124. - ; and that's not legal on 68030.
  3125. - ;
  3126. -     DATA
  3127. - nulltc:    dc.l    0
  3128.   
  3129.       TEXT
  3130. - _set_mmu:
  3131. -     pmove    nulltc,tc        ; turn off mmu
  3132. -     dc.l    $f0390800,nulltc    ; pmove nulltc,tt0
  3133. -     dc.l    $f0390c00,nulltc    ; pmove nulltc,tt1
  3134. -     pmove    4(sp),crp        ; caution: crp is 8 bytes
  3135. -     pmove    $c(sp),tc
  3136. -     rts
  3137.   _build_context:
  3138.       move.l    a0,-(sp)    ; save a0; we'll use it for scratch
  3139.       move.l    8(sp),a0    ; get address of save area
  3140. --- 48,60 ----
  3141. ***************
  3142. *** 179,186 ****
  3143.       move.l    -4(a1),C_PC(a0)    ; save PC
  3144.       move.l    usp,a1
  3145.       move.l    a1,C_USP(a0)    ; save user stack pointer
  3146. !     move.w    sr,d0
  3147. !     move.w    d0,C_SR(a0)    ; save status register
  3148.       move.l    ($408).w,C_TERM(a0)    ; save GEMDOS terminate vector
  3149.       move.l    (sp)+,C_A0(a0)    ; save old a0
  3150.       moveq.l    #0,d0        ; return 0
  3151. --- 158,164 ----
  3152.       move.l    -4(a1),C_PC(a0)    ; save PC
  3153.       move.l    usp,a1
  3154.       move.l    a1,C_USP(a0)    ; save user stack pointer
  3155. !     move.w    sr,C_SR(a0)    ; save status register
  3156.       move.l    ($408).w,C_TERM(a0)    ; save GEMDOS terminate vector
  3157.       move.l    (sp)+,C_A0(a0)    ; save old a0
  3158.       moveq.l    #0,d0        ; return 0
  3159. ***************
  3160. *** 194,200 ****
  3161.   ; the process we're switching to. Thus, we can change memory context
  3162.   ; to there.
  3163.   
  3164. !     move.l    C_SSP(a0),sp    ; supervisor stack pointer
  3165.       move.l    C_USP(a0),a1
  3166.       move.l    a1,usp        ; set user stack pointer
  3167.       move.l    C_TERM(a0),($408).w    ; restore GEMDOS terminate vector
  3168. --- 172,181 ----
  3169.   ; the process we're switching to. Thus, we can change memory context
  3170.   ; to there.
  3171.   
  3172. !     move.l    C_SSP(a0),a1    ; get supervisor stack pointer
  3173. !     tst.b    (a1)        ; touch the page for virtual memory programs
  3174. !     tst.b    -1023(a1)    ; make sure stack can grow
  3175. !     move.l    a1,sp
  3176.       move.l    C_USP(a0),a1
  3177.       move.l    a1,usp        ; set user stack pointer
  3178.       move.l    C_TERM(a0),($408).w    ; restore GEMDOS terminate vector
  3179. ***************
  3180. *** 239,246 ****
  3181.   short4:    frestore    C_FSTATE(a0)            ; finally the internal state
  3182.   short3:
  3183.       move.l    C_PC(a0),-(sp)    ; push the PC
  3184. !     move.w    C_SR(a0),d0    ; fetch status register
  3185. !     move.w    d0,-(sp)    ; push the status register
  3186.       tst.b    C_PTRACE(a0)        ; check for a pending trace
  3187.       movem.l    (a0),d0-d7/a0-a6    ; restore registers d0-d7/a0-a6
  3188.       beq.s    notrace
  3189. --- 220,226 ----
  3190.   short4:    frestore    C_FSTATE(a0)            ; finally the internal state
  3191.   short3:
  3192.       move.l    C_PC(a0),-(sp)    ; push the PC
  3193. !     move.w    C_SR(a0),-(sp)    ; push the status register
  3194.       tst.b    C_PTRACE(a0)        ; check for a pending trace
  3195.       movem.l    (a0),d0-d7/a0-a6    ; restore registers d0-d7/a0-a6
  3196.       beq.s    notrace
  3197. ***************
  3198. *** 257,263 ****
  3199.   ; the process we're switching to. Thus, we can change memory context
  3200.   ; to there.
  3201.   
  3202. !     move.l    C_SSP(a0),sp    ; supervisor stack pointer
  3203.       move.l    C_USP(a0),a1
  3204.       move.l    a1,usp        ; set user stack pointer
  3205.       move.l    C_TERM(a0),($408).w    ; restore GEMDOS terminate vector
  3206. --- 237,246 ----
  3207.   ; the process we're switching to. Thus, we can change memory context
  3208.   ; to there.
  3209.   
  3210. !     move.l    C_SSP(a0),a1    ; get supervisor stack pointer
  3211. !     tst.b    (a1)        ; touch the page for virtual memory programs
  3212. !     tst.b    -1023(a1)    ; make sure stack can grow
  3213. !     move.l    a1,sp
  3214.       move.l    C_USP(a0),a1
  3215.       move.l    a1,usp        ; set user stack pointer
  3216.       move.l    C_TERM(a0),($408).w    ; restore GEMDOS terminate vector
  3217. ***************
  3218. *** 291,297 ****
  3219.   ; if running with a true coprocessor we need to restore the FPU state
  3220.   
  3221.       tst.w    _fpu        ; is there a true FPU in the system
  3222. !     beq.s    short3
  3223.       tst.b    C_FSTATE(a0)        ; if NULL frame then the FPU is not in use
  3224.       beq.s    short5        ; skip programmer's model restore
  3225.       fmovem.l    C_FCTRL(a0),fpcr/fpsr/fpiar    ; restore control registers
  3226. --- 274,280 ----
  3227.   ; if running with a true coprocessor we need to restore the FPU state
  3228.   
  3229.       tst.w    _fpu        ; is there a true FPU in the system
  3230. !     beq.s    short6
  3231.       tst.b    C_FSTATE(a0)        ; if NULL frame then the FPU is not in use
  3232.       beq.s    short5        ; skip programmer's model restore
  3233.       fmovem.l    C_FCTRL(a0),fpcr/fpsr/fpiar    ; restore control registers
  3234. ***************
  3235. *** 299,306 ****
  3236.   short5:    frestore    C_FSTATE(a0)            ; finally the internal state
  3237.   short6:
  3238.       move.l    C_PC(a0),-(sp)    ; push the PC
  3239. !     move.w    C_SR(a0),d0    ; fetch status register
  3240. !     move.w    d0,-(sp)    ; push the status register
  3241.       tst.b    C_PTRACE(a0)        ; check for a pending trace
  3242.       movem.l    (a0),d0-d7/a0-a6    ; restore registers d0-d7/a0-a6
  3243.       beq.s    notrace2
  3244. --- 282,288 ----
  3245.   short5:    frestore    C_FSTATE(a0)            ; finally the internal state
  3246.   short6:
  3247.       move.l    C_PC(a0),-(sp)    ; push the PC
  3248. !     move.w    C_SR(a0),-(sp)    ; push status register
  3249.       tst.b    C_PTRACE(a0)        ; check for a pending trace
  3250.       movem.l    (a0),d0-d7/a0-a6    ; restore registers d0-d7/a0-a6
  3251.       beq.s    notrace2
  3252. *** 1.4    1993/03/08 21:36:20
  3253. --- cpu.spp    1993/05/24 23:24:00
  3254. ***************
  3255. *** 1,7 ****
  3256.   ;
  3257. ! ; CPU tricks (we should probably have spl7(), spl() & reboot() in here)
  3258.   ;
  3259.       TEXT
  3260.   ;
  3261.   ; Cache tricks
  3262.   ;
  3263. --- 1,50 ----
  3264.   ;
  3265. ! ; CPU tricks (mostly having to do with the MMU)
  3266.   ;
  3267. + ;
  3268. + ; set_mmu(crp,tc): called once, the first time a page table is built, to 
  3269. + ; switch away from the MMU setup that came from the ROM and into the setup 
  3270. + ; that we just built.  The CRP is actually on the stack, and it's 8 bytes.
  3271. + ; The TC is four bytes at sp@(0xc).  "Nulls" is here because we need to
  3272. + ; shove zeros into a few places.
  3273. + ;
  3274. +     TEXT
  3275. + nulltc:    dc.l    0
  3276. +     XDEF    _set_mmu
  3277. + _set_mmu:
  3278. +     pmove    (nulltc).l,tc        ; turn off mmu
  3279. +     dc.l    $f0390800,nulltc    ; pmove nulltc,tt0
  3280. +     dc.l    $f0390c00,nulltc    ; pmove nulltc,tt1
  3281. +     pmove    4(sp),crp        ; caution: crp is 8 bytes
  3282. +     pmove    $c(sp),tc
  3283. +     rts
  3284. + ;
  3285. + ; save_mmu, restr_mmu: save and restore the MMU setup that came from ROM
  3286. + ;
  3287. +     BSS
  3288. + oldcrp    ds.l    2
  3289. + oldtc    ds.l    1
  3290. + oldtt0    ds.l    1
  3291. + oldtt1    ds.l    1
  3292.       TEXT
  3293. +     XDEF    _save_mmu
  3294. + _save_mmu:
  3295. +     pmove    tc,oldtc
  3296. +     dc.l    $f0390a00,oldtt0    ; pmove    tt0,oldtt0
  3297. +     dc.l    $f0390e00,oldtt1    ; pmove    tt1,oldtt1
  3298. +     pmove    crp,oldcrp
  3299. +     rts
  3300. +     XDEF    _restr_mmu
  3301. + _restr_mmu:
  3302. +     pmove    (nulltc).l,tc
  3303. +     dc.l    $f0390800,oldtt0    ; pmove    oldtt0,tt0
  3304. +     dc.l    $f0390c00,oldtt1    ; pmove    oldtt1,tt1
  3305. +     pmove    oldcrp,crp
  3306. +     pmove    oldtc,tc
  3307. +     rts
  3308.   ;
  3309.   ; Cache tricks
  3310.   ;
  3311. ***************
  3312. *** 73,76 ****
  3313. --- 116,126 ----
  3314.       move.l    (sp)+,sp    ; set stack pointer
  3315.       jmp    (a0)        ; return
  3316.   
  3317. + ;
  3318. + ; PMMU stuff
  3319. + ;
  3320. +     XDEF    _flush_pmmu
  3321. + _flush_pmmu:
  3322. +     pflusha
  3323. +     rts
  3324.       END
  3325. *** 1.4    1993/03/08 21:36:20
  3326. --- intr.spp    1993/04/20 16:24:38
  3327. ***************
  3328. *** 16,23 ****
  3329.       ori.w    #$0700,sr
  3330.       rts
  3331.   _spl:
  3332. !     move.w    4(sp),d0
  3333. !     move.w    d0,sr
  3334.       rts
  3335.   
  3336.       XDEF    _mint_5ms
  3337. --- 16,22 ----
  3338.       ori.w    #$0700,sr
  3339.       rts
  3340.   _spl:
  3341. !     move.w    4(sp),sr
  3342.       rts
  3343.   
  3344.       XDEF    _mint_5ms
  3345. *** 1.4    1993/03/08 21:36:20
  3346. --- syscall.spp    1993/04/15 00:37:34
  3347. ***************
  3348. *** 97,103 ****
  3349.   ; calls a GEMDOS function (Srealloc) and so
  3350.   ; we must *not* change any of the vectors!!
  3351.   
  3352. !     btst    #13,(sp)        ; test for user/super mode
  3353.       beq    LX_usr
  3354.   %ifdef ONLY030
  3355.       lea    8(sp),a1
  3356. --- 97,103 ----
  3357.   ; calls a GEMDOS function (Srealloc) and so
  3358.   ; we must *not* change any of the vectors!!
  3359.   
  3360. !     btst    #5,(sp)            ; test for user/super mode
  3361.       beq    LX_usr
  3362.   %ifdef ONLY030
  3363.       lea    8(sp),a1
  3364.