    ,    ,           

A process consists of an address space, object handles, and one or more paths of execution (threads). Threads are used to perform work. For example, a thread can respond to interrupts and handle asynchronous process-related events in thread context. 

RTX timers are not synchronization objects which means threads cannot wait on an RTX timer handle. This is in contrast to the Windows waitable timer, which is an object on which a thread can wait, or against which a thread can receive notification.

event -  .  pulse (   waitforsingleobject)


,           ,     
(  -   )
      "", ..    
      ,        
     
     , ..      (      -  ,           ,   include  )

 ,    ,  

()    (  ,       ):
1.     :  ,   .
:
- fixed (   ?  )
- nearcode
- [initialized neardata (==nearcode?)]
- [empty neardata]
- farcode
- [initialized fardata (==farcode)])
- [empty fardata]
2.       -            ?
3.  
4.  
5.  

     :
1.  16-    (  ,  )
[2. HSB  8-  (  ,  )]
[3. LSB  8-  (  ,  )]
4.   far  (  )
5.  FIXUP "   -  , - "
5.  FIXUP "   -  , - "

      ?
       ?
 ,      " " (  ,   ,    2-)
           
(   :
-    ,      FIXUP " ,   FIXUP    -  , - " (      !!!),   ;
-     ,      FIXUP " ,   FIXUP    -  , - " (      !!!),   
-    ,      
-    ,     "  , "
-       ,     "   far "
     ?  -?
       ($-1, + (  , ...),   call/jp/jr,      (   ),      ,     (?))?
  org $-1?  ,    ?
  nearcode , ..    ?   -  !
)
()       ,   ,        

   far    ,       128   48
     (            )
 ,      .
      48   48 (  , ,  ,  near )


   ?       ?    ,   ?
     ,  


    ?
)    (   48),   ,     
)     (        ,  )
2)    ,       
    ,       -     (   ,   , ..      ),  ,  .       .
    1  2?
     ? ?     1,     
)      (        48,      >40K)
)     ,    ,  ?
)          -     ?

      include?   -     ?
       ?        ?
       ?

,    ,  ,         ,     (   ,  )
     (     )
   (    ),         
  incbin     ,    
         ?    ?     !!!

   -   :
-  (~10K)
-  (~20K+)
-  (~25K+)
-  (~10K+)
-   (  , , )

     48, :
     
      ?      , ..       48
    . ?
   !    ?     ?       !!!
           .        ?

-  -  ,    

 
 
  ,    
:    ( ?       !),   ,      
  (  ?),  ,  



 48    :
  near   
  far    (  near)
256b   
256b?    



     :
  (word  16M) (4   (2  , 2 .  )=4*1024=4k,   word,     .    .  )(       -        )
 eff7 -    !!!
 fe?   ?
  (0/8) -    !!!   ATM    7ffd     

   (  )      , ..      .    ,    ,     ( )  ..


      (   )
         
    ,     ,   ?    ?

  -   (-, )
     -  
      ,         

     



  (   ):
+   range check (    )
+     (    )
+    
+   
:
-     ,  ?    ?
-        ?

        





         .
    !   ?
     ,    .
      hdd!     ?
)      (,        !)
)        
)   ,            
)          


;   
or a
semaphoreloop
call c,Sleep
ld hl,fsemaphore ;#fe - , #ff - 
sra (hl) ;#ff
jc semaphoreloop
; Sleep  - ?


;   
ld hl,fsemaphore
ld (hl),#fe

    ,      ,      ,   ,   .

semaphore12loop
STARTCRITICAL
ld a,(fsemaphore1) ;#fe - , #ff - 
ld hl,fsemaphore2 ;#fe - , #ff - 
or (hl) ;   ,  #ff
rrca
jnc semaphore12ok ;
ENDCRITICAL
call Sleep
jr semaphore12loop
semaphore12ok
ld a,#ff ;
ld (fsemaphore1),a
ld (fsemaphore2),a
ENDCRITICAL







     60 ,        /.
        .
  ,       ,    ?
    .     .
      ,      ,  ..
 ,    memory overflow    .

     -      (   ),
       (   ).
    ,    .

       -  #4000? ,       ld a,%0x0xxxxx:out (#fd),a   out #dffd, #fdfd, #1ffd.
