Re: [Pharo-dev] [Vm-dev] [ANN] PharoNOS

2017-03-22 Thread Igor Stasenko
On 23 March 2017 at 00:03, Ronie Salgado  wrote:

>
> Hi,
>
> With the experimental Lowcode backend for the UFFI, it is possible to call
> functions with almost arbitrary calling conventions. For some of the
> special assembly instructions that are required by this project, I could
> add the following extra instruction:
>  - storeIntoSpecialRegister: {CR0, CR1, CR2, CR3, CR4, CR5, GDT, LDT, IDT)
>  - loadFromSpecialRegister:
>  - loadFromIOPortU?Int{8,16,32}:
>  - storeIntoIOPortU?Int{8,16,32}:
>
> As for the interruptions, there are far trickier because they can be
> triggered in any time. They probably would require some special trampoline
> for storing/restoring the VM state, something similar to the callbacks.
>
> Currently I am finishing a refactoring of the Lowcode register allocator,
> so the Lowcode VM is out of service for this week :) .
>
> Hey, guys, i'd like to stress, that AsmJit
>> is quite standalone part of NB, and nothing prevents you to use it in own
>> way, not the way NB was..
>> Because NB was born to make nice integration between machine code and VM
>> , and providing FFI,
>> and as a demonstration that generating machine code IS possible and quite
>> doable from within an image.
>>
>> But there's a tons of ways how you could generate machine code, and then
>> use it outside the scope of FFI.
>> You could just make own llittle primitive, that just makes a call on
>> arbitrary address, and put your generated code on it.. Voila.
>> Again, you could store generated code not in method(s) trailer , but
>> somewhere else.. it just up to you, after all.
>> For instance i had parts that were storing generated code directly in
>> COG's JITter, replacing its primitive section.
>> So, that make a nice integration with JIT, that just using your code as a
>> primitive for given method..
>> All is doable, when you working at lowest level, you just need to think
>> how to expose it in convenient way.
>>
>
> For GPU compilation, I implemented a SSA based intermediate representation
> very similar to the one used by LLVM. As a experiment, I did a very basic
> machine code generator which can produce relocatable ELF32 and ELF64 object
> files, which can be linked with any C library or program. With this I
> managed to implement a basic ahead of time compiled Smalltalk runtime.
>
> Before starting that backend, I took a look on AsmJit and the VirtualCPU
> and I did not like the dependencies and some details about the stack.
> However, now I do not like the low level backend so I started refactoring
> into a separate package, but I still think that I should take yet another
> look to AsmJit and the VirtualCPU, so I am wondering where is actually
> located the latest version of these two projects.
>
> IIRC, the stack (but more precisely - temporaries) management in AsmJIT
are implemented in own classes, that doing the job of allocating stack
space and assigning each temporary to specific place on stack.
As well, as calling convention. Nothing prevents you from adding own by
implementing their protocol(s).
Or you may leave it as a whole, except that then you'll have to handle it
by yourself. And of course, it is already there, since initial version has
no such functionality at all,
all you have to do is to tell:
asm noStackFrame.
And so, it will leave you without it.

As for where it located - see at smalltalkhub , if i remember Max  were
working on that and made quite complete coverage of ARM instruction set. (
http://smalltalkhub.com/#!/~maxmattone/AsmJit-ARM)
I don't remember if we merged the ARM support into main branch.. But i
think you can figure it out.

P.S. ohh, you see.. it just never ending quest to keep dispelling people's
perception, that there's something impossible or wrong with these things
or that's there are something that won't make things possible.. So, they
choose to go with C :)

Best regards,
> Ronie
>
>
-- 
Best regards,
Igor Stasenko.


Re: [Pharo-dev] More Windows VM Crashing -_-

2017-03-22 Thread Esteban Lorenzano
Hi, 

I do not think this is a windows problem. 
At least, I had some crashes when performing compaction last days too… this is 
a crash I collected 10 mins ago, in a mac. 

cheers, 
Esteban



crash.dmp
Description: Binary data


