Author Topic: Can an application be started and run in monoprocessor?  (Read 665 times)

roberto

  • Sr. Member
  • ****
  • Thank You
  • -Given: 16
  • -Receive: 7
  • Posts: 441
    • View Profile
Can an application be started and run in monoprocessor?
« on: February 20, 2019, 05:52:34 pm »
I wanted to ask if from c you can have an application start in monoprocessor and only use one processor.
Or else it would also be useful, to start the application in such a way that it only uses one processor.
Saludos

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 9
  • -Receive: 129
  • Posts: 1862
    • View Profile
Re: Can an application be started and run in monoprocessor?
« Reply #1 on: February 20, 2019, 06:07:53 pm »
Sure, use the MARKEXE utility, might need the toolkit installed.
Code: [Select]
G:\os2tk45\bin>markexe.exe /?

Operating System/2 Executable File Attribute Utility
Version 4.00.004 Oct  4 2001Usage: MARKEXE [/?] [/Q] [FORCE] [NO] [option] filename...
Valid options are:
        DISPLAY         - display status of flags
        DLLINIT         - per-process initialization
        DLLTERM         - per-process termination
        WINDOWAPI       - window api (PM application)
        WINDOWCOMPAT    - window compatible application
        NOTWINDOWCOMPAT - not window compatible application
        UNSPECIFIED     - unspecified application type
        LFNS            - long filenames support
        MPUNSAFE        - multi-processor unsafe application
        SETVERSION      - Write 32 bit Module Version Field

The parameter you want is MPUNSAFE.
There have been reports of some buggyness in the command which I can't remember right now.

Doug Bissett

  • Hero Member
  • *****
  • Thank You
  • -Given: 1
  • -Receive: 44
  • Posts: 1159
    • View Profile
Re: Can an application be started and run in monoprocessor?
« Reply #2 on: February 20, 2019, 06:40:43 pm »
You don't need the toolkit, if you use C:\OS2\EXECMODE.EXE. Just run the program in  command line window, and it will tell you how to use it.

Dariusz Piatkowski

  • Sr. Member
  • ****
  • Thank You
  • -Given: 13
  • -Receive: 9
  • Posts: 498
    • View Profile
Re: Can an application be started and run in monoprocessor?
« Reply #3 on: February 24, 2019, 09:21:55 pm »
Is this about running everything in the process on a single (assigned) CPU, or is it about just starting on a single core?

Here is why I ask, for some time now I've had this particular problem: certain apps when started on my multi-core configuration will freeze WPS, occasionally I may recover, but most of the time I have to CTRL-ALT-DEL the machine and even with 'CAD-Pupup' in place I may not have a smooth way to shut the machine off. Of all apps ANPM is a perfect example of this, start this in SMP mode and guaratneed lock results.

Now, strange enough if I force all the cores but one into OFF state before starting ANPM this is not a problem. I can successfuly start the app and then turn on all the other cores aftewards, no problem there.

I previously tried the suggested approaches of markexe as well as execmode, neither one helps, so I suspect that the symptom I am seeing maybe the result of a particualr DLL load/execution problem. This is why I ask if it's just about starting in a single core mode, or a full exec in a single core mode?

roberto

  • Sr. Member
  • ****
  • Thank You
  • -Given: 16
  • -Receive: 7
  • Posts: 441
    • View Profile
Re: Can an application be started and run in monoprocessor?
« Reply #4 on: February 27, 2019, 05:58:51 pm »
Doug:
I marked it with this program apparently fine, but the final result is not executed in monoprocessor.
The program that I wanted to run in mono processor is the Freemem.exe

Dave:
The version you propose is not the one I have installed now, in fact I have Borland c ++ V2.0 for os2.
In Borland options, I do not have any with that option.
I will try to install and try that version.

Dariusz:
What you think is very strange to me, anyway if a processor is set to 100% and you do not get out of there.
 You could try turning it off with SETPROC.exe 2 3 4 5 6 7 8 OFF

Andreas Schnellbacher

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 18
  • Posts: 378
    • View Profile
Re: Can an application be started and run in monoprocessor?
« Reply #5 on: February 27, 2019, 06:33:15 pm »
The version you propose is not the one I have installed now, in fact I have Borland c ++ V2.0 for os2.
Even when you use an old compiler, always use the newest toolkit. Always make sure that the toolkit paths come before the paths of the outdated compiler in your command file that sets the environment.

