home *** CD-ROM | disk | FTP | other *** search
- /******************************************
- * CSR_DEMO.C *
- * Copyright Chen Shuren. 1991 *
- ******************************************/
-
- #include <stdlib.h>
- #include <dos.h>
- #include <ts.h>
- #undef main /*this file contains the real McCoy...*/
- extern int _slint;
-
- TS_TASK ts_main(void)
- {
- int i;
- for(i = 0; i < 4; i++){
- critstart(DOS_CRCLASS);
- printf("process_name -> %s\n", curproc->name);
- critend(DOS_CRCLASS);
- }
- }
-
- static TS_TASK ts_idle(void)
- {
- int i;
- for(i = 0; i < 2; i++){
- critstart(DOS_CRCLASS);
- printf("process_name -> %s\n", curproc->name);
- critend(DOS_CRCLASS);
- }
- }
-
- void main(argc ,argv ,envp) int argc;
- char **argv;
- char **envp;
- {
- PROCESS bootproc;
- union REGS regs ;
- char *p, *inDos_ptr();
- int i = 1;
-
- /*initialize _vidseg to user's video segment*/
- regs.h.ah = 15 ;
- int86( 0x10 , ®s , ®s ) ;
- _vidseg = ( (regs.h.al == 7 ) ? 0xB000 : 0xB800 ) ;
- if (p = getenv("SLICER")) _slint = atoi(p);
- _DosFlag = inDos_ptr();
- /*boot slicer*/
- if (argc == 2) i = atoi(argv[1]);
- _ts_boot(&bootproc) ;
- ssleep() ;
- tickrate(i);
- if((_idleproc = spawn("TSIDLE", 0x100, ts_idle)) &&
- (_mainproc = spawn("TSMAIN", 0x100, ts_main))){
- _mainproc->status |= DOSCRIT;
- _mainproc->nxt = _idleproc;
- _idleproc->nxt = _mainproc;
- init13(&_i13Flag, 0x13); /* Slicer sleeps when in FileIO */
- swake();
- guc();
- }
- else printf("No memory for TSMAIN\r\n");
- exitmp( 0xFF ) ;
- } /* main */
-