> On 22 Mar 2017, at 10:31, Peter Uhnak  wrote:
> 
> Hi,
> 
> Originally I thought my VM is crashing because of FT, so I applied some fix 
> from FogBugz (that is now part of Pharo 6), but that didn't help.
> 
> So I disabled FT in settings and changed fonts to non-FT ones; didn't help.
> So I completely removed FT2Plugin.dll (now settings just states that FT fonts 
> are not available), but that didn't help either.
> 
> And obviously there is no crash.dmp whatsoever (this is latest Windows VM).
> 
> This crash is extremely frustrating because the crash happens _during 
> saving_, which means I am losing code all the time and have to constantly 
> recover them, which really makes my blood boil.
> 
> Without crash dump I don't even know where and how to start investigating. 
> Windows kindly opens Visual Studio when Pharo crashes, but all it shows to me 
> is assembly, which is not very useful to me. I can somewhat orient myself in 
> the C code of the VM (as I've alredy fixed some other issues in the VM), but 
> here I am lost.
> 
> 
> 00407D7F  ret  
> 00407D80  mov eax,dword ptr ds:[00596E44h]  
> 00407D85  testal,3  
> 00407D87  jne 00407DB2  
> 00407D89  mov ecx,dword ptr ds:[596E08h]  
> 00407D8F  lea edx,[ecx-1]  
> 00407D92  cmp eax,edx  
> 00407D94  jb  00407DB2  
> 00407D96  cmp dword ptr ds:[596E10h],eax  
> 00407D9C  jb  00407DB2  
> 00407D9E  mov ecx,dword ptr ds:[5B89D0h]  
> 00407DA4  cmp dword ptr [eax-4],ecx  
> 00407DA7  jb  00407DB2  
> 00407DA9  mov eax,dword ptr ds:[00596E28h]  
> ---> 00407DAE  movzx   eax,byte ptr [eax]  
> 00407DB1  ret  
> 
> eax = 
> ecx = 0470
> 
> 
> So my question I guess is:
> How can we fix this? How can I help fix this? Because I've lost countless 
> days of time and energy on this f***ing problem...
> 
> Peter
> 



Re: [Pharo-dev] [ANN] PharoNOS

2017-03-22 Thread Igor Stasenko
Hey, guys, i'd like to stress, that AsmJit
is quite standalone part of NB, and nothing prevents you to use it in own
way, not the way NB was..
Because NB was born to make nice integration between machine code and VM ,
and providing FFI,
and as a demonstration that generating machine code IS possible and quite
doable from within an image.

But there's a tons of ways how you could generate machine code, and then
use it outside the scope of FFI.
You could just make own llittle primitive, that just makes a call on
arbitrary address, and put your generated code on it.. Voila.
Again, you could store generated code not in method(s) trailer , but
somewhere else.. it just up to you, after all.
For instance i had parts that were storing generated code directly in COG's
JITter, replacing its primitive section.
So, that make a nice integration with JIT, that just using your code as a
primitive for given method..
All is doable, when you working at lowest level, you just need to think how
to expose it in convenient way.

-- 
Best regards,
Igor Stasenko.


Re: [Pharo-dev] [ANN] PharoNOS

2017-03-22 Thread Javier Pimás
Cool!!! I just tried and loads nicely :))).

For the curious, easy way to test (ubuntu 16.04):

you'll need qemu (sudo apt-get install qemu)

unzip
chmod +x NOS.img
qemu-system-i386 NOS.img
enjoy!

Cheers!!!
Pocho

On Wed, Mar 22, 2017 at 12:40 PM, jan.struz  wrote:

> It is working now, thanks for feedback.
> Link here - Download the latest build artifact for PharoNOS
> 
> Save The World!
>
> --
> View this message in context: Re: [ANN] PharoNOS
> 
> Sent from the Pharo Smalltalk Developers mailing list archive
>  at
> Nabble.com.
>



-- 
Javier Pimás
Ciudad de Buenos Aires


Re: [Pharo-dev] [ANN] PharoNOS

2017-03-22 Thread jan.struz
It is working now, thanks for feedback.
Link here -  Download the latest build artifact for PharoNOS

  



