Linux-Development-Sys Digest #277, Volume #8 Tue, 14 Nov 00 06:13:11 EST
Contents:
Re: New glibc-2.2 building (proton)
Re: New glibc-2.2 building (Andreas Jaeger)
Is it safe to execute binary codes in the allocated memory? ("Brian")
Re: Is it safe to execute binary codes in the allocated memory? (Josef Moellers)
receiving data from raw socket ("ByungDeok Kim")
Re: Man-pages - section 9 (kernel reference guide) -- would someone please help
me?!? (Peter Mutsaers)
Re: Is it safe to execute binary codes in the allocated memory? ("Brian")
problem with "screen" app (patrick)
Re: Allocating Non-cacheable memory (Kristof Beyls)
Problems getting MAC address of network card (Johan)
Re: Errors when insmod ("D. Stimits")
Stack access speed ([EMAIL PROTECTED])
Re: 16-bit assembly code (Robert Kaiser)
Re: Errors when insmod (Josef Moellers)
Re: Is it safe to execute binary codes in the allocated memory? (Josef Moellers)
Re: ntpd hung my system... (Wouter Verhelst)
----------------------------------------------------------------------------
From: proton <[EMAIL PROTECTED]>
Subject: Re: New glibc-2.2 building
Date: Tue, 14 Nov 2000 06:19:40 GMT
Gene Heskett wrote:
> Need expert opinions here regarding glibc-2.2 built from the tar.gz.
>
> I've built it, and installed it, but apparently *not* where a red hat
> install wants it.
Installing new C libraries in a running system without some kind
of safeguard is suicidal behaviour. Its not entirely unlikely that
the glibc Makefile put the `install' somewhere where its out of
harms way so that you can install it in a more safe manner once
you have verified that it works.
> After a reboot, the glibc version is still, according to gnorpm's verify
> function, 2.1.94-3. So I assume the next step is a 'make uninstall', and a
> new configure with --prefix=/ and --exec-prefix=/ followed by a fresh
> make and install.
>
> Right/Wrong?
>
> Also, as this is 7.0, and gcc is the busted one, should I set an
> 'export CC=kgcc' before the rebuild? 2.96-whatever didn't toss any errors
> that I saw go by.
Since we're talking a _library_ here, I really do think you should avoid
any non-stable GCC like the one that ships as default with RH7.
Why not get GCC 2.95.2 and compile it yourself? It takes less time
and isnt much harder than compiling glibc. On my own system I have
GCC 2.7.2.3 and pgcc 2.95.2, they have not failed me to date.
/proton
------------------------------
From: Andreas Jaeger <[EMAIL PROTECTED]>
Subject: Re: New glibc-2.2 building
Date: 14 Nov 2000 07:35:51 +0100
>>>>> Gene Heskett writes:
> Need expert opinions here regarding glibc-2.2 built from the tar.gz.
> I've built it, and installed it, but apparently *not* where a red hat
> install wants it.
You've got to run configure with --prefix=/usr - have a look at the
Spec file.
> After a reboot, the glibc version is still, according to gnorpm's verify
> function, 2.1.94-3. So I assume the next step is a 'make uninstall', and a
Did you use RPM to install glibc? Otherwise rpm won't update the numbers
> new configure with --prefix=/ and --exec-prefix=/ followed by a fresh
> make and install.
Don't do this!
> Right/Wrong?
> Also, as this is 7.0, and gcc is the busted one, should I set an
> 'export CC=kgcc' before the rebuild? 2.96-whatever didn't toss any errors
> that I saw go by.
Shouldn't be a problem.
Andreas
--
Andreas Jaeger
SuSE Labs [EMAIL PROTECTED]
private [EMAIL PROTECTED]
http://www.suse.de/~aj
------------------------------
From: "Brian" <[EMAIL PROTECTED]>
Subject: Is it safe to execute binary codes in the allocated memory?
Date: 14 Nov 2000 07:12:20 GMT
I allocated some memory by calling kmalloc(some_size, GFP_KERNEL), loaded a
function's binary code (this function could even be the interrupt service
routine) into this area, and it seems I can successfully call this function.
I am a little bit worried about this type of programming, even though I
don't think the codes in the allocated memory would possibly be swapped out.
Is it safe to do this all the time?I'm working on kernel 2.2.14-5.0 now.
Thanks in advance.
- Brian
------------------------------
From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: Is it safe to execute binary codes in the allocated memory?
Date: Tue, 14 Nov 2000 08:39:12 +0100
Brian wrote:
> =
> I allocated some memory by calling kmalloc(some_size, GFP_KERNEL), load=
ed a
> function's binary code (this function could even be the interrupt servi=
ce
> routine) into this area, and it seems I can successfully call this func=
tion.
> I am a little bit worried about this type of programming, even though I=
> don't think the codes in the allocated memory would possibly be swapped=
out.
> Is it safe to do this all the time?I'm working on kernel 2.2.14-5.0 now=
=2E
> Thanks in advance.
Well, I have yet to see a piece of kernel memory being swapped out, but
you never know.
Also, it may very well be that on some machine architectures, memory
areas allocated with kmalloc may be "read/write", but not
"read/execute". Look into the code that does modules to find out.
-- =
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
------------------------------
From: "ByungDeok Kim" <[EMAIL PROTECTED]>
Subject: receiving data from raw socket
Date: Mon, 13 Nov 2000 16:51:53 +0900
Hi,
I am trying to read data from RAW Socket, but cannot make it.
I am using select and recvfrom from the raw socket.
sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
and I used
IP_HDRINCL because I need to make ip header and udp header.
I found that it is possible to send raw packet with any ip header and udp
header.
but I don't see any data coming in the raw sock which I used to send
packets.
does anybody know that is it possible to send and receive data using raw
socket?
thanks for reading......
------------------------------
Crossposted-To: alt.os.linux
Subject: Re: Man-pages - section 9 (kernel reference guide) -- would someone please
help me?!?
From: Peter Mutsaers <[EMAIL PROTECTED]>
Date: 14 Nov 2000 08:58:08 +0100
>> "RA" == Rui Antunes <[EMAIL PROTECTED]> writes:
RA> But those are in html format - I meant man-pages in the
RA> "linux-man" format... (but thanks anyway!)
That's just the way it is with Linux.
For less chaotic, better organized free Unix you should try
FreeBSD. It doesn't have a multitude of HOWTO's, scores of books etc
etc, but has one "official" handbook that is all you need, has all
sections of manpages (nothing gets in -stable without proper
documentation) and a sound design.
*Note*: I don't mean to put off Linux! Just Linux and FreeBSD have
different focusses IMO: FreeBSD tries to be a more conservetive but
standard UNIX, slower but better organized and is easier to maintain
(for an experienced UNIX user, not for newbies since there aren't all
these non standard graphical tools for system management like for
Linux).
Linux is of course where the action is, has newer drivers for more
hardware, more commercial apps (though many run in FreeBSD's excellent
Linux emulator at full speed), all kinds of graphical tools for system
management (albeit different between Linux distros). It depends on
what want from your OS and on your own background.
--
Peter Mutsaers | D�bendorf | Trust me, I know
[EMAIL PROTECTED] | Switzerland | what I'm doing.
------------------------------
From: "Brian" <[EMAIL PROTECTED]>
Subject: Re: Is it safe to execute binary codes in the allocated memory?
Date: 14 Nov 2000 08:29:30 GMT
> "Josef Moellers" <[EMAIL PROTECTED]> ?????
news:[EMAIL PROTECTED]...
> Well, I have yet to see a piece of kernel memory being swapped out, but
> you never know.
You mean even kernel memory can be swapped out? If so, is there any way to
"pin" the memory? Thanks.
-Brian
> Also, it may very well be that on some machine architectures, memory
> areas allocated with kmalloc may be "read/write", but not
> "read/execute". Look into the code that does modules to find out.
> --
> Josef M�llers (Pinguinpfleger bei FSC)
> If failure had no penalty success would not be a prize (T. Pratchett)
------------------------------
From: patrick <[EMAIL PROTECTED]>
Subject: problem with "screen" app
Date: Tue, 14 Nov 2000 09:40:28 +0100
Reply-To: [EMAIL PROTECTED]
Hello every body,
I'm using "screen" application for viewing the output of many
applications launched in background.
I wish to run screen in my startup file like "/etc/rc.d/rc.local"
without doing any login.
The problem is that I get the following errror message
"Must be connected to a terminal"
I put the following line in rc.local:
screen <mybinaryfile>
I even tried with some other options of screen:
screen -m -d <mybinaryfile>
I don't have the error message but I don't have any
running application in memory for my binary file.
Do I missed something? Do I have to write something
in the /root/.screenrc file?
There are possibilities to run screen from the /etc/inittab
file? How to do that?
Any help will be welcomed,
Thanks in advance,
Pat
------------------------------
From: Kristof Beyls <[EMAIL PROTECTED]>
Subject: Re: Allocating Non-cacheable memory
Date: Tue, 14 Nov 2000 10:08:12 +0100
Philip Armstrong wrote:
> In article <[EMAIL PROTECTED]>,
> Kristof Beyls <[EMAIL PROTECTED]> wrote:
> >Is there a system call under linux 2.4 that can be used to allocate some
> >amount of memory with the
> >non-cacheable bits set, so that the allocated memory will never be
> >placed into the cache?
>
> Do you mean swap, or the processor cache?
>
> If the former, you need to investigate mlock(), in the latter case I
> don't know of anything specifically, but there might be games you can
> play with mtrr's (Memory Type Range Registers) on modern CPUs
> (possibly requiring a kernel recompile with the relevant options
> turned on.) to mark a paricular memory range as uncacheable. Accessing
> this from userland would probably require the support of a kernel
> module however.
>
I mean processor cache. I hoped there would be a system call that
would allocate a block of memory that will never be placed in the
processor cache.
Kristof Beyls
------------------------------
From: Johan <[EMAIL PROTECTED]>
Subject: Problems getting MAC address of network card
Date: Tue, 14 Nov 2000 10:18:00 +0100
I'm trying to get the MAC address from my ethernet card with the name
eth0. I do this with the ioctl call SIOCGIFHWADDR with an ifreq struct
(ifr) as an argument. The hardware address is then supposed to be put in
ifr.ifr_hwaddr.sa_data but that string is empty. Why?
This is the code I use:
int main(void)
{
int i;
int ioctl_sid;
static char mac_addr[16];
struct ifreq ifr;
char interface[] = "eth0";
if ((ioctl_sid = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
printf("Unable to create a new socket.");
return(-1);
strcpy(ifr.ifr_name, interface);
if (ioctl(ioctl_sid, SIOCGIFHWADDR, &ifr) < 0) {
printf("Unable to get MAC addrress of the interface: %s.",
interface);
close(ioctl_sid)
return(-1);
}
else {
memcpy(mac_addr, ifr.ifr_hwaddr.sa_data, 8);
}
printf("mac_addr = %s\n", mac_addr); /* This one returns an empty
string, why? */
close(ioctl_sid);
return(0);
}
------------------------------
Date: Tue, 14 Nov 2000 02:35:38 -0700
From: "D. Stimits" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: Re: Errors when insmod
misec wrote:
>
> I want to install a device driver module.
> The compile command and options for the driver are below...
>
> % gcc -c -Wall -D__KERNEL__ -DMODULE -O2 aaa.c
>
> above compile is successful.
>
> so, i install the driver module using insmod command.
>
> % insmod aaa.o
>
> then, following errors are listed..
>
> aaa.o: unresolved symbol request_region
> aaa.o: unresolved symbol __wake_up
> aaa.o: unresolved symbol kmalloc
> aaa.o: unresolved symbol unregister_chrdev
> aaa.o: unresolved symbol release_region
> aaa.o: unresolved symbol register_chrdev
> aaa.o: unresolved symbol pcibios_present
> ....
> ....
>
> What do those error messages mean?
>
> the problem making me confuse is that the same module is successfully
> installed the other kernel version (2.2.14)of linux.
>
> now i use the linux kernel version 2.2.12-20.
>
> Please teach me ..
>
> thanks.
This probably means your kernel source in /usr/src/linux/ is not set up
and configured for your current system. Sometimes distributions change
the include path symbolic links which can also cause things to appear
unconfigured. But basically during module compile it has to find the
source for your kernel *configured* for your current system. When you
compile a kernel one of the aids you get is the file System.map, which
should be installed fresh each kernel compile. So...be sure your kernel
source is in, and that it exactly matches your system, through at least
the make menuconfig (or other config) stage.
------------------------------
From: [EMAIL PROTECTED]
Subject: Stack access speed
Date: Tue, 14 Nov 2000 09:56:00 GMT
Hi all:
My name is Alan and I have a question that I need some help from all
great minds in this forum.
The question are as follow:
Question:
Platform 1 = Pentium 600 ,Win NT 4.0 + SP4 , Visual C++ 6.0
Platform 2 = Pentium 600, Suse Linux 6.4 , GCC compiler 2.95.2 with
optimize flag '-O2' set.
I have programmed the following code for a small test and run it on two
different platform as stated above.
Code:
====
void STATIC_RAM_TEST()
{
unsigned long bigArray1[500];
unsigned long bigArray2[500];
unsigned long bigArray3[500];
unsigned long bigArray4[500];
unsigned long bigArray5[500];
unsigned long bigArray6[500];
unsigned long bigArray7[500];
unsigned long bigArray8[500];
unsigned long i;
for (i=0;i<500;i++) {
bigArray2[i] = bigArray1[i] + i;
bigArray3[i] = bigArray2[i] + bigArray1[i];
bigArray4[i] = bigArray3[i] + bigArray2[i];
bigArray5[i] = bigArray4[i] + bigArray3[i];
bigArray6[i] = bigArray5[i] + bigArray4[i];
bigArray7[i] = bigArray6[i] + bigArray5[i];
bigArray8[i] = bigArray7[i] + bigArray6[i];
}
}
The results is as follow:
MS Visual C++ = ~900ms
Linux with GCC = ~2000ms
We then change the declaration of these arrays to "static" and rerun
the test, the result are as follow:
MS Visual C++ = ~900ms
Linux with GCC = ~950ms
We have isolated the problem to be "access speed to locally defined
automatic arrays" i.e. stack access speed. Our arrays are typically 1
KB in size and we use lots of them in our functions. As shown above, we
ran some timing tests for simple manipulation of arrays cells and found
that arrays defined as "automatic" ran significantly slower than arrays
defined as "static". This has caused our program to crawl in certain
instances when arrays are constantly being pushed and popped from the
stack. Is there a way to configure Linux to be more efficient in this
regard, or possibly we have missed something in GCC?
Any help would be much appreciated here. Thank you for your time.
Alan
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
From: [EMAIL PROTECTED] (Robert Kaiser)
Subject: Re: 16-bit assembly code
Date: 14 Nov 2000 09:58:21 GMT
In article <[EMAIL PROTECTED]>,
@cisco.com writes:
> I want to write 16-bit assembly code in AT&T syntax. Which assembler is
> best for 16-bit code assembling ?
I don't know if it's the best, but recent versions of GNU as can do
16-bit assembly. You must use the .code16 directive to switch from the
default 32-bit mode to 16-bit.
> I heard that gcc has some problems
> with 16-bit code.
Yes, if you want to write 16-bit code in "C", gcc won't get you very far.
For assembly though, the GNU assembler is OK and it supports AT&T syntax.
HTH
Rob
================================================================
Robert Kaiser email: rkaiser AT sysgo DOT de
SYSGO RTS GmbH http://www.elinos.com
Klein-Winternheim / Germany http://www.sysgo.de
------------------------------
From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: Errors when insmod
Date: Tue, 14 Nov 2000 11:38:23 +0100
misec wrote:
> =
> I want to install a device driver module.
> The compile command and options for the driver are below...
> =
> % gcc -c -Wall -D__KERNEL__ -DMODULE -O2 aaa.c
> =
> above compile is successful.
> =
> so, i install the driver module using insmod command.
> =
> % insmod aaa.o
> =
> then, following errors are listed..
> =
> aaa.o: unresolved symbol request_region
> aaa.o: unresolved symbol __wake_up
> aaa.o: unresolved symbol kmalloc
> aaa.o: unresolved symbol unregister_chrdev
> aaa.o: unresolved symbol release_region
> aaa.o: unresolved symbol register_chrdev
> aaa.o: unresolved symbol pcibios_present
> ....
> ....
> =
> What do those error messages mean?
> =
> the problem making me confuse is that the same module is successfully
> installed the other kernel version (2.2.14)of linux.
> =
> now i use the linux kernel version 2.2.12-20.
Do an "fgrep request_region /proc/ksyms". If the result looks something
like
c011be4c request_region_Rsmp6d32b2d7
(note the _R thing!), then your kernel was compiled using modversions,
an additional safety measure to prevent incompatible modules from
entering your kernel.
You will need at least to include "-DMODVERSIONS" in your gcc
invocation.
-- =
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
------------------------------
From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: Is it safe to execute binary codes in the allocated memory?
Date: Tue, 14 Nov 2000 11:55:20 +0100
Brian wrote:
> =
> > "Josef Moellers" <[EMAIL PROTECTED]> ?????
> news:[EMAIL PROTECTED]...
> =
> > Well, I have yet to see a piece of kernel memory being swapped out, b=
ut
> > you never know.
> =
> You mean even kernel memory can be swapped out? If so, is there any way=
to
> "pin" the memory? Thanks.
Kernel memory is not swapped out. The remark at the end is there because
I just hate to make absolute statements (especially those that reach
into the future) and I just wanted to protect my a** B-{)
Although in theory it would be possible to make parts of the kernel
swappable, this would not result in any significant improvement in
memory availability since the kernel only takes up a rather small
fraction of memory, not taking into account the buffer cache. Also,
since the kernel is always active, handling interrupts and system calls,
the pages occupied by the kernel and its data structures will most
likely never reach an age where they will be victims of a page-out.
In addition, it will make the kernel more complex and the resulting
reduction in memory usage by the kernel will most likely be compensated
by the increase in code to handle this. The kernel already has a fairly
small footprint due to the fact that most drivers are modularized and
the "static" kernel can sometimes be made even smaller by configuring
out uneeded parts.
I'd say the chances are greater that your kmalloc'ed piece of memory may
not be marked "executable" on some machine architecture or the other,
given the wide range of hardware platforms Linux runs on.
Again, try to find the code that handles module insertion inside the
kernel. There, memory is allocated to contain executable code.
Sorry if I confused you,
-- =
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
------------------------------
From: [EMAIL PROTECTED] (Wouter Verhelst)
Subject: Re: ntpd hung my system...
Date: Tue, 14 Nov 2000 11:04:37 GMT
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] writes:
> On Sun, 12 Nov 2000 12:03:21 GMT Wouter Verhelst <[EMAIL PROTECTED]> wrote:
>
>| I am running a self-compiled linux-kernel on my masq-gateway. On this gateway,
>| along a number of other applications, there is also ntpd. However, when I
>| first tried to boot my system after compiling my kernel, it just sat there,
>| doing nothing -- not even replying to a ping or something similar.
>
> Can you get any response via the SysRq feature (which your .config suggests
> you do have enabled)?
Forgot to check that. Stupid me... ;-)
When I have the time, I'll do that. But I'm afraid not...
>| A bit of experimenting with my system (I compiled another kernel, this time
>| including Virtual Console support ;-) showed that it hung right after ntpd was
>| started. At that moment, I got no response anymore -- at all. No reply to the
>| keyboard, no reply to pings, just nothing. My first idea was that something
>| went wrong after the last reboot (I had a forced reboot because of a power
>| failure), so I copied ntpd to a save place and let apt-get remove and then
>| install it.
>| I was surprised that the problem still existed. I thought that I probably
>| forgot to compile something in my kernel, and that ntpd was waiting for
>| a timeout to occur. But I've let my system running for about 24 hours, and
>| there's still no change, which makes me think that this is a kernel-bug.
>
> Disable NTP from automatic startup, and start it manually right after reboot
> and see if it causes the same problem.
Before I posted this, I already booted to runlevel 1, then manually
ran through my bootscripts (by doing ./<scriptname>)
I was sure that my netwerk was up at the time I reached ntp, but it
hung immediately. Well, immediately... I had about one second ;-)
I also checked whether there was any network-activity, but I didn't
see any LEDs blinking.
>| That's what brings me to you guys. I do not have the knowledge to hunt down
>| this bug, especially not since there's no information at all -- no panic or
>| oops, I just get no reaction anymore. However, I think this may be a security
>| issue (It's not because ntpd is ran as root, that no other application can
>| hang this system the same way...)
>| I'll upload the .config I used to compile my kernel, to give you guys at
>| at least a starting point. If there's more information to be needed, let
>| me know.
>
> I doubt it is a security issue. It may be an issue with a clock change
> causing something else to go crazy.
>
> Is your network all connected OK by the time NTP does start? What is your
> NTP configuration like?
It uses time.nist.gov as server.
If you want details: users.pandora.be/wouter.verhelst/ntp.conf
> How far off time is the clock?
By now: exactly 1 minute. (checked its time agains the time of my
workstation, which runs ntpd itself)
I don't think this is a huge difference...
Still, if some daemon hangs because of a clock change, I should be
able to switch to another VC, which was not possible.
> Try adding the -d or -q option to ntpdate
> (and making sure ntpdate gets run before starting ntpd). This should tell
> you if you have a large clock error.
>
>
>| Or if this is an issue already widely known, let me know too ;-)
>
> Not one I've heard of. The worst I've seen is a kernel message about an
> unknown syscall on the Sparc port of Linux when starting ntp.
>
>
>| BTW: The system is a Cyrix 486 DLC, while the kernel version I run is a 2.2.17
>
> I had no problems under that version, though I cannot test since I'm mostly
> switched over to 2.4.0-test10 now.
>
> NTP documentation probably can be read with:
> lynx /usr/doc/xntp3-5.93e/html/index.html
I'll check that out, thanks.
--
wouter punt verhelst op advalvas in Belgi�
11:50am up 1:29, 3 users, load average: 2.75, 1.67, 1.24
Voor een vertaling van Documentation/Configure.help naar het Nederlands:
http://users.pandora.be/wouter.verhelst/configure.html
QOTD:
"It seems to me that your antenna doesn't bring in too many
stations anymore."
------------------------------
** 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
******************************