Dec 062017
CTask is a set of routines that allow your C program to execute functions in parallel, without you having to build in sophisticated polling and switching schemes.
File CTSK22.ZIP from The Programmer’s Corner in
Category C Source Code
CTask is a set of routines that allow your C program to execute functions in parallel, without you having to build in sophisticated polling and switching schemes.
File Name File Size Zip Size Zip Type
CONOUT.C 3090 1101 deflated
CTASK.DEF 4057 1129 deflated
CTASK.DOC 306428 70447 deflated
CTASK.MS 2849 692 deflated
CTASK.TC 3550 883 deflated
CTASKH.BC 6620 1078 deflated
CTASKH.TC 6606 1067 deflated
CTASKMS.LIB 72245 29466 deflated
CTC.BAT 158 117 deflated
CTSUP.MS 832 365 deflated
CTSUP.TC 1018 420 deflated
CTSUPH.BC 846 389 deflated
CTSUPH.TC 828 373 deflated
CTSUPMSL.LIB 6683 3584 deflated
KBD.H 6192 1578 deflated
MINRES.ASM 1585 787 deflated
MINRES.MS 376 238 deflated
MINRES.TC 462 295 deflated
MS.BAT 127 97 deflated
MSPAWN.C 6099 1987 deflated
MSPAWN.MS 606 350 deflated
MSPAWN.TC 779 439 deflated
PRT.H 1079 440 deflated
README 11043 4179 deflated
RES.C 4011 1494 deflated
RES.MS 590 346 deflated
RES.TC 750 424 deflated
SAMPMS.BAT 205 108 deflated
SAMPTC.BAT 578 142 deflated
SIO.H 4860 1313 deflated
SNAP.C 883 422 deflated
SNAP.MS 593 348 deflated
SNAP.TC 770 435 deflated
SPAWN.C 6299 2202 deflated
SPAWN.MS 599 351 deflated
SPAWN.TC 772 437 deflated
TCH.BAT 179 127 deflated
TEST.C 5744 1866 deflated
TEST.MS 591 345 deflated
TEST.TC 765 433 deflated
TESTMOD.ASM 1190 505 deflated
TESTMOD.MS 382 242 deflated
TESTMOD.TC 461 292 deflated
TPRT.C 2569 1118 deflated
TPRT.MS 599 351 deflated
TPRT.TC 759 428 deflated
TSIO.C 3265 1255 deflated
TSIO.MS 599 350 deflated
TSIO.TC 760 427 deflated
TSK.H 34925 7335 deflated
TSK.MAC 16352 4865 deflated
TSKALLOC.C 3844 1109 deflated
TSKASM.ASM 27397 8215 deflated
TSKBIOS.ASM 5666 2156 deflated
TSKBUF.C 4707 1322 deflated
TSKCNT.C 4980 1293 deflated
TSKCONF.H 16946 4478 deflated
TSKDEB.H 2606 842 deflated
TSKDOS.ASM 36237 9633 deflated
TSKEMS.ASM 5442 1994 deflated
TSKFLG.C 3381 970 deflated
TSKGRP.C 5822 1903 deflated
TSKHOT.C 4175 1198 deflated
TSKINST.C 10547 3255 deflated
TSKINT17.ASM 4496 1636 deflated
TSKKBD.ASM 14331 4464 deflated
TSKLOCAL.H 12470 3406 deflated
TSKMAIN.C 6299 2111 deflated
TSKMEMW.C 3056 1039 deflated
TSKMSG.C 3374 1075 deflated
TSKNAME.C 2743 1013 deflated
TSKNDP.ASM 1421 756 deflated
TSKPIP.C 6486 1630 deflated
TSKPORW.C 3143 1051 deflated
TSKPRF.ASM 29722 7757 deflated
TSKPRF.H 1523 425 deflated
TSKPRT.C 11406 3140 deflated
TSKPRTI.ASM 900 455 deflated
TSKQUE.ASM 8517 2367 deflated
TSKRES.ASM 2025 850 deflated
TSKRSC.C 4448 1142 deflated
TSKSEC.ASM 2890 1122 deflated
TSKSIO.C 26480 6208 deflated
TSKSIOI.ASM 1125 514 deflated
TSKSNAP.C 11804 2768 deflated
TSKSTCK.ASM 8666 2861 deflated
TSKSTUB.ASM 7389 2408 deflated
TSKSUB.C 5329 1887 deflated
TSKSUP.H 621 319 deflated
TSKTASK.C 6960 2392 deflated
TSKTICK.C 2075 813 deflated
TSKTIM.ASM 13843 3959 deflated
TSKTOPS.C 4065 1176 deflated
TSKTSUB.C 2841 1003 deflated
TSKTTSK.C 8772 2781 deflated
TSKTUTL.C 4790 1285 deflated
TSKUTIL.C 3829 1315 deflated
TSKWPIP.C 6542 1656 deflated

