Linux-Development-Sys Digest #289, Volume #8 Sun, 19 Nov 00 20:13:09 EST
Contents:
Undelete/Rebuild files in Linux ext2 filesystem (Stuart Park)
Re: injecting keystrokes into virtual console (Bryan Hackney)
Re: What distro does Linus Torvalds use? (Michael V. Ferranti)
Re: Preemption within the kernel? (David Wragg)
Annotated assembler source from gcc??? (Kaelin Colclasure)
Re: Annotated assembler source from gcc??? (Pete Zaitcev)
Re: Annotated assembler source from gcc??? (Martin von Loewis)
Re: Annotated assembler source from gcc??? (Kaelin Colclasure)
Re: What distro does Linus Torvalds use? (Paul Kimoto)
gethostbyname on 386 ("Gilles Reeves")
Re: gethostbyname on 386 ("Gilles Reeves")
help with an intro to .... ("d.frost")
Re: Annotated assembler source from gcc??? (David Wragg)
which device? (Russell & Kristal Suter)
2.4.0test11pre7 PCMCIA+SMP (bill davidsen)
Re: Starting Linux without logging into it. ("Ross Crawford")
Re: Annotated assembler source from gcc??? ([EMAIL PROTECTED])
Re: injecting keystrokes into virtual console ([EMAIL PROTECTED])
Re: Annotated assembler source from gcc??? (Kaelin Colclasure)
----------------------------------------------------------------------------
From: Stuart Park <[EMAIL PROTECTED]>
Subject: Undelete/Rebuild files in Linux ext2 filesystem
Date: Sun, 19 Nov 2000 19:05:02 +1100
Is there currently any way to "undelete" or at least be able to manually
rebuild files in the ext2 filesystem?
(i.e. if you accidentally delete a file, to be able to do a search through
disk blocks looking for the data and then be able to manually link the
blocks together into a file)
It would be nice to have something like a "norton utilities" for linux..
------------------------------
From: Bryan Hackney <[EMAIL PROTECTED]>
Subject: Re: injecting keystrokes into virtual console
Date: Sun, 19 Nov 2000 02:00:53 -0600
[EMAIL PROTECTED] wrote:
>
> On Fri, 17 Nov 2000 20:30:14 GMT George MacDonald <[EMAIL PROTECTED]> wrote:
>
[...]
> | Another approach would be to modify the inittab, remove all the getty
> | programs and write another program to do the same thing they do, except
> | also do what you want. That of course only works if your additional input
> | is at the beginning.
>
> Been there, done that.
>
[...]
Before this thread wanders off the right hand side, I suggest taking this
suggestion seriously, and revisting the custom getty thing. I see know
reason to get into the kernel.
Say you have a custom getty called mygetty. You run 7 of them out of init.
They talk to each other with a shared memory block. One can propagate actions
to the others. Exec programs. That kind of stuff. Seems sufficient. Unless
I have not understood the real requirement here.
--
Bryan Hackney / BHC / [EMAIL PROTECTED]
http://www.FreeClassAds.com/
http://bhconsult.com/
------------------------------
From: Michael V. Ferranti <[EMAIL PROTECTED]>
Subject: Re: What distro does Linus Torvalds use?
Date: Sun, 19 Nov 2000 08:02:36 +0000
And [EMAIL PROTECTED] spoke thusly:
>That's a FAQ :) He uses more than one, as I read in a recent article,
>so that he can avoid showing favoritism.
Crap. Guess I'll go with Debian then.
-- Michael V. Ferranti [blades&inreach*com]
Warning: The Surgeon General has deemed that excessive displays of warning
labels and public service announcements produce stress and shortens lives.
------------------------------
From: David Wragg <[EMAIL PROTECTED]>
Subject: Re: Preemption within the kernel?
Date: 19 Nov 2000 17:34:37 +0000
Kaelin Colclasure <[EMAIL PROTECTED]> writes:
> But if there's preemption at the kernel level in Linux's future, is a
> simple (i.e. non-interrupt-masked) spinlock still useful? And am I
> correct in guessing that masking interrupts guarantees atomicity?
> I.e. that kernel-level preemption relys on the timer interrupt not
> being masked?
In the discussions on l-k on this issue, Linus made it clear that
preemption should use the mechanisms already in the kernel for dealing
with SMP. So as long as your code is SMP-safe now, you shouldn't need
to worry much about the possibility of a fully preemptive kernel in
the future. This implies that spin_lock will mask interrupts in some
fashion in the preemptive case.
I assume, though I haven't checked, that Monta Vista's preemptive
kernel patches follow Linus' suggestions.
David Wragg
------------------------------
From: Kaelin Colclasure <[EMAIL PROTECTED]>
Subject: Annotated assembler source from gcc???
Date: 19 Nov 2000 10:14:23 -0800
A feature that I have found useful from time to time is to generate
the assembler source from one of my .c files. In the past when I've
done this I've seen the original C code interspersed as comments in
the generated assembler source. But gcc's -S option doesn't seem to do
this. And the only hopeful-looking option I saw on the man page was
-fverbose-asm -- which doesn't do it either.
Is there an option for getting this kind of annotated listing from
gcc?
I did manage to track down the issue I was trying to debug, but it
took a lot longer to find the relevant line of assembler source
without the comments. :-/
-- Kaelin
------------------------------
From: [EMAIL PROTECTED] (Pete Zaitcev)
Subject: Re: Annotated assembler source from gcc???
Date: Sun, 19 Nov 2000 19:33:44 GMT
> A feature that I have found useful from time to time is to generate
> the assembler source from one of my .c files. In the past when I've
> done this I've seen the original C code interspersed as comments in
> the generated assembler source. But gcc's -S option doesn't seem to do
> this. And the only hopeful-looking option I saw on the man page was
> -fverbose-asm -- which doesn't do it either.
I think that this technique falls apart at seams with contemporary
optimizing compilers. When basic blocks are rearranged, you would
have a hard time to identify a part of C code that was relevant.
Conditional execution is especially nasty, with its epitome in EPIC.
Sometimes a single C sentence can produce code replicated in 3 places.
--Pete
------------------------------
From: Martin von Loewis <[EMAIL PROTECTED]>
Subject: Re: Annotated assembler source from gcc???
Date: 19 Nov 2000 21:34:06 +0100
[EMAIL PROTECTED] (Pete Zaitcev) writes:
> I think that this technique falls apart at seams with contemporary
> optimizing compilers. When basic blocks are rearranged, you would
> have a hard time to identify a part of C code that was relevant.
> Conditional execution is especially nasty, with its epitome in EPIC.
> Sometimes a single C sentence can produce code replicated in 3 places.
GCC has the additional problem that at code emission time, knowledge
about preprocessor output, let alone *original source code* is long lost.
What is preserved is line information as offered to debuggers. So the
back-end generator *could* go back and look into the source files, to
insert the original source code line.
It seems that this feature is too rarely request/too difficult to
implement so that it is not available in gcc.
Regards,
Martin
------------------------------
From: Kaelin Colclasure <[EMAIL PROTECTED]>
Subject: Re: Annotated assembler source from gcc???
Date: 19 Nov 2000 12:50:57 -0800
[EMAIL PROTECTED] (Pete Zaitcev) writes:
> > A feature that I have found useful from time to time is to generate
> > the assembler source from one of my .c files. In the past when I've
> > done this I've seen the original C code interspersed as comments in
> > the generated assembler source. But gcc's -S option doesn't seem to do
> > this. And the only hopeful-looking option I saw on the man page was
> > -fverbose-asm -- which doesn't do it either.
>
> I think that this technique falls apart at seams with contemporary
> optimizing compilers. When basic blocks are rearranged, you would
> have a hard time to identify a part of C code that was relevant.
> Conditional execution is especially nasty, with its epitome in EPIC.
> Sometimes a single C sentence can produce code replicated in 3 places.
I understand your point, and in general I'd never try to understand a
C program by looking at the assembly code generated -- commented or
not. But if you have a specific expression that you want to check the
generated instruction sequence on, this technique is quite practical.
For example, we once had a quite elusive bug in a service implemented
on an OpenVMS/AXP system. If you want to see C code sequences moved
around to optimize their execution order, look at Alpha code! But in
spite of this we eventually isolated the bug to a code generation
problem in Digital's C++ compiler. (I vaguely recall it had something
to do with getting sign-extension wrong in a sufficiently complicated
C expression. We simplified the expression into multiple steps and
reported the bug to Digital, who confirmed it.)
I don't think we would ever have isolated this bug any other way.
And as for Intel hardware -- well, either it's just not as
sophisticated as the Alpha / Sparc / etc. RISC processors, or gcc just
isn't as agressive as some other compilers I've used. At -O2 I saw no
apparent execution reordering. It was relatively easy to follow along
in the C source with the assembler source. It just would have taken a
lot less time if the compiler had interleaved them for me.
-- Kaelin
------------------------------
From: [EMAIL PROTECTED] (Paul Kimoto)
Subject: Re: What distro does Linus Torvalds use?
Date: 19 Nov 2000 16:22:26 -0500
Reply-To: [EMAIL PROTECTED]
In article <[EMAIL PROTECTED]>,
Michael V. Ferranti wrote:
>> That's a FAQ :) He uses more than one, as I read in a recent article,
>> so that he can avoid showing favoritism.
> Crap. Guess I'll go with Debian then.
I don't think that's one he's ever been reported to use ...
--
Paul Kimoto
This message was originally posted on Usenet in plain text. Any images,
hyperlinks, or the like shown here have been added without my consent,
and may be a violation of international copyright law.
------------------------------
From: "Gilles Reeves" <[EMAIL PROTECTED]>
Subject: gethostbyname on 386
Date: Sun, 19 Nov 2000 22:34:16 +0100
Hello,
I'm looking for the solution of a problem since several days, now.
I'm trying to install Linux on a very old 386 SX 16 (8Mo Ram, 120Mo HDD).
As I have a very few space on the hard drive, I manually installed that from a
'tomsrtbt' distribution (all on one floppy) that I'm
trying to complete with files taken from a Redhat 6.2 distribution.
I didn't install RPM at all. All the files I put were copied by hand.
I didn't install 'linuxconf' either.
(maybe you will think I loose my time... but I do so also for better understanding the
system!)
In fact the system boots correctly, I installed a dual boot configuration with Lilo
(one with the 'tomsrtbt' kernel and one with a
'redhat' recompiled kernel - version 2.2.14 -), I can get it to work without problem
on any of them except I got stuck in trying to
install a Samba server.
After a lot of researchs, starting by looking inside the Samba logs, and after writing
a small C program for testing it, it appears
that the fault comes from the 'gethostbyname()' function that does not return any
result (except NULL), and returns an h_errno code
equal to 0 (meaning no error !).
If I test the same kernel on a Pentium II 233 system, it works correctly.
The 'HOSTNAME', 'hosts', 'host.conf' and 'resolv.conf' files are correct.
I tried to recompile the 'libc' library also without getting any change (I use version
2.1.3).
The same 'libc' library works also correctly on my Pentium, but not on the 386.
I would like to know what happens.
Do this has something to do with the fact I didn't install Linux 'regularly' on that
computer ?
Did I miss to copy some important files to my 386 ?
Is it a bug from that version of the kernel or from that version of 'libc' that makes
it incompatible with the 386 processor ?
Does somebody know about such a bug ?
Should I try to put files from another distribution, older or newer ?
If so, which one is known to work in that case ?
Thank you in advance for your answers...
Gilles.
==============================================================
Here is the program I wrote for testing :
==============================================================
#include <unistd.h>
#include <netdb.h>
#include <errno.h>
#include <stdio.h>
extern int h_errno;
int main()
{
int err;
char str[128];
struct hostent * he;
//
err = gethostname(str, sizeof(str));
if (err==0)
printf("str = \"%s\"\n", str);
else
printf("str: errno=%i\n", errno);
//
//
he = gethostbyname(str);
if (he)
{
int i;
//
printf("he->h_name = \"%s\"\n", he->h_name);
for(i=0; he->h_aliases[i]!=NULL; i++)
printf("he->h_aliases[%i] = \"%s\"\n", i, he->h_aliases[i]);
printf("he->h_addrtype = %i\n", he->h_addrtype);
printf("he->h_length = %i\n", he->h_length);
for(i=0; he->h_addr_list[i]!=NULL; i++)
{
unsigned char * ad = (unsigned char *)he->h_addr_list[i];
//
printf("he->h_addr_list[%i] = %u.%u.%u.%u\n",
i, ad[0], ad[1], ad[2], ad[3]);
}
}
else
printf("gethostbyname(\"%s\") = NULL : h_errno = %i\n", str, h_errno);
return 0;
}
------------------------------
From: "Gilles Reeves" <[EMAIL PROTECTED]>
Subject: Re: gethostbyname on 386
Date: Sun, 19 Nov 2000 22:47:11 +0100
| I tried to recompile the 'libc' library also without getting any change (I use
|version 2.1.3).
| The same 'libc' library works also correctly on my Pentium, but not on the 386.
Sorry, I meant 'glibc', not 'libc'.
Gilles.
------------------------------
From: "d.frost" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: help with an intro to ....
Date: Sun, 19 Nov 2000 22:05:07 +0000
Hi all,
I am interested in interfacing with my pc( not personally but with pic
chips!). I have found quite a lot on the internet about pic chips, but
not much on how to access serial ports and how to link the ports to some
bits of circuitry.
Ultimately i would like to build boards that work on the pci bus, but i
think that is beyond me at the moment by quite a way. From what i know
the serial port is easier( or the parallel port).
Any help on this subject would be of great help.
Thanks
Dave Frost
------------------------------
From: David Wragg <[EMAIL PROTECTED]>
Subject: Re: Annotated assembler source from gcc???
Date: 19 Nov 2000 22:09:11 +0000
Martin von Loewis <[EMAIL PROTECTED]> writes:
> What is preserved is line information as offered to debuggers. So the
> back-end generator *could* go back and look into the source files, to
> insert the original source code line.
>
> It seems that this feature is too rarely request/too difficult to
> implement so that it is not available in gcc.
Or perhaps because compiling with -g then using objdump -S already
does this?
David Wragg
------------------------------
Date: Sun, 19 Nov 2000 15:17:40 -0700
From: Russell & Kristal Suter <[EMAIL PROTECTED]>
Subject: which device?
DQpJIGp1c3QgcmVwbGFjZWQgYW4gb2xkIGNkcm9tIHdpdGggYSBjZC13cml0ZXIgYW5kIEkn
bSB1c2luZyB0aGUNCmlkZS1zY3NpIG1vZHVsZSBzbyBJIGNhbiB1c2UgY2RyZGFvLiAgV2l0
aCB0aGUgaWRlLXNjc2kgbW9kdWxlLA0KbXkgL3Byb2Mvc2NzaS9zY3NpIGZpbGUgc2hvd3M6
DQoNCkhvc3Q6IHNjc2kwIENoYW5uZWw6IDAwIElkOiAwMCBMdW46IDAwDQogIFZlbmRvcjog
SU9NRUdBICAgTW9kZWw6IFpJUCAxMDAgICAgICAgICAgUmV2OiAxNC5BDQogIFR5cGU6ICAg
RGlyZWN0LUFjY2VzcyAgICAgICAgICAgICAgICAgICAgQU5TSSBTQ1NJIHJldmlzaW9uOiBm
ZmZmZmZmZg0KSG9zdDogc2NzaTAgQ2hhbm5lbDogMDAgSWQ6IDAxIEx1bjogMDANCiAgVmVu
ZG9yOiBIUCAgICAgICBNb2RlbDogQ0QtV3JpdGVyKyA5MTAwICBSZXY6IDEuMGMNCiAgVHlw
ZTogICBDRC1ST00gICAgICAgICAgICAgICAgICAgICAgICAgICBBTlNJIFNDU0kgcmV2aXNp
b246IDAyDQoNCk15IHppcCBkaXNrIGlzIHdvcmtpbmcgd2l0aCAvZGV2L3NkYTQuICBJIHRy
aWVkIGRldmljZSBmaWxlcyBsaWtlDQovZGV2L3NkYiBmb3IgdGhlIGNkIGJ1dCBJIGhhdmVu
J3QgZm91bmQgb25lIHRoYXQgd29ya3MuICBBbnlvbmUNCmtub3cgd2hpY2ggZGV2aWNlIGZp
bGUgSSBuZWVkIHRvIHVzZT8/PyAgSWYgeW91IGtub3csIHBsZWFzZQ0KZW1haWwgbWUuICBJ
J20gbm90IGFsd2F5cyBnb29kIGFib3V0IHJlYWRpbmcgdGhpcyBuZXdzZ3JvdXAuDQoNClRJ
QQ0KDQotLQ0KUnVzcw0K
------------------------------
Subject: 2.4.0test11pre7 PCMCIA+SMP
From: [EMAIL PROTECTED] (bill davidsen)
Date: Sun, 19 Nov 2000 23:15:51 GMT
Almost right... it will now work if the system is booted with a card in,
find the card, use the card. It will allow removeal of a card, I used
'cardctl eject' before the physical eject, that worked.
But if I plug in a card while the system is running, panic. Can't really
capture the registers on this, but I'm 3 for 3 and quitting now, I'll go
ahead and shutdown before putting in cards, at least for now. Haven't
installed on a laptop or any uni machine, but SMP fails every time.
Still a vast improvement, I can use the flash memory.
--
bill davidsen <[EMAIL PROTECTED]>
------------------------------
From: "Ross Crawford" <[EMAIL PROTECTED]>
Subject: Re: Starting Linux without logging into it.
Date: Mon, 20 Nov 2000 10:37:05 +1100
in /etc/initab, set it to default to run-level 1, ie:
init:1:initdefault: (I think!)
You only get single user (root).
Or fiddle with /etc/inittab to load what you want (as others have
suggested).
regards,
ROSCO
henry <[EMAIL PROTECTED]> wrote in message
news:8v60fp$m9c$[EMAIL PROTECTED]...
> Does anyone have a suggestion how i can build a linux OS thats runs
without
> logging into it?
>
> I know that it is a multiuser OS but i want to use Linux without logging
> into it.
>
> Thanks
>
>
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: Annotated assembler source from gcc???
Date: Sun, 19 Nov 2000 23:38:40 GMT
Kaelin Colclasure <[EMAIL PROTECTED]> wrote:
> And as for Intel hardware -- well, either it's just not as
> sophisticated as the Alpha / Sparc / etc. RISC processors, or gcc just
> isn't as agressive as some other compilers I've used. At -O2 I saw no
> apparent execution reordering. It was relatively easy to follow along
RISC CPU's by their very nature require much more aggressive optimizations
than a CISC unit such as the x86. This is in particular true for ins.
reordering, in order to keep the pipeline effective. Thus your observation.
Taavo.
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: injecting keystrokes into virtual console
Date: Mon, 20 Nov 2000 00:16:19 -0000
On Sun, 19 Nov 2000 02:00:53 -0600 Bryan Hackney <[EMAIL PROTECTED]> wrote:
|> | Another approach would be to modify the inittab, remove all the getty
|> | programs and write another program to do the same thing they do, except
|> | also do what you want. That of course only works if your additional input
|> | is at the beginning.
|>
|> Been there, done that.
|>
| Before this thread wanders off the right hand side, I suggest taking this
| suggestion seriously, and revisting the custom getty thing. I see know
| reason to get into the kernel.
|
| Say you have a custom getty called mygetty. You run 7 of them out of init.
| They talk to each other with a shared memory block. One can propagate actions
| to the others. Exec programs. That kind of stuff. Seems sufficient. Unless
| I have not understood the real requirement here.
What kinds of actions would one instance of "mygetty" pass to another?
Normally getty exec*()'s the login shell, which inherits the particular
console device as stdin/stdout/stderr. It sounds like you are suggesting
that instead, "mygetty" should set up a pty/tty and fork to the shell.
But I still don't see what the shared memory block can accomplish. Can
you be more specific?
--
| Phil Howard - KA9WGN | My current websites: linuxhomepage.com, ham.org
| phil (at) ipal.net +----------------------------------------------------
| Dallas - Texas - USA | [EMAIL PROTECTED]
------------------------------
From: Kaelin Colclasure <[EMAIL PROTECTED]>
Subject: Re: Annotated assembler source from gcc???
Date: 19 Nov 2000 16:19:21 -0800
David Wragg <[EMAIL PROTECTED]> writes:
> Martin von Loewis <[EMAIL PROTECTED]> writes:
> > What is preserved is line information as offered to debuggers. So the
> > back-end generator *could* go back and look into the source files, to
> > insert the original source code line.
> >
> > It seems that this feature is too rarely request/too difficult to
> > implement so that it is not available in gcc.
>
> Or perhaps because compiling with -g then using objdump -S already
> does this?
Ah, so it does! And this is actually more convenient than having the
compiler do it -- you don't have to mess with your Makefiles. Thanks
for the tip, David!
Hmmm, now I wonder if this works e.g. on Solaris/Sparc?
-- Kaelin
------------------------------
** 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
******************************