Allow DOS and NT to share bands.
authorGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Sun, 18 Jul 1993 22:25:57 +0000 (22:25 +0000)
committerGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Sun, 18 Jul 1993 22:25:57 +0000 (22:25 +0000)
v7/src/microcode/dosconio.c
v7/src/microcode/ntgui.c
v7/src/microcode/ntsig.c
v7/src/runtime/runtime.pkg
v8/src/runtime/runtime.pkg

index bbe5548146dbac37ede50fc756a2703e5bd63898..d75f08b37d1d3abf03129f2a6dd45e71821734b2 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Id: dosconio.c,v 1.10 1993/07/16 20:56:45 gjr Exp $
+$Id: dosconio.c,v 1.11 1993/07/18 22:25:57 gjr Exp $
 
 Copyright (c) 1992-1993 Massachusetts Institute of Technology
 
@@ -262,20 +262,35 @@ DEFUN_VOID (DOS_initialize_conio)
 
 extern void EXFUN (DOS_initialize_fov, (SCHEME_OBJECT));
 
+/* This sets up the interrupt handlers for both DOS and NT,
+   so that bands can be shared.
+ */
+
 void
 DEFUN (DOS_initialize_fov, (fov), SCHEME_OBJECT fov)
 {
-  int in;
-  SCHEME_OBJECT iv, imv, prim;
+  int ctr, in;
+  SCHEME_OBJECT iv, imv, prim, mask;
   extern SCHEME_OBJECT EXFUN (make_primitive, (char *));
+  static int interrupt_numbers[] = {
+    Global_GC_Level,
+    Global_1_Level
+    };
+  static long interrupt_masks[] = {
+    0,                         /* No interrupts allowed */
+    (INT_Stack_Overflow | INT_Global_GC | INT_GC)
+    };
 
-  in = Global_GC_Level;
-  prim = (make_primitive ("DOS-HIGH-PRIORITY-TIMER-INTERRUPT"));
   iv = (FAST_VECTOR_REF (fov, System_Interrupt_Vector));
-  VECTOR_SET (iv, in, prim);
   imv = (FAST_VECTOR_REF (fov, FIXOBJ_INTERRUPT_MASK_VECTOR));
-  /* No interrupts allowed while processing this interrupt. */
-  VECTOR_SET (imv, in, (long_to_integer (0)));
+  prim = (make_primitive ("MICROCODE-POLL-INTERRUPT-HANDLER"));
+
+  for (ctr = 0; ctr < ((sizeof (interrupt_numbers)) / (sizeof (int))); ctr++)
+  {
+    in = interrupt_numbers[ctr];
+    VECTOR_SET (iv, in, prim);
+    VECTOR_SET (imv, in, (long_to_integer (interrupt_masks[ctr])));
+  }
   return;
 }
 
@@ -359,8 +374,8 @@ DEFUN (console_read, (buffer, nbytes, buffered_p, blocking_p, intrpt_p),
   return (0);
 }
 \f
-DEFINE_PRIMITIVE ("DOS-HIGH-PRIORITY-TIMER-INTERRUPT", Prim_dos_high_priority_timer, 2, 2,
-                 "DOS High-priority timer interrupt handler.")
+DEFINE_PRIMITIVE ("MICROCODE-POLL-INTERRUPT-HANDLER", Prim_dos_high_priority_timer, 2, 2,
+                 "DOS Polling interrupt handler---timer and keyboard.")
 {
   extern void EXFUN (dos_process_timer_interrupt, (void));
   PRIMITIVE_HEADER (2);
index 8fc0414195540a4e66ea24ec13cdb2320c0896e8..93d7e5dfda467f29913d01f34e4589094a009b35 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Id: ntgui.c,v 1.2 1993/06/24 02:02:05 gjr Exp $
+$Id: ntgui.c,v 1.3 1993/07/18 22:25:50 gjr Exp $
 
 Copyright (c) 1993 Massachusetts Institute of Technology
 
@@ -184,7 +184,7 @@ DEFUN_VOID (nt_gui_default_poll)
 }
 
 