,  #3ffd ( , ..  #7ffd, #bffd, #fffd)  #9ffd.
   #0000 ( #FE      ),   :
1.   is-dos chic (  128-   #0000),
2.        ( #1ffd),
3.   0 (  ) - ,  5, 4.
          0- ,          .
  ,     vtrdos    #4000,     .
     #3dxx,       ,    ,    .

 BQ  SOS:    #0000  #8000  
      (  32  ++
 +...).     "5-/1- .  #4000".      "  #0000"?

   #4000   ,  .    2   16,  .
  ,    #0000,  (   inc h:call z,...  .).     -     #8000.
    SP  ,   
 .         . ,     .

   3 :   ,   ,   ,       - +.
       . ,   . ,   .
            .
     ( BQ),    #0000 ( .),   #4000,   #8000,   #c000.
 2 ,         .

     ?     ,     .     ?      fork     (   vfork).      ,   ... (: 1. , 2.  8, 3.    (  ), 4.   , 5.    16, 6.  , [7.  ]).    7   8 (   )   16.         ;      ;   ,        .


          
 .    - :
WORD size
WORD nextpg
WORD nextaddr
            .
 ,   ,     .
    ?     (..    ,     ).
     ?       "  ".


         ,   -  .
    .

      ,     ,   


 UNIX    -     - fork.
  fork,     ? (    )

      ,   .
    (   ,    ),      (    ,    ).
      stack overflow     (   ), underflow   ,         .        ,     -  !


16-    22 .  32-?




    100%    ?       ,      ,  .
    100%     

    O(1),         .




   :
:
+       (    )
+      (  -  ,      );  -        (     )
+        
+   RST (     !)
( CP/M )
:
-    128 (  ?)
-         (  ),   ?
)   ( )
)     (   ?)
)    =    (  , ., DNA OS -   SOS)
)   ?    ,     (  /  ?).       .

     MSX-DOS / CP/M.
     /    


rpm -qa | more
ls -l `which su`

 SManager.




    .
(  )  ()   (ontimer, onkeydown, onkeyup) .    ,   (  ,    /)
   .
 - ,         (  ),    (keypressed)
   .
 -      (       , )

, ,  ( )   API.

    [         !    gui,      -      ,   ]

API  :
  OpenDevice       (   ?)
     /  ,        ( CloseDevice)
      -    , ,   ( ,     )
             (   ,        )
       ,  ,      (        -    ,        ISR)

 ?     - .&        ;   /  -    ; !!!  ,     ,     ,     ,        !!!   ISR      (       -   ,   FIFO-   ).

  ,   ,   . Ÿ  ,     .   ,         (    ,   32768)?

      ,          ,   (    ).
    ,       (,          )    ,  .         (  ): "     -",       ,     -,       .
      .
!    ,   .
    SENDMSG,           .
  -     ON_INT (  ISR!!!) .

   (,     )    -  
     ,      .    
       (   -       ;        ),       .

     ,        .
 ,       ?
 ,    ?    bitmap    ?         .
       . ..   , ,    ( )  .     "",               .       (,  F10),               .
    ,     .
   ?      (  -       ,     )   ,    .

    :        (,  DMA   - ,            DMA:  full screen,  ,    ,         )

,    :

IQ( ):
0.     .
1. GETMSG.
 :
T1.   ;
T2.   ,       MAIN.
T3.   1.
  (   MAIN):
K1.   /   ;
K2.   1.
 "":
E1.       "".
   1.

MAIN:
0. ...
1. GETMSG.
    
{
 " ":
R1.     "  ".
R2.    (     IQ,   BQ)
R3.       -     (   R2,          -  BQ  ).
R4.     " ".
R5.     ",  ".
R6.   1.
 " ":
O1.   IQ  "".
O2.    .
O3.   1.
 "":
E1.   .
E2.   IQ  "".
E3.   .
E4.   1.
   1.
}
   
{
 IQ  "":
Q1.       "".
   1.
}
    