Download File CTSK22.ZIP Here

Contents of the README file

CTask - A Multitasking Kernel for C.
Version 2.2, Released 90-10-12.
version 2.2b files added to this zip - dje 8/15/91

Public Domain Software written by Thomas Wagner

Home Address: Business Address:
Patschkauer Weg 31 Ferrari electronic GmbH
D-1000 Berlin 33 Beusselstrasse 27
Germany D-1000 Berlin 21, Germany
Phone: (49-30) 396 50 21
Fax: (49-30) 396 80 20

BIX: twagner
UUCP: [email protected] (attn: Thomas Wagner)

This software is in the Public Domain. No registration is required,
and no license fees or royalties must be paid.

You are using this software at your own risk. There is no warranty on
fitness for any purpose, and the author can not be held liable for
any damages whatsoever.

Re-distribution by any media, disk or BBS, is expressly encouraged.
Please distribute freely, but please leave the archives intact when

re-posting. If there is a technical need to split up the archives,
please include this with all parts, and tell the user where
to find the other parts. Version 2.2 consists of two archives, one
with all sources and documentation, the other with the precompiled
libraries only. If you intend to re-compile the sources anyway, you
only need the source archive. The binary archive is provided for
those who want to get started right away, without the hassle of
setting up the compilation environment.

Versions released so far:
0.1 (Beta) 88-03-01
1.1 88-07-01
1.1a 88-12-29
1.1b 89-05-30
2.0 89-12-24
2.1 90-07-23
2.1a 90-08-13
2.1b 90-08-14
2.2 (this) 90-10-12

If you want to receive future updates, I recommend joining BIX. You
will not only have access to the newest version of CTask, you will
also get direct support from me through E-mail or the CTask support
topic in the ibm.other conference. Please see the manual for
more information on BIX, and for the complete support policy.

If BIX is too expensive, or for other reasons unavailable to you, I'm
also willing to send you new versions on disk. However, I do have to
charge you for this service. I've been sending out more and more
disks for free with each release, and the postage is starting to
hurt. See the file ORDER.DOC for more information.


Version 2.2 was released mainly to correct a number of known bugs in
2.1. To avoid further delays, and continued problems due to the bugs,
I made this version public even though there are two problem areas

If you want to use the 80x87 support in CTask, please be aware that
the NDP support is not yet tested. It is quite likely that your
program will crash if you set NDP to true in tskconf.h, so get your
debugger ready. Please report your experiences. Also, floating point
emulation is not supported. The emulation entries apparently are not

Version 2.2 will not work correctly with Windows 3.0 in enhanced 386
mode if CTask is installed as TSR before starting Windows. The reason
(communication between virtual machines) is known, but a solution
would be rather complex. I will try to solve this problem in the next
release. CTask will work fine with Windows 3.0 if started in a
DOS-window, or if used with the real-mode version.


When compiling some of the files, you will get warnings about
unreferenced formal parameters. This is normal, and should be
ignored. The Turbo C pragma for turning off those warnings is not
compatible with Microsoft, so it is not used in the current version.


Note that the Turbo C batch and make files refer to "lib" and
"tmake", where Turbo users would normally use "tlib" and "make". This
is to resolve naming conflicts in my own configuration. To use the
files in a "standard" Turbo configuration, you may have to edit the
files, or provide suitable alias definitions.


CAUTION: DO NOT use TASM 1.0 to assemble the CTask routines. Version
1.0 of Borland's TASM has severe problems with the extended model
directives, which will cause Assembly time errors, and, if you get
past them, run time crashes.

Versions 1.01 and 2.0 of TASM are safe to use. Please check with
Borland for an update.

You can also use MASM 5.1 for the TC version, just edit the make
files to change the assembler name.


Turbo C++ 1.0 problems

The original release of Turbo C++ 1.0 has a number of bugs in include
files and run-time routines. Patches for the known bugs are available
in the borland conference on BIX, and on other Borland-supported
online services. If you don't have access to BIX, contact Borland for
the patches.

The main problem with CTask is that the definitions for the intrinsic
functions "inportb" and "outportb" are missing from the TC++
header-file "dos.h". This leads to those functions being compiled as
external functions, and the resulting library is model dependent. To
correct this, copy the lines defining the intrinsics from the old TC
2.0 header file into the new dos.h:

unsigned char _Cdecl __inportb__(int __portid);
void _Cdecl __outportb__ (int __portid, unsigned char __value);
#define inportb __inportb__
#define outportb __outportb__

