Minheadless VM flavour status update

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Minheadless VM flavour status update

Ronie Salgado
 
Hi all,

I am happy to announce that my latest VM refactoring experiment is almost complete. I am only missing adding traditional style Makefiles to make Eliot happy ;), and making this work with MSVC.

The minheadless is a VM variant that unifies a lot of the code for Windows, Linux and OS X. To the point that I am using the same CMake scripts for building on the three platforms.

The minheadless VM is a completely headless by default VM, unless the configure script finds SDL2.

If the configure script finds SDL2, and the legacy display interface is enabled(which is by default), then this VM will be built using SDL2 to implement the normal diplay primitives. The SDL2 backend work with normal Pharo and Squeak image.

If SDL2  is not found by the configure script, or the legacy display primitives are disabled in the configure script, or the VM is started in headless mode, then the traditional display primitives are just going to be a /dev/null.

Currently I am commiting this VM variant to the MinimalisticHeadless branch at: https://github.com/ronsaldo/opensmalltalk-vm/tree/MinimalisticHeadless

For building using CMake it can be done in two ways:

------------------------------------
Calling CMake directly

mkdir build
cmake .. -DCMAKE_BUILD_TYPE=<The build type> (or cmake-gui ..)
make

The supported build types are:
- Debug
- Assert
- RelWithDebInfo
- Release

If you are on an x86_64 system and you want to build  32 bits version, you have to pass the -DBUILD_I386_VERSION=True option to cmake.

mkdir build
cmake .. (or cmake-gui ..)
make

------------------------------------
Using mvm style scripts

Easy mode:

cd build.minheadless.cmake/<x86 or x64>/vm_variant
./mvm

A bit more complicated/flexible mode:

This mvm will configure and build the vm for the four build types. This behavior was present on the mvm for Windows, so I am replicating it.

In these same folders that are two other scripts: mvm_configure (calls cmake to only configure the build types), and mvm_configure_variant

mvm_configure_variant is used to actually call cmake and configure the VM for building. The syntax of mvm_configure_variant is the following:

mvm_configure_variant <BuildDirectory> <BuildType>

Currently my workflow for using these scripts is the following with MSys/Cygwin/Linux:

./mvm_configure
make -j8

The makefile at build.minheadless.cmake/<x86 or x64>/vm_variant is only used for delegating to the makefiles created by CMake.

------------------------------------
I am leaving some prebuilt Pharo VMs with the SDL2 backend for Windows for experimenting at: http://ronie.cl/files/vm/

Using OSWindow with this VM requires loading the latest version of OSWindow by reloading the ConfigurationOfOSWindow manually in Monticello, and then doing ConfigurationOfOSWindow load. With this VM, there are finally no more duplicated events.

My TODO list for this includes adding plain Makefile. BTW: during the following week I will continue working with Lowcode. I really need it working again.

Happy longest/shortest day of the year
Ronie
Reply | Threaded
Open this post in threaded view
|

Re: Minheadless VM flavour status update

Denis Kudriashov
 
Hi Ronie.

This is super cool.

I just compared size of VM: 1.3 mb vs 4 mb (current PharoVM). It is really nice result.

2016-12-24 22:25 GMT+01:00 Ronie Salgado <[hidden email]>:
 
Hi all,

I am happy to announce that my latest VM refactoring experiment is almost complete. I am only missing adding traditional style Makefiles to make Eliot happy ;), and making this work with MSVC.

The minheadless is a VM variant that unifies a lot of the code for Windows, Linux and OS X. To the point that I am using the same CMake scripts for building on the three platforms.

The minheadless VM is a completely headless by default VM, unless the configure script finds SDL2.

If the configure script finds SDL2, and the legacy display interface is enabled(which is by default), then this VM will be built using SDL2 to implement the normal diplay primitives. The SDL2 backend work with normal Pharo and Squeak image.

If SDL2  is not found by the configure script, or the legacy display primitives are disabled in the configure script, or the VM is started in headless mode, then the traditional display primitives are just going to be a /dev/null.

Currently I am commiting this VM variant to the MinimalisticHeadless branch at: https://github.com/ronsaldo/opensmalltalk-vm/tree/MinimalisticHeadless

For building using CMake it can be done in two ways:

------------------------------------
Calling CMake directly

mkdir build
cmake .. -DCMAKE_BUILD_TYPE=<The build type> (or cmake-gui ..)
make

The supported build types are:
- Debug
- Assert
- RelWithDebInfo
- Release

If you are on an x86_64 system and you want to build  32 bits version, you have to pass the -DBUILD_I386_VERSION=True option to cmake.

mkdir build
cmake .. (or cmake-gui ..)
make

------------------------------------
Using mvm style scripts

Easy mode:

cd build.minheadless.cmake/<x86 or x64>/vm_variant
./mvm

A bit more complicated/flexible mode:

This mvm will configure and build the vm for the four build types. This behavior was present on the mvm for Windows, so I am replicating it.