Doug Bissett

  • Hero Member
  • *****
  • Thank You
  • -Given: 1
  • -Receive: 44
  • Posts: 1159
    • View Profile
Re: Can an application be started and run in monoprocessor?
« Reply #6 on: February 27, 2019, 07:03:47 pm »
Quote
I marked it with this program apparently fine, but the final result is not executed in monoprocessor.
The program that I wanted to run in mono processor is the Freemem.exe

Setting to run in one processor doesn't stop programs from running in multiple processors. What it does, is make sure that the program only runs in one processor at any one time (not always the same processor).

What is FREEMEM.EXE, and why would you want to use it? There are probably better options, like using the Sentinel memory watcher, in XCenter.

Quote
You could try turning it off with SETPROC.exe 2 3 4 5 6 7 8 OFF

What is SETPROC.EXE? There is no such thing in ArcaOS. If it is the old utility to turn off processors, it won't work with ACPI. Well, it will turn the processors off, but when ACPI decides they should be turned back on, they are (usually immediately). You would need to use the /MAXCPU=1 setting on the PSD line in CONFIG.SYS., but that means it always only uses one CPU. Good for problem determination, but not for general use.

What, exactly, are you trying to do? It seems that you want to use tools that don't exist, or are not SMP safe. If that is the case, they are probably way too old to be of any use, and you should find newer tools.

Doug Clark

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 122
    • View Profile
Re: Can an application be started and run in monoprocessor?
« Reply #7 on: February 27, 2019, 09:04:35 pm »
I have wondered about running an application on a single processor.

The app I was specifically wondering about is VirtualPC v 5.1. It is unstable on a multiprocessor system - or perhaps just on a newer system. Do you think marking the exe for no multiple cpu would make it run?

Doug Bissett

  • Hero Member
  • *****
  • Thank You
  • -Given: 1
  • -Receive: 44
  • Posts: 1159
    • View Profile
Re: Can an application be started and run in monoprocessor?
« Reply #8 on: February 28, 2019, 03:54:20 am »
Quote
The app I was specifically wondering about is VirtualPC v 5.1. It is unstable on a multiprocessor system - or perhaps just on a newer system. Do you think marking the exe for no multiple cpu would make it run?

I have been using Virtual Box 5.0.6, for a while now. It runs okay, but uses HUGE amounts of lower shared memory space. I have taken steps to use as much upper shared memory space, for other apps, as possible, and that has helped, but I still need to be very careful what I run along with VirtualBox. I wouldn't be surprised if Virtual PC is even worse, and that is what causes the instability. Using only a single CPU probably isn't going to change that, since it is a memory allocation problem (if that is, indeed, the problem).

First, try adding /MAXCPU=1  to the ACPI.PSD line, in CONFIG.SYS, and see if it does, or does not, make it better. If it does, then it may be worth changing VIRTUAL PC (and all of the parts) to use only one CPU. If not, it is more likely to be a memory allocation problem, which requires other methods.

An option is to switch to VirtualBox. You should be able to use the virtual disk (or a copy of it, to be safe). At least VirtualBox is still under development, and it isn't owned by Microsoft.

Andy Willis

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 10
  • Posts: 196
    • View Profile
Re: Can an application be started and run in monoprocessor?
« Reply #9 on: February 28, 2019, 04:29:11 am »
Quote
The app I was specifically wondering about is VirtualPC v 5.1. It is unstable on a multiprocessor system - or perhaps just on a newer system. Do you think marking the exe for no multiple cpu would make it run?

I have been using Virtual Box 5.0.6, for a while now. It runs okay, but uses HUGE amounts of lower shared memory space. I have taken steps to use as much upper shared memory space, for other apps, as possible, and that has helped, but I still need to be very careful what I run along with VirtualBox. I wouldn't be surprised if Virtual PC is even worse, and that is what causes the instability. Using only a single CPU probably isn't going to change that, since it is a memory allocation problem (if that is, indeed, the problem).

First, try adding /MAXCPU=1  to the ACPI.PSD line, in CONFIG.SYS, and see if it does, or does not, make it better. If it does, then it may be worth changing VIRTUAL PC (and all of the parts) to use only one CPU. If not, it is more likely to be a memory allocation problem, which requires other methods.

An option is to switch to VirtualBox. You should be able to use the virtual disk (or a copy of it, to be safe). At least VirtualBox is still under development, and it isn't owned by Microsoft.

