Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

MS-DOS Multi-Tasking or TSR

Status
Not open for further replies.

tcwong3

Junior Member level 2
Junior Member level 2
Joined
Mar 29, 2004
Messages
23
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
182
I need to write a program to capture time & date info from serial port and update the system clock while another DOS-based application is running.

I'm thinking two methods:

(1) write a TSR DOS based program to capture time info. The problem is I'm not familiar with DOS TSR.

(2) I'm not sure if this is possible or not.
Install Windows OS and run the DOS application program.
And write a WIndows-based time info capture program by using VB.

I need to install Windows OS because it can do multi tasking.

I have seen a PC run in two OS ---- Windows 98 & MS-DOS at the same time.
How to do the installation?


Is there any link or reference for this?

Thanks in advanced
 

An alternative is to write a mutitasking kernel for dos. Attached is the c code for a basic multitasking kernell, I have added 2 tasks as a demo. It was compiled with Borland Turbo c.
This is a lean Kernel which I have used with success in the past.
Not many dos functions are reentrant, so access to these functions must be serialized. I have code for semaphores and other bits that can turn this into a full-featured multitasking kernel.
If you are interested, I will add them to the file.
 

Of course, if you don't have the source code for the DOS program, you can't make it multitasking! Then TSR is the way to go. You don't need to deeply understand the inner workings of TSR's. If you adapt and link your program to the two source files 'popup.c' and 'resident.c', they will turn your standard c program into a TSR.
You call your program from the popup function in the popup file.
Your program must abide by a few rules.

1. The program must be built with Borland Turbo C, I used version 3, which is a free download from Borlands site. It must use the tiny or small memory model.
2. The program must not use DOS functions 0 to 12.
3. If the program changes the curent working disc directory, it must restore the original directory before returning to the interrupted program.
4. The program should avoid the use of floating point operations.
5. The program must never terminate or exit to DOS.

I have attached an example Turbo C project.
To run the program type 'tsr'. This command will load the TSR and cause it to terminate and stay resisdent. Before terminating, the program displays the following message, "Popup has been loaded".
If you were to run it a second time, it would sense that it was already resisdent and would display, "Popup is already resident".
You can cause it to suspend, resume or terminate itself with the commands,
tsr wait
tsr restart
tsr quit

The hot keys assigned to it are ALT . (Full stop) combination. This will run the TSR.
I should imagine that your program will intercept the comms interrupt and update the clock when a message arrives. Good luck.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top