32 bit TSR in FreeBasic (yes, it worked, in the end)

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

Re: 32 bit TSR in FreeBasic (yes, it worked, in the end)

Post by Gablea »

Tanks for confirmbig it can go to a serial port caseih I’ll have a look on google and see what I can find.
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: 32 bit TSR in FreeBasic (yes, it worked, in the end)

Post by caseih »

Nearly all embedded linux devices use the serial port for messages and also for a login terminal.

Here's a good doc on it. It's for Arch, but applicable to any distro:
https://wiki.archlinux.org/index.php/wo ... al_console
St_W
Posts: 1618
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: 32 bit TSR in FreeBasic (yes, it worked, in the end)

Post by St_W »

Gablea wrote:I have looked at moving the .net app to Mono but becuase I use OPoS to communcate to the Printers, cash drawer and scanners Mono does not like it (last time I tried to port it over I had over 2,000 error messages) after looking on the Mono website they do not have full support for the VB language (C is fully support in Mono)
It's likely that certain libraries just won't work; in that case you have to either find alternative ones or implement the functionality yourself. You could even implement things like the POS-hardware communication in FreeBasic and call it via P/Invoke from VB. If you'd write the whole thing in another programming language you'd have to implement those things anyway.
(btw the number of error messages isn't really a good measure)
Gablea wrote:I have never looked at .net core (does that support VB.net as well or is just like the rest of them just supporting C)
If you can't get it to work in Mono then forget about .net core for now, as it will be even worse.
Gablea wrote:I would not create a web version of the PoS as I do not like web applications (I like complied as they would use the services and RAM etc of the local machine and not relay to much on the server)
Use just meant to render the UI using web-technologies. Server and client can run on the same machine and even be the same application. But of course you'd need to create your whole UI from scratch, just like if you'd rewrote it in FB.
Gablea wrote:I do how ever use MySQL as my database engine for the PoS applications (Did use Firebird but I could never work out how to talk to that from VB.net)
Firebird provides an ADO.NET driver and is compatible with EF and you can install all the needed libraries via nuget, so actually it should be rather easy to setup and use.
angros47
Posts: 2321
Joined: Jun 21, 2005 19:04

Re: 32 bit TSR in FreeBasic (yes, it worked, in the end)

Post by angros47 »

Adding abstraction layers (like Mono/.NET, or a web interface) would increase portability, but it would also bloat the software, and increase hardware requirements. To make a native interface one would need a graphic driver, and a library to draw the interface itself (windows, lists, icons, text boxes and so on). To use a web interface one would need to add x-windows, a modern working browser, a framework like Gnome or KDE, a framework for web interface, and so on. And on a limited hardware Firefox requires a while just to load and open the main page.

Since Gablea is targeting old hardware, the best solution would involve less abstraction. A native software running in Linux in kiosk mode sounds reasonable, if multitasking is required. If no multitasking is required, perhaps DOS, too, might be enough, and a good feature of FreeBasic is that it allows to compile the same software for dos or for linux with not many changes to the source code
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Re: 32 bit TSR in FreeBasic (yes, it worked, in the end)

Post by Gablea »

angros47 wrote:Since Gablea is targeting old hardware, the best solution would involve less abstraction. A native software running in Linux in kiosk mode sounds reasonable, if multitasking is required. If no multitasking is required, perhaps DOS, too, might be enough, and a good feature of FreeBasic is that it allows to compile the same software for dos or for linux with not many changes to the source code
I agree with angros47

The only thing I would need multitasking for would be to update the database file (if running on dos) if I do it for Linux then I could use direct database connection.

I was also thinking about doing a simple vb.net version but then I would have to use Windows. I want this project to move away from Microsoft as much as I can.

The main advantage is the user display is only a 2 line chr display. The customer display will be the computer monitor and that will only display information that is need
angros47
Posts: 2321
Joined: Jun 21, 2005 19:04

Re: 32 bit TSR in FreeBasic (yes, it worked, in the end)

Post by angros47 »

Updating the database files is an operation that is performed in FreeBasic, or in a different program?

Because I am unsure if you need multitasking (running two different programs at the same time), or multithreading (running two different surbroutines of the same program at the same time).
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Re: 32 bit TSR in FreeBasic (yes, it worked, in the end)

Post by Gablea »

As this program is just at the design stage I’m open to any idea’s. Ideally I would like to have the scanner support on a thread of its own but that would limit the operating systems I can use (unless the dos complier is updated to support multithreading)

Ideal any solutions that are come up with would have to work in dos
grindstone
Posts: 862
Joined: May 05, 2015 5:35
Location: Germany

Re: 32 bit TSR in FreeBasic (yes, it worked, in the end)

Post by grindstone »

Only a vague idea: Is the ASM statement available in the DOS version of FB?

Maybe I'm a little naive (I never worked with FB-DOS), but wouldn't it be possible to emulate multithreading by periodically switching through multiple segments of the program, each time saving and restoring the set of processor registers? I coded something similar for an AVR microcontroller some years ago, and it worked fine.
marcov
Posts: 3454
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: 32 bit TSR in FreeBasic (yes, it worked, in the end)

Post by marcov »

grindstone wrote:Only a vague idea: Is the ASM statement available in the DOS version of FB?

Maybe I'm a little naive (I never worked with FB-DOS), but wouldn't it be possible to emulate multithreading by periodically switching through multiple segments of the program, each time saving and restoring the set of processor registers? I coded something similar for an AVR microcontroller some years ago, and it worked fine.
Yes. There are dozens if not hundreds of such things for ordinary (16-bit) dos programs. However for 32-bit, it is already a bit thinner, since then the extender also comes into play.

But from a working demo to an application can be laborious. Debugging suffers.

If it had to be DOS however, I'd use something like (the now free) Desqview/X. Used it for BBSes for a long time, and it is stable and fairly comfortable. There are also some int 2F services for dos apps to communicate with DV/X and eachother (IPC like, e.g. to give a signal to eachother), though often just semaphore files were used.
angros47
Posts: 2321
Joined: Jun 21, 2005 19:04

Re: 32 bit TSR in FreeBasic (yes, it worked, in the end)

Post by angros47 »

Gablea wrote:As this program is just at the design stage I’m open to any idea’s. Ideally I would like to have the scanner support on a thread of its own but that would limit the operating systems I can use (unless the dos complier is updated to support multithreading)

Ideal any solutions that are come up with would have to work in dos
As I told you before, the last version of the dos compiler (that still has not been released officially, but can be downloaded at http://users.freebasic-portal.de/stw/builds/dos/) is updated to support multithreading.

@Marcov
As far as I know, DV/X is not free. It is a proprietary software, that is now an abandonware (so, it's very unlikely that anyone will complain if it is distributed, but including it in a commercial software is still illegal). If you know for sure that it is now available legally, and for free, could you provide me the links to prove it, so I will update the page on wikipedia?
St_W
Posts: 1618
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: 32 bit TSR in FreeBasic (yes, it worked, in the end)

Post by St_W »

angros47 wrote:Adding abstraction layers (like Mono/.NET, or a web interface) would increase portability, but it would also bloat the software, and increase hardware requirements.
The performance impact by .NET is usually neglectable - especially if a Windows + .NET version already exists and seems to be working well as far as I understood. Linux + Mono isn't that much slower than Windows + .NET, it might even be faster.

But as far as I got from the previous posts you want to do a full rewrite anyway. Of course FreeBasic is fine in that case. Just consider that this will be a lot of work and will probably take several months or even years - you've been warned. Personally I still think that it's a bad idea, but of course the decision is yours.
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Re: 32 bit TSR in FreeBasic (yes, it worked, in the end)

Post by Gablea »

@St_W
I Know that rewriting the whole platform of my EPoS systems is a long process. It was when we move from DOS to windows 2000 originally. And then when we had to move from Vb6 to .NET that was even longer.

As a business I made the decision over a year ago to look into alternatives to the windows platform. And we was really thinking about dropping back to the DOS platform (Ie FreeDOS).

Though at the time I was the only programmer who know much about dos. So we stuck with .NET

Now that FreeBASIC is around I’ve once again looked into to moving from windows (as none of the tills I own or supply will run windows 7 or above) and they struggle to run Windows XP and you can not run a .net framework 3.5 application on windows 2000 trust me I’ve tried s few times.

I would have used ReactOS but at the moment that is not stable enough. So it was Linux that won out and after some googling I even found that we do not need to use the X11 server. So even better means the older machines are still supported. (As I can get some of them from NCR for less then $150 each)

I’m sure you are all aware of the first few attempts I have done with FreeBASIC of converting my NPoS to FreeBASIC. (A few of you know who you are and have saved my backside many times)

The last version of the FB NPoS has almost all the same functions as the windows version (apart from the way it shows items on the screen) and a few modern functions that are yet to be implements.

I’m sure you all keep saying to me forget dos is old etc and to move to Linux yea I agree. But the move to Linux will talk time. And I was hoping to make the new FB version of my retail software modular(ideally each hardware would have its own module that the core pos app would talk to)

Would that idea work in Linux?
angros47
Posts: 2321
Joined: Jun 21, 2005 19:04

Re: 32 bit TSR in FreeBasic (yes, it worked, in the end)

Post by angros47 »

@Gablea
Yes, that approach would work on Linux, Windows and DOS. The same approach is used in the FreeBasic runtime libraries , too.

@St_W
Perhaps the performance impact of a framework like .NET might be neglectable, but the memory impact isn't, especially on old machines that have a small amount of memory available. And if available memory is not enough, swapping might be activated, and this would impact on performance
St_W
Posts: 1618
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: 32 bit TSR in FreeBasic (yes, it worked, in the end)

Post by St_W »

Gablea wrote:The last version of the FB NPoS has almost all the same functions as the windows version (apart from the way it shows items on the screen) and a few modern functions that are yet to be implements.
Ok, I didn't know that you have progressed on the FB implementation already that far, although I remember your previous questions on similar/related topics. That changes the situation, of course. If you use the functionality in the FB runtime exclusively (and no 3rd party libraries etc.) you could easily compile your application for Windows / Linux or even DOS with no or very little adaptations.
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: 32 bit TSR in FreeBasic (yes, it worked, in the end)

Post by caseih »

Gablea wrote:So it was Linux that won out and after some googling I even found that we do not need to use the X11 server. So even better means the older machines are still supported. (As I can get some of them from NCR for less then $150 each)
Years ago I used X11 on a tiny handheld embedded device, a precursor to modern smart phones. This was about 16 years ago now. X11 ran great on that tiny, anemic device. X11 also worked fairly well on the old Zaurus handheld computers.

In my last job we ran a kiosk using X11 with no window manager or desktop environment on ancient hardware as well. It's a myth that framebuffer mode is in some way lighter or faster than X11. If you can work out the auto login and running your POS as a fullscreen X11 app with no window manager, that will be a better way than the framebuffer. X11 has the advantage of supporting newer hardware too, something that may not be possible with the framebuffer device which may not even be supported by some video cards. Just gives more flexibility. I can't really speak to Wayland in this context, but I don't think X11 will disappear in the short term.

But the nice thing about using FB is portability between graphics backends, so probably none of what I wrote matters either! :) You can experiment with X11 later and see how it compares on the old hardware.
Post Reply