As I recall, there is some issue that is fixed with virtualpc to mark it to use only one CPU, IIRC it had a tendency to lock up the system without it.

Doug Clark

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 122
    • View Profile
Re: Can an application be started and run in monoprocessor?
« Reply #10 on: February 28, 2019, 07:23:57 am »
I am using vbox 5.0.51 and it runs pretty well - except for having to pause for about 20 seconds or so between starting vbox and starting a virtual machine. It appears that Vbox doesnt run os/2 clients = at least that is the message I get trying to install OS/2 on vbox on a Windows 7 host. Virtual PC version 5 runs OS/2 clients just fine, on an OS/2 host. It works very will on my ECS 2.x box with a pentium 4 with 2 gb of memory circa 2001 or so. But  VirtualPC does not run on my AMD 4 core machine. I will however try it with the /MAXCPU=1 to see if that makes a difference.  Thanks for the suggestion.

I THINK it is possible to install OS/2 on the MS version of Virtual PC that is available for Windows 7. However the menu item for attaching/using a floppy drive has been removed, so it is a pain to use floppies with the MS version of Virtual PC. You apparently can do it, but it requires running a VB script and I never could get it to actually use an USB attached floppy; only floppy images. Plus I would rather run it on OS/2 as the host.



Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 9
  • -Receive: 129
  • Posts: 1862
    • View Profile
Re: Can an application be started and run in monoprocessor?
« Reply #11 on: February 28, 2019, 08:47:33 am »
Vbox needs hardware virtualization to run OS/2, enable VT-x/AMD-V under System-->Acceleration, which means you need a CPU (and BIOS and OS) that supports it. If you're using a P4, it won't work. Not sure about your AMD machine  but OS/2 itself doesn't support it so no running OS/2 on vbox with an OS/2 host.

Valery Sedletski

  • Sr. Member
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 18
  • Posts: 256
    • View Profile
Re: Can an application be started and run in monoprocessor?
« Reply #12 on: February 28, 2019, 04:32:41 pm »
2Doug Bissett:

> I have been using Virtual Box 5.0.6, for a while now. It runs okay, but uses HUGE amounts of lower shared memory space.

You could try marking VirtualBox DLL's for loading into high memory, then it will use less lower one. For that, I made a highmem.cmd script. It uses highmem.exe from OpenOffice distribution for marking DLL's for loading into high memory, so you need it too. The same could be done with XUL.DLL from Mozilla, it helped me a lot. Unfortunately, not all DDL's like if they are loaded into high memory, so use it with care. It can hang your machine if used incorrectly.

2Doug Clark:

> I am using vbox 5.0.51 and it runs pretty well - except for having to pause for about 20 seconds or so between starting vbox and starting a virtual machine.

VirtualBox VM's communicate with the VBox Selector window via remote procedure call (specifically, for sending the VM screenshots for previews. So, you can try to ease your life with VBox by disabling preview updates. Just right-click on the preview window and set a "Update disabed" checkbox). Or, you could try closing the Selector window, or run VBox from the OS/2 window as "VirtualBox --startvm <vm_name>". Or, better use "VBoxSDL -s <vm_name>". The problem with PM lockups when starting the VM are present in Qt frontend, only. SDL frontend is free from it. So, you can try to set up the VM parameters in the selector window, then close it, and run a VM without the selector.

> It appears that Vbox doesnt run os/2 clients = at least that is the message I get trying to install OS/2 on vbox on a Windows 7 host. Virtual PC version 5 runs OS/2 clients just fine, on an OS/2 host. It works very will on my ECS 2.x box with a pentium 4 with 2 gb of memory circa 2001 or so. But  VirtualPC does not run on my AMD 4 core machine.

VBox runs OS/2 clients, but only with hardware virtualization enabled. Pentium 4 machines doesn't have hardware virtualization support, the same is for my Athlon 64 (1-core, socket 939- based). VirtualPC runs fine on my Athlon 64, though. Did not experimented with it on SMP machines, though (I'm unsure, but it seems, I ran VirtualPC on a Core2Duo, without any problems. Need to check.)

> I THINK it is possible to install OS/2 on the MS version of Virtual PC that is available for Windows 7. However the menu item for attaching/using a floppy drive has been removed, so it is a pain to use floppies with the MS version of Virtual PC. You apparently can do it, but it requires running a VB script and I never could get it to actually use an USB attached floppy; only floppy images.

