Booting into Pharo!

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

Booting into Pharo!

Torsten Bergmann
>The idea is to build a minimalist Linux based system which would boot up
>straight into a full-screen Pharo environment.

Why use a Linux underneath when you can do it in Smalltalk ;)

Look at SqueakNOS - an operating system that was/still is able to
boot from disk right into Squeak:

http://wiki.squeak.org/squeak/1762

Accessing devices/writing drivers in Smalltalk, etc.

>Would like to know if it's some how possible to control external
>programs from within Pharo, essentially shell scripts for network setup,
>etc.

Check out the "OSProcess" package in Pharo.

Bye
T.

Reply | Threaded
Open this post in threaded view
|

Re: Booting into Pharo!

kilon.alios
I seriously doubt that SqueakNOS uses smalltalk to program the drivers


On Fri, Sep 19, 2014 at 10:36 PM, Mayuresh Kathe <[hidden email]> wrote:
Yes, that's something I would have loved to have, a single language to program everything, right from the drivers to user interface and applications.

SqueakNOS looks very interesting, but still is way behind a combination of Linux kernel + X + Pharo in terms of hardware support and maturity.

Also, in case you didn't know, there was an effort made to run Squeak directly on bare metal (Mitsubishi M32R/D) which worked like a charm, but has been suppressed for unknown reasons.

~Mayuresh



On 2014-09-20 01:00, Torsten Bergmann wrote:
The idea is to build a minimalist Linux based system which would boot up
straight into a full-screen Pharo environment.

Why use a Linux underneath when you can do it in Smalltalk ;)

Look at SqueakNOS - an operating system that was/still is able to
boot from disk right into Squeak:

http://wiki.squeak.org/squeak/1762

Accessing devices/writing drivers in Smalltalk, etc.

Would like to know if it's some how possible to control external
programs from within Pharo, essentially shell scripts for network setup,
etc.

Check out the "OSProcess" package in Pharo.

Bye
T.


Reply | Threaded
Open this post in threaded view
|

Re: Booting into Pharo!

Luc Fabresse
Hi all,

I do not remember all the details but most of SqueakNOS has been written in Smalltalk!
even some drivers ;-)

http://squeaknos.blogspot.ch/

Cheers,

#Luc

2014-09-19 21:41 GMT+02:00 kilon alios <[hidden email]>:
I seriously doubt that SqueakNOS uses smalltalk to program the drivers


On Fri, Sep 19, 2014 at 10:36 PM, Mayuresh Kathe <[hidden email]> wrote:
Yes, that's something I would have loved to have, a single language to program everything, right from the drivers to user interface and applications.

SqueakNOS looks very interesting, but still is way behind a combination of Linux kernel + X + Pharo in terms of hardware support and maturity.

Also, in case you didn't know, there was an effort made to run Squeak directly on bare metal (Mitsubishi M32R/D) which worked like a charm, but has been suppressed for unknown reasons.

~Mayuresh



On 2014-09-20 01:00, Torsten Bergmann wrote:
The idea is to build a minimalist Linux based system which would boot up
straight into a full-screen Pharo environment.

Why use a Linux underneath when you can do it in Smalltalk ;)

Look at SqueakNOS - an operating system that was/still is able to
boot from disk right into Squeak:

http://wiki.squeak.org/squeak/1762

Accessing devices/writing drivers in Smalltalk, etc.

Would like to know if it's some how possible to control external
programs from within Pharo, essentially shell scripts for network setup,
etc.

Check out the "OSProcess" package in Pharo.

Bye
T.



Reply | Threaded
Open this post in threaded view
|

Re: Booting into Pharo!

HilaireFernandes
In reply to this post by kilon.alios
Le 19/09/2014 21:41, kilon alios a écrit :
> I seriously doubt that SqueakNOS uses smalltalk to program the drivers
>

it does/did.

--
Dr. Geo - http://drgeo.eu
iStoa - http://istao.drgeo.eu


Reply | Threaded
Open this post in threaded view
|

Re: Booting into Pharo!

kilon.alios
via Slang ? 

On Fri, Sep 19, 2014 at 11:05 PM, Hilaire <[hidden email]> wrote:
Le 19/09/2014 21:41, kilon alios a écrit :
I seriously doubt that SqueakNOS uses smalltalk to program the drivers


it does/did.

--
Dr. Geo - http://drgeo.eu
iStoa - http://istao.drgeo.eu



Reply | Threaded
Open this post in threaded view
|

Re: Booting into Pharo!

EstebanLM

On 19 Sep 2014, at 22:23, kilon alios <[hidden email]> wrote:

via Slang ? 

nope. 
no compilations. 
pure smalltalk. 
after all… a compiler just translates some code into binary code…. if you can do that directly… why would you need a compiler?



