Linux-Development-Sys Digest #287, Volume #8 Fri, 17 Nov 00 21:13:10 EST
Contents:
Re: Pointers, arrays and in_addr! ("Christoper McClan")
Any suggestion? (Pachinko Lin)
Re: injecting keystrokes into virtual console (George MacDonald)
How to use create_proc_entry(), etc? (Kaelin Colclasure)
PCTel modem driver for Mandrake 7.2 ("liquidFX")
Preemption within the kernel? (Kaelin Colclasure)
Re: PCI device I/O and user space buffers ("Tom")
Re: Preemption within the kernel? (Kaz Kylheku)
Re: Newbie compile problem ("Jan Thompson")
It worked wonderfully well! (Sean Bose)
Re: Free Memory available??? (Juergen Heinzl)
Re: Kernel Panic after booting recompiled kernel ([EMAIL PROTECTED])
Re: How to use create_proc_entry(), etc? ([EMAIL PROTECTED])
Re: TCP congestion-avoiding slow start mode (Daniel Kiracofe)
Re: Newbie compile problem (Edward Lee)
Re: Kernel Panic after booting recompiled kernel ("Karl Heyes")
What distro does Linus Torvalds use? (Michael V. Ferranti)
Re: TCP congestion-avoiding slow start mode (Todd Knarr)
----------------------------------------------------------------------------
From: "Christoper McClan" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development
Subject: Re: Pointers, arrays and in_addr!
Date: Fri, 17 Nov 2000 18:48:16 +0000
Thanks,
That did the job!
Christopher.
In article <8v2to0$[EMAIL PROTECTED]>, "Slawek Grajewski"
<[EMAIL PROTECTED]> wrote:
> The below program does what you want (I hope). The best source for
> information on C language is Kernighan & Ritchie book on C language:
> "http://s1.amazon.com/exec/varzea/ts/exchange-glance/Y01Y4217460Y0732303/qid
> =974453189/sr=1-2/ref=aps_sr_z_2_2/107-6173044-1111761"
>
> Hope this helsp. Slawek
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <sys/socket.h>
> #include <netinet/in.h>
> #include <arpa/inet.h>
>
> int main(int argc, char **argv)
> {
> struct in_addr *ip; struct in_addr **addr_list;
>
> /* allocate table for 1024 pointers to address structures */
> addr_list = (struct in_addr **)malloc(1024*sizeof(addr_list[0]));
>
> /* allocate memory for address #1 */
> ip = malloc(sizeof(*ip)); inet_aton("192.168.1.1", ip);
> addr_list[0] = ip;
>
> /* allocate memory for address #2 */
> ip = malloc(sizeof(*ip)); inet_aton("192.168.1.5", ip);
> addr_list[1] = ip;
>
> printf("addr_list[0] : %s\n", inet_ntoa(*addr_list[0]));
> printf("addr_list[1] : %s\n", inet_ntoa(*addr_list[1]));
>
> free(addr_list[0]); free(addr_list[1]); free(addr_list);
>
> return 0;
> }
>
>
> Christoper McClan wrote in message
> <8v1e6c$if6$[EMAIL PROTECTED]>...
>>A small snipet of code :
>>
>>#include <all relevant headers>
>>int main (int argc, char **argv)
>>{
>> struct in_addr ip1; char **addr_list; char *A; addr_list = (char
>> **)malloc(1024); ip1 = *((struct in_addr *)malloc(1024));
>> inet_aton("192.168.1.1",&ip1); addr_list[0]=(char *)&ip1;
>> inet_aton("192.168.1.5",&ip1); addr_list[1]=(char *)&ip1;
>> printf("addr_list[0] : %s\n",inet_ntoa(*(struct in_addr
> *)addr_list[0]));
>> printf("addr_list[1] : %s\n",inet_ntoa(*(struct in_addr
> *)addr_list[1]));
>>}
>>The output is : addr_list[0] : 192.168.1.5 addr_list[1] : 192.168.1.5
>>
>>I'm not briliant with pointers and referencing etc, does anyone know of
>>a
> good
>>resource for me to look them up?
>>
>>Obviously I want to copy the IP addresses into the addr_list array
>>rather
> than
>>copy a pointer to a in_addr structure (which is what I think is going
>>on!?)
>>
>>Fairly inexperienced at all this!
>>
>>Thanks,
>>
>>Christopher.
>
>
------------------------------
From: Pachinko Lin <[EMAIL PROTECTED]>
Subject: Any suggestion?
Date: 17 Nov 2000 18:51:52 GMT
Hello,
I want to learn Linux kernel with great details, especially the part
about networking. Richard Stevens's "TCP/IP Illustrated: vol 2" is a good
starting point, but its code is based on BSD system. Is these any suggestion
for Linux-specific resources? By the way, to learn Linux kernel, which book
do you recommend? I see some on Amazon, but still haven't decided which one
to start. Thank you.
------------------------------
From: George MacDonald <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: Re: injecting keystrokes into virtual console
Date: Fri, 17 Nov 2000 20:30:14 GMT
[EMAIL PROTECTED] wrote:
>
> On Thu, 16 Nov 2000 07:09:47 GMT George MacDonald <[EMAIL PROTECTED]> wrote:
>
> | I don't quite understand what you are trying to do, nor how fast you
> | want a solution, nor how widely deployed it will be. I just offered the hardware
>info
> | in case you didn't know about it. It could be used in some circumstances,
> | i.e. driving an OS test suite, or for performance testing ...
> | I just know about it, but have never tried it myself...
>
> I want one program to feed input into several sessions so that those
> sessions get initialized just as if I had spent the time to type it all in
> myself. Since it involves about 500 keystrokes into 40 or more sessions, it
> would be of great value to have this done for me. Having 40 extra
> processes between the real console devices and the ptys seems to me to be a
> waste. I'm trying to eliminate it, not change it over to a hardware
> solution that involves a converter and another computer, costing at least
> another $1000.
>
You could drive it from the serial port on the *same* computer which
should allow you to drive automatic keystrokes as well as manual. Of
course this lacks feedback to the serial port agent, so timing will
be an issue.
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.
> | Automating logins seems to be that hardest part, once logged in you can
> | run psuedo tty's for most things. X terminal windows ...
>
> That's what I'm trying to eliminate. A lot of these sessions produce some
> significant output and I feel the extra pty and process layers are slowing
> things down. Since all the process is doing once the session is initialized
> is copying data back and forth, it seems to be a waste to even have it
> there. Yet, manually setting up the sessions is time consuming and error
> prone.
Ah, your after a multi-headed turnkey type system. One login triggers initialization
of all the sessions to some pre-defined state. Such session "awareness" is
not built in at the lower levels of Linux, it is at the higher levels of
the desktops(GNOME, KDE) and "session" aware apps. So yet another way would
be to fire up the desktops, starting the apps in X term type windows, initialized
as appropriate. Hmm, sounds like you don't want to do that though!
I suppose yet another option is to use the program called "screen".
--
We stand on the shoulders of those giants who coded before.
Build a good layer, stand strong, and prepare for the next wave.
Guide those who come after you, give them your shoulder, lend them your code.
Code well and live! - [EMAIL PROTECTED] (7th Coding Battalion)
------------------------------
From: Kaelin Colclasure <[EMAIL PROTECTED]>
Subject: How to use create_proc_entry(), etc?
Date: 17 Nov 2000 12:38:34 -0800
I noticed some comments in the system header files to the effect that
some of the fs/proc/generic.c stuff was "incomplete." Does this imply
that the API's / structures might be changing between the 2.2.x and
2.4.x kernels?
Also, I have my own inode and file operations structures I wish to
associate with several new /proc entries. Is it safe for me to use
create_proc_entry() to allocate the entry and then re-initialize the
relevant structure members myself before returning from my
init_module() routine? Or could this result in a race condition if
some userland process attempts to access /proc/xxx at just the wrong
instant?
If there is a potential race condition, do I need to just clone my own
version of the create_proc_entry() code or is there a better way?
-- Kaelin
------------------------------
From: "liquidFX" <[EMAIL PROTECTED]>
Subject: PCTel modem driver for Mandrake 7.2
Date: Fri, 17 Nov 2000 15:42:56 -0500
Is anyone aware of a driver for a pctel hsp56 micromodem that will work
under Mandrake 7.2? pctel.o worked fine under 7.0 but not 7.2. Can anyone
tell me how to update the driver that worked under 7.0? Thanks
------------------------------
From: Kaelin Colclasure <[EMAIL PROTECTED]>
Subject: Preemption within the kernel?
Date: 17 Nov 2000 12:43:57 -0800
I saw some commentary within the kernel sources that implied there was
no preemption possible when running kernel-space code. (I'm talking
scheduler-level preemption -- I'm aware that interrupts my occur
unless I mask them.) Is this in fact true? And can I count on this to
remain true in future kernel versions?
And how about e.g. Solaris? Does kernel-level code there also run
without process-level preemption?
-- Kaelin
------------------------------
From: "Tom" <[EMAIL PROTECTED]>
Crossposted-To: fa.linux.kernel
Subject: Re: PCI device I/O and user space buffers
Date: Fri, 17 Nov 2000 21:15:26 GMT
Thanks Arne for reading my post.
Thanks for the clarification and "sanity check". Just wanted to be sure I
had the facts straight.
Thanks again,
Tom
------------------------------
From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: Preemption within the kernel?
Reply-To: [EMAIL PROTECTED]
Date: Fri, 17 Nov 2000 21:14:40 GMT
On 17 Nov 2000 12:43:57 -0800, Kaelin Colclasure <[EMAIL PROTECTED]> wrote:
>I saw some commentary within the kernel sources that implied there was
>no preemption possible when running kernel-space code.
That is true, however other processors can execute the kernel code
concurrently. So it is still necessary to protect critical regions, even
if you don't expect interrupts to execute your code.
>And how about e.g. Solaris? Does kernel-level code there also run
>without process-level preemption?
I don't believe that Solaris has a preemptable kernel, but you better
ask in a Solaris newsgroup.
------------------------------
From: "Jan Thompson" <[EMAIL PROTECTED]>
Subject: Re: Newbie compile problem
Date: Fri, 17 Nov 2000 22:05:18 +0100
Sorry, try to build these programs. But I can't find the rpm version of
mentioned programs, only the tarballs.
But the main question is: why do I get the ILLEGAL INSTRUCTION?
Is this a hardware problem (allthough the machine itself is running fine). ?
I see during the startup that Redhat finds a CPU bug, but installed a
workaround for this.
Does this have to do something with my problem?
If anyone has advises, Jan...
<[EMAIL PROTECTED]> wrote in message news:8uvlqd$fjv$[EMAIL PROTECTED]...
> Do you need to compile them?
> Consider obtaining them from the RPM.
> rpm -i rpm_filename
> The above will install the programs you want.
> Sorry if this wasn't what you needed.
>
> Brian
>
> In article <3a130bae$0$8166@reader3>,
> "Jan Thompson" <[EMAIL PROTECTED]> wrote:
> > I am trying to compile several programs like
> Squid, OpenSSL and OpenSSH.
> > Whatever I try I get fatal errors during
> compilations.
> > Error is:
> > make[1]: .... Illegal instruction (Core
> dumped)
> >
> > In the makefile originally was a line like
> CLAGS= .... -march=pentiumpro
> > ....
> > I tried to change this in just pentium, I
> removed the entry, but I still get
> > the error!
> > I'm getting desperate!
> > My CPU is a Pentium 200 MMX, 128Mb mem, SCSI
> disks
> > Is this a Pentium bug or any hardware related
> problem, is it ...
> >
> > Any suggestions would be appreciated.
> >
> > Thanks in advance, Jan...
> >
> >
>
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
From: Sean Bose <[EMAIL PROTECTED]>
Subject: It worked wonderfully well!
Date: Fri, 17 Nov 2000 14:27:13 -0800
Reply-To: [EMAIL PROTECTED]
Hi Sylvie
Please take my deepest thanks for your suggestion.
It worked wonderfully well.
Sean Bose
------------------------------
From: [EMAIL PROTECTED] (Juergen Heinzl)
Subject: Re: Free Memory available???
Date: 17 Nov 2000 22:38:10 GMT
In article <[EMAIL PROTECTED]>, Frederic S. Parain wrote:
>"Arint�" <[EMAIL PROTECTED]> writes:
>
>> Is there a function call in linux to get the amount memory available?
>> How about a system call? This is for a c project.
>
>Why don't you just open and parse the file /proc/meminfo?
[-]
Maybe because it's not going to return anything useful ?
Use getrlimit() as while at some point in time and space the
machine might have 1GB free combined memory space this does not
have to mean a given process is free to use it.
Of course parsing /proc/meminfo is even less portable than
getrlimit()
Ta',
Juergen
--
\ Real name : J�rgen Heinzl \ no flames /
\ EMail Private : [EMAIL PROTECTED] \ send money instead /
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: Kernel Panic after booting recompiled kernel
Date: Fri, 17 Nov 2000 22:42:45 GMT
my version does not have a manual entry for 'rdev'
also, I have no problems booting off of the orginal floppy as well as
off of Lilo. I have seen other threads about possible modules I should
not have linked. Any other suggestions? Thanks.
In article <8v2qlj$[EMAIL PROTECTED]>,
"Slawek Grajewski" <[EMAIL PROTECTED]> wrote:
> >The error message that I receive after booting off of my newly
> >recompiled kernel is:
> >
> >"Error, Cannot mount root fs on 21:06"
> >"Kernel Panic ... "
> >
> This message means that your system can not mount /dev/hde6 as a
root. So
> you probably don't have valid file system in this locaiton.
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: How to use create_proc_entry(), etc?
Date: Fri, 17 Nov 2000 23:05:28 GMT
Kaelin Colclasure <[EMAIL PROTECTED]> wrote:
: I noticed some comments in the system header files to the effect that
: some of the fs/proc/generic.c stuff was "incomplete." Does this imply
: that the API's / structures might be changing between the 2.2.x and
: 2.4.x kernels?
: Also, I have my own inode and file operations structures I wish to
: associate with several new /proc entries. Is it safe for me to use
: create_proc_entry() to allocate the entry and then re-initialize the
: relevant structure members myself before returning from my
: init_module() routine? Or could this result in a race condition if
: some userland process attempts to access /proc/xxx at just the wrong
: instant?
: If there is a potential race condition, do I need to just clone my own
: version of the create_proc_entry() code or is there a better way?
use proc_register if you have your own inode and file ops.
--
Jeff Garzik |
Building 1024 | The chief enemy of creativity is "good" sense
MandrakeSoft | -- Picasso
------------------------------
From: Daniel Kiracofe <[EMAIL PROTECTED]>
Subject: Re: TCP congestion-avoiding slow start mode
Date: Fri, 17 Nov 2000 17:04:40 -0500
Jerome Corre wrote:
> Where can I find out more about the TCP protocol and this mode?
> Is there a way to know when the slow start is active or inactive during
> a transmition? is there a way to force this mode constantly? is there
> any other mode?
AFAIK, the Berkeley sockets are pretty much agnostic about this kind of
transmission level detail. Stevens (as in W. Richard Stevens "UNIX
Network Programming" Vol 1, 2nd. ed.) does not mention any system call
to determine this information, and if it's not in there, it probably
doesn't exist (at least not portably). He gives a reference to the
class paper on congestion avoidance that you might want to check out,
Jacobson, 1988 "Congestion Avoidance and Control" Computer Communcation
Review, vol 18, no 4, pp 314-329,
ftp://ftp.ee.lbl.gov/papers/congavoid.ps.Z
--
/* Daniel */
E-mail: [EMAIL PROTECTED]
Personal Homepage: http://www.cis.ohio-state.edu/~kiracofe
"Fear is only afraid of the absence of itself" - Mediocrates
------------------------------
From: Edward Lee <[EMAIL PROTECTED]>
Subject: Re: Newbie compile problem
Date: Fri, 17 Nov 2000 15:37:18 -0800
Jan Thompson wrote:
> Sorry, try to build these programs. But I can't find the rpm version of
> mentioned programs, only the tarballs.
> But the main question is: why do I get the ILLEGAL INSTRUCTION?
That happens if you run PentiumPro instructions on a Pentium MMX. Your
installation program is probably messed up with CPU identification.
>
> Is this a hardware problem (allthough the machine itself is running fine). ?
> I see during the startup that Redhat finds a CPU bug, but installed a
> workaround for this.
It is probably a Redhat bug, rather than a CPU bug.
>
> Does this have to do something with my problem?
>
> If anyone has advises, Jan...
>
> <[EMAIL PROTECTED]> wrote in message news:8uvlqd$fjv$[EMAIL PROTECTED]...
> > Do you need to compile them?
> > Consider obtaining them from the RPM.
> > rpm -i rpm_filename
> > The above will install the programs you want.
> > Sorry if this wasn't what you needed.
> >
> > Brian
> >
> > In article <3a130bae$0$8166@reader3>,
> > "Jan Thompson" <[EMAIL PROTECTED]> wrote:
> > > I am trying to compile several programs like
> > Squid, OpenSSL and OpenSSH.
> > > Whatever I try I get fatal errors during
> > compilations.
> > > Error is:
> > > make[1]: .... Illegal instruction (Core
> > dumped)
> > >
> > > In the makefile originally was a line like
> > CLAGS= .... -march=pentiumpro
> > > ....
> > > I tried to change this in just pentium, I
> > removed the entry, but I still get
> > > the error!
> > > I'm getting desperate!
> > > My CPU is a Pentium 200 MMX, 128Mb mem, SCSI
> > disks
> > > Is this a Pentium bug or any hardware related
> > problem, is it ...
> > >
> > > Any suggestions would be appreciated.
> > >
> > > Thanks in advance, Jan...
> > >
------------------------------
From: "Karl Heyes" <[EMAIL PROTECTED]>
Subject: Re: Kernel Panic after booting recompiled kernel
Date: Sat, 18 Nov 2000 00:26:07 +0000
In article <8v4c94$bg9$[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote:
> my version does not have a manual entry for 'rdev' also, I have no
> problems booting off of the orginal floppy as well as off of Lilo. I
> have seen other threads about possible modules I should not have
> linked. Any other suggestions? Thanks.
>
Boot from floppy or lilo into your working system and type rdev on
its own as root. This will say what partition the root filesystem is
on. eg
/dev/hda1 /
Then just run
rdev /boot/<what name you called it> <the root filesystem>
eg
rdev /boot/bzImage /dev/hda1
re-run lilo.
karl.
------------------------------
From: Michael V. Ferranti <[EMAIL PROTECTED]>
Subject: What distro does Linus Torvalds use?
Date: Sat, 18 Nov 2000 01:36:49 +0000
TSIA. He's writing the kernel, so I figure what better flavor of
distro to use than what he's got running...
-- 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: Todd Knarr <[EMAIL PROTECTED]>
Subject: Re: TCP congestion-avoiding slow start mode
Date: 18 Nov 2000 01:56:56 GMT
In comp.os.linux.development.system <8v352v$94v$[EMAIL PROTECTED]> Jerome Corre
<[EMAIL PROTECTED]> wrote:
> Where can I find out more about the TCP protocol and this mode?
> Is there a way to know when the slow start is active or inactive during
> a transmition? is there a way to force this mode constantly? is there
> any other mode?
I don't believe you can find the information, because in a compliant
TCP stack slow-start is _always_ active. It's part of the protocol
definition for TCP, after all. And you do _not_ want to deactivate it,
as it's a critical part of avoiding congestion overload on the network.
If it is eliminated, performance drops off dramatically as new connections
cause overloads at routers and packet loss goes through the roof as a
consequence.
And no, that's not a theoretical conclusion. It's the observed results
from when TCP didn't have slow-start in it, which is why it was added
to the protocol.
--
Remember: every member of your 'target audience' also owns a broadcasting
station. These 'targets' can shoot back.
-- Michael Rathbun to advertisers
in n.a.n-a.e
------------------------------
** 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
******************************