-DEFINE_PRIMITIVE ("NT-DEFAULT-POLL-GUI-INTERRUPT",
+DEFINE_PRIMITIVE ("MICROCODE-POLL-INTERRUPT-HANDLER",
                   Prim_nt_default_poll_gui_interrupt, 2, 2,
                  "NT High-priority timer interrupt handler for Windows I/O.")
 {
index 360e6c480593ee9e4edd75aaf97071837489ff48..ff7753ac3544573343e98e050aa9ee6e97d8e71e 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Id: ntsig.c,v 1.3 1993/06/24 02:08:32 gjr Exp $
+$Id: ntsig.c,v 1.4 1993/07/18 22:25:44 gjr Exp $
 
 Copyright (c) 1992-1993 Massachusetts Institute of Technology
 
@@ -1282,22 +1282,37 @@ DEFUN_VOID (install_timer)
     return  0;
 }
 
-
+/* This sets up the interrupt handlers for both DOS and NT,
+   so that bands can be shared.
+ */
 
 void
 DEFUN (NT_initialize_fov, (fov), SCHEME_OBJECT fov)
 {
+  int ctr, in;
+  SCHEME_OBJECT iv, imv, prim, mask;
   extern SCHEME_OBJECT EXFUN (make_primitive, (char *));
-  SCHEME_OBJECT iv, prim;
-
-  prim = make_primitive ("NT-DEFAULT-POLL-GUI-INTERRUPT");
-  iv = FAST_VECTOR_REF (fov, System_Interrupt_Vector);
-//  VECTOR_SET (iv, Global_GC_Level, prim);
-  VECTOR_SET (iv, Global_1_Level, prim);
+  static int interrupt_numbers[] = {
+    Global_GC_Level,
+    Global_1_Level
+    };
+  static long interrupt_masks[] = {
+    0,                         /* No interrupts allowed */
+    (INT_Stack_Overflow | INT_Global_GC | INT_GC)
+    };
+
+  iv = (FAST_VECTOR_REF (fov, System_Interrupt_Vector));
+  imv = (FAST_VECTOR_REF (fov, FIXOBJ_INTERRUPT_MASK_VECTOR));
+  prim = (make_primitive ("MICROCODE-POLL-INTERRUPT-HANDLER"));
+
+  for (ctr = 0; ctr < ((sizeof (interrupt_numbers)) / (sizeof (int))); ctr++)
+  {
+    in = interrupt_numbers[ctr];
+    VECTOR_SET (iv, in, prim);
+    VECTOR_SET (imv, in, (long_to_integer (interrupt_masks[ctr])));
+  }
   return;
 }
-
-
 \f
 void
 DEFUN_VOID (NT_initialize_signals)
index 0beb1ac7501a973bddfa17017b4e35f9db62a601..c2f483073ce4d0b8af0d133c8ed705813d66822d 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: runtime.pkg,v 14.184 1993/07/07 20:01:39 gjr Exp $
+$Id: runtime.pkg,v 14.185 1993/07/18 22:25:37 gjr Exp $
 
 Copyright (c) 1988-1993 Massachusetts Institute of Technology
 
@@ -1508,17 +1508,19 @@ MIT in each case. |#
    (else))
   (initialization (initialize-package!)))
 
+;; DOS and NT pathanme packages present in both to allow band sharing.
+
 (define-package (runtime pathname dos)
   (parent (runtime pathname))
   (file-case os-type
-   ((dos) "dospth")
+   ((dos nt) "dospth")
    (else))
   (initialization (initialize-package!)))
 
 (define-package (runtime pathname nt)
   (parent (runtime pathname))
   (file-case os-type
-   ((nt) "ntpth")
+   ((nt dos) "ntpth")
    (else))
   (initialization (initialize-package!)))
 
index 0beb1ac7501a973bddfa17017b4e35f9db62a601..c2f483073ce4d0b8af0d133c8ed705813d66822d 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: runtime.pkg,v 14.184 1993/07/07 20:01:39 gjr Exp $
+$Id: runtime.pkg,v 14.185 1993/07/18 22:25:37 gjr Exp $
 
 Copyright (c) 1988-1993 Massachusetts Institute of Technology
 
@@ -1508,17 +1508,19 @@ MIT in each case. |#
    (else))
   (initialization (initialize-package!)))
 
+;; DOS and NT pathanme packages present in both to allow band sharing.
+
 (define-package (runtime pathname dos)
   (parent (runtime pathname))
   (file-case os-type
-   ((dos) "dospth")
+   ((dos nt) "dospth")
    (else))
   (initialization (initialize-package!)))
 
 (define-package (runtime pathname nt)
   (parent (runtime pathname))
   (file-case os-type
-   ((nt) "ntpth")
+   ((nt dos) "ntpth")
    (else))
   (initialization (initialize-package!)))