On Fri, Sep 19, 2014 at 11:05 PM, Hilaire <[hidden email]> wrote:
Le 19/09/2014 21:41, kilon alios a écrit :
I seriously doubt that SqueakNOS uses smalltalk to program the drivers


it does/did.

--
Dr. Geo - http://drgeo.eu
iStoa - http://istao.drgeo.eu




Reply | Threaded
Open this post in threaded view
|

Re: Booting into Pharo!

melkyades
In reply to this post by kilon.alios


On Fri, Sep 19, 2014 at 4:41 PM, kilon alios <[hidden email]> wrote:
I seriously doubt that SqueakNOS uses smalltalk to program the drivers

Actually, it does. The thing is that most drivers can be written in Smalltalk and glued with very very little assembly. 3 years ago, during our MSc thesis we added drivers to support virtual memory management and hard drives, all of them in smalltalk. In the end, the only assembly required was for I/O, for accesing special processor registers like CR0 and CR3 and to bind a function address to a Smalltalk block (callbacks). All of this was abstracted into primitives and managed at image side.

Cheers!
Javier




On Fri, Sep 19, 2014 at 10:36 PM, Mayuresh Kathe <[hidden email]> wrote:
Yes, that's something I would have loved to have, a single language to program everything, right from the drivers to user interface and applications.

SqueakNOS looks very interesting, but still is way behind a combination of Linux kernel + X + Pharo in terms of hardware support and maturity.

Also, in case you didn't know, there was an effort made to run Squeak directly on bare metal (Mitsubishi M32R/D) which worked like a charm, but has been suppressed for unknown reasons.

~Mayuresh



On 2014-09-20 01:00, Torsten Bergmann wrote:
The idea is to build a minimalist Linux based system which would boot up
straight into a full-screen Pharo environment.

Why use a Linux underneath when you can do it in Smalltalk ;)

Look at SqueakNOS - an operating system that was/still is able to
boot from disk right into Squeak:

http://wiki.squeak.org/squeak/1762

Accessing devices/writing drivers in Smalltalk, etc.

Would like to know if it's some how possible to control external
programs from within Pharo, essentially shell scripts for network setup,
etc.

Check out the "OSProcess" package in Pharo.

Bye
T.





--
Javier Pimás
Ciudad de Buenos Aires
Reply | Threaded
Open this post in threaded view
|

Re: Booting into Pharo!

kilon.alios
I am impressed....

:)

So much potential here , lovely. 

On Sat, Sep 20, 2014 at 12:21 AM, Javier Pimás <[hidden email]> wrote:


On Fri, Sep 19, 2014 at 4:41 PM, kilon alios <[hidden email]> wrote:
I seriously doubt that SqueakNOS uses smalltalk to program the drivers

Actually, it does. The thing is that most drivers can be written in Smalltalk and glued with very very little assembly. 3 years ago, during our MSc thesis we added drivers to support virtual memory management and hard drives, all of them in smalltalk. In the end, the only assembly required was for I/O, for accesing special processor registers like CR0 and CR3 and to bind a function address to a Smalltalk block (callbacks). All of this was abstracted into primitives and managed at image side.

Cheers!
Javier




On Fri, Sep 19, 2014 at 10:36 PM, Mayuresh Kathe <[hidden email]> wrote:
Yes, that's something I would have loved to have, a single language to program everything, right from the drivers to user interface and applications.

SqueakNOS looks very interesting, but still is way behind a combination of Linux kernel + X + Pharo in terms of hardware support and maturity.

Also, in case you didn't know, there was an effort made to run Squeak directly on bare metal (Mitsubishi M32R/D) which worked like a charm, but has been suppressed for unknown reasons.

~Mayuresh



On 2014-09-20 01:00, Torsten Bergmann wrote:
The idea is to build a minimalist Linux based system which would boot up
straight into a full-screen Pharo environment.

Why use a Linux underneath when you can do it in Smalltalk ;)

Look at SqueakNOS - an operating system that was/still is able to
boot from disk right into Squeak:

http://wiki.squeak.org/squeak/1762

Accessing devices/writing drivers in Smalltalk, etc.

Would like to know if it's some how possible to control external
programs from within Pharo, essentially shell scripts for network setup,
etc.

Check out the "OSProcess" package in Pharo.

Bye
T.





--
Javier Pimás
Ciudad de Buenos Aires

Reply | Threaded
Open this post in threaded view
|

Re: Booting into Pharo!

S Krish
In reply to this post by Torsten Bergmann

try the TCL + Pharo stuff. It is simple and easy to hook up.

Tiny Core gets it down to around 20 MB for a bare bone linux + Pharo  can be similar to Android if one goes down the path.

