Re: Perl/Linux
by ambrus (Abbot) on Oct 08, 2004 at 16:30 UTC
|
Perlinux does not have linux itself written in perl, only many unix applications. The kernel and a small libc (and perl of course) is still written in C, but all other programs are in perl.
| [reply] |
|
|
I just thought it seemed interesting at the time :). That clicked after I wrote it, the whole idea of "wait, then what's interpreting the code, definately not perl." But, it still seemed pretty neat to have certain tools written in perl, which I guess could be found in many other places, and I could write for myself. But, I think the bigger picture is, if I am using Windows with ActivePerl, and I want to play around with UNIX tools and programs, it is a nice alternative to Cygwin, which I used, and loved, before I chose to switch to Linux.
| [reply] |
Re: Perl/Linux
by hardburn (Abbot) on Oct 08, 2004 at 16:36 UTC
|
Umm, the kernel there is not written in Perl. In fact, I don't think you could call a kernel written in Perl to be "Linux". Other than the Perl interpreter itself, the other non-Perl code is a small version of the Unix standard library (uClib). I haven't actually tried it, but I'm wondering if they have init as a compiled program, too?
Most of it looks like it came from Perl Power Tools, which has been around for a while.
"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.
| [reply] |
|
|
Don't think you need a c compiled init:
lilo: linux init="/usr/bin/perl /usr/local/sbin/init.pl"
Now this is totally untested, but I have run a shell in place of init many times. Anyone know if the linux kernel or lilo take multiword environment variables?
Jon | [reply] [d/l] |
|
|
You don't need to. If /sbin/init is mode (at least) 555 and
starts with the line "#!/bin/perl" (without quotes of course) and perl is really in /bin (no link) then this script will start as init. /usr/bin/perl doesn't work every time because /usr could be umounted.
| [reply] |
|
|
Re: Perl/Linux
by jonnybe (Scribe) on Oct 08, 2004 at 17:17 UTC
|
Had another thought...why stop there? How about embedding a perl interpreter in the kernel? Wow, device drivers on the fly and reduced overhead for perl scripts, lol.
Jon | [reply] |
|
|
| [reply] |
|
|
| [reply] |
|
|
Ok, we can put it in a kernel module. :D
| [reply] |
|
|
I'm too lazy to check, but I seem to remember a system for writing virtual file-systems in Perl for Linux. I don't know if that involved embedding Perl in the kernel, but it seems like it might have!
-sam
| [reply] |
|
|
I wrote RFC: Fuse::DBI - mount database as filesystem about such virtual file-system (which mounts part of database). It uses Fuse perl bindings, so it embeds fuse into kernel and then just calls it from perl. It's very powerfull, but in strange file-system way.
| [reply] |
|
|
| [reply] |