Author Topic: automatic DOS program termination from another process  (Read 5344 times)

Offline mik3ca

  • Jr. Member
  • *
  • Posts: 30
automatic DOS program termination from another process
« on: January 09, 2021, 03:14:22 AM »
I'll first explain what I am trying to achieve.

I have made a custom circuit (PCB) by hand that does special functions. It connects to a Dell Wyse thin-client PC's serial port. Then I hook this thin-client to the internet via RJ45 cable and I make it a web server so that one of today's computers can easily control features on my circuit board.

Since on-board flash drive storage capacity is 128MB and I am using a regular monitor with a video adapter (VGA to DVI adapter) to see the screen, It is reasonable that I limit my OS to just DOS. No Windows or Linux.

For a large portion of the web server, I'm using webserv.bas quickbasic code from rubbermallet.org (http://rubbermallet.org/software/webserv.html) along with trumpet TCP drivers and a packet driver.

So far, I can make as many web page requests from any of today's PC's to the thin client as I want as long as I wait a few seconds in-between each request, but sometimes waiting a few seconds might be a problem, especially when I have a page that requests multiple objects from the same server.

When I make too many requests in such a short time, the server locks up and I would have to
restart the entire computer to make the server run.

I know NTCPDRV (which is the trumpet driver I'm using) has asynchronous functions available for only the compatible packet drivers but I want to make something that works for everyone.

I feel one of my solutions is to chain to the existing DOS interrupt 1Ch because it automatically is called by DOS about 18 times a second I think. Then in that timer, I want to somehow create code that forces the webserver to restart or at least kill the webserver process if it locks up so I can modify a batch file to restart it.

The closest idea I came up with is that inside the 1Ch interrupt I could execute one of the below interrupts and override the CS value...

http://www.ctyme.com/intr/rb-2471.htm
http://www.ctyme.com/intr/rb-2551.htm

..then again, doesn't CS only equal the current running code segment and if i change it, the next instruction is executed from another area of ram?

So can anyone give me any ideas on how to solve this without me having to turn off and on the computer to make the server work every time someone decides to hold down F5 on a remote computer to constantly refresh a page? Remember, I'm working in a DOS 16-bit environment and only 2 interrupts are used. One for the packet driver and one for the trumpet (NTCPDRV) driver.

Offline bastl

  • Jr. Member
  • *
  • Posts: 17
Re: automatic DOS program termination from another process
« Reply #1 on: January 09, 2021, 08:51:23 PM »
Hello, yes, is the right idea interrupts but...
DOS is a RT-System or single process system. So you can not do multitasking like with linux.
The only thing you have to do is to schedule the queries.
You can do it directly with the interrupt. But you have to handle the interrupt very fast until cli and there is not much time!
1.) handle the interface to receive data
2.) cli to receive new interrupt
3.) receive and handle data until next interrupt.

To handle data you need a scheduler that decides which data to work on and were to display or shift
If you have no multicore than you have to do all in that scheduler else you can split the work.
To schedule you need to set a timer. Then you can jump from one open work to the next one ...

If you want to handle multiple requests at a time you need multitasking else you have to block all other tasks until you have received one request - totally ! It is DOS !
You can store the requests until the first is done and then do the second ...

 else you know what happens!