Linux-Development-Sys Digest #75, Volume #8      Fri, 11 Aug 00 19:13:13 EDT

Contents:
  Re: problems with printk ("Olivier Accili")
  How to run a CGI in Apache Web Server? ("Alan Po")
  Re: How to run a CGI in Apache Web Server? (=?iso-8859-1?Q?Rasmus_B=F8g_Hansen?=)
  Re: driver superblock problem ("Andy Jeffries")
  insmod with new kernel: unresolved symbols (Thomas Berkefeld)
  Re: linux streaming MP3 problem/question (Jan Panteltje)
  Re: Some Qs about parallel port programming (in EPP mode) (Kasper Dupont)
  Re: share libraries in Linux (Kasper Dupont)
  Sound card programming (Kevin Lo)
  using call gates problems ("Olivier Accili")
  printk and EXPORT_SYMBOL in a MODULE (Brian Horton)
  Re: insmod with new kernel: unresolved symbols (Rick Ellis)
  Re: Sound card programming (Rick Ellis)
  checking properties of incoming connection (Bhavin Shah)
  Misterious Hangs in my network ("Andres Tarallo")
  Re: checking properties of incoming connection (Kaz Kylheku)
  Re: What is the difference between soft link and hard link? (Mario Klebsch)
  /proc/mtrr is empty (Karl =?iso-8859-1?Q?Stephenson-M=F6ller?=)
  Adding a system call dynamically (James Avery)
  Unrecognized symbols printk - ("Rob Morris")
  Re: insmod with new kernel: unresolved symbols ("Rob Morris")
  Re: Problem including <limits.h> (Andrew Jaffe)

----------------------------------------------------------------------------

From: "Olivier Accili" <[EMAIL PROTECTED]>
Subject: Re: problems with printk
Date: Thu, 10 Aug 2000 15:22:33 +0200
Reply-To: "Olivier Accili" <[EMAIL PROTECTED]>


First, thank for responding,

RM wrote in message ...
>Check the optimization settings for GCC.  Some compilers (saw it with
>MSVC6.0, think I saw something that sounds the same under GCC) will
>"optimize" by keeping track of stack usage across multiple function calls,
>then perform a single cleanup call whenever appropriate (i.e. before a
loop,
>within a loop, or before function end). This would explain the 12-bytes for
>your code (three 32-bit long ints).


If it's that, I'll have some problems, but I do not need to use this any
longer, what a good news for me.

>Question is, why is the format string identifier "%ls" for the tss.esp0? If
>this is not a typo, It could also be the source of your problems.

This was a typing error, in the core the type is %lx ... sorry I didn't see
that when reeding back this message.

>Sorry I can't be more specific about where to look or which command line
>option to tweak...


It is quite helpfull while you gave me a way to look for answers.

Thanks a lot.



------------------------------

From: "Alan Po" <[EMAIL PROTECTED]>
Crossposted-To: 
alt.comp.linux,alt.os.linux,comp.os.linux,comp.os.linux.development.apps,comp.os.linux.help,comp.os.linux.questions
Subject: How to run a CGI in Apache Web Server?
Date: Fri, 11 Aug 2000 17:14:25 +0800

Dear sir

I have installed a CGI (w3cam.cgi) and try to put it into my apache server
to run it. However, I don't know where can I put it? Is /cgi-bin? I have
tried to put into /html but a "Forbidden" meesage come out. Please tell how
can I work with CGI in Apache.

Alan Po
[EMAIL PROTECTED]



------------------------------

From: =?iso-8859-1?Q?Rasmus_B=F8g_Hansen?= <[EMAIL PROTECTED]>
Crossposted-To: 
alt.comp.linux,alt.os.linux,comp.os.linux,comp.os.linux.development.apps,comp.os.linux.help,comp.os.linux.questions
Subject: Re: How to run a CGI in Apache Web Server?
Date: Fri, 11 Aug 2000 11:32:20 +0200

On Fri, 11 Aug 2000, Alan Po wrote:

> Dear sir
> 
> I have installed a CGI (w3cam.cgi) and try to put it into my apache server
> to run it. However, I don't know where can I put it? Is /cgi-bin? I have
> tried to put into /html but a "Forbidden" meesage come out. Please tell how
> can I work with CGI in Apache.

First of all, you will have to enable CGI-scripts in your apache
configuration. You will also have to provide a cgi-alias to
/cgi-bin/. I'm afraid, that I don't remember these options - but you could
find them in the apache manual.

If these are enabled and set correct, you just put the script in
/cgin-bin/ - and access it with http://your_host/cgi-bin/your_script.

That should do it.

Rasmus B. Hansen

---
N�h ja for fa'en
- det er jo mig, der skal starte
                                  -- Ole Fick


------------------------------

From: "Andy Jeffries" <[EMAIL PROTECTED]>
Subject: Re: driver superblock problem
Date: Fri, 11 Aug 2000 10:58:35 +0000

In article <[EMAIL PROTECTED]>,
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> I an writing a device driver that is a fake raw hard drive. ie you can
> mount it. The driver is implemented as a kernal device driver module.
> 
> Formatting of the device works fine except i have to define a max block
> number.
> 
> When i try to mount it , mount says bad super block. get_super returns
> NULL.
> 
> Yet if i copy my device into a raw file and mount with loop back it
> works.
> 
> Can anyone please help me,
> 
> Thanks Richard.
> 

Is there any chance of a copy of your source code?  We are starting 
to do the same thing.  We are writing a version of Scramdisk 
(www.scramdisk.clara.net) for Linux.

Our code will, of course, be GPL'd!


-- 
Andy Jeffries
Lead-developer of Scramdisk for Linux
Developer of original Scramdisk Delphi Component


------------------------------

From: [EMAIL PROTECTED] (Thomas Berkefeld)
Subject: insmod with new kernel: unresolved symbols
Date: Fri, 11 Aug 2000 12:18:07 +0200

Hello,

after updating the kernel from 2.2.14 to 2.2.17pre15, a module that has been 
compiled afterwards cannot be loaded. insmod says "unresolved symbol" 
for all symbols. Any ideas?

Thanks

Thomas

------------------------------

From: [EMAIL PROTECTED] (Jan Panteltje)
Crossposted-To: be.comp.programming,comp.os.linux.development.apps
Subject: Re: linux streaming MP3 problem/question
Date: Fri, 11 Aug 2000 14:31:12 GMT

>
Hi,
You should buffer at the receiver and send and read a lot of chars
at the same time.
Also you should do the correct error check on the read, and look for E_AGAIN.

                        bytes_read =\
                        read(sock, ucbufptr, buffer_length - bytes_received);
                        if (bytes_read < 0)
                                {
                                /* Read error. */
                                perror ("read_from_server(): read");
                                if(errno == EAGAIN) continue;
                                if(errno == EINTR) continue;
                                return 0;
                                }
                        else if (bytes_read == 0)/* EOF, connection closed by server */
                                {
                                /* we are here for example if incorrect password */
                                fprintf(stdout, "read_from_server(): EOF detected\n");

                                /* maybe close socket here */
                                return 0;
                                }
                

have a look at the internet_server.c in mcam (webcam via tcp/ip)
http://www.panteltje.demon.nl/mcam/
Not I am not using streaming, just send a frame a the time.
Still it caters for the data coming in in chunks.
(So calls to read until all data is read)
And I use select to see if data is available on the sockets.
I did try a small streaming version, but for this purpose it was not the
best solution.
Anyways, again, look at something like realplayer, it first fills a buffer,
only then it starts playing (from the buffer), while the connection keeps
the buffer filled.
The Internet cannot guarantee continuous data flow.
Please read libc.info (/usr/info/libc.info... )
it goes into much detail about all this.
Jan

 

------------------------------

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Some Qs about parallel port programming (in EPP mode)
Date: Fri, 11 Aug 2000 17:03:08 +0200