On Fri, Sep 19, 2014 at 9:48 PM, Mayuresh Kathe <[hidden email]> wrote:
Hello,

While I am still waiting for my copy of the PBE, I would like to
initiate work on a project (along with friends).

The idea is to build a minimalist Linux based system which would boot up
straight into a full-screen Pharo environment.

The system itself would be single user, consisting of not more than a
Linux kernel, a few system utilities (busybox?), X (KDrive?) and Pharo
(vm + image + ...).

Would like to know if it's some how possible to control external
programs from within Pharo, essentially shell scripts for network setup,
etc.

Thanks,

~Mayuresh



Reply | Threaded
Open this post in threaded view
|

Re: Booting into Pharo!

Sven Van Caekenberghe-2

On 20 Sep 2014, at 06:26, Mayuresh Kathe <[hidden email]> wrote:

> I have built Linux systems which fit in 8MB of disk space (along with the GUI). Google around for "NevyOS".
>
> Building a tiny Linux system isn't what worries me, it's the probable high resource consumption of Pharo which is scary.
>
> Would Pharo be able to run in the limited compute resources offered by low cost computers like the Raspberry Pi?

It already does. But the RPi is not that small by some definitions (512MB RAM, 4GB HD, 32-bit, full linux), while for others it might be a baseline.

> ~Mayuresh
>
>
> On 2014-09-20 09:45, S Krish wrote:
>> try the TCL + Pharo stuff. It is simple and easy to hook up.
>> Tiny Core gets it down to around 20 MB for a bare bone linux + Pharo
>> can be similar to Android if one goes down the path.
>> On Fri, Sep 19, 2014 at 9:48 PM, Mayuresh Kathe <[hidden email]>
>> wrote:
>>> Hello,
>>> While I am still waiting for my copy of the PBE, I would like to
>>> initiate work on a project (along with friends).
>>> The idea is to build a minimalist Linux based system which would
>>> boot up
>>> straight into a full-screen Pharo environment.
>>> The system itself would be single user, consisting of not more than
>>> a
>>> Linux kernel, a few system utilities (busybox?), X (KDrive?) and
>>> Pharo
>>> (vm + image + ...).
>>> Would like to know if it's some how possible to control external
>>> programs from within Pharo, essentially shell scripts for network
>>> setup,
>>> etc.
>>> Thanks,
>>> ~Mayuresh
>


Reply | Threaded
Open this post in threaded view
|

Re: Booting into Pharo!

David T. Lewis
In reply to this post by Torsten Bergmann
On Sat, Sep 20, 2014 at 06:56:31PM +0530, Mayuresh Kathe wrote:

> On Sat, Sep 20, 2014 at 02:46:04PM +0200, stepharo wrote:
> >
> > On 20/9/14 08:48, Mayuresh Kathe wrote:
> > >Hello Stepharo,
> > >
> > >Thanks for writing in the detailed email.
> > >
> > >Last night I got Pharo to work on my Ubuntu Server system with minimal X
> > >and running in full-screen mode without any extra baggage like a window
> > >manager, worked like a charm.
> >
> > super!
> > I would be good to be able to publish the script and result somewhere.
>
> Not much of a script as such.
>
> Put your Pharo image, changes and sources files in your home directory.
> create/edit a file called .xinitrc containing only "exec pharo-vm-x"
> (without quotes) within your home directory.
>
> Start the X session by issuing "startx" at the command line, and the GUI
> should be up with Pharo as the only application, no need for even a
> window manager.
>
> Next, just set the Pharo session to use full-screen mode by bringing up
> the "World" menu inside Pharo, go to the "Windows" sub-menu, and choose
> "Toggle Full Screen mode", and voila, you have a Pharo full-screen
> session, as if it's your GUI, remember to save the changes when you
> quit the Pharo session (which will drop you back to your *nix shell).
>
> The next time you issue "startx" within your home directory, the GUI
> presented would be Pharo. :)
>
> Still working on making Pharo the only shell running directly atop the
> Linux kernel with X as the windowing system, yeah, tried Linux FB,
> failed.
>
> Best,
>
> ~Mayuresh
>

If you are booting directly into the image, you may find it useful to also
load CommandShell/OSProcess into your image. This will let you open a
Smalltalk shell window directly within your Squeak/Pharo boot image, so
that you have access to the operating system with actually opening any
windows or terminal sessions outside of your image.

  http://www.squeaksource.com/CommandShell
  http://www.squeaksource.com/OSProcess

Dave

Reply | Threaded
Open this post in threaded view
|

Re: Booting into Pharo!

