Linux-Development-Sys Digest #878, Volume #7 Fri, 19 May 00 08:13:15 EDT
Contents:
Re: linux kernel not C++ friendly? (Mathias Waack)
Re: ping souce code (A Guy Called Tyketto)
Re: does linux support RAMDISK??? (Josef Moellers)
Re: Linux drivers for DVD drives? (Eric)
Re: Need ideas for university funded project for linux ("Peter T. Breuer")
Re: linux kernel not C++ friendly? (Alexander Viro)
Re: linux kernel not C++ friendly? (Stefaan A Eeckels)
Re: linux kernel not C++ friendly? (Stefaan A Eeckels)
embedded Linux system ("sllai")
Re: zip with password (Christian Winter)
Re: Differences among Linux-en (Christian Winter)
Re: Why no defrag? (Christian Winter)
----------------------------------------------------------------------------
From: Mathias Waack <[EMAIL PROTECTED]>
Subject: Re: linux kernel not C++ friendly?
Date: Fri, 19 May 2000 10:31:12 +0200
Matthew Palmer wrote:
> IIRC, the kernel would have issues with the linkage - there's a lot of stuff
> your average C++ binary relies on which is not available in the kernel.
Give examples.
> The question is, really, why develop a module in C++? You can write in an
> object-oriented style in C if you really must, and I think that C is still
> much more memory efficient (a *must* when you're dealing with memory which
> can't be swapped out) that C++.
No, it isn't.
Some reasons why I would use C++ in a kernel module:
1. I must reuse existing code written in C++
2. I must implement a bigger specification given in an OO form
3. I'm a professional C++ programmer and I've never used C before
There maybe much other reasons...
Mathias
--
Mathias Waack | [EMAIL PROTECTED]
Tel.: +49 621 181 2717 Fax.: +49 621 181 2713
------------------------------
From: A Guy Called Tyketto <[EMAIL PROTECTED]>
Subject: Re: ping souce code
Date: Fri, 19 May 2000 08:52:19 GMT
=====BEGIN PGP SIGNED MESSAGE=====
Hash: SHA1
Diego Betancor <[EMAIL PROTECTED]> wrote:
> Hi,
> ping is great but when it fails it does not tell you like windows
> that says something about timeout. The only way that I know is
> counting the number of packets and looking for one that is missing.
> does anyone know where I can get the source for ping to change it?,
> or does anyone already done it?
Why change the source?
from man 8 ping:
-v Verbose output. ICMP packets other than ECHO_RESPONSE that
are received are listed.
This should print out, verbosely, what happens, when you go to
ping a site, and there's a problem. e.g.:
bellicha:~> ping -c 10 -v 20.7.245.100
PING 20.7.245.100 (20.7.245.100): 56 data bytes
ping: packet too short (56 bytes) from 4.1.13.250
ping: packet too short (56 bytes) from 4.1.13.250
ping: packet too short (56 bytes) from 4.1.13.250
Corresponding traceroute gives me:
bellicha:~> traceroute 20.7.245.100
traceroute to 20.7.245.100 (20.7.245.100), 30 hops max, 40 byte packets
1 pm3-6.wizard.com (209.170.216.36) 128.769 ms 119.59 ms 119.802 ms
2 lv-7206-1.wizard.com (209.170.216.1) 119.752 ms 110.442 ms
119.233 ms
3 H0-0.irv-lvg100.gw.eni.net (207.168.88.9) 119.824 ms 119.601 ms
120.879 ms
.
.
.
14 p4-0-0.vienna1-cr2.bbnplanet.net (4.0.5.150) 199.667 ms 189.538 ms
189.9 ms
15 f0-0.vienna1-cr5.bbnplanet.net (4.1.0.6) 189.654 ms 279.711 ms
189.851 ms
16 s0.csc6.bbnplanet.net (4.1.13.250) 199.493 ms * 189.903 ms
17 * * *
18 * * *
19 * * *
The source to ping already has the options you need.. just
impliment them. :)
BL.
- --
Brad Littlejohn | Email: [EMAIL PROTECTED]
Unix Systems Administrator, | [EMAIL PROTECTED]
Web + NewsMaster, BOFH.. Smeghead! :) | http://www.wizard.com/~tyketto
PGP: 1024D/E319F0BF 6980 AAD6 7329 E9E6 D569 F620 C819 199A E319 F0BF
=====BEGIN PGP SIGNATURE=====
Version: GnuPG v1.0.1e (FreeBSD)
Comment: For info see http://www.gnupg.org
iD8DBQE5JQC7yBkZmuMZ8L8RAq3gAKDJKfV+5obmIvOqd17mhR6aDihDKACeJIAE
BVdPJ2eXzQpYr2tuIA7wSgU=
=cqBl
=====END PGP SIGNATURE=====
------------------------------
From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: does linux support RAMDISK???
Date: Fri, 19 May 2000 11:02:40 +0200
Bernd Strieder wrote:
> =
> Mario Klebsch wrote:
> >
> >[..]
> >
> > In fact, one of my favourite RAM disk implementation is tmpfs from
> > Solaris. tmpfs lives in virtual memory and, IMHO, the best thing abou=
t
> > tmpfs is, that you do not have to specify any size for it. If you
> =
> Then is there any filesystem that is capable of adjusting its size on
> demand, without reformatting, or even without unmounting, or even on th=
e
> fly? I have not seen a filesystem like this on linux. There are similar=
> solutions, but they need manual interaction by the admin.
> =
> AFAICS linux followed another strategy with that /tmp issue. Since any
> io data is buffered anyway in RAM before writing it to disk, there is n=
o
> reason to make this explicit, by creating that special tmpfs, that will=
> be filled enough that it will have to be swapped out. That stuff would
> just be another highly special case in the kernel. So its why the
> hackers obviously didn't like it. Another issue is /tmp being wiped on
> shutdown, do you like that? Not that shutdown is that often, but it's
> against any intuition that untouched files disappear during a regular
> shutdown or a crash.
No file in /tmp is guaranteed to survive anything.
My understanding is that as soon as I close a file in /tmp it may very
well disappear.
I know that hell breaks loose when files won't survive a few seconds,
but where's the limit?
Also, I have heard that it may be worth while putting /tmp on a separate
file system and doing a reformat on every reboot, but that was some
years ago, probably sysV time rather than ufs and ext2.
If you don't cleanup /tmp occasionally, it will fill up eventually.
While we're at it, does anyone know where "lsR<pid>.??????" files in
/tmp (always three files with identical <pid> but different, random
"extension", all created at midnight or three minutes after, no entry in
any crontab that would explain this, all size 0) come from?
-- =
Josef M=F6llers
Fujitsu Siemens Computers
SHV Server DS 1
------------------------------
From: Eric <[EMAIL PROTECTED]>
Subject: Re: Linux drivers for DVD drives?
Date: Fri, 19 May 2000 08:39:37 GMT
Reply-To: [EMAIL PROTECTED]
Eric wrote:
>
> Robert Phillips wrote:
> >
> > I've considered getting a DVD-RAM, but I have not found out the
> > write-rate on these drives my looking at ads, at least. Do you have
> > an estimate of MB/sec write speed? Eg, how long is the total time, say
> > to copy a 100 megabyte file to the dvd-ram, from when you enter the cp
> > command
> > to when it is safe to eject the disk?
> > How long for a 1 megabyte file?
> >
> > Thanks,
> > Robert
>
> I've a dvdram (panasonic, atapi) that has a max. write rate of 5,5 MB/s
> (half of the actual spec, suppose they do a write verify or so, couldn't
> be disabled I was told)
>
> Eric
Oops typo! 5,5 MB/s should be 5,5 Mbps
Eric
>
> > Stefan Homburg wrote:
> >
> > >
> > > I am using Panosonic's DVD-RAM drive (5,2 gigabyte) and asked
> > > myself the same question when I considered moving to linux. Curiously,
> > > Panasonic provides a "linux driver", packed as a .zip file, but after
> > > you
> > > gunzip it, it only contains a textfile claiming that you do not need a
> > > driver.
> > >
> > > And this is actually true. My DVD-RAM is simply /dev/sdb. It is
> > > treated as a harddisk by the system, with the exception that it cannot
> > > be partitioned.
> > >
> > > --
> > > Prof. Dr. Stefan Homburg
> > > Lehrstuhl �ffentliche Finanzen
> > > Universit�t Hannover
> > > K�nigsworther Platz 1
> > > D-30167 Hannover
> > >
> > > Tel.: (0049) 511-762-5633
> > > Fax.: (0049) 511-762-5656
------------------------------
From: "Peter T. Breuer" <[EMAIL PROTECTED]>
Crossposted-To:
comp.os.linux.development.apps,comp.os.linux.misc,comp.os.linux.setup,comp.os.linux.advocacy
Subject: Re: Need ideas for university funded project for linux
Date: 19 May 2000 09:35:14 GMT
In comp.os.linux.misc David Steinberg <[EMAIL PROTECTED]> wrote:
: Peter T. Breuer ([EMAIL PROTECTED]) wrote:
: : I use slackware and debian, and have no problems with either. I'd never
: : touch redhat with a bargepole, since it's as nonstandard as hell. But
: It seems to me like EVERY distribution is "non-standard"; they all seem to
: put the same things in different places. /usr or /usr/local? /usr or
No distribution can put anything in /usr/local. That's for YOU to make
non-distro-spawned additions in.
: /opt? /etc or /sbin? Is there even a standard? I'm really surprised
/opt is for independent packages. But there is a new fsstd coming up.
/etc is for system configuration files. /sbin is for super-user only
executables, the ones needed at or near boot.
: that this hasn't been fixed yet. I can't imagine what benefit one gets
It's been "fixed" for the last 20 years.
: from putting stuff in a different plcae in the tree, other than the nice
You get the benefits of nonstandardization, a la microsoft. In my
opinion redhat is particularly and repellently guilty of that.
: feeling that his choice is more "logical." However, the benefits for
: having a common directory structure would be large. In particular, people
There is one.
Peter
------------------------------
From: [EMAIL PROTECTED] (Alexander Viro)
Subject: Re: linux kernel not C++ friendly?
Date: 19 May 2000 05:56:00 -0400
In article <[EMAIL PROTECTED]>,
Mathias Waack <[EMAIL PROTECTED]> wrote:
>Some reasons why I would use C++ in a kernel module:
>
>1. I must reuse existing code written in C++
You do realize that rules regarding the atomicity, kinds of memory allocation,
etc. are _seriously_ different from whatever you have in userland, right?
_All_ experiments on using the same codebase for kernel and userland failed
miserably - witness the monster in fs/ntfs, for one. If you want to reuse
the userland code - keep it in userland. No need to put heavy-weight stuff into
the kernel.
>2. I must implement a bigger specification given in an OO form
And? C allows OO just fine. VFS is written that way.
>3. I'm a professional C++ programmer and I've never used C before
Too bad, I know professional APL programmers, and several Algol-68 ones.
And?
--
"You're one of those condescending Unix computer users!"
"Here's a nickel, kid. Get yourself a better computer" - Dilbert.
------------------------------
From: [EMAIL PROTECTED] (Stefaan A Eeckels)
Subject: Re: linux kernel not C++ friendly?
Date: Fri, 19 May 2000 09:37:55 +0200
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Kaz Kylheku) writes:
> On Fri, 19 May 2000 00:41:33 +0200, Stefaan A Eeckels <[EMAIL PROTECTED]>
> wrote:
>>
>>Medium sized answer: You could, but you'd have to provide all the
>>run time support usually provided by C++'s support libraries, and
>>libc. You don't want to do this.
>
> I see. So it follows that to use C for writing kernel code,
> you would also need to provide all the run time support normally
> provided by a hosted implementation of C.
To benefit from the advantages of C++ over 'C', one would have to
implement a significant chunk of the run-time support libraries.
Obviously, you could strip C++ down to its bare essentials, as
you show in your second post, but the advantages over 'C' become
moot.
In addition, there aren't any "kernel-classes" to derive from,
you can't use exceptions, etc (this has been rehashed to death
here, anyway).
When it comes to writing Linux kernel modules, C++ is a bad
choice, as would Java, or Ada, or Modula-[23], which all are
(arguably, I don't want to start a flame war here) "better"
languages than 'C'.
--
Stefaan
--
--PGP key available from PGP key servers (http://www.pgp.net/pgpnet/)--
Ninety-Ninety Rule of Project Schedules:
The first ninety percent of the task takes ninety percent of
the time, and the last ten percent takes the other ninety percent.
------------------------------
From: [EMAIL PROTECTED] (Stefaan A Eeckels)
Subject: Re: linux kernel not C++ friendly?
Date: Fri, 19 May 2000 10:00:48 +0200
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Kaz Kylheku) writes:
>
> I just wrote a module in C++ and it loaded just nicely into 2.2.12.
>
> Here is the module:
>
> #include <stddef.h>
> #include <linux/config.h>
> #include <linux/module.h>
> #include <linux/kernel.h>
>
> void *operator new (size_t) {
> }
>
> void operator delete (void *ptr) {
> }
>
> class myclass {
> public:
> myclass() { printk(KERN_INFO "myclass::myclass\n"); }
> ~myclass() { printk(KERN_INFO "myclass::~myclass\n"); }
> };
>
> extern "C" int init_module()
> {
> myclass dummy;
> printk(KERN_INFO "foo_init\n");
> return 0;
> }
>
> extern "C" void cleanup_module()
> {
> myclass dummy;
> printk(KERN_INFO "foo_cleanup\n");
> }
>
> I compiled this with g++ -fno-exceptions -D__KERNEL__ -DMODULE test.cc -c
>
> When I insert it into the kernel, it produces trace messages indicating
> that the dummy objects are being constructed and destroyed.
>
> What library features am I missing? Are you saying I need things like
> <iostream> or the STL in order to use C++? That's not true any more than
> that I need strftime(), qsort(), frexp() or wcstombs() in order to do kernel
> programming in C.
Well, you've written a module that does a few printk's with more
lines (and more overhead) than the equivant 'C' module, only to be
able to use g++.
You'd use C++ because of its advantages over 'C', and most, if not
all of these advantages are implemented with run-time library
support. You can't benefit from existing C++ kernel classes, because
there aren't any, obviously.
> Note: I would have completed the definitions of operators new and delete to
> call kmalloc and kfree, but adding the right headers barfs the compiler. As a
> workaround, I could make wrappers in a separate translation unit written in C
> and call those wrappers from the C++ one. Then use the linker to combine the
> two .o's into one. In general, I could create a C++ friendly interface wrapper
> around just about anything in the kernel, though the real solution is to make
> the headers be acceptable as C++.
Thank you for proving my point. As things stand, it is less efficient
to write kernel modules in C++. It is possible that a re-implementation
of UNIX in C++ would lead to an OS that's easier to write kernel modules
for, but then again, it might not. The fact remains that when Linux was
started, C++ wasn't standardized, and evolving rapidly, which would have
made it an extremely bad choice. Things are better now, but the simple
fact is that the kernel is written in 'C' makes it easier to write modules
in 'C'.
If you really believe that C++ will make a huge difference in efficiency
(both speed of development, reliability and speed of the resulting
module), then put your time where your mouth is, C++-ize the headers,
write the C++ classes that map the kernel data structures and interfaces,
and give them to Travis so he can write his modules in C++.
--
Stefaan
--
--PGP key available from PGP key servers (http://www.pgp.net/pgpnet/)--
Ninety-Ninety Rule of Project Schedules:
The first ninety percent of the task takes ninety percent of
the time, and the last ten percent takes the other ninety percent.
------------------------------
From: "sllai" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: embedded Linux system
Date: Fri, 19 May 2000 19:19:19 +0800
If I would like to bulid an application software that is using embedded
linux system.
What kind of embedded Linux , what kind of development tool and do I need to
have a X windows based computer.
Can somebody provide some info regarding this
Thanks
sllai
------------------------------
From: Christian Winter <[EMAIL PROTECTED]>
Subject: Re: zip with password
Date: Fri, 19 May 2000 09:41:41 +0200
Diego Betancor <[EMAIL PROTECTED]> schrob:
> zip is a program that compresses files is a format that is
> compatible with pkzip and the windows world. When you read the man
> page, it describes -P password but when I tried it said that that
> version of zip would not do it. Why? because my distribution
> (slackware 7) is based in the US?
That's right. There are countries like USA (recently this has gotten
at least a bit less rigid) that have strict cryptography export laws.
And to prevent users from accidentially exporting such crypto many
distributors keep all their CD and download versions crypto-free.
But for zip you are likely to have the sources, then you only need
to get the libcrypt + header files from the web and recompile it
(no big task since zip is quite small).
> Can I get a zip version that does encrypt?
Just look round the web, there are a lot of servers providing
binary packages, most of them homed in europe.
HTH
Christian
------------------------------
From: Christian Winter <[EMAIL PROTECTED]>
Subject: Re: Differences among Linux-en
Crossposted-To: comp.os.linux.development.apps
Date: Fri, 19 May 2000 09:57:50 +0200
In comp.os.linux.development.system schrob [EMAIL PROTECTED]:
> Are the needs of developers well enough known so that a configuration
> file could be put in /etc (/etc/my_linux) which describes that on this
> computer, files of this type are in /path/to/directory/1, files of
> another type are in /path/to/directory/2, .... Then a program like
> rpm or apt just needs to look in this configuration file to figure out
> where to look for functions that it needs in order to operate.
Well, I think there are a lot of people working on things like that,
but I haven't met anything yet that seems promising.
Certainly with the better use of automake and configure the configuration
processes get more standardized, maybe the authors of those tools know if
there are real efforts going on in this direction?
> Just a random thought (or my $0.02).
This were my 0.01Euro
Regards
Christian
------------------------------
From: Christian Winter <[EMAIL PROTECTED]>
Subject: Re: Why no defrag?
Crossposted-To: comp.os.linux.development.apps
Date: Fri, 19 May 2000 09:53:06 +0200
In comp.os.linux.development.system schrob Mark Tranchant <[EMAIL PROTECTED]>:
> The consciencious user would defrag all filesystems regularly,
> and feel "clean" after doing so!
Nice aspect. Maybe one problem for Linux in getting more popular
is that it does all those things automatically?
Looking at a lot of fanatic users creeping through the windows jungle,
there may be quite a bunch of them longing for such "religious" aspects.
(Yes, yes, I admit. There are linux-freaks at the same level too.)
Maybe one should build a nice little app that pops up a window from time
to time asking the user to press a "disk check" or "virus clean" button.
For the latter one could compare file sizes in *bin/ and alias settings
to have 99% of security issues cleared.
Perhaps someone thinks of it next April...
Regards
Christian
(But I think this is getting OT and a little weird, so F'Up2 Poster set to
spare resources)
------------------------------
** FOR YOUR REFERENCE **
The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:
Internet: [EMAIL PROTECTED]
You can send mail to the entire list (and comp.os.linux.development.system) via:
Internet: [EMAIL PROTECTED]
Linux may be obtained via one of these FTP sites:
ftp.funet.fi pub/Linux
tsx-11.mit.edu pub/linux
sunsite.unc.edu pub/Linux
End of Linux-Development-System Digest
******************************