-
Save The World!
--
View this message in context: 
http://forum.world.st/ANN-PharoNOS-tp4939247p4939643.html
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.

Re: [Pharo-dev] [ANN] PharoNOS

2017-03-22 Thread Hernan Wilkinson
Hi Jan,
 I tried to download the artifacts but I get a 404 error (the link related
with the "Download artifacts" is
https://gitlab.com/johnnyzz/pharo-nos-build/builds/12516481/artifacts/download).
..

On Wed, Mar 22, 2017 at 10:52 AM, jan.struz  wrote:

> Hi Hernan,
> the disk image is built on CI, you can find it under "Pipelines", go to
> https://gitlab.com/johnnyzz/pharo-nos-build/pipelines and you will see
> the download button ("Download artifacts").
> The archive contains the raw disk image, and the .kernel file.
> The "dev-build" project, you requested access to, is intended to build a
> "Docker image" with the build environment, if you had problem there, it was
> because I forgot to allow public access to this repository. It is now fixed.
> Jan
> Save The World!
>
> --
> View this message in context: Re: [ANN] PharoNOS
> 
>
> Sent from the Pharo Smalltalk Developers mailing list archive
>  at
> Nabble.com.
>



-- 

*Hernán WilkinsonAgile Software Development, Teaching & Coaching*
*Phone: +54-011*-4893-2057
*Twitter: @HernanWilkinson*
*site: http://www.10Pines.com *
Address: Alem 896, Floor 6, Buenos Aires, Argentina


Re: [Pharo-dev] [ANN] PharoNOS

2017-03-22 Thread jan.struz
Hi Hernan,
the disk image is built on CI, you can find it under "Pipelines", go to 
https://gitlab.com/johnnyzz/pharo-nos-build/pipelines
   and you will see
the download button ("Download artifacts").
The archive contains the raw disk image, and the .kernel file.
The "dev-build" project, you requested access to, is intended to build a
"Docker image" with the build environment, if you had problem there, it was
because I forgot to allow public access to this repository. It is now fixed.
Jan



-
Save The World!
--
View this message in context: 
http://forum.world.st/ANN-PharoNOS-tp4939247p4939628.html
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.

Re: [Pharo-dev] Pharo 6 vm crashed when pasting a big file

2017-03-22 Thread Eliot Miranda
Hi Thomas,

can you look at the crash.dmp file and post it here?  If it contains more 
than one report please edit it to include only the relevant report.

Can you keep a copy of the file and the image so we can try and reproduce car 
the bug also?

Thanks
Eliot
_,,,^..^,,,_ (phone)

> On Mar 22, 2017, at 5:44 AM, tdupr...@ens-paris-saclay.fr wrote:
> 
> Quoting Nicolai Hess :
> 
>> 2017-03-22 11:04 GMT+01:00 :
>> 
>>> Hi,
>>> 
>>> The pharo 6 vm crashed when I pasted a long text file in the body of a
>>> method.
>>> Surprisingly, the vm did not crashed when I pasted a file of approximately
>>> the same size but only containing a single string ('adafcawa' copy-pasted
>>> on 8000 lines).
>>> 
>>> The crash occured after I:
>>> - Opened a fresh image (60450)
>>> - Created a package, with a single class, with a single method
>>> - Tried to paste the content of the attached file into the methods body
>>> (the vm froze for 20-30 seconds then crashed)
>>> 
>>> Ubuntu 16.04 LTS
>>> 64 bits
>>> vm obtained from http://get.pharo.org/ (the '60+vm' package)
>>> image 60450
>>> 
>>> Thomas
>>> 
>> 
>> 
>> Hi,
>> this is somehow related to syntax highlighting and that the parser for
>> syntax highlighting stops due to a syntax error.
>> You can disable syntax highlighting.
>> SHPreferences enabled:false.
>> 
>> And if you just paste this code as a string
>> 
>> foo
>> ^ 'YOUR_FILE_CONTENTS'
>> 
>> the syntax error occurs from line 35 of your file contents:
>> 
>> Other Elements. All syntactic structures that don't fall
>> 
>> this lines contains a quote and the parser tries to parse the remaining
>> part as code.
>> 
>> What I don't understand, sometimes it is working (code pane just shows the
>> code with all after the text
>> "don't" highlighted red, indicating a syntax error). And sometimes it does
>> not work and  the vm just consumes a
>> ridiculous amount of memory ~ 1GB.
>> 
> 
> Ok, thanks. I got around it by pasting the file pieces by pieces.
> 
> Although I'm not sure it's all there is, because even pasting the content of 
> the file after having removed this quote (and checked that it was the only 
> quote of the file) into the method body crashes the vm.
> 
> foo
> ^ 'FILE_CONTENT_WITHOUT_QUOTES'
> 
> Thomas
> 
> 



