Linux-Development-Sys Digest #173, Volume #8 Tue, 26 Sep 00 09:13:10 EDT
Contents:
executing userspace apps ([EMAIL PROTECTED])
Re: executing userspace apps ([EMAIL PROTECTED])
Re: PC speaker text-to-speech ("D. Stimits")
Re: PC speaker text-to-speech ("D. Stimits")
Re: how pci devices use dma (Arne Driescher)
Re: ioremap not in namespce...? (Arne Driescher)
Re: Problems with mmap() call and PCI device memory protections. (Arne Driescher)
Re: Q: network driver interface changes between 2.2.x and 2.4.x (Shmulik Hen)
Re: gdb ("Paul")
Re: gdb ("Paul")
Re: gdb ("Z")
Re: Linux Stack Sizes? (0/1) (James Avery)
Memory overuse problem (Dhiren Salian)
Re: Linux Stack Sizes? (0/1) (Rimas)
----------------------------------------------------------------------------
From: [EMAIL PROTECTED]
Subject: executing userspace apps
Date: Tue, 26 Sep 2000 15:35:34 +1000
Hi,
I was wondering if it is possible to execute a userspace application
from within the kernel (particularly binfmt_elf.c)...
something along the lines of execl()...
If so, what is the name of the function used to do this?
*an aside: It would be very useful for newbies like myself to have a
list of functions that can be used in the kernel.... Does this exist at
all?
Thanks very much for your time....
dan
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: executing userspace apps
Date: Tue, 26 Sep 2000 16:48:00 +1000
And also, are there any problems with trying to execute a program from
within the actual code that executes a program itself (ie. binfmt_elf.c
-> do_load_elf_binary)
thanks.
dan.
[EMAIL PROTECTED] wrote:
>
> Hi,
>
> I was wondering if it is possible to execute a userspace application
> from within the kernel (particularly binfmt_elf.c)...
> something along the lines of execl()...
>
> If so, what is the name of the function used to do this?
>
> *an aside: It would be very useful for newbies like myself to have a
> list of functions that can be used in the kernel.... Does this exist at
> all?
>
> Thanks very much for your time....
>
> dan
------------------------------
Date: Tue, 26 Sep 2000 01:00:20 -0600
From: "D. Stimits" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: Re: PC speaker text-to-speech
Marc SCHAEFER wrote:
>
> Jerome Corre <[EMAIL PROTECTED]> wrote:
> : I was just wondering if their is any way of using the pc speaker to play
> : sound? Is their any ready made module (i use the redhat 6.1 kernel) to
>
> There use to be the pcsp driver in 2.0.x as a patch. I don't know if
> it still exists on 2.2.x.
>
> : control the device? Is there any application available for linux to do
> : text to speech (i am not looking for quality here since the pc speaker
> : is gonna be the sound device, but for a small and simple application)
>
> In English, Festival is now free software (BSD or GPL license I think).
> Alternatively, there are MBROLA (non-free) and IBM ViaVoice (commercial).
I have an old program that I can't remember where exactly it came from.
But it probably had something to do with one of the university speech
projects around the nation. It is "say", and all I can find is from "say
--version":
test --version
test (GNU sh-utils) 2.0
Written by FIXME: ksb and mjb.
Copyright (C) 1999 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
It does quite well at speaking based on typewritten text. I think I
picked it up back in the 2.0 kernel days, eventually compiled it under
glibc, then lost the source. I wish I could find it again, it could have
quite a few applications. It doesn't use the pc speaker though, it
requires a sound card. If you found a program for normal sound
redirection to a pc speaker though, this could then be redirected that
way. Uncompressed, the binary is about 174k. If you need a copy, and
can't find "say" on the web, let me know.
D. Stimits, [EMAIL PROTECTED]
------------------------------
Date: Tue, 26 Sep 2000 01:02:37 -0600
From: "D. Stimits" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: Re: PC speaker text-to-speech
"D. Stimits" wrote:
>
> Marc SCHAEFER wrote:
> projects around the nation. It is "say", and all I can find is from "say
> --version":
> test --version
Didn't notice my own typo. That's what I get for having too many
windows. "say --version" doesn't do anything but speak. The offer still
stands though, if you can't find "say", I can get you a copy of this
one.
D. Stimits, [EMAIL PROTECTED]
------------------------------
From: Arne Driescher <[EMAIL PROTECTED]>
Subject: Re: how pci devices use dma
Date: Tue, 26 Sep 2000 09:04:23 +0200
"Michael D. Colasono" wrote:
> Not all have DMA capability
> and you'll need to use the DMA chip on the mother board. If you have a
>
> Anil Prasad wrote:
>
> > hi,
> > can anyone tell that how pci devices in linux use dma.
Hmm, putting the answer and the original question together
I think that you have to point out, that the DMA on the motherboard
has nothing to do with DMA used by PCI devices (correct me if I am
wrong).
PCI uses busmaster DMA. This means every PCI-device has its own
DMA controller (if it need one). How to write a driver for
this DMA controller depends on the chip on your PCI board and you
should study the documentation usually (*smile*) provided by
your provider. However, the most common PCI-chips (e.g. PLX)
are often used and you can find many fine examples in the
drivers dir of your kernel source.
-Arne
------------------------------
From: Arne Driescher <[EMAIL PROTECTED]>
Subject: Re: ioremap not in namespce...?
Date: Tue, 26 Sep 2000 09:11:02 +0200
>
> Hmmm... I DO see the same __ioremap in my System.map file - I don't see it when I
> run ksyms however.
> I must admit, I'm confused. Where exactly does the module look for it? I thought
> that in order for a module to access it, it would
> have to be listed in ksyms' output...but Why would it be in my System.map and not in
> ksyms' output?
>
Don't qoute me on this but as far as I know the module loader
uses System.map to resolve references to kernel functions.
Running ksyms on my system:
pc45:[~]> ksyms -a | grep ioremap
c010ee54 __ioremap
shows the reference to ioremap.
>From System.map:
c010ee54 T __ioremap
Both are the same. Perhaps you should start to build new
kernel until you have the same result in both cases.
-Arne
------------------------------
From: Arne Driescher <[EMAIL PROTECTED]>
Subject: Re: Problems with mmap() call and PCI device memory protections.
Date: Tue, 26 Sep 2000 09:16:46 +0200
Ben Burch wrote:
>
> Hi!
>
> I have here a driver I based upon Grant Edward's demomm.c driver. The goal
> here is to map SRAM from a PCI VCC Hotworks-II/Spartan board into the memory
> space of a user task. This is a 2 MB SRAM, and is pointed to by the device
> base register zero, with base register 1 pointing to the device I/O space;
>
> Sep 25 17:49:31 Device register 0: F5000000
> Sep 25 17:49:31 Device register 1: 00001081
>
> The driver builds and loads, and when I call mmap() I seem to have successfully
> mapped to it. That is, I can read data I know to be there. However, when I
> try to write to the same addresses, I get a bus error each time.
>
> The protection registers from the vma struct;
>
> vma->flags: 0073
> vma->page_prot: 000000
>
> When I try, the error in the kernel logs is;
>
> kernel: do_wp_page: bogus page at address 4010b000 (b5000000)
>
> Which is odd to me because the physical address as returned from the device's
> registers is f5000000.
>
Only a very far fetched guess: You are mixing up virt and phys
addresses. If you don't know what I am talking about read
/usr/src/linux/Documentation/IO-mapping.txt
Otherwise ignore this mail :-)
-Arne
------------------------------
From: Shmulik Hen <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.networking,comp.os.linux.development
Subject: Re: Q: network driver interface changes between 2.2.x and 2.4.x
Date: Tue, 26 Sep 2000 10:09:54 +0300
I happend to stumble on an article by David S. Miller from Feb 10 2000 about
"New network driver interface changes" in kernel 2.3.43-7. It looked like
someone saved a portion of a thread from a discussion group.
The article is very good and I was hoping there was an update, I just can't
seem to find where that thread is from and I was also hoping someone will be
able to direct me to it (it just didn't seem right to me to address my
question directly to the owner).
Thanks,
Shmulik.
bill davidsen wrote:
> In article <[EMAIL PROTECTED]>,
> Shmulik Hen <[EMAIL PROTECTED]> wrote:
>
> | Is there a good source of information that I can find about what changed
> | between 2.2.x and 2.4.x kernels in terms of ethernet device drivers ?
>
> If you have lots of time and disk space, you can take the two kernels,
> run a diff on the trees, use patchview to change the output to pretty
> HTML, and browse.
>
> However, the diff program doesn't work well when a file is moved to a
> new directory, so this may not do all you want.
>
> There are vast changes, so don't expect anyone to type in a summary.
>
> --
> bill davidsen <[EMAIL PROTECTED]> CTO, TMR Associates, Inc
> Make the rules? I don't make the rules. I don't even FOLLOW the rules!
------------------------------
From: "Paul" <[EMAIL PROTECTED]>
Subject: Re: gdb
Date: Tue, 26 Sep 2000 20:06:16 +1000
Thanks for your suggestion Z
I tried "print count" and still get the same error message.
- although if I move "count" and "i" up to make them globals then I can
print them out.
Any other ideas for printing out local vars ???
Z <[EMAIL PROTECTED]> wrote in message
news:8qmvob$dd4$[EMAIL PROTECTED]...
> Once upon a while "Paul" <[EMAIL PROTECTED]> wrote:
>
> > Forgot to mention - I did compile/build with GCC, not CC as wrongly
stated
> > below.
> >
> >
> > Paul <[EMAIL PROTECTED]> wrote in message
> > news:8qkapj$7o3$[EMAIL PROTECTED]...
> >> I am trying to debug my application using GDB with no luck.
> >> So I wrote a simple program and tried debugging it - with still no
luck.
> >> I have read up on GDB on the RedHat website (using Ver 6.2 of RedHat).
> >> Anyway I'm trying to display some variables using the "print" command
as
> > per
> >> doco. after a crash.
> >>
> >> So here is the code: test.c
> >>
> >> ====================
> >> #include <stdio.h>
> >>
> >> main ( )
> >> {
> >> int i, count;
> >>
> >> count = 0;
> >> printf("count=%d\n", count);
> >> i = 10 / count;
> >> printf("i=%d\n", i);
> >> }
> >> =======================
> >>
> >> Here is my compiler command:
> >>
> >> cc testdb.c -g -otestdb
> >>
> >> =====================
> >>
> >> When I run it and it crashes, I type in the following to run GDB
> >>
> >> gdb -e testdb -c core
> >>
> >> Then at the GDB prompt I want to view the value of the variable
"count".
> >> I type in:
> >>
> >> (gdb) print 'testdb.c'::count
> >>
> >> The response from GDB is:
> >>
> >> No symbol "testdb.c" in current context
> >>
> >>
> >> Can someone help me and tell me why I can't view the value of any
> > variables
> >> ???
> >>
> >> Thank you in advance
> >> Paul
> >>
> >>
> >
> >
>
> Hello Paul,
>
> what is the state of gdb when you want to lookup count?
> You shopuld do the following:
>
> 1) gdb progname
> 2) set breakpoint near to where you think progname crashes
> 3) run progname
> 4) step thru program with 'n' or 's'
> 5) print count (without a filename! because gdb will only
> show the value of count if it is available
> in the actual context)
>
>
> hope this is of any help.
>
> Z
>
>
>
> --
> LISP is worth learning for the profound enlightenment experience you
> will have when you finally get it; that experience will make you a
> better programmer for the rest of your days. Eric S. Raymond
------------------------------
From: "Paul" <[EMAIL PROTECTED]>
Subject: Re: gdb
Date: Tue, 26 Sep 2000 20:08:44 +1000
I tried the file name as a last resort. Still no luck.
Tried running "gdb testdb" and then "run testdb".
When it crashes I tried typing in "print count" and get the message
described below.
Moved the vars to make them global vars and was able to print them.
But no luck on printing local vars after the crash.
Russ Suter <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Paul wrote:
>
> > Forgot to mention - I did compile/build with GCC, not CC as wrongly
stated
> > below.
> >
> > Paul <[EMAIL PROTECTED]> wrote in message
> > news:8qkapj$7o3$[EMAIL PROTECTED]...
> > > I am trying to debug my application using GDB with no luck.
> > > So I wrote a simple program and tried debugging it - with still no
luck.
> > > I have read up on GDB on the RedHat website (using Ver 6.2 of RedHat).
> > > Anyway I'm trying to display some variables using the "print" command
as
> > per
> > > doco. after a crash.
> > >
> > > So here is the code: test.c
> > >
> > > ====================
> > > #include <stdio.h>
> > >
> > > main ( )
> > > {
> > > int i, count;
> > >
> > > count = 0;
> > > printf("count=%d\n", count);
> > > i = 10 / count;
> > > printf("i=%d\n", i);
> > > }
> > > =======================
> > >
> > > Here is my compiler command:
> > >
> > > cc testdb.c -g -otestdb
> > >
> > > =====================
> > >
> > > When I run it and it crashes, I type in the following to run GDB
> > >
> > > gdb -e testdb -c core
> > >
> > > Then at the GDB prompt I want to view the value of the variable
"count".
> > > I type in:
> > >
> > > (gdb) print 'testdb.c'::count
> > >
> > > The response from GDB is:
> > >
> > > No symbol "testdb.c" in current context
> > >
> > >
> > > Can someone help me and tell me why I can't view the value of any
> > variables
> > > ???
> > >
> > > Thank you in advance
> > > Paul
> > >
> > >
>
> When specifying a variable name, you do not include the file name. The
gdb
> help page for
> print states "Variables accessible are those of the lexical environment of
> the selected
> stack frame, plus all those whose scope is global or an entire file." So,
the
> file name is
> implied based on where you are in the code (in this case, at the point of
the
> core).
>
>
>
------------------------------
From: "Z" <[EMAIL PROTECTED]>
Subject: Re: gdb
Date: Tue, 26 Sep 2000 11:45:33 +0200
Once upon a while "Paul" <[EMAIL PROTECTED]> wrote:
> I tried the file name as a last resort. Still no luck.
> Tried running "gdb testdb" and then "run testdb".
> When it crashes I tried typing in "print count" and get the message
> described below.
> Moved the vars to make them global vars and was able to print them.
> But no luck on printing local vars after the crash.
>
Did you examin in which context the crash occured?
type 'bt' ( for backtrace ) to see which function
lead to the crash if the varaibles you try to
access are not in that function you can't access them.
Sometimes library functions crash because they are
passed the wrong arguments. I'ld suggest to set a breakpoint
in the calling function and see what the parameters to
the crashing function are than step into the crashing
function using 's' and see wheter there are any problems
with what you passed!
Z
--
LISP is worth learning for the profound enlightenment experience you
will have when you finally get it; that experience will make you a
better programmer for the rest of your days. Eric S. Raymond
------------------------------
From: James Avery <[EMAIL PROTECTED]>
Subject: Re: Linux Stack Sizes? (0/1)
Date: Tue, 26 Sep 2000 13:42:59 +0200
On Tue, 26 Sep 2000, MeekGeek wrote:
> Anyhow, the following program crashes if I specify anything more than
> about 6K, such as the default if you just run it. Also attached with
> a makefile.
Hi,
Why do you want to use the stack, which is rather volatile, rather than
use a calloc() allocated memory area?
--
Med venlig hilsen,
James Avery <[EMAIL PROTECTED]>
------------------------------
From: Dhiren Salian <[EMAIL PROTECTED]>
Subject: Memory overuse problem
Date: Tue, 26 Sep 2000 17:27:59 +0530
Hi
I was testing a linux box (64mb ram , 132mb swap running 2.2.12 kernel)
with a large memory consuming program (attached below). When I ran
multiples instances of the program until both the ram and swap space
were consumed, VM started killing off the processes. When they were
restarted, then VM after a few tries started killing off daemons like
crond, syslogd, portmap, etc. In a couple of instances it started
killing init (??) at which point , init went into PANIC. In a majority
of the cases(upto 95%), after some of the daemons were killed , the
system never became stable and some of the terminals froze up. Logging
in was not possible through telnet nor through the console (since this
had frozen up). The only alternative was a hard reboot. (From one of the
active consoles, the 'reboot' command returned me to the bash prompt
after broadcasting a shutdown message.)
Is this behaviour expected? I tested this with linux kernels 2.2.12-20,
2.2.14, 2.2.17 as also 2.4.0. Similar results on all kernels
|]hiren
============================================================
#include <stdio.h>
#include <stdlib.h>
#define BUF_SIZE (1024 * 1024)
#define BUFS 40
void main()
{
char *pointer1[BUFS];
char *pointer2[BUFS];
char *tmpptr;
int i,j;
for (i=0;i<BUFS;i++)
{ tmpptr = (char *) malloc (BUF_SIZE);
if (tmpptr != NULL)
pointer1[i] = tmpptr;
else
printf("failed to allocate for pointer1[%d]",i);
tmpptr = (char *) malloc(BUF_SIZE);
if (tmpptr != NULL)
pointer2[i] = tmpptr;
else
printf("failed to allocate for pointer2[%d]",i);
printf("round %d over :\n",i);
}
printf("allocated %d buffers of %d bytes", BUFS, BUF_SIZE);
j=0;
while(1)
{
for(i=0;i<BUFS;i++)
{ bcopy(pointer1[i],pointer2[i],BUF_SIZE);
}
printf("bcopy round %d \n",j++);
}
}
------------------------------
From: Rimas <[EMAIL PROTECTED]>
Subject: Re: Linux Stack Sizes? (0/1)
Date: Tue, 26 Sep 2000 13:24:30 +0200
MeekGeek wrote:
> // Now, check access to stack memory
> // and reference guard pages (Windows).
> c = *p; // try reading
> *p = c; // try writing
Check out the assembler output (-S).
This code is 'optimized out' by compiler. Try to compile without
optimization or use something like
*p=*p+1;
or
*p++;
to prevent optimization.
--
Rimas
------------------------------
** 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
******************************