In this version (2.2) only, the TSK.H file also contains those
definitions. They will likely be removed from tsk.h in future


The manual included is ready for printing. No fancy formatting
was used, and the page length was chosen to fit the short
American sized paper. The only control character your printer
must understand is the formfeed.


Well, this guy is giving all that away - there must be a catch
somewhere, you say? Right you are! You are REQUIRED to read my
sales blurb in the file FERRARI.DOC in this library IMMEDIATELY,
or this software will self-destruct in thirty seconds... 😉


Files in the archives:

Binary archive (CTBIN22.LZH)

Compiled CTask kernel and support routines

READ.ME This file

CTASKMS.LIB CTask kernel, Microsoft C (any model)
CTSUPMSL.LIB CTask support routines, MS-C (large model)

CTASKTC.LIB CTask kernel, Turbo C (any model except Tiny & Huge)
CTSUPTCL.LIB CTask support routines, Turbo C (large model)

Source Archive (CTASK22.LZH)


READ.ME This file
CTASK.DOC Documentation for CTask, ready for printing
FERRARI.DOC Commercial advertising, required reading
ORDER.DOC Information on ordering CTask disks

CTASK.DEF Periscope debugger record definition file

Include Files

KBD.H Keyboard scan code and flag definitions for Hotkeys
PRT.H Include file required for printer driver
SIO.H Include file required for serial driver
TSK.H Include file required for CTask kernel
TSKCONF.H CTask configuration options (C and Assembler)
TSKDEB.H Debug mode configuration (C and Assembler)
TSKLOCAL.H Include file for internal CTask use
TSKPRF.H Function prototypes for printf replacement routines
TSKSUP.H Include file required for support routines

TSK.MAC Assembler include file

Source files for the CTask kernel

TSKASM.ASM Scheduler and miscellaneous ASM routines
TSKBIOS.ASM AT BIOS wait/post handler (INT 15)
TSKDOS.ASM DOS multiplex interface for CTask
TSKEMS.ASM EMS support routines
TSKINT17.ASM BIOS printer interface (INT 17)
TSKKBD.ASM Keyboard interface and hotkey handler
TSKNDP.ASM Numerioc coprocessor support routines
TSKPRTI.ASM Printer driver interrupt stack switcher
TSKQUE.ASM Queue handling

TSKRES.ASM CTask residency check
TSKSEC.ASM DOS and Keyboard interface routines
TSKSIOI.ASM Serial driver interrupt stack switcher
TSKSTCK.ASM Stack switch routine
TSKSTUB.ASM Code sharing function stubs/entry table
TSKTIM.ASM Timer tick interface (INT 8)

TSKBUF.C Buffer events
TSKCNT.C Counter events
TSKFLG.C Flag events
TSKGRP.C Group creation/removal
TSKHOT.C Hotkey creation
TSKINST.C Main kernel installation/removal
TSKMAIN.C Main CTask installation routines
TSKMEMW.C Memory watches
TSKMSG.C Mailbox events
TSKNAME.C Name searching
TSKPORW.C Port watches
TSKPIP.C Pipe events
TSKPRT.C Printer driver
TSKRSC.C Resource events
TSKSIO.C Serial I/O driver
TSKSUB.C Subroutines for internal CTask use
TSKTASK.C Main task related routines
TSKTICK.C Ticker handling
TSKTOPS.C Timeout and watch routines
TSKTSUB.C Timer/watch helper subroutines
TSKTTSK.C Timer task
TSKTUTL.C Task utility subroutines
TSKUTIL.C Miscellaneous utilitiy routines
TSKWPIP.C Word pipe events

Support routine source files

CONOUT.C Console output support
TSKALLOC.C Memory allocation RTL interface
TSKSNAP.C Snapshot dump utility
TSKPRF.ASM Printf replacement routines

Sample application sources

MINRES.ASM Minimal resident CTask
TESTMOD.ASM Check for model independence

SNAP.C Snapshot dump
TEST.C General Test
TPRT.C Test printer driver
TSIO.C Test serial driver

Batch files to make kernel and samples

MS.BAT Make Kernel and support routines, MS-C
SAMPMS.BAT Make Sample applications, MS-C
CTC.BAT Make Kernel and support routines, Turbo C
SAMPTC.BAT Make Sample applications, Turbo C
TCH.BAT Make Kernel and support routines, Turbo C Huge model

Microsoft Make files for Microsoft C/MASM

CTASK.MS Make Kernel
CTSUP.MS Make Support Routines


Borland Make files for Turbo C/TASM

CTASK.TC Make Kernel
CTSUP.TC Make Support Routines

CTASKH.TC Make Kernel, Huge model
CTSUPH.TC Make Support Routines, Huge model


 December 6, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>