[EMAIL PROTECTED] wrote:
> 
[...]
> 
> 2. I have read lp.c in Linux Kernel Source and found the following
>    code. Why it use do { ... } while (0) to enclose the actual code?
> 
>    #define w_dtr(x,y)  \
>     do { parport_write_data(lp_table[(x)].dev->port, (y)); } while (0)
> 
[...]

The do { ... } while (0) construction is necesarry when
the macro contains multiple statements or local variables.
In the particular case it could be done as simple as this:

#define w_dtr(x,y)  \
   parport_write_data(lp_table[(x)].dev->port, (y))

But this macro would not work without do { ... } while (0)

#define DELETE(a) do{ \
      if(a)free(a);   \
      a=NULL;         \
   }while(0)

-- 
Kasper Dupont

------------------------------

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: share libraries in Linux
Date: Fri, 11 Aug 2000 17:24:54 +0200

Jan Wielemaker wrote:
> 
> In article <8msb45$25a$[EMAIL PROTECTED]>, Peter Huang wrote:
> >Is there any way that I can allow different processes using a share library
> >to share resources,
> 
> This is not related to shared libraries in Unix.  You may wish to have a
> look at the shared memory stuff (see shmget() for a starting point).
> 
> Indeed you can also use a deamon process to hold the common value.  How depends
> on the details.  If the processes are childs of some master process you can
> create a pipe before forking.  Otherwise you'll have to use UNIX or INET domain
> sockets for the communication.
> 
> Finally you can use a file, either using mapping or read/write with proper
> locking.
> 
> For short, it depends on the details: how do the processes relate as well as
> performance and locking requirements.
> 

You should also consider posible security problems.
You might need to store the data inside the module
or in a daemon/server. The module should have
enough information to verify all calls, in general
a module should trust no one, not even the server.

If you choose to use a server process, you could
make that run as root, and the module could then
choose only to allow root to call the functions.

I believe there exist some effective way to transfer
data between a server and a client on the same host,
perhaps shmget() and shmat() could be used.

The choice depends on what exactly you want to do.

-- 
Kasper Dupont

------------------------------

From: Kevin Lo <[EMAIL PROTECTED]>
Subject: Sound card programming
Date: Sat, 12 Aug 2000 01:08:59 +0800

Hi,

I want to learn how to write device drivers for sound card.
Would anyone know where I can get the info or recommend me
good books, thanks.

- Kevin


------------------------------

From: "Olivier Accili" <[EMAIL PROTECTED]>
Subject: using call gates problems
Date: Fri, 11 Aug 2000 15:58:20 +0200
Reply-To: "Olivier Accili" <[EMAIL PROTECTED]>

Hello,

I'd like to use call gates but I need some samples.

I tried this:
"
movl $0x41,%eax
mov %ax,%gs
call *%gs:(%eax)
"
With 0x41 the selector to acces my call gate in the GDT (I move up TSS and
LDT descriptors).

But mov instruction fails because 0x41 is not a GDT index for data segment
or readable code segment but for a call gate.

Thanks in advance

--
Olivier



------------------------------

From: Brian Horton <[EMAIL PROTECTED]>
Subject: printk and EXPORT_SYMBOL in a MODULE
Date: Fri, 11 Aug 2000 11:58:36 -0500

kernel newbie here... I'm trying to build a kernel module (that I'll be
loading via insmod) and want it to export a symbol (via EXPORT_SYMBOL).
I compile the code w/ -DMODULE -DEXPORT_SYMTAB and it compiles fine.
But, when I insmod it fails w/ unresolved on symbol 'printk'. Sure
enough, my kernel doesn't have 'printk', it has:

# cat /proc/ksyms|grep printk
c0113e2e printk_R1b7d4074

So how do I get printk and EXPORT_SYMBOL at the same time? What am I
doing wrong? Some other flag or -D that I need? Or can Modules not
export symbols?

thx.bri.

------------------------------

From: [EMAIL PROTECTED] (Rick Ellis)
Subject: Re: insmod with new kernel: unresolved symbols
Date: 11 Aug 2000 17:36:19 GMT