Re: [Pharo-dev] Pharo 6 vm crashed when pasting a big file

2017-03-22 Thread tdupriez

Quoting Nicolai Hess :


2017-03-22 11:04 GMT+01:00 :


Hi,

The pharo 6 vm crashed when I pasted a long text file in the body of a
method.
Surprisingly, the vm did not crashed when I pasted a file of approximately
the same size but only containing a single string ('adafcawa' copy-pasted
on 8000 lines).

The crash occured after I:
- Opened a fresh image (60450)
- Created a package, with a single class, with a single method
- Tried to paste the content of the attached file into the methods body
(the vm froze for 20-30 seconds then crashed)

Ubuntu 16.04 LTS
64 bits
vm obtained from http://get.pharo.org/ (the '60+vm' package)
image 60450

Thomas




Hi,
this is somehow related to syntax highlighting and that the parser for
syntax highlighting stops due to a syntax error.
You can disable syntax highlighting.
SHPreferences enabled:false.

And if you just paste this code as a string

foo
^ 'YOUR_FILE_CONTENTS'

the syntax error occurs from line 35 of your file contents:

 Other Elements. All syntactic structures that don't fall

this lines contains a quote and the parser tries to parse the remaining
part as code.

What I don't understand, sometimes it is working (code pane just shows the
code with all after the text
"don't" highlighted red, indicating a syntax error). And sometimes it does
not work and  the vm just consumes a
ridiculous amount of memory ~ 1GB.



Ok, thanks. I got around it by pasting the file pieces by pieces.

Although I'm not sure it's all there is, because even pasting the  
content of the file after having removed this quote (and checked that  
it was the only quote of the file) into the method body crashes the vm.


foo
^ 'FILE_CONTENT_WITHOUT_QUOTES'

Thomas




Re: [Pharo-dev] [ANN] PharoNOS

2017-03-22 Thread Hernan Wilkinson
Hi Jan,
 I feel kind of stupid but I can not find how to download a disk image to
bootstrap... I don't see them on gitlab, could you give me a hint? :-)

Thanks!
Hernan.

On Sat, Mar 18, 2017 at 8:30 PM, jan.struz  wrote:

> Hi,
> I successfully ported SqueakNOS to Pharo, and want to share it with you!
> It works with Pharo 4.0 image, networking included, ping works!
>
> *What is different:*
> - I use my own CMake build file, with "out-of-tree" build support, instead
> of "build.xyz" directories inside source tree + some template scripts to
> build any VM type, but it is not complete...
> - I use MUSL  instead of GlibC,
> cross-compiling GlibC statically on 64bit for 32bit seems impossible, but
> anyway I use 32bit environment to build it
> - It works with pre-opensmalltalk-vm migration directory structure, so the
> "sync" with latest trunk remains #TODO, or maybe start a new branch again
> from the latest upstream commit should work too
> - freetype is included, but will not load any fonts, since the filesystem
> driver is image-side... so you will need to make new fonts embedded, if you
> want them
> - known issues: image snapshot and fileout are not working, current
> date+time hacked to make fat32 timestamps work
> - revision needed: timer (heartbeat) vs. GC vs. interrupts enable/disable
> - there are even some hacks to image-side methods
>
> *PharoNOS platform directory sources: [pharonos branch]*
> SRC: https://gitlab.com/johnnyzz/pharonos
>
> *VM sources: [dev branch]*
> SRC: https://gitlab.com/johnnyzz/pharo-vm
> - added platform directory, build scripts and CMake templates
> - added VMMaker configs
>
> *Build Environment (32bit) - Docker image repository, with CI:*
> https://gitlab.com/johnnyzz/dev-build
>
> *PharoNOS CI (uses previous Docker image):*
> CI: https://gitlab.com/johnnyzz/pharo-nos-build
>
> *How to run it:*
> You can download fresh disk image from CI and then run:
> (sudo) kvm -hda build/NOS.img -enable-kvm -cpu kvm32 -vga qxl -m 256
> -netdev tap,id=user.3,ifname=tap2,vhost=on -net
> nic,model=rtl8139,netdev=user.3 -global isa-fdc.driveA= -serial stdio
>
> *One more thing:*
> Statically linked Pharo Spur32 (headless) VM, with only one dependency -
> Linux kernel:
> CI: https://gitlab.com/johnnyzz/pharo-build-static
> Size: 2,4MB (too big?, but Freetype included too!)
>
> enjoy
>
> Jan
> Save The World!
>
> --
> View this message in context: [ANN] PharoNOS
> 
> Sent from the Pharo Smalltalk Developers mailing list archive
>  at
> Nabble.com.
>



