nuSqueak source

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

Re: nuSqueak source

p.fazio
 
Please take me off the list

-------- Original Message --------
Subject: Re: [Vm-dev] nuSqueak source
From: K K Subbu <[hidden email]>
Date: Fri, October 30, 2020 5:39 am
To: [hidden email]


On 29/10/20 9:01 pm, Eliot Miranda wrote:
> The OS can impose radically different constraints on the JIT.  In
> Mankato it is impossible to derive an executable region from mmap that
> is at the same time writable.  On MacOS it is possible, but the VM needs
> a capability conveyed through its Info.plist and baked in when the app
> bundle is signed.

doesn't PROT_EXEC imply PROT_READ? a region with write|exec would
essentially be equivalent to an unprotected one.

> Other linuxes for Pi4 May impose different constraints.  As I only have
> these two variants I need your help in dealing with differing
> constraints on these other platforms.

I don't have a RP 4 board to test the Ubuntu aarch64 (COVID-19 lockdown
constraints). Sorry :-(.

Regards .. Subbu
Reply | Threaded
Open this post in threaded view
|

Re: nuSqueak source

p.fazio
In reply to this post by Yoshiki Ohshima-3
 

Please take me off the list
-------- Original Message --------
Subject: Re: [Vm-dev] nuSqueak source
From: <[hidden email]>
Date: Fri, October 30, 2020 5:48 am
To: "Open Smalltalk Virtual Machine Development Discussion"
<[hidden email]>


Please take me off the list

-------- Original Message --------
Subject: Re: [Vm-dev] nuSqueak source
From: K K Subbu <[hidden email]>
Date: Fri, October 30, 2020 5:39 am
To: [hidden email]


On 29/10/20 9:01 pm, Eliot Miranda wrote:
> The OS can impose radically different constraints on the JIT.  In
> Mankato it is impossible to derive an executable region from mmap that
> is at the same time writable.  On MacOS it is possible, but the VM needs
> a capability conveyed through its Info.plist and baked in when the app
> bundle is signed.

doesn't PROT_EXEC imply PROT_READ? a region with write|exec would
essentially be equivalent to an unprotected one.

> Other linuxes for Pi4 May impose different constraints.  As I only have
> these two variants I need your help in dealing with differing
> constraints on these other platforms.

I don't have a RP 4 board to test the Ubuntu aarch64 (COVID-19 lockdown
constraints). Sorry :-(.

Regards .. Subbu
Reply | Threaded
Open this post in threaded view
|

Re: nuSqueak source

Eliot Miranda-2
In reply to this post by K K Subbu
 
> On Oct 30, 2020, at 4:39 AM, K K Subbu <[hidden email]> wrote:
>
> On 29/10/20 9:01 pm, Eliot Miranda wrote:
>> The OS can impose radically different constraints on the JIT.  In Mankato it is impossible to derive an executable region from mmap that is at the same time writable.  On MacOS it is possible, but the VM needs a capability conveyed through its Info.plist and baked in when the app bundle is signed.
>
> doesn't PROT_EXEC imply PROT_READ? a region with write|exec would essentially be equivalent to an unprotected one.

I believe not. I think an instruction fetch is different at the bus
level from a normal read. I could be wrong.  There are strong security
reasons why this should be the case.

The manual page says

     The protections (region accessibility) are specified in the prot argument
     by or'ing the following values:

     PROT_NONE   Pages may not be accessed.
     PROT_READ   Pages may be read.
     PROT_WRITE  Pages may be written.
     PROT_EXEC   Pages may be executed.

     Note that, due to hardware limitations, on some platforms PROT_WRITE may
     imply PROT_READ, and PROT_READ may imply PROT_EXEC.  Portable programs
     should not rely on these flags being separately enforcable.


Note that it does *not* say that due to hardware limitations PROT_EXEC
may imply PROT_READ :-)

