Linux-Development-Sys Digest #647, Volume #8 Mon, 16 Apr 01 11:13:16 EDT
Contents:
help in using initrd when there is no root file system (lmc83)
Re: How to blank the screen in C? ("John Erbs")
Capturing raw ethernet frames ("Cameron Kerr")
Re: Basic question about PCI device drivers ([EMAIL PROTECTED])
The reason for static... (David)
Re: The reason for static... ("Peter T. Breuer")
Who can help me? ("ja")
Who can help me? ("ja")
killing a parent process also kills childern ? ("Yoav Zach")
Re: killing a parent process also kills childern ? (Lew Pitcher)
Re: Tizek.com is in dire need of a development team... ([EMAIL PROTECTED])
Re: glibc2.2.2 make error (Art Haas)
Re: The reason for static... (Chronos Tachyon)
----------------------------------------------------------------------------
From: lmc83 <[EMAIL PROTECTED]>
Subject: help in using initrd when there is no root file system
Date: Mon, 16 Apr 2001 14:26:50 +0800
hi,
I want to develop system in an evaluation board (edb7212).
Currently, the kernel could download into the board and boot up.
But it shows "VFS: unable to mount root fs".
If I want to use initrd as root file system, how to do ?
( There was no root file system currently, the only thing
I could do is to download the initrd.img to the specifiled
address which is on chip flash )
Thanks in advance for your help.
Liang Ming-Chung
------------------------------
From: "John Erbs" <[EMAIL PROTECTED]>
Subject: Re: How to blank the screen in C?
Date: Mon, 16 Apr 2001 17:26:13 +1000
"Paul Haley" <[EMAIL PROTECTED]> wrote in message
news:y40B6.2394$[EMAIL PROTECTED]...
> Kasper Dupont <[EMAIL PROTECTED]> wrote in
> <[EMAIL PROTECTED]>:
>
> >Paul Haley wrote:
> >>
> >> I'm working on a small project here and need to be able to blank the
> >> screen and bring it back when necessary. Does anybody have any sample
> >> code?
> >>
> >> Thanks,
> >> Paul Haley
> >
> >There is no ANSI C function to blank or unblank the
> >screen. Of course in most environments it can be done,
> >and it can be done in a lot of different ways.
> >
> >If you told us what is the environment in which you
> >intend to run your program we would be able to give a
> >much better answer.
> >
> >If your question had been:
> >How to blank the screen on a Linux Virtual Terminal
> >or How to blank the screen in X?
> >I could have answered it, but I don't know if that is
> >what you want to know or you want to know something
> >completely different. Also remember that there are
> >different ways to blank the screen, you can make an
> >all black image or you can turn off the monitor using
> >DPMS. What do you want?
> >
>
> Sorry, I need to blank the screen on a virtual terminal, not in X. I
don't
> want to turn off the monitor with DPMS, I just want it to be blanked out.
I
> only need this, though, if I can't figure out how to suppress all the
> messages on bootup.
>
> Regards,
> Paul
>
You mention you would liek to suppress all the messages on bootup. I read
the following message just before on this same news group, so I will just
copy and paste. Sorry if its just confusing the issue but i hope it helps.
Kasper Dupont wrote:
>Benjamin Scherrey wrote:
>>
>> I've got a techno-phobic client who gets concerned when he sees all the
>> things going across his screen when linux boots up. This is enough of an
>> issue that I'm prepared to go in and build a customer kernel or whatever
>> is necessary to make a linux boot appear even simpler than windows. How
>> do I get control over what gets to the screen when linux is booting? Is
>> there some parameter I can pass while building the kernel to suppress its
>> screen output? Perhaps route it to /dev/null or something?
>>
>> thanx & later,
>>
>> Ben Scherrey
>
>All you have to do is give "console=null" as argument to
>the kernel. The kernel argument can be specified in your
>loader configuration. If you use lilo the configuration
>is in /etc/lilo.conf. Find the default option and make a
>copy, then edit the append option. When the new config
>is saved run /sbin/lilo.
>
There's also a Linux Progress Patch which displays pretty pictures and
flashing lights as the machine boots, but really, this guy sounds like a
total retard, even if he is paying you money you should only tolerate his
cluelessness so far. You should just hit him in the head with your
combination Clue Stick / LART (LARTs are very useful in my experiencing for
the Readjustment of Luser Attitude) and let him figure it out himself. Or
advise him to turn his monitor on a minute after switching on his computer.
Maybe tell him that if there is a problem and you can't see the error
messages you'll have to charge him double for the extra time required to
work out the problem.
- Daniel
--
****************************************************************************
**
* Daniel Franklin - Postgraduate student in Electrical Engineering
* University of Wollongong, NSW, Australia * [EMAIL PROTECTED]
****************************************************************************
**
------------------------------
From: "Cameron Kerr" <[EMAIL PROTECTED]>
Subject: Capturing raw ethernet frames
Date: Mon, 16 Apr 2001 20:36:46 +1200
Hello, I'm looking for a point in the right direction.
I need to know how I can capture raw ethernet frames from
an ethernet network. It has do be done programmatically.
Basically, my brief is that I have to basically do all
the work of libpcap and bpk (which libpcap uses).
I'm looking through the source of libpcap and various .h
files, but have found no good starting points.
Can anyone suggest a source of information that might
help me? I should be able to have a look at "Linux Device
Drivers" (one of the O'Reilly books) tommorrow or suchlike,
but is there any other preferably "official" documentation.
Thanks.
--
Cameron Kerr -- cameron.kerr @ paradise.net.nz
Praise Slackware, our baud and saviour!
--
------------------------------
From: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.networking
Subject: Re: Basic question about PCI device drivers
Date: Mon, 16 Apr 2001 11:22:17 +0200
Slawek Grajewski <[EMAIL PROTECTED]> wrote:
[snip]
> Since DMA is performed
> by a different processor (card adapter), there must be some way of
> invalidating (synchronizing) the cache for that page in the main CPU.
> Otherwise, the main CPU could possibly use the stale contents of its cache
> for that page, not affected by the DMA transfer.
> I see three possibilities, but I don't know which is true:
> a. network buffers (alloc_skb()) are in non-cached memory,
> b. CPU invalidates the cache before accessing the frame,
> c. CPU cache is automatically updated by hardware (so that its view is
> always coherent).
> Can someone explain it to me?
Disclaimer: all AFAIK!
On the i386 processors the hardware solves the problem. I think it does
something called "bus snooping" and invalidates (not: updates) the
affected cache lines. So you don't have to care about that.
Something I'm not really sure about is the other way: If you fill some
memory buffer from the CPU and then tell a PCI card (by writing to some
I/O-mapped or memory mapped register) to get the buffer, is it sure that
the PCI card sees the updated memory content?
Followups: removed c.o.l.d.a.
Peter
------------------------------
From: [EMAIL PROTECTED] (David)
Subject: The reason for static...
Date: Mon, 16 Apr 2001 09:06:50 GMT
Hello people,
I have always wondered why most of the variables and functions in a
device driver needs to be declared as static. Is there a reason to
this practice? And when can we safely discard the static tag?
Thanks,
David
------------------------------
From: "Peter T. Breuer" <[EMAIL PROTECTED]>
Subject: Re: The reason for static...
Date: Mon, 16 Apr 2001 13:39:05 +0200
David <[EMAIL PROTECTED]> wrote:
> I have always wondered why most of the variables and functions in a
> device driver needs to be declared as static. Is there a reason to
Well, the functions will be static to keep the kernel namespace clean.
Variables will either be static for the same reason, or in order to use
them as module parameters.
> this practice? And when can we safely discard the static tag?
Why would you want to? The more functions that are static, the safer
the thing is.
Peter
------------------------------
From: "ja" <[EMAIL PROTECTED]>
Subject: Who can help me?
Date: Mon, 16 Apr 2001 20:30:52 +0800
I face a problem about compile.
%cc -o AppTest AppTest.c
AppTest.c: In function 'Attempt Connection':
AppTest.c:253: in compatible type for argument 2 of 'connect'
AppTest.c: In function 'GetReturnStatus':
AppTest.c:storage size of 'readFds' isn't known.
Do you know what's wrong?
Below is my program.
#include <errno.h>
#include <sys/errno.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <signal.h>
#include <stdio.h>
#include <netdb.h>
#include <fcntl.h>
#include <unistd.h>
/* include files needed for "herror ()" call */
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>
int AttemptConnection (ConnectionStatus)
int *ConnectionStatus;
{
int Socket, I;
struct sockaddr_in ServerAddr;
Socket = stream_socket_info.Socket;
ServerAddr = stream_socket_info.Addr;
//AppTest.c:253: in compatible type for argument 2 of 'connect'
// compile tell me ServerAddr have something wrong . why???
// How to modify ?
if (connect (Socket, ServerAddr, sizeof (struct sockaddr_in)) == ERROR)
{
if (errno == ECONNREFUSED)
{
perror ("INFO - Attempting connection to server ");
close (Socket);
if (CreateStreamSocket(I) == ERROR) return(ERROR);
}
else
{
perror ("FATAL ERROR - Attempting connection to server ");
return (ERROR);
}
}
else
{
printf ("Successful connection to %s\n", stream_socket_info.HostName);
*ConnectionStatus = CONNECTED;
return (NO_ERROR);
}
*ConnectionStatus = NOT_CONNECTED;
return (NO_ERROR);
}
int GetReturnStatus ()
{
int BytesRead;
int selectCount;
//AppTest.c:storage size of 'readFds' isn't known.
//How to modify?
struct fd_set readFds;
struct timeval timeLimit;
timeLimit.tv_sec = TIME_OUT;
timeLimit.tv_usec = 0;
FD_ZERO (&readFds);
FD_SET (stream_socket_info.Socket, &readFds);
printf("WAITING FOR RESPONSE.....\n");
selectCount = select (FD_SETSIZE, &readFds, NULL,NULL, &timeLimit);
if (selectCount == ERROR)
{
printf ("FATAL ERROR - select failed in GetReturnStatus.\n");
return (ERROR);
}
if (selectCount == 0)
{
printf ("FATAL ERROR - Time out occured in GetReturnStatus.\n");
return (ERROR);
}
if ((BytesRead =
read (stream_socket_info.Socket, &control_message, BUFLEN)) ==
ERROR)
{
perror ("FATAL ERROR - GetReturnStatus (read).\n");
return (ERROR);
}
if (BytesRead < BUFLEN)
{
printf ("FATAL ERROR - Read from socket incomplete!!! \n");
return (ERROR);
}
printf ("%s for %s \n", control_message.Buffer1, WscStationId);
}
Thank you!
[EMAIL PROTECTED]
------------------------------
From: "ja" <[EMAIL PROTECTED]>
Subject: Who can help me?
Date: Mon, 16 Apr 2001 20:31:20 +0800
I face a problem about compile.
%cc -o AppTest AppTest.c
AppTest.c: In function 'Attempt Connection':
AppTest.c:253: in compatible type for argument 2 of 'connect'
AppTest.c: In function 'GetReturnStatus':
AppTest.c:storage size of 'readFds' isn't known.
Do you know what's wrong?
Below is my program.
#include <errno.h>
#include <sys/errno.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <signal.h>
#include <stdio.h>
#include <netdb.h>
#include <fcntl.h>
#include <unistd.h>
/* include files needed for "herror ()" call */
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>
int AttemptConnection (ConnectionStatus)
int *ConnectionStatus;
{
int Socket, I;
struct sockaddr_in ServerAddr;
Socket = stream_socket_info.Socket;
ServerAddr = stream_socket_info.Addr;
//AppTest.c:253: in compatible type for argument 2 of 'connect'
// compile tell me ServerAddr have something wrong . why???
// How to modify ?
if (connect (Socket, ServerAddr, sizeof (struct sockaddr_in)) == ERROR)
{
if (errno == ECONNREFUSED)
{
perror ("INFO - Attempting connection to server ");
close (Socket);
if (CreateStreamSocket(I) == ERROR) return(ERROR);
}
else
{
perror ("FATAL ERROR - Attempting connection to server ");
return (ERROR);
}
}
else
{
printf ("Successful connection to %s\n", stream_socket_info.HostName);
*ConnectionStatus = CONNECTED;
return (NO_ERROR);
}
*ConnectionStatus = NOT_CONNECTED;
return (NO_ERROR);
}
int GetReturnStatus ()
{
int BytesRead;
int selectCount;
//AppTest.c:storage size of 'readFds' isn't known.
//How to modify?
struct fd_set readFds;
struct timeval timeLimit;
timeLimit.tv_sec = TIME_OUT;
timeLimit.tv_usec = 0;
FD_ZERO (&readFds);
FD_SET (stream_socket_info.Socket, &readFds);
printf("WAITING FOR RESPONSE.....\n");
selectCount = select (FD_SETSIZE, &readFds, NULL,NULL, &timeLimit);
if (selectCount == ERROR)
{
printf ("FATAL ERROR - select failed in GetReturnStatus.\n");
return (ERROR);
}
if (selectCount == 0)
{
printf ("FATAL ERROR - Time out occured in GetReturnStatus.\n");
return (ERROR);
}
if ((BytesRead =
read (stream_socket_info.Socket, &control_message, BUFLEN)) ==
ERROR)
{
perror ("FATAL ERROR - GetReturnStatus (read).\n");
return (ERROR);
}
if (BytesRead < BUFLEN)
{
printf ("FATAL ERROR - Read from socket incomplete!!! \n");
return (ERROR);
}
printf ("%s for %s \n", control_message.Buffer1, WscStationId);
}
Thank you!
[EMAIL PROTECTED]
------------------------------
From: "Yoav Zach" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development
Subject: killing a parent process also kills childern ?
Date: Mon, 16 Apr 2001 16:32:57 +0300
I wrote the simplest piece of code, in which a process creates a new one and
they both wait for input from the keyboard. Now, when killing the parent
process ( by sending it SIGTERM ), the child process is killed too. I can't
figure out who kills it and why. Does anyone knows the answer ?
------------------------------
From: [EMAIL PROTECTED] (Lew Pitcher)
Crossposted-To: comp.os.linux.development
Subject: Re: killing a parent process also kills childern ?
Reply-To: [EMAIL PROTECTED]
Date: Mon, 16 Apr 2001 13:49:01 GMT
On Mon, 16 Apr 2001 16:32:57 +0300, "Yoav Zach" <[EMAIL PROTECTED]>
wrote:
>I wrote the simplest piece of code, in which a process creates a new one and
>they both wait for input from the keyboard. Now, when killing the parent
>process ( by sending it SIGTERM ), the child process is killed too. I can't
>figure out who kills it and why. Does anyone knows the answer ?
Who killed the child process? You did.
Why? For whatever reason you sent the SIGTERM
Most signals are 'inherited' by the child processes. You have to take
special action in the child to 'disinherit' it from the signals passed
to the parent process. This is even more true when both parent and
child share a controlling terminal.
For more details, read...
'man 2 signal'
'man 2 fork'
'man 2 kill'
'man 2 clone'
and any good book on Unix.
Lew Pitcher, Information Technology Consultant, Toronto Dominion Bank Financial Group
([EMAIL PROTECTED])
(Opinions expressed are my own, not my employer's.)
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: Tizek.com is in dire need of a development team...
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.misc
Date: Mon, 16 Apr 2001 13:59:23 GMT
[EMAIL PROTECTED] writes:
> There is no pay (yet) but once we get going income will be generated
> through advertisements on the site and various other services which
> we will offer, and there will surely be enough to go around.
> Brief Overview:
> TizEK.com is destined to be THE premiere Internet portal for techies
> and geeks alike. We currently need graphic developers, HTML authors,
> PHP, CGI/PERL authors, and creative minds. To apply, mail us at
> [EMAIL PROTECTED]
If the need is _SO_ desperate, and the destiny for greatness so
certain, it would seem senseless NOT to spend some of the venture
capital paying for competent programmers.
Any venture that plans to altogether defer paying would-be employees
seems more than a mite shifty to me...
--
(concatenate 'string "cbbrowne" "@ntlug.org")
http://vip.hyperusa.com/~cbbrowne/resume.html
Friends help you move. Real friends help you move bodies.
------------------------------
From: Art Haas <[EMAIL PROTECTED]>
Subject: Re: glibc2.2.2 make error
Date: 16 Apr 2001 09:40:10 -0500
Greg Ellison <[EMAIL PROTECTED]> writes:
> Hi!
> I,m trying to upgrade my libs after ViaVoiceTTS fails to work on my
> RH7 system. I,ve followed the FAQ advice and put it into my kernel and
> configured with
> ../configure --enable-add-ons=linuxthreads --prefix=/usr
> --with-headers=/usr/src/linux-2.2.16/include
> I also tried the test install from glibc2 HOWTO using
> "--prefix=/usr/i486-glibc2.2.2-linux " and failed at the same point on
> make.
> Any suggestion, should I use the new 2.4 kernel?
> There is a menusagestat.h but no menisagestat.o in the malloc dir
> Thanks.
>
> ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -nostdinc
> -isystem /usr/lib/gcc-lib/i386-redhat-linux/2.96/include -isystem
> /usr/src/linux-2.2.16/include -D_LIBC_REENTRANT -include
> ../include/libc-symbols.h -o
> /usr/src/linux-2.2.16/glibc-2.2.2/compile/malloc/memusagestat.o
> memusagestat.c:36:16: gd.h: No such file or directory
> memusagestat.c:37:21: gdfontl.h: No such file or directory
> memusagestat.c:38:21: gdfonts.h: No such file or directory
> make[2]: ***
> [/usr/src/linux-2.2.16/glibc-2.2.2/compile/malloc/memusagestat.o] Error
> 1
> make[2]: Leaving directory `/usr/src/linux-2.2.16/glibc-2.2.2/malloc'
> make[1]: *** [malloc/others] Error 2
> make[1]: Leaving directory `/usr/src/linux-2.2.16/glibc-2.2.2'
> make: *** [all] Error 2
> [root@localhost compile]# exit
You need to use `--with-gd-include=DIR' when you run
configure to correctly get the gd headers. I'm assumming they are
located in `/usr/include' ...
$ ../configure --enable-add-ons=linuxthreads --prefix=/usr \
--with-headers=/usr/src/linux-2.2.16/include \
--with-gd-include=/usr/include
There are a couple of options relevant to gd, do a
$ ../configure --help
to see them (as well as all the other options).
--
###############################
# Art Haas
# (713) 689-2417
###############################
------------------------------
From: Chronos Tachyon <[EMAIL PROTECTED]>
Subject: Re: The reason for static...
Date: Mon, 16 Apr 2001 14:48:21 GMT
On Mon 16 Apr 2001 04:06, David wrote:
> Hello people,
>
> I have always wondered why most of the variables and functions in a
> device driver needs to be declared as static. Is there a reason to
> this practice? And when can we safely discard the static tag?
>
> Thanks,
> David
>
The "static" keyword used at a global scope means that a function or
variable is only visible within that one file and that it shouldn't be
exported. Any member that should stay private within a driver should be
marked static to prevent namespace pollution. While you could technically
get away with discarding the static tag, it *will* eventually bite you as
soon as two drivers contain private variables that have the same name.
--
Chronos Tachyon
Guardian of Eristic Paraphernalia
Gatekeeper of the Region of Thud
[Reply instructions: My real domain is "echo <address> | cut -d. -f6,7"]
------------------------------
** 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 by posting to the
comp.os.linux.development.system newsgroup.
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
******************************