2013/1/14 JonY <[email protected]>
> On 1/14/2013 17:29, Ruben Van Boxem wrote:
> > Hey guys,
> >
> > I couldn't sleep last night and thought of this: MSYS is a fork of
> Cygwin,
> > which introduced a bunch of POSIX runtime stuff to be able to run all
> them
> > shell commands.
> >
> > What if someone were to write an sh interpreter that used special tricks
> to
> > manipulate directory names when it calls programs, which were all
> compiled
> > for native Win32? The sh interpreter could act as a process/thread
> manager
> > that handles all the shell's forking.
> >
>
> It is called a VM, one such program is called VirtualBox.
>
A VM is not a sh interpreter. A VM needs an OS that needs maintenance and
setup (and CPU power and memory).
>
> But seriously, you will probably end up writing your own PE loader to
> simulate fork(), since specs say new process must have exact memory
> layout as the parent, not to mention Posix signaling pipelines to route
> to the correct process. fork() is especially tricky since win32 is
> lacking anything similar unless you go with undocumented Vista+ APIs
> that I heard rumors about.
>
Well yes. But I would like to draw a fine (make that an extremely, very
thin line) between the shell and its programs: all executables will be
Win32 native executables, using nothing POSIX specific. Heck, I'll port
Coreutils and its brethren on top of the bare Win32 API if I find the
motivation ;-).
I'm not sure to what extent the shell interpreter in the role of running
configure scripts requires specific memory layout stuff specifies in the
POSIX spec and as you say quite ... involved.
Would not a simple command evaluator coupled with natively ported
applications possessing the required interface bring me quite far?
>
> > I know there would be some trickiness involved when running shell scripts
> > containing Unix-like directory names, although I don't think it would be
> > undoable.
> >
>
> Those are the least of your worries, a usermode rootkit, err.., remotely
> attached thread can fix that.
>
lol virus scanners beware :P
>
> > This might be exactly what MSYS does of course, but it requires a special
> > build environment and ancient GCC (although the mysterious MSYS2 will
> > probably fix this).
>
> Give Services for Unix a try, assuming you have Vista/7 enterprise or
> ultimate edition installed. IIRC Win8 pro has it too. It is even 64bit.
>
I've tried it and never got it to work anywhere near decently. Also, this
again tries to bring a whole POSIX programming environment with it. And
they EOL'ed it after Win7.
What I would (very hypothetically) want to do is just have a filesystem
wrapping shell interpreter that is capable of executing sh scripts, and
then use native Win32 ports of the common Unix utilities called through
this layer.
I'm not trying to create an environment to run POSIX programs in, I want to
bring the common Unix tools' functionality to an sh interpreter running in
Windows. I imagine most of my work is made quite trivial by using Boost's
extensive functionality (regex, filesystem, etc...).
If you could give me a real-world (albeit simple) example of some sh
trickery that is impossible to implement (without e.g. the fully spec'ed
functionality of fork()), I would love to know so I can dump this crazy
idea in the trash can before I spend any lost time in it.
Thanks,
Ruben
>
> Get the features right now for a low low prices of $$$!
>
>
>
>
> ------------------------------------------------------------------------------
> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> MVPs and experts. SALE $99.99 this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122412
> _______________________________________________
> Mingw-w64-public mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
>
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public