>> Other linuxes for Pi4 May impose different constraints.  As I only have these two variants I need your help in dealing with differing constraints on these other platforms.
>
> I don't have a RP 4 board to test the Ubuntu aarch64 (COVID-19 lockdown constraints). Sorry :-(.

They're inexpensive and fun.

>
> Regards .. Subbu
Reply | Threaded
Open this post in threaded view
|

Re: nuSqueak source

Tobias Pape
 


> On 30. Oct 2020, at 19:39, Eliot Miranda <[hidden email]> wrote:
>
>>> The OS can impose radically different constraints on the JIT.  In Mankato it is impossible to derive an executable region from mmap that is at the same time writable.  On MacOS it is possible, but the VM needs a capability conveyed through its Info.plist and baked in when the app bundle is signed.
>

In OpenBSD, your _filesystem_ must allow write&exectute-pages otherwise your program is killed when trying to mprotect a page w&x.

-t
Reply | Threaded
Open this post in threaded view
|

Re: nuSqueak source

Yoshiki Ohshima-3
In reply to this post by timrowledge
 
Yup. I just needed to fall into the same trap...

Now that we have an improved version of the VM, what is the "rest" of procedure to get the next version of Raspberry Pi OS to have the updated VM and installation?  Somebody would make an apt package?

On Wed, Oct 28, 2020 at 4:22 PM tim Rowledge <[hidden email]> wrote:
 


> On 2020-10-28, at 4:05 PM, Yoshiki Ohshima <[hidden email]> wrote:
>
> I may be simply on a wrong OS. The main reason for me to dive in again was to fix it for Raspberry Pi OS users:
>
> https://www.raspberrypi.org/downloads/raspberry-pi-os/
>
> but then it simply is not a 64bit OS I gather. It's just the compiler on targets 32 bit.

Ah, you're making a mistake made by many.

The Pi 4 (and indeed 3+, 3 and even the 2) have ARMv8 cpus. *BUT* Raspbian is a 32bit OS using the v7 support in the ARM A53 & A72 cores.
A lot of people have posted questions asking if they have been sold a 'fake' Pi after seeing that the API for querying the processor type tells them they have a 32 bit v7. That is actually an upstream Debian issue not under the control of RPF at all.

So the squeak vm supplied for the current default Raspbian (or rather, recently renamed, Raspberry Pi OS) is a 32 bit version as built in the opensmalltalk-vm⁩ ▸ ⁨build.linux32ARMv6⁩ ▸ ⁨squeak.stack.spur⁩ tree.

There *is* a 64 bit version of Raspberry PI OS that is currently in late-beta. That would need a VM from the opensmalltalk-vm⁩ ▸ ⁨build.linux32ARMv6⁩ ▸ ⁨squeak.stack.spur⁩ tree and of course a 64 bit image. That VMworks on *some* OS but not others due to some issue with the permission bits for memory being messed around in the name of some sort of security waffle. Eliot has made it work for at least some cases - Manjaro, for example. It still needs sorting out for the Pi 64bit OS.

As soon as you have a 32bit vm that handled the Japanese input stuff ok, let me know and I'll do a build and ask RPF to upload it. I don't know how many people still use it on any sort of regular basis but it certainly isn't 0, which is gratifying.



tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
On a clear disk you can seek forever...




--
-- Yoshiki

Reply | Threaded
Open this post in threaded view
|

Re: nuSqueak source

timrowledge
 


> On 2020-11-04, at 8:28 AM, Yoshiki Ohshima <[hidden email]> wrote:
>
> Yup. I just needed to fall into the same trap...

Life is full of silly traps.

>
> Now that we have an improved version of the VM, what is the "rest" of procedure to get the next version of Raspberry Pi OS to have the updated VM and installation?  Somebody would make an apt package?

What we do is make sure I can build an identical and working VM, I put together a new 5.3 based NuScratch image, we test it a bit, I pass the vm & image to RPF and they do the rest of the magic.

And of course, some documentation about how to make use of the new inputs is needed. Are there any changes to any of the translation files required? Anything else needing attention?

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Fractured Idiom:- IDIOS AMIGOS - We're wild and crazy guys!