In article <[EMAIL PROTECTED]>,
Thomas Berkefeld <[EMAIL PROTECTED]> wrote:

>after updating the kernel from 2.2.14 to 2.2.17pre15, a module that has been 
>compiled afterwards cannot be loaded. insmod says "unresolved symbol" 
>for all symbols. Any ideas?

Do you have symbol versioning on?

--
http://www.fnet.net/~ellis/photo/linux.html

------------------------------

From: [EMAIL PROTECTED] (Rick Ellis)
Subject: Re: Sound card programming
Date: 11 Aug 2000 17:43:52 GMT

In article <[EMAIL PROTECTED]>, Kevin Lo  <[EMAIL PROTECTED]> wrote:

>I want to learn how to write device drivers for sound card.
>Would anyone know where I can get the info or recommend me
>good books, thanks.

http://www.amazon.com/exec/obidos/ASIN/1565922921/ricksphotograpag

Also look at the sources for other sound card drivers.

--
http://www.fnet.net/~ellis/photo/linux.html

------------------------------

From: Bhavin Shah <[EMAIL PROTECTED]>
Subject: checking properties of incoming connection
Date: Fri, 11 Aug 2000 10:44:13 -0700

Hi,

Is there a way to check the properties (say ip addr)
of an incoming connection from listen/accept?

Thanks in advance.

Bhavin 



------------------------------

From: "Andres Tarallo" <[EMAIL PROTECTED]>
Crossposted-To: alt.os.linux.suse,comp.os.linux.networking,comp.os.linux.setup
Subject: Misterious Hangs in my network
Date: Fri, 11 Aug 2000 15:08:35 -0300

I have made the following installation for a high school were i work for and
i play the role of a System Administrator.

I have a Pentium MMX @ 166 Mhz with 64 MB RAM acting as NIS Server and NFS
server. I'm exporting the users home directories to the Computer LAB; In the
computer lab I have workstations ranging from K5 to Celeron @433 Mhz; with
an average of 32 Mb of RAM at least (Many have 64 Mb of RAM).

During some clases we had a misterious hang that all the network frezeed, we
rebooted and then we continued working without problem. WE don't have
harware problem; we even changed a disk that seems to be faulty; but the
problem persists.

We're currently working with SuSE 6.4 both in server and workstations; the
server si running kernel NFS; I'm aware of that this is still under
development but I hva e to run on the workstations StarOffice and this was
the only solution I've found

Thanks for any advice
                            Andres Tarallo
                            [EMAIL PROTECTED]



------------------------------

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: checking properties of incoming connection
Reply-To: [EMAIL PROTECTED]
Date: Fri, 11 Aug 2000 18:03:27 GMT

On Fri, 11 Aug 2000 10:44:13 -0700, Bhavin Shah <[EMAIL PROTECTED]> wrote:
>Hi,
>
>Is there a way to check the properties (say ip addr)
>of an incoming connection from listen/accept?

Hmm, you don't suppose that's what the last two of accept's three parameters
are for? Have you tried to read *any* documentation on accept before posting?

-- 
Any hyperlinks appearing in this article were inserted by the unscrupulous
operators of a Usenet-to-web gateway, without obtaining the proper permission
of the author, who does not endorse any of the linked-to products or services.

------------------------------

From: [EMAIL PROTECTED] (Mario Klebsch)
Subject: Re: What is the difference between soft link and hard link?
Date: Fri, 11 Aug 2000 18:38:22 +0200

Lew Pitcher <[EMAIL PROTECTED]> writes:

>Kevin Lacquement wrote:
>> 
>> Mario Klebsch wrote:
>> <SNIP>
>> > 1st link is the directory (stored in its parent dir).
>> > 2nd link is '.' stored in the directory
>> > 3rd, 4tt, .. link is '..' stored in each child direcory.
>> 
>> Is this true for the root directory as well?  I don't see that
>> it would have the first link you describe here.