In these same folders that are two other scripts: mvm_configure (calls cmake to only configure the build types), and mvm_configure_variant

mvm_configure_variant is used to actually call cmake and configure the VM for building. The syntax of mvm_configure_variant is the following:

mvm_configure_variant <BuildDirectory> <BuildType>

Currently my workflow for using these scripts is the following with MSys/Cygwin/Linux:

./mvm_configure
make -j8

The makefile at build.minheadless.cmake/<x86 or x64>/vm_variant is only used for delegating to the makefiles created by CMake.

------------------------------------
I am leaving some prebuilt Pharo VMs with the SDL2 backend for Windows for experimenting at: http://ronie.cl/files/vm/

Using OSWindow with this VM requires loading the latest version of OSWindow by reloading the ConfigurationOfOSWindow manually in Monticello, and then doing ConfigurationOfOSWindow load. With this VM, there are finally no more duplicated events.

My TODO list for this includes adding plain Makefile. BTW: during the following week I will continue working with Lowcode. I really need it working again.

Happy longest/shortest day of the year
Ronie


Reply | Threaded
Open this post in threaded view
|

Re: Minheadless VM flavour status update

EstebanLM
In reply to this post by Ronie Salgado
 
Hi Ronie, 

this is cool :)

btw… I do not think the VM should open any windowing system in any way. 
This should be a task performed at image level, IMO.

Esteban

On 24 Dec 2016, at 22:25, Ronie Salgado <[hidden email]> wrote:

Hi all,

I am happy to announce that my latest VM refactoring experiment is almost complete. I am only missing adding traditional style Makefiles to make Eliot happy ;), and making this work with MSVC.

The minheadless is a VM variant that unifies a lot of the code for Windows, Linux and OS X. To the point that I am using the same CMake scripts for building on the three platforms.

The minheadless VM is a completely headless by default VM, unless the configure script finds SDL2.

If the configure script finds SDL2, and the legacy display interface is enabled(which is by default), then this VM will be built using SDL2 to implement the normal diplay primitives. The SDL2 backend work with normal Pharo and Squeak image.

If SDL2  is not found by the configure script, or the legacy display primitives are disabled in the configure script, or the VM is started in headless mode, then the traditional display primitives are just going to be a /dev/null.

Currently I am commiting this VM variant to the MinimalisticHeadless branch at: https://github.com/ronsaldo/opensmalltalk-vm/tree/MinimalisticHeadless

For building using CMake it can be done in two ways:

------------------------------------
Calling CMake directly

mkdir build
cmake .. -DCMAKE_BUILD_TYPE=<The build type> (or cmake-gui ..)
make

The supported build types are:
- Debug
- Assert
- RelWithDebInfo
- Release

If you are on an x86_64 system and you want to build  32 bits version, you have to pass the -DBUILD_I386_VERSION=True option to cmake.

mkdir build
cmake .. (or cmake-gui ..)
make

------------------------------------
Using mvm style scripts

Easy mode:

cd build.minheadless.cmake/<x86 or x64>/vm_variant
./mvm

A bit more complicated/flexible mode:

This mvm will configure and build the vm for the four build types. This behavior was present on the mvm for Windows, so I am replicating it.

In these same folders that are two other scripts: mvm_configure (calls cmake to only configure the build types), and mvm_configure_variant

mvm_configure_variant is used to actually call cmake and configure the VM for building. The syntax of mvm_configure_variant is the following:

mvm_configure_variant <BuildDirectory> <BuildType>

Currently my workflow for using these scripts is the following with MSys/Cygwin/Linux:

./mvm_configure
make -j8

The makefile at build.minheadless.cmake/<x86 or x64>/vm_variant is only used for delegating to the makefiles created by CMake.

------------------------------------
I am leaving some prebuilt Pharo VMs with the SDL2 backend for Windows for experimenting at: http://ronie.cl/files/vm/

Using OSWindow with this VM requires loading the latest version of OSWindow by reloading the ConfigurationOfOSWindow manually in Monticello, and then doing ConfigurationOfOSWindow load. With this VM, there are finally no more duplicated events.

My TODO list for this includes adding plain Makefile. BTW: during the following week I will continue working with Lowcode. I really need it working again.

Happy longest/shortest day of the year
Ronie

Reply | Threaded
Open this post in threaded view
|

Re: Minheadless VM flavour status update

Ronie Salgado
 
Hello,

I just compared size of VM: 1.3 mb vs 4 mb (current PharoVM). It is really nice result.
This probably because I am building with a less number of internal plugins.
 
2016-12-26 15:36 GMT-03:00 Esteban Lorenzano <[hidden email]>:
btw… I do not think the VM should open any windowing system in any way. 
This should be a task performed at image level, IMO.
I agree. I am doing the SDL2 backend as a stepping stone until we can get rid completely of it.  With this VM, to disable the legacy backend completely is just a matter of building with the -DSUPPORT_TRADITIONAL_DISPLAY=Off.

