32bit TSR

DOS specific questions.
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

32bit TSR

Post by Gablea »

Hi all,
Is it possible to create a TSR with FreeBASIC?

What I would like to do is create a program that runs in the background of dos to copy files from the local pc to a shared folder on the server.

Is this possible?

Andy
dasyar
Posts: 372
Joined: Dec 04, 2008 15:31

Re: 32bit TSR

Post by dasyar »

For those of you who have not played with DOS recently, TSR - Terminate and Stay Resident. In order to have something running in the background, you would need a multitasking program.

There is an earlier thread, in this forum, where the person was trying to make a functional multitasking program, but that thread has gone quiet. For the last 15 or 20 years I was hoping somebody would create a functional 32/64 bit multitasking DOS, but that has gone quiet.
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: 32bit TSR

Post by marcov »

Yeah, even the "dos ain't dead" forum (http://www.bttr-software.de/forum/) seems to be dead nowadays.
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Re: 32bit TSR

Post by Gablea »

FreeDOS is still alive But that does not have multitasking support yet.

So in the older dos how did a TSR function?
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: 32bit TSR

Post by marcov »

Gablea wrote:FreeDOS is still alive But that does not have multitasking support yet.

So in the older dos how did a TSR function?
IIRC you had to hook some vectors and then call some int 21 call. But in 32-bit you don't work directly with dos, but with the dos extender. The dos extender documentation and searching for go32v2+tsr might give some places to start.
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: 32bit TSR

Post by srvaldez »

perhaps HX DOS-Extender might be of interest https://sourceforge.net/projects/hx-dos/files/
the development is discontinued but it should still be a viable product to use.
HX DOS-Extender is a free DOS extender with built-in Win32 PE file format support. Usually the purpose of a DOS extender is to make protected-mode features available for DOS applications. HX fully supports this goal, but goes some steps further. A Win32 API emulation layer is part of HX which allows many Win32 console applications to run in DOS. This emulation goes far beyond similiar approaches in other extenders (Borland's PowerPack, WDOSX or Phar Lab TNT). Furthermore HX implements - limited - support for windows, DirectDraw, GDI and even OpenGL graphics. This allows to run "simple" Win32 GUI apps in DOS as well.
although it supports multithreading it does not support multitasking, so I doubt that it would work for what you want.
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Re: 32bit TSR

Post by Gablea »

I’m open to ideas all I’m trying to do is find a way of moving files from a local machine to server with out locking up the main program while the files copy.

I would need to move the files when ever they show up (say 30 seconds after they are created) as the files are stored on a RAM drive (for speed)

If someone know the best way In dos to copy 20 files extramly quickly (size ranged from 2kb upto 1mb) then I’m all ears (as we say in the UK)

What I am doing is creating a DOS PoS system (as I like dos)
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: 32bit TSR

Post by srvaldez »

this is just an idea, I don't have the knowledge or expertise to implement it, using HX DOS extender use a thread inside your PoS to copy the files.
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: 32bit TSR

Post by marcov »

Or run desqview or some other multitasker.
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Re: 32bit TSR

Post by Gablea »

I’ve never heard of that desqview. Is it a comercial program? I suppose to find more info out I’ll google it
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: 32bit TSR

Post by caseih »

Yup it is/was a commercial program for running multiple DOS programs. https://en.wikipedia.org/wiki/DESQview

Note that you cannot copy file safely in the background while your POS app is running. DOS simply has no multi-user or file locking capabilities that I know of. You might be able to close your database file, copy it locally, then re-open the database file and continue. Then another process/thread could copy this other local copy to the server for safe keeping. I suspect the local copy could be done fast enough that your POS program wouldn't even blink.
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: 32bit TSR

Post by marcov »

(it does have locking, it is called share.exe )
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Re: 32bit TSR

Post by Gablea »

I was thinking about having a trigger file so if it shows up the PoS would display a message to the user just saying updating files... and then perform the database updates

Would that be a better option? I would love to have
Mysql support in dos but I’m not the clever to work out the mysql library and I’m sure it would take me years to port it over to dos

But hey we can dream.
angros47
Posts: 2324
Joined: Jun 21, 2005 19:04

Re: 32bit TSR

Post by angros47 »

Two things: HX DOS extender provides support for multithreading, not for multitasking. To use it, you have to compile using the Win32 version of FreeBasic. By the way, version 1.06 of FreeBasic for DOS supports native multithreading (based on a old, buggy library, but it works). So, if you want to use multiple threads in a single FB programs, you don't need anything else.

Second thing: DESQView was a very interesting program, but nowaday it is completely useless: its last version featured a desktop environment that was better that Windows (https://www.youtube.com/watch?v=V_lfpdK7bQM), but it was basically a port of X Windows for DOS (there was also a GCC port for it). Hardware requirements to run it were the same needed to run Windows 3.1, or a small Linux distro, so, today, it is possible to have exactly the same using some old version of Linux (damnsmalllinux, puppy linux, muLinux, and many others): you can have more features, with the same resources, and you will have a 100% legal and free operating system.
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: 32bit TSR

Post by marcov »

angros47 wrote:
Second thing: DESQView was a very interesting program.....
The suggestion took into account that the user had some reason to stay with dos in the first place, and I assumed they were software rather than hardware related (I don't think they are because they still have a 486/DX)

DV/X does run many authentic dos programs fine and at the same time. This includes things that are attached to I/O.
Post Reply