>In the root directory, '.' has the inode of the root directory (as you
>would expect), and '..' _also_ has the inode of the root directory.

Yes, but he is right, there is no parent directory containing a
normally named entry for the root directory.

73, Mario
-- 
Mario Klebsch                                           [EMAIL PROTECTED]
PGP-Key available at http://www.klebsch.de/public.key
Fingerprint DSS: EE7C DBCC D9C8 5DC1 D4DB  1483 30CE 9FB2 A047 9CE0
 Diffie-Hellman: D447 4ED6 8A10 2C65 C5E5  8B98 9464 53FF 9382 F518

------------------------------

From: [EMAIL PROTECTED] (Karl =?iso-8859-1?Q?Stephenson-M=F6ller?=)
Subject: /proc/mtrr is empty
Date: 11 Aug 2000 21:42:29 GMT

I have MTRR support compiled in the kernel and there is a /proc/mtrr file.
The problem is that it contains nothing. I am running RedHat 6.2 on a K6-2 300
(stepping 12), Voodoo3 3000 AGP, FIC VA-503+ mb.

[karl@boye karl]$ cat /proc/mtrr
[karl@boye karl]$

When the 3dfx device driver module (which is supposed to enable MTRR support)
is loaded:

[karl@boye karl]$ cat /proc/mtrr
reg00: base=0xe4000000 (3648MB), size=  16MB: write-combining, count=1
[karl@boye karl]$

I've learned that there should also be at least one write-back register. Is
this correct? I get the same result using both RedHat's kernel 2.2.14-5.0 and
2.2.16 from kernel.org. Help would be appreciated.

-- 
Karl Stephenson-M�ller                [EMAIL PROTECTED]
Sorry for my bad english.

------------------------------

From: James Avery <[EMAIL PROTECTED]>
Subject: Adding a system call dynamically
Date: Fri, 11 Aug 2000 23:49:40 +0200

Hi,

I have a kernel module that installs an interrupt handler which maintains
some state. Now, I want to communicate this state to userland through a
system call in this module, which looks something like:

int lookup(char *key){ 
        .. <reference module data structures> ..; 
        return <result>; 
} 

I can't really add the syscall statically, since it has to reference the
modules memory, and should only function when the module is running.

So the question is: How does one add a system call -- in a module?

The information I've found on the net seem to imply that all anyone would
ever want to do with modules is make devices with file semantics or hijack
existing system calls. There's got to be a prettier way, where one
doesn't have to bend over backwards?

Thank's in advance.

-- 
 Med venlig hilsen,
        James Avery <[EMAIL PROTECTED]>


------------------------------

From: "Rob Morris" <[EMAIL PROTECTED]>
Subject: Unrecognized symbols printk -
Date: Fri, 11 Aug 2000 15:27:08 -0700

Man kernel programming is fun.........

I have one machine that has no problems with printk, copy_from_user,
copy_to_user, unresgister_chrdev, and register_chrdev.  The machines have
the exact same hardware and both are running Redhat 6.2, with kernel version
2.2.14.  I loaded these kernels myself and made the configuration the same
for both machines.  (I even took the .config file from the good machine and
put it in the bad machine!!)  Both systems run fine and what not.  But when
I load a compile a module using the following:

#testdriver.o: testdriver.c /usr/include/linux/version.h
# Makefile for a basic kernel module

#CC=gcc
#MODCFLAGS := -Wall -DMODULE -D__KERNEL__ -DLINUX

rm -f testdriver.o

#testdriver.o: testdriver.c /usr/include/linux/version.h
#               $(CC) $(MODCFLAGS) -c testdriver.c
gcc -Wall -DMODULE -D__KERNEL__ -DLINUX -c testdriver.c -o testdriver.o

Then I load the module with "insmod testdriver.o", the following error comes
out on the "bad" machine and it works fine on the "good" machine.