{
 IQ  "":
Q1.   .
   1.
}
   
{
 "":
Q1.       "".
 ...
...
 ...
B1.    .
B2.  IQ   .
B3.   1.
}

   ,  ,      ,  GUI    .

  GETMSG  ,   ,   -     ,      :
1.     ",  "      ;
2.          ,     " "       ;
3.     " ".


  Wolf/Quake     -.
     + (  )      .
        . (    > 70000t,  .)
   (  +      / ),
        .
    (, General Sound).
        .
     ,   (    ,        EOF).
  ,     
(       +    ).
     EOF   ?        (  )?
    (-   EOF)  ,         (   ,  ,   ,  ).

         (       ),
        
(    ,     ,     ).




     (     )   GETMSG,    .
50Hz   "",          .
  :
       ,   ,        (      )    .
       ,        ,        (      )    .
       ,        (      )    .
 HALT.
  256 :       .
          .

,    ,  ,       ,  ,   

 NMI -   ON_INT (  ,    NMI?)

  54  ()   RS232   50Hz    23040 ( 5) 

  RS232          




        ,  :
     ,         ,         ( ,         )

       ,    

  :

Struct app
Byte priority ;
Byte flags ; (factive, ftimeslice, fusetimer)
Word mainpg ;   (  )
Word curmsg ;    
Word endmsg ;     
Word curpg ; 
Word sp ;   (    ,   )
Word next ;    (      )
;[ ,      -       /]
EndStruct

  :
        (..   )
     ,  "  ",    - 
 ,  "  ",  ,   .

 :
    ="  "
   (    ) :      ,  (  "  ",  )      ,  ,  = 
       .


       (256 )
     :

Struct msg
Word type ;  (2 )
Word sender ;  (2 )
Array param,12 ; (2-) -  !!! 6 ? ( =16 )
EndStruct

       ,   256 . ..      ,      .      -    (#C000)?  Ctrl+Alt+Del     ";  "

    (    ),
      .
   (, )     ,
   ,   ?

Windows.pas:
  tagMSG = packed record
    hwnd: HWND;
    message: UINT;
    wParam: WPARAM;
    lParam: LPARAM;
    time: DWORD;
    pt: TPoint;
  end;

Types.pas:
  TPoint = packed record
    X: Longint;
    Y: Longint;
  end;
    + 4  + (?)






          ,      .    ,   .





[20:15] <alone>         ZX:  MagOS (   ) +  + 
[20:16] <alone>    ( Alt+Tab,   , ..   -  )
[20:16] <alone>     
[20:16] <alone>       
[20:17] <alone>       47K    #400 +    ( )
[20:17] <savelij13>         )
[20:17] <alone> ,      ,   ,   
[20:18] <alone>   ,  ,     
[20:18] <savelij13>     ?      
[20:18] <alone>      
[20:18] <alone>     
[20:19] <alone>  -
[20:19] <savelij13> ?
[20:19] <alone>      
[20:19] <alone>    
[20:19] <alone>       ,   /    
[20:19] <savelij13> .     .        )
[20:20] <alone>       ,         
[20:20] <alone> 47     
[20:20] <alone>   63,       
[20:20] <savelij13>          
[20:21] <alone>     - 
[20:21] <alone>     
[20:21] <savelij13>     ?
[20:21] <alone> 100% 
[20:21] <savelij13>         ?
[20:22] <alone>  
[20:35] <alone>    #100  ,    / 
[20:35] <alone>          .    
[20:36] <alone>     /    " ", " ", " "
[20:37] <alone> sleep -  getch
[20:37] <alone>    
[20:37] <alone>    :
[20:38] <alone>      
[20:38] <alone>        



[16:21:03] <Leaf44119>  API -  ,  -  
[16:21:27] <Leaf44119>       - -  


     63  47+.
    ?
)   ?
)     ?
)     ?
   sp? 0  63, 000  47?
  !      
..:   ,           ,   

     ,    ?    31 :    ,   1!!!  2  31 ?    ?         0?

  : 7, , 16,   0,   7, 7 , 320 ,     ,  (      80   80) -   80.    zxbus?