BTW, I forgot to mention that I did basic embedding interface available at: https://github.com/ronsaldo/opensmalltalk-vm/blob/MinimalisticHeadless/include/SqueakVirtualMachine.h . For usage ordering, take a look at the squeak_main function at: https://github.com/ronsaldo/opensmalltalk-vm/blob/MinimalisticHeadless/platforms/minheadless/common/sqVirtualMachineInterface.c . My main(and WinMain) functions are used to only call  squeak_main.

Best regards,
Ronie
Reply | Threaded
Open this post in threaded view
|

Re: Minheadless VM flavour status update

timrowledge
In reply to this post by EstebanLM
 

> On 26-12-2016, at 10:36 AM, Esteban Lorenzano <[hidden email]> wrote:
>
> btw… I do not think the VM should open any windowing system in any way.
> This should be a task performed at image level, IMO.

I agree - and have been saying this since around 1996. Amongst other things it’s what the HostWindowPlugin is intended to help with.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Always try to be modest. And be damn proud of it!


Reply | Threaded
Open this post in threaded view
|

Re: Minheadless VM flavour status update

Pavel Krivanek-3
In reply to this post by Ronie Salgado
 
Ronie,

nice job! How the embedded VM will behave from the perspective of the C/C++ application? How do you expect that the C side and VM will comunicate and excange data?

Cheers,
-- Pavel

2016-12-24 22:25 GMT+01:00 Ronie Salgado <[hidden email]>:
 
Hi all,

I am happy to announce that my latest VM refactoring experiment is almost complete. I am only missing adding traditional style Makefiles to make Eliot happy ;), and making this work with MSVC.

The minheadless is a VM variant that unifies a lot of the code for Windows, Linux and OS X. To the point that I am using the same CMake scripts for building on the three platforms.

The minheadless VM is a completely headless by default VM, unless the configure script finds SDL2.

If the configure script finds SDL2, and the legacy display interface is enabled(which is by default), then this VM will be built using SDL2 to implement the normal diplay primitives. The SDL2 backend work with normal Pharo and Squeak image.

If SDL2  is not found by the configure script, or the legacy display primitives are disabled in the configure script, or the VM is started in headless mode, then the traditional display primitives are just going to be a /dev/null.

Currently I am commiting this VM variant to the MinimalisticHeadless branch at: https://github.com/ronsaldo/opensmalltalk-vm/tree/MinimalisticHeadless

For building using CMake it can be done in two ways:

------------------------------------
Calling CMake directly

mkdir build
cmake .. -DCMAKE_BUILD_TYPE=<The build type> (or cmake-gui ..)
make

The supported build types are:
- Debug
- Assert
- RelWithDebInfo
- Release

If you are on an x86_64 system and you want to build  32 bits version, you have to pass the -DBUILD_I386_VERSION=True option to cmake.

mkdir build
cmake .. (or cmake-gui ..)
make

------------------------------------
Using mvm style scripts

Easy mode:

cd build.minheadless.cmake/<x86 or x64>/vm_variant
./mvm

A bit more complicated/flexible mode:

This mvm will configure and build the vm for the four build types. This behavior was present on the mvm for Windows, so I am replicating it.

In these same folders that are two other scripts: mvm_configure (calls cmake to only configure the build types), and mvm_configure_variant

mvm_configure_variant is used to actually call cmake and configure the VM for building. The syntax of mvm_configure_variant is the following:

mvm_configure_variant <BuildDirectory> <BuildType>

Currently my workflow for using these scripts is the following with MSys/Cygwin/Linux:

./mvm_configure
make -j8

The makefile at build.minheadless.cmake/<x86 or x64>/vm_variant is only used for delegating to the makefiles created by CMake.

------------------------------------
I am leaving some prebuilt Pharo VMs with the SDL2 backend for Windows for experimenting at: http://ronie.cl/files/vm/

Using OSWindow with this VM requires loading the latest version of OSWindow by reloading the ConfigurationOfOSWindow manually in Monticello, and then doing ConfigurationOfOSWindow load. With this VM, there are finally no more duplicated events.

My TODO list for this includes adding plain Makefile. BTW: during the following week I will continue working with Lowcode. I really need it working again.

Happy longest/shortest day of the year
Ronie


Reply | Threaded
Open this post in threaded view
|

Re: Minheadless VM flavour status update

Igor Stasenko
In reply to this post by timrowledge
 


On 26 December 2016 at 21:53, tim Rowledge <[hidden email]> wrote:


> On 26-12-2016, at 10:36 AM, Esteban Lorenzano <[hidden email]> wrote:
>
> btw… I do not think the VM should open any windowing system in any way.
> This should be a task performed at image level, IMO.

I agree - and have been saying this since around 1996. Amongst other things it’s what the HostWindowPlugin is intended to help with.

amen!
 
tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Always try to be modest. And be damn proud of it!





--
Best regards,
Igor Stasenko.