[root@ftpc4 ARC8-8-2000]# ./maktest
[root@ftpc4 ARC8-8-2000]# insmod testdriver.o
testdriver.o: unresolved symbol __generic_copy_from_user
testdriver.o: unresolved symbol unregister_chrdev
testdriver.o: unresolved symbol register_chrdev
testdriver.o: unresolved symbol printk
testdriver.o: unresolved symbol __generic_copy_to_user

NOTE:  both computers have the nodes on them, I used "mknod /dev/testdriver
c 254 0" to make the nodes for this char device.

Any suggestions about what my problem may be?

Thanks once again to all you Linux guru's out there!!

Rob Morris

-by the way this is not the Rob Morris who started the worm virus in late
80's - he probably knows how to fix this problem :-)



------------------------------

From: "Rob Morris" <[EMAIL PROTECTED]>
Subject: Re: insmod with new kernel: unresolved symbols
Date: Fri, 11 Aug 2000 15:32:45 -0700


"Rick Ellis" <[EMAIL PROTECTED]> wrote in message
news:8n1dij$10f$[EMAIL PROTECTED]...
> In article <[EMAIL PROTECTED]>,
> Thomas Berkefeld <[EMAIL PROTECTED]> wrote:
>
> >after updating the kernel from 2.2.14 to 2.2.17pre15, a module that has
been
> >compiled afterwards cannot be loaded. insmod says "unresolved symbol"
> >for all symbols. Any ideas?
>
> Do you have symbol versioning on?
>
> --
> http://www.fnet.net/~ellis/photo/linux.html

I am having pretty much the same problem.  Could you elaborate on what you
mean by "symbol versioning on"?  Are you talking about when you make
xconfig?     (i.e. configure your kernel/machine)

Thanks,
Rob



------------------------------

From: Andrew Jaffe <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.setup
Subject: Re: Problem including <limits.h>
Date: 11 Aug 2000 14:53:13 -0700

Hi All-

I have a related problem. I have RH6.1, but I recently upgraded to
kernel 2.2.16, using the instructions from the HOWTO (as well as all
other recommended upgrades)

Now, when I try to compile anything complicated (e.g. the kernel itself,
or xemacs), I get error messages like

In file included from /usr/include/errno.h:36,
                 from <whatever>
/usr/include/bits/errno.h:25: linux/errno.h: No such file or directory

that is, linux/errno.h doesn't exist (nor does any other linux/*.h that
various *.h files try to include)

I have tried getting the latest glibc libraries and headers, to no avail.

HELP!

Andrew

[EMAIL PROTECTED] (Tony Seward) writes:
> Right.  There's one in the kernel-headers RPM to which I set a
> symlink.  But I thought that I had seen somewhere on the kernel list
> that users should not have to have the kernel headers on their machine
> in order to compile normal programs (i.e. programs that don't interact
> directly with the kernel).  So, I'm wondering if I'm remembering this
> wrong or if there should be headers with glibc or if their should be
> another RPM.
> 
> Tony
> 
> On Tue, 8 Aug 2000, [iso-8859-1] Ren� M�ller Fonseca wrote:
> 
> > I think 'linux/limits.h' is generated when you configure and/or
> > compile the kernel.
> > 
> > Ren�
> > 
> > Tony Seward wrote:
> > > 
> > > When including <limits.h> I get the following traceback:
> <snip>
> > > 
> > > /usr/include/bits/local_lim.h says that it wants the kernel's
> > > limits.h.  IIR, this (requiring the kernel headers to compile user
> > > programs) is frowned upon by the kernel people.  Is this a problem
> > > with glibc, or the RPMs or me?
> > > 
> > 
> 
> 
> 
> _______________________________________________
> Redhat-devel-list mailing list
> [EMAIL PROTECTED]
> https://listman.redhat.com/mailman/listinfo/redhat-devel-list

-- 
Andrew Jaffe___________________________________________________________ 
Center for Particle Astrophysics                [EMAIL PROTECTED]
University of California, 301 LeConte Hall               (510) 642-7570
Berkeley, CA 94720                                        FAX    2-1756

------------------------------


** 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
******************************

Reply via email to