-- 

*Hernán WilkinsonAgile Software Development, Teaching & Coaching*
*Phone: +54-011*-4893-2057
*Twitter: @HernanWilkinson*
*site: http://www.10Pines.com *
Address: Alem 896, Floor 6, Buenos Aires, Argentina


Re: [Pharo-dev] More Windows VM Crashing -_-

2017-03-22 Thread Nicolai Hess
2017-03-22 10:31 GMT+01:00 Peter Uhnak :

> Hi,
>
> Originally I thought my VM is crashing because of FT, so I applied some
> fix from FogBugz (that is now part of Pharo 6), but that didn't help.
>
> So I disabled FT in settings and changed fonts to non-FT ones; didn't help.
> So I completely removed FT2Plugin.dll (now settings just states that FT
> fonts are not available), but that didn't help either.
>
> And obviously there is no crash.dmp whatsoever (this is latest Windows VM).
>
> This crash is extremely frustrating because the crash happens _during
> saving_, which means I am losing code all the time and have to constantly
> recover them, which really makes my blood boil.
>
> Without crash dump I don't even know where and how to start investigating.
> Windows kindly opens Visual Studio when Pharo crashes, but all it shows to
> me is assembly, which is not very useful to me. I can somewhat orient
> myself in the C code of the VM (as I've alredy fixed some other issues in
> the VM), but here I am lost.
>
> 
> 00407D7F  ret
> 00407D80  mov eax,dword ptr ds:[00596E44h]
> 00407D85  testal,3
> 00407D87  jne 00407DB2
> 00407D89  mov ecx,dword ptr ds:[596E08h]
> 00407D8F  lea edx,[ecx-1]
> 00407D92  cmp eax,edx
> 00407D94  jb  00407DB2
> 00407D96  cmp dword ptr ds:[596E10h],eax
> 00407D9C  jb  00407DB2
> 00407D9E  mov ecx,dword ptr ds:[5B89D0h]
> 00407DA4  cmp dword ptr [eax-4],ecx
> 00407DA7  jb  00407DB2
> 00407DA9  mov eax,dword ptr ds:[00596E28h]
> ---> 00407DAE  movzx   eax,byte ptr [eax]
> 00407DB1  ret
>
> eax = 
> ecx = 0470
> 
>
> So my question I guess is:
> How can we fix this? How can I help fix this? Because I've lost countless
> days of time and energy on this f***ing problem...
>
> Peter
>
>
Maybe it would help if other people try to reproduce this error.
Can you share the image/code you are using ?

Do you have a mingw build environment ? Sometimes it helps to start the vm
with gdb, and if an exception occurs that does not write a crash.dmp, if
you are lucky, gdb will show some additional information.


(for me, the latest windows vm *sometimes* does create a crash.dmp).


Re: [Pharo-dev] Pharo 6 vm crashed when pasting a big file

2017-03-22 Thread Nicolai Hess
2017-03-22 11:04 GMT+01:00 :