Reply | Threaded
Open this post in threaded view
|

Re: nuSqueak source

Yoshiki Ohshima-3
 
Hi Tim,

This is probably a fix we'd do on the image side, but one thing Abe-san mentioned was that the first time playing a sound takes longer as it would be initializing the sound system. Maybe we can play a silent sound (like the sound of one hand clapping) at the start up time anyway as many Scratch projects involve sound anyway.

On Wed, Nov 4, 2020 at 1:50 PM tim Rowledge <[hidden email]> wrote:
 


> On 2020-11-04, at 8:28 AM, Yoshiki Ohshima <[hidden email]> wrote:
>
> Yup. I just needed to fall into the same trap...

Life is full of silly traps.

>
> Now that we have an improved version of the VM, what is the "rest" of procedure to get the next version of Raspberry Pi OS to have the updated VM and installation?  Somebody would make an apt package?

What we do is make sure I can build an identical and working VM, I put together a new 5.3 based NuScratch image, we test it a bit, I pass the vm & image to RPF and they do the rest of the magic.

And of course, some documentation about how to make use of the new inputs is needed. Are there any changes to any of the translation files required? Anything else needing attention?

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Fractured Idiom:- IDIOS AMIGOS - We're wild and crazy guys!




--
-- Yoshiki

Reply | Threaded
Open this post in threaded view
|

Re: nuSqueak source

timrowledge
 


> On 2020-11-05, at 7:58 PM, Yoshiki Ohshima <[hidden email]> wrote:
>
> This is probably a fix we'd do on the image side, but one thing Abe-san mentioned was that the first time playing a sound takes longer as it would be initializing the sound system.

Ah, yes, that problem. It's basically a result of the utterly pathetic sound capabilities of linuxes. The 'fun' we had with pulseaudio and so on... (un)happy days.


> Maybe we can play a silent sound (like the sound of one hand clapping) at the start up time anyway as many Scratch projects involve sound anyway.


There was, at some point, a Very Good Reason for using the 'stop sounds when done' preference. IIRC there was something about hissing background noises? We can certainly try again and see if the march of time has improved things.

There is also (as I've just been reminded by the very famous Scratcher Simon Walters) still the ancient bug of odd morph clipping when dropping a block onto another block to add it to the script. Never did manage to solve that one and it doesn't happen when you try to degub it... if anyone has any ideas...

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Strange OpCodes: SDD: Scratch Disk and Die


Reply | Threaded
Open this post in threaded view
|

Re: nuSqueak source

Yoshiki Ohshima-3
 
Another thing Abe-san told me is that the font rendering result is not good, as if anti-aliasing is not giving the right alpha.  I have not looked into it but sounds like an annoying problem.


On Fri, Nov 6, 2020 at 11:21 AM tim Rowledge <[hidden email]> wrote:
 


> On 2020-11-05, at 7:58 PM, Yoshiki Ohshima <[hidden email]> wrote:
>
> This is probably a fix we'd do on the image side, but one thing Abe-san mentioned was that the first time playing a sound takes longer as it would be initializing the sound system.

Ah, yes, that problem. It's basically a result of the utterly pathetic sound capabilities of linuxes. The 'fun' we had with pulseaudio and so on... (un)happy days.


> Maybe we can play a silent sound (like the sound of one hand clapping) at the start up time anyway as many Scratch projects involve sound anyway.


There was, at some point, a Very Good Reason for using the 'stop sounds when done' preference. IIRC there was something about hissing background noises? We can certainly try again and see if the march of time has improved things.

There is also (as I've just been reminded by the very famous Scratcher Simon Walters) still the ancient bug of odd morph clipping when dropping a block onto another block to add it to the script. Never did manage to solve that one and it doesn't happen when you try to degub it... if anyone has any ideas...

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Strange OpCodes: SDD: Scratch Disk and Die




--
-- Yoshiki

123