You can try VPC 2004 or VPC 2007 from MS, I used the former to run OS/2 successfully without any problems, and IIRC, it can use floppies without problems too.

2Dave Yeo:

> Vbox needs hardware virtualization to run OS/2, enable VT-x/AMD-V under System-->Acceleration, which means you need a CPU (and BIOS and OS) that supports it. If you're using a P4, it won't work. Not sure about your AMD machine  but OS/2 itself doesn't support it so no running OS/2 on vbox with an OS/2 host.

Hardware virtualization works fine under OS/2 host (and OS/2 guest runs fine on OS/2 host. If you interested, I can post screenshots here :)), but only on OS/4 kernels at the moment. Though it is under development, it is generally working. For hardware virtualization, VBox needs a feature to run code on all CPU's in parallel in sync (the feature is called "CPU rendez-vous"). This feature is missing on IBM's kernels. OS/4 kernels has this feature available with a new KEE calls. It is possible to implement it on IBM's kernels with ACPI.PSD, but I see no interest from ArcaNoae for that to be implemented. (ACPI.PSD from Pavel Shtemenko had some function for CPU rendez-vous, but it was removed in version by David Azarevicz). And I will support IBM's kernels only in case it will be financed properly (either by ArcaNoae, or by interested community members). Unfortunately, I see no interest in this from ArcaNoae. VBox was funded by XEU a bit, but the funds are almost ended and the work requires more funding. So, for now, if you want hardware virtualization support in OS/2, use OS/4 kernel.

Valery Sedletski

  • Sr. Member
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 18
  • Posts: 256
    • View Profile
Re: Can an application be started and run in monoprocessor?
« Reply #13 on: February 28, 2019, 05:42:04 pm »
P.S.:
> It is possible to implement it on IBM's kernels with ACPI.PSD, but I see no interest from ArcaNoae for that to be implemented.

On OS/4 kernels, it works with any PSD. Tested successfully with os4apic.psd, os2apic.psd and acpi.psd. On IBM's kernels, it is possible to use ACPI.PSD, or implement this feature locally in VBoxDrv.sys driver, or create a special helper driver for that, in theory.

Doug Clark

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 122
    • View Profile
Re: Can an application be started and run in monoprocessor?
« Reply #14 on: March 09, 2019, 09:23:14 pm »
Valery,

vboxsdl.exe, which you suggested, runs much better than virtualbox.exe. On my machine it will restore a saved VM running Windows XP in 2 to 4 seconds. Wow. Faster than virtualPC on Windows 7 running on the same CPU and motherboard. And I like the user interface better: you don't have all the extra menus and icons - just the VM and a title bar. Much closer to seamless.

There are still a couple of small issues:

1) sometimes I have to run the command
vboxsdl --startvm "WindowsXP_Pro"
twice to get the vbox to start. Very rarely three times.  But I don't have to wait between tries - or rather waiting between tries doesn't seem to make any difference from executing the command immediately.

When vboxsdl doesn't start the error returned is:
fatal error: RTR3Init: VERR_INVALID_CPU_ID

2) If I need to run Firefox and vboxsdl at the same time, I have to start vbox first. If firefox is already running vboxsdl will not start. This is true no matter what the setting is for virtualAddressLimit. And after shutting down firefox I have to wait about 10 seconds before vboxsdl will start.

And - though this really isn't an issue, since the vboxsdl user interface is so minimal there is no option for saving the state of the vm when shutting down the vm. You have to do that using vboxmanage, e.g.
vboxmanage controlvm "WindowsXP_Pro" savestate

But since I use a CMD file to start vbox, it is no big deal to use a CMD file to shut down the VM and save its state. If I want to turn off the VM PC I just close the VM window.

Using vboxsdl to run a VM I would rate vbox on OS/2 as better than virtualPC xp mode on Windows 7. Vboxsdl starts faster than virtualPC/xp mode, shuts down/saves its state at least as fast, and the performance inside the VM is at least a good or better than Windows 7/VPC . Plus, from my experience, vbox is more reliable. There is the multiple tries to get vboxsdl to run hiccup on OS/2, but Windows 7/VPC/xp mode also has its issues. I have had xpmode just stop working on two difference Windows 7 machines. The only fix  was to reinstall virtual PC.

Thanks for the suggestion to run vboxsdl, and for your work on vbox.