> Hi,
>
> The pharo 6 vm crashed when I pasted a long text file in the body of a
> method.
> Surprisingly, the vm did not crashed when I pasted a file of approximately
> the same size but only containing a single string ('adafcawa' copy-pasted
> on 8000 lines).
>
> The crash occured after I:
> - Opened a fresh image (60450)
> - Created a package, with a single class, with a single method
> - Tried to paste the content of the attached file into the methods body
> (the vm froze for 20-30 seconds then crashed)
>
> Ubuntu 16.04 LTS
> 64 bits
> vm obtained from http://get.pharo.org/ (the '60+vm' package)
> image 60450
>
> Thomas
>


Hi,
this is somehow related to syntax highlighting and that the parser for
syntax highlighting stops due to a syntax error.
You can disable syntax highlighting.
SHPreferences enabled:false.

And if you just paste this code as a string

foo
^ 'YOUR_FILE_CONTENTS'

the syntax error occurs from line 35 of your file contents:

 Other Elements. All syntactic structures that don't fall

this lines contains a quote and the parser tries to parse the remaining
part as code.

What I don't understand, sometimes it is working (code pane just shows the
code with all after the text
"don't" highlighted red, indicating a syntax error). And sometimes it does
not work and  the vm just consumes a
ridiculous amount of memory ~ 1GB.


[Pharo-dev] More Windows VM Crashing -_-

2017-03-22 Thread Peter Uhnak
Hi,

Originally I thought my VM is crashing because of FT, so I applied some fix 
from FogBugz (that is now part of Pharo 6), but that didn't help.

So I disabled FT in settings and changed fonts to non-FT ones; didn't help.
So I completely removed FT2Plugin.dll (now settings just states that FT fonts 
are not available), but that didn't help either.

And obviously there is no crash.dmp whatsoever (this is latest Windows VM).

This crash is extremely frustrating because the crash happens _during saving_, 
which means I am losing code all the time and have to constantly recover them, 
which really makes my blood boil.

Without crash dump I don't even know where and how to start investigating. 
Windows kindly opens Visual Studio when Pharo crashes, but all it shows to me 
is assembly, which is not very useful to me. I can somewhat orient myself in 
the C code of the VM (as I've alredy fixed some other issues in the VM), but 
here I am lost.


00407D7F  ret  
00407D80  mov eax,dword ptr ds:[00596E44h]  
00407D85  testal,3  
00407D87  jne 00407DB2  
00407D89  mov ecx,dword ptr ds:[596E08h]  
00407D8F  lea edx,[ecx-1]  
00407D92  cmp eax,edx  
00407D94  jb  00407DB2  
00407D96  cmp dword ptr ds:[596E10h],eax  
00407D9C  jb  00407DB2  
00407D9E  mov ecx,dword ptr ds:[5B89D0h]  
00407DA4  cmp dword ptr [eax-4],ecx  
00407DA7  jb  00407DB2  
00407DA9  mov eax,dword ptr ds:[00596E28h]  
---> 00407DAE  movzx   eax,byte ptr [eax]  
00407DB1  ret  

eax = 
ecx = 0470


So my question I guess is:
How can we fix this? How can I help fix this? Because I've lost countless days 
of time and energy on this f***ing problem...

Peter



[Pharo-dev] Collecting of event data still needed?

2017-03-22 Thread Pavel Krivanek
>From a Slack discussion:

Alexandre Bergel [6:03 PM]
@uko  : Do we still need the usage data ?

Alexandre Bergel [6:03 PM]
Having this large red bar is a bit aggressive

Yuriy Tymchuk [6:06 PM]
Data is always useful. Now as I end my Ph.D. I will not have time to
investigate the collected data any more, so the question is does anybody
else care about the collected data, because yes, I can just remove it. By
the way, I just reuse the morph from Spotter, so it is up to them to define
the style :slightly_smiling_face:

-

So the question is: do we still need to display appeal for sending usage
data in Pharo 7? Is anyone analyzing it or do we only irritate users? Such
request can be in the Welcome window.

Cheers,
-- Pavel