Pierce Ng-3
On Sun, Sep 21, 2014 at 06:56:27PM -0400, David T. Lewis wrote:
> If you are booting directly into the image, you may find it useful to also
> load CommandShell/OSProcess into your image. This will let you open a
> Smalltalk shell window directly within your Squeak/Pharo boot image, so
> that you have access to the operating system with actually opening any
> windows or terminal sessions outside of your image.
>
>   http://www.squeaksource.com/CommandShell
>   http://www.squeaksource.com/OSProcess

In view of ShellShock, from a PipeableOSProcess example:

  | env |
  env := OSProcess thisOSProcess environment copy.
  env at: #SHOCKED put: '() { :;}; echo ShellShocked;'.
  (PipeableOSProcess command: 'echo Nah environment: env) output

This gives the following. (Yes, this is done on an unpatched bash for demo
purposes. Everyone should patch as soon as you can.)

  ShellShocked
  Nah

I have a webapp that shells out to some OS command line tool. I think I have
written it such that untrustworthy web input does not taint the command line
tool's environment and input. I think. Everyone doing similar may wish to
relook at it.

David, perhaps the code is already there, but can we run OS commands without
invoking the shell?

Pierce


Reply | Threaded
Open this post in threaded view
|

Re: Booting into Pharo!

David T. Lewis
> On Sun, Sep 21, 2014 at 06:56:27PM -0400, David T. Lewis wrote:
>> If you are booting directly into the image, you may find it useful to
>> also
>> load CommandShell/OSProcess into your image. This will let you open a
>> Smalltalk shell window directly within your Squeak/Pharo boot image, so
>> that you have access to the operating system with actually opening any
>> windows or terminal sessions outside of your image.
>>
>>   http://www.squeaksource.com/CommandShell
>>   http://www.squeaksource.com/OSProcess
>
> In view of ShellShock, from a PipeableOSProcess example:
>
>   | env |
>   env := OSProcess thisOSProcess environment copy.
>   env at: #SHOCKED put: '() { :;}; echo ShellShocked;'.
>   (PipeableOSProcess command: 'echo Nah environment: env) output
>
> This gives the following. (Yes, this is done on an unpatched bash for demo
> purposes. Everyone should patch as soon as you can.)
>
>   ShellShocked
>   Nah
>
> I have a webapp that shells out to some OS command line tool. I think I
> have
> written it such that untrustworthy web input does not taint the command
> line
> tool's environment and input. I think. Everyone doing similar may wish to
> relook at it.
>
> David, perhaps the code is already there, but can we run OS commands
> without
> invoking the shell?
>
> Pierce
>
>

Yes, you can run any executable command as an external OS process. It is
usually easier to run /bin/sh as the command and let the shell do the
parsing, but you can run any program you like. And you can also do the
"shell" in native Smalltalk with CommandShell, although this is not a
complete simulation of a unix shell, so sometimes it is better to use the
real /bin/sh program.

Dave



Reply | Threaded
Open this post in threaded view
|

Re: Booting into Pharo!

Sven Van Caekenberghe-2
In reply to this post by Pierce Ng-3

On 25 Sep 2014, at 18:27, Pierce Ng <[hidden email]> wrote:

> On Sun, Sep 21, 2014 at 06:56:27PM -0400, David T. Lewis wrote:
>> If you are booting directly into the image, you may find it useful to also
>> load CommandShell/OSProcess into your image. This will let you open a
>> Smalltalk shell window directly within your Squeak/Pharo boot image, so
>> that you have access to the operating system with actually opening any
>> windows or terminal sessions outside of your image.
>>
>>  http://www.squeaksource.com/CommandShell
>>  http://www.squeaksource.com/OSProcess
>
> In view of ShellShock, from a PipeableOSProcess example:
>
>  | env |
>  env := OSProcess thisOSProcess environment copy.
>  env at: #SHOCKED put: '() { :;}; echo ShellShocked;'.
>  (PipeableOSProcess command: 'echo Nah environment: env) output
>
> This gives the following. (Yes, this is done on an unpatched bash for demo
> purposes. Everyone should patch as soon as you can.)
>
>  ShellShocked
>  Nah
>
> I have a webapp that shells out to some OS command line tool. I think I have
> written it such that untrustworthy web input does not taint the command line
> tool's environment and input. I think. Everyone doing similar may wish to
> relook at it.

It is my understanding that the attack vector is cgi-bin which turns HTTP headers into environment variables, which are then interpreted as functions and executable shell code. [ which is pretty heavy/scary stuff ]

If you serve HTTP directly (Zinc/Seaside), or through a proxy (apache2 or nginx), no HTTP headers are turned into environment variables, so invoking a sub shell is safe (unless you make some other error of course). [ anyway, that is what I think ]

I disables all cgi[d] modules, we weren't using them anyway. [ but who knows what will turn up ]

> David, perhaps the code is already there, but can we run OS commands without
> invoking the shell?
>
> Pierce
>
>