Linux-Development-Sys Digest #150, Volume #8     Sat, 16 Sep 00 13:13:11 EDT

Contents:
  Re: I'm in kernel land now! (Robert Redelmeier)
  Re: two drivers of same device ("Anil Prasad")
  Re: sound during system startup (in LILO?) (Aurel Balmosan)
  Re: new windowing system (Aurel Balmosan)
  More then one bind to a ip-port possible? (Aurel Balmosan)
  Re: new windowing system (Stephen Tse)
  Re: More then one bind to a ip-port possible? (Mario Klebsch)
  Re: is a given IP adress local (Hartmann Schaffer)
  Re: is a given IP adress local ("Vik Heyndrickx")
  Re: sk_buff : private data field ? (Andi Kleen)
  Re: two drivers of same device ("Norm Dresner")
  URGENT:problem with module-insertion in kernel-2.2.14-5.0 and 2.2.12-20 ("Anil 
Prasad")
  Re: is a given IP adress local (Michael F Gordon)
  ext2 file size limit? (Paul Reilly)

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

From: Robert Redelmeier <[EMAIL PROTECTED]>
Subject: Re: I'm in kernel land now!
Date: Fri, 15 Sep 2000 23:33:57 -0500

Steve Helding wrote:
> 
> Gave up on trying to write to the ISA board at 15 M in user mode.  Got a
> crude device driver writing to the board.  Flashing the lights so I know
> it's talking to it.  Gettin' in deep now.  Talk about a clusterf* having
> to patch the kernel to do this.  I'm using a bzdisk/floppy with the
> Linux kernel patch so I don't screw up my development system but soon
> I'll need to make it a permanent patch to the hard drive.  Sheesh, what
> a pain.  I need to ask my boss for a raise.

Why patch the kernel?  That's the old & hard way.  Just write a simple 
kernel module.  0:edit-compile-insmod-debug-rmmod / jnc 0b.  No reboots
unless you goof badly.  The current Assembly Programmers Journal 
http://asmjournal.freeservers.com/ gives an excellent overview, and 
good references for `c`.

You'll probably want to map that ISA board as /proc/something .  
Very easily done.  Otherwise, kernel IO is very restricted.

As for disk safety, make sure you umount anything not needed (/home),
and an unmounted back-up partition would take it a step further.

-- Robert


-- Robert

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

From: "Anil Prasad" <[EMAIL PROTECTED]>
Subject: Re: two drivers of same device
Date: 16 Sep 2000 05:25:13 GMT



>>You must also tell the other driver to release all other resources 

>>it holds, /proc entries etc.

>>Better remove the driver from the kernel code entirely.

but the problem is that i don't want to completely remove the original
driver instead when i want to do something different to the device at that
i should remove the original driver dynamically and after my job is over ,
the original driver must be linked into the kernel...

Anil 

-- 
Josef M�llers (Pinguinpfleger bei FSC)
        If failure had no penalty success would not be a prize (T. Pratchett)

==========


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

From: Aurel Balmosan <[EMAIL PROTECTED]>
Subject: Re: sound during system startup (in LILO?)
Date: Sat, 16 Sep 2000 05:26:59 GMT

Kasper Dupont <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > 
> > When a Mac starts up, we hear a pleasant little phooom sound.
> > When Windows starts up, we hear some chintsy annoying sound.
> > When Linux starts up, one hears nothing except the hard disk.

> I don't think that LILO will ever get that feature.
> You could either write your own loader with that
> feature or do it before LILO is being loaded. Most
> PC's have 31KB of unused space at the start of the
> harddisk, here you could place the sound and a
> copy of the MBR in the MBR you could then place
> the code to play the sound. That would work
> independent of what OS you are using.

Also the MAC or windows play sound AFTER the OS has been
loaded. (and of course the audio drivers) 

It should be quite simple to introduce beeps and other nice
sound (if you have a sound card configured) that are played
from within the inittab processing. I.e. for SuSE installations
there is currently a colored 'done' shown. 

- find out where this 'done'is printed
- introduce a new environment variable (like
  SOUND_OK=ok.wav, SOUND_FAILED=failed.wav, 
  SOUND_FATAL=fatal.wav)
- allow the init-scripts to set these variables
  to play specific wave sounds.

to make something like the windows startup sound when 
using xdm (or other X-login programs) you just have to
wrap the X-Server call by a script that plays the sound
and then executes the x-server.

Playing sound after a user is logged in is a matter of the
window manager (session manager). I think KDE allows
you to configure that. 

Best Regards,

        Aurel Balmosan.
have to wrap 
-- 
================================================================
Aurel Balmosan                |  [EMAIL PROTECTED], [EMAIL PROTECTED] 
http://gaia.owl.de/~aurel/    |                                 
================================================================

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

Crossposted-To: comp.os.linux.x,comp.windows.x
From: Aurel Balmosan <[EMAIL PROTECTED]>
Subject: Re: new windowing system
Date: Sat, 16 Sep 2000 05:14:45 GMT

In comp.os.linux.development.system Karl Heyes <[EMAIL PROTECTED]> 
wrote:
> In article <sSUv5.5422$[EMAIL PROTECTED]>, [EMAIL PROTECTED]
> (Christopher Browne) wrote:

> > It seems to me that the "fact that X uses sockets" represents one of those
> > "unexamined fallacies" of life.  Because it is a _false_ statement.
> > 
> > A modicum of research would show that it supports other transport layers as
> > well, notably local connections via STREAMS pipes and Unix Domain Sockets,
> > which are both Rather Faster Than BSD Sockets.
> > 

> Streams has been notorious for being slow, see solaris as an example, but there
> has been reports of using pipes and improving X performance, by how much
> I don't know.

Hi all,

I just want to give my 2 cents to this discussion:

Where can the so called performance problem be found in X11?
Personnaly I haven't found any yet. If one compares the
'performance' of X and other so called faster windowing
systems with fair benchmarks, or even better, real applications
no difference can be found.

If one of you know a specific action that is supported
by X11 and by another windowing system that its noticable
slow in X11 please e-mail me. I would really like to know it.

One point I have to make: Why is everyone thinking that a socket
(tcp/ip, unix, ...) connection is slow? Especially when it comes
to X the Xlib communication layer knows how to use it efficiently.

Best Regards,

        Aurel Balmosan.
-- 
================================================================
Aurel Balmosan                |  [EMAIL PROTECTED], [EMAIL PROTECTED] 
http://gaia.owl.de/~aurel/    |                                 
================================================================

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

From: Aurel Balmosan <[EMAIL PROTECTED]>
Subject: More then one bind to a ip-port possible?
Date: Sat, 16 Sep 2000 05:38:31 GMT

Hi all,

DecOSF-4.* (Tru64) has a nice feature. It allows that
sereval processes bind to one ip-port. This is very
useful for UDP when you work with broadcasts. My
current usage of this feature is:

- One UDP-Port has been defined to reach a certain
  service.
- Several processes bind to that port and wait for 
  data.
- One process gets one request and start processing
  it.
- While the first process is doing something the others
  are still ready to receive.

Mainly this feature allows you to do load balancing without
a specific thread/process that distributes the requests.

I know that this feature is none standard and that it
will only work with packet orientated transmissions
(like UDP) and only when two packets contain always 
independend data. Would it be difficult to introduce
this feature also into Linux?

Best Regards,

        Aurel Balmosan.
-- 
================================================================
Aurel Balmosan                |  [EMAIL PROTECTED], [EMAIL PROTECTED] 
http://gaia.owl.de/~aurel/    |                                 
================================================================

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

Crossposted-To: comp.os.linux.x,comp.windows.x
Subject: Re: new windowing system
From: Stephen Tse <[EMAIL PROTECTED]>
Date: Sat, 16 Sep 2000 06:52:01 GMT

Aurel Balmosan <[EMAIL PROTECTED]> writes:

> If one of you know a specific action that is supported
> by X11 and by another windowing system that its noticable
> slow in X11 please e-mail me. I would really like to know it.

What about 3D graphics? animation? Direct rendering seems to beat glx
in real applcations.

> 
> One point I have to make: Why is everyone thinking that a socket
> (tcp/ip, unix, ...) connection is slow? Especially when it comes
> to X the Xlib communication layer knows how to use it efficiently.

It depends on the usage of an application. I don't think you can
implement a faster image loading scheme with socket than share memory
model possible only with IPC.


Stephen

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

From: [EMAIL PROTECTED] (Mario Klebsch)
Subject: Re: More then one bind to a ip-port possible?
Date: Sat, 16 Sep 2000 09:05:37 +0200

Aurel Balmosan <[EMAIL PROTECTED]> writes:

>I know that this feature is none standard and that it
>will only work with packet orientated transmissions
>(like UDP) and only when two packets contain always 
>independend data. Would it be difficult to introduce
>this feature also into Linux?

You should already be able to do it in Linux (as on most other UNIXes,
too). You create the socket in a parent process and inherit it to each
child.

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] (Hartmann Schaffer)
Subject: Re: is a given IP adress local
Date: 15 Sep 2000 22:51:58 -0400

In article <syuw5.17632$[EMAIL PROTECTED]>,
Vik Heyndrickx <[EMAIL PROTECTED]> wrote:
> ...
>1. how can I (=what is the best way to) know if a given IPv4 address is the
>IP address of one of the local network interfaces (, or that is is not a
>local IP address).
>To get this information I do not want to make a TCP connection to any remote
>machine (because I am not necessarily able to do so at the time I want this
>to know), I do not want to peek in '/proc', and I do not want to run a
>program from my program (like ifconfig).

have a look at the meaning of NETMASK.  basically, any ip address that
is identical to yours in the area identified by the netmask is on the
local network interface.

>2. how can I create a list of all local IP addresses.

what exactly do you mean?  any ip address with the same NETMASKed
portion is a local ip address (exept for the net and the broadcast
address).  if you want to know all ip addresses that have an interface
assigned to them, i think there is a way to ask your dns server for a
list.  all ip addresses that are currently connected?  no way except
going to the net and find out (the other machines have to be
cooperative, though)

hs


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

From: "Vik Heyndrickx" <[EMAIL PROTECTED]>
Subject: Re: is a given IP adress local
Date: Sat, 16 Sep 2000 13:04:32 GMT

"Hartmann Schaffer" <[EMAIL PROTECTED]> wrote in message
news:8pun8e$8bi$[EMAIL PROTECTED]...
> have a look at the meaning of NETMASK.  basically, any ip address that
> is identical to yours in the area identified by the netmask is on the
> local network interface.

I think you misunderstood. My program does not know what the running host's
IP address is. I just want to find out without calling a program. Is such a
thing possible using socket programming?





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

From: Andi Kleen <[EMAIL PROTECTED]>
Subject: Re: sk_buff : private data field ?
Date: 16 Sep 2000 15:18:41 +0200

[EMAIL PROTECTED] writes:

> Hi all,
> In kernel 2-2-14, is there a private data field in the sk_buff
> structure which should be used internally in a network driver to pass
> information between modules ?
> I guess the cb[48] field is for that purpose but I can't find its
> description in any documentation.

2.4 added a clarifying comment.

->cb is for that correct. You own it as long as you have the skb queued.
When you submit it to upper or lower layers you lose ownership and it may
be overwriten.


-Andi


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

Reply-To: "Norm Dresner" <[EMAIL PROTECTED]>
From: "Norm Dresner" <[EMAIL PROTECTED]>
Subject: Re: two drivers of same device
Date: Sat, 16 Sep 2000 14:42:39 GMT

If there's a module-version of the original driver, you're set.  Enable
modules in the kernel and write your own driver as a module too.  Then you
can unload (man rmmod) and load (man insmod) "whenever" you want to.

    Norm

Anil Prasad <[EMAIL PROTECTED]> wrote in message
news:01c01f79$6465c930$7cd4b809@aprasad...
>
>
> >>You must also tell the other driver to release all other resources
>
> >>it holds, /proc entries etc.
>
> >>Better remove the driver from the kernel code entirely.
>
> but the problem is that i don't want to completely remove the original
> driver instead when i want to do something different to the device at that
> i should remove the original driver dynamically and after my job is over ,
> the original driver must be linked into the kernel...
>
> Anil
>
> --
> Josef M�llers (Pinguinpfleger bei FSC)
> If failure had no penalty success would not be a prize (T. Pratchett)
>
> ----------
>


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

From: "Anil Prasad" <[EMAIL PROTECTED]>
Subject: URGENT:problem with module-insertion in kernel-2.2.14-5.0 and 2.2.12-20
Date: 16 Sep 2000 15:21:16 GMT

hi,
i wrote a simple module(code is given below along with strace output), it
compiled succesfully but when i tried to insert it by doing insmod, i got
error message like: resource/device busy( errno=EBUSY)
==============================================================
#define MODULE
#include<linux/module.h>
#include<linux/kernel.h>
int init_module()
{
 printk("in init_module");

}
void cleanup_module()
{
        printk("removed");
}
=============================
this is output when i did "strace insmod "name of the module"
==========================================================================
execve("/sbin/insmod", ["insmod", "test"], [/* 24 vars */]) = 0
brk(0)                                  = 0x804efa4
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=23960, ...}) = 0
mmap(0, 23960, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40013000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0755, st_size=4118299, ...}) = 0
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\250\202"..., 4096)
= 4096
mmap(0, 993500, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40019000
mprotect(0x40104000, 30940, PROT_NONE)  = 0
mmap(0x40104000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3,
0xea000) = 0x40104000
mmap(0x40108000, 14556, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40108000
close(3)                                = 0
mprotect(0x40019000, 962560, PROT_READ|PROT_WRITE) = 0
mprotect(0x40019000, 962560, PROT_READ|PROT_EXEC) = 0
munmap(0x40013000, 23960)               = 0
personality(0 /* PER_??? */)            = 0
getpid()                                = 815
brk(0)                                  = 0x804efa4
brk(0x804f144)                          = 0x804f144
brk(0x8050000)                          = 0x8050000
uname({sys="Linux", node="vangogh", ...}) = 0
brk(0x8052000)                          = 0x8052000
stat("./test", 0xbffff704)              = -1 ENOENT (No such file or
directory)
stat("./test.o", {st_mode=S_IFREG|0644, st_size=1128, ...}) = 0
open("./test.o", O_RDONLY)              = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=1128, ...}) = 0
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x40013000
_llseek(3, 0, [0], SEEK_SET)            = 0
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\1\0\3\0\1\0\0\0\0\0\0\0"..., 4096)
= 1128
_llseek(3, 1128, [1128], SEEK_SET)      = 0
_llseek(3, 1128, [1128], SEEK_SET)      = 0
_llseek(3, 1128, [1128], SEEK_SET)      = 0
_llseek(3, 1128, [1128], SEEK_SET)      = 0
_llseek(3, 1128, [1128], SEEK_SET)      = 0
_llseek(3, 1128, [1128], SEEK_SET)      = 0
_llseek(3, 1128, [1128], SEEK_SET)      = 0
_llseek(3, 1128, [1128], SEEK_SET)      = 0
_llseek(3, 1128, [1128], SEEK_SET)      = 0
uname({sys="Linux", node="vangogh", ...}) = 0
query_module(NULL, 0, NULL, 0)          = 0
query_module(NULL, QM_MODULES,
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 0xbffffc58) =
0
query_module("eepro100", QM_INFO, "6\256\4\10\0\0\0\0\0\0\0\0\0\0\0\0",
0xbffffc58) = 0
query_module("eepro100", QM_SYMBOLS,
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 0xbffffc58) =
0
brk(0x8057000)                          = 0x8057000
query_module(NULL, QM_SYMBOLS,
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 0xbffffc58) =
-1 ENOSPC (No space left on device)
brk(0x805e000)                          = 0x805e000
query_module(NULL, QM_SYMBOLS, " \327$\300\230\30\0\0\200l
\300\255\30\0\0\0m \300\305"..., 0xbffffc58) = 0
create_module("test", 148)              = -998195200
init_module(0x804f140, 0x8057e88)       = -1 EBUSY (Device or resource
busy)
write(2, "./test.o: ", 10./test.o: )              = 10
open("/usr/share/locale/locale.alias", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=2174, ...}) = 0
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x40014000
read(4, "# Locale name alias data base.\n#"..., 4096) = 2174
read(4, "", 4096)                       = 0
close(4)                                = 0
munmap(0x40014000, 4096)                = 0
open("/usr/share/i18n/locale.alias", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT
(No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No
such file or directory)
write(2, "init_module: Device or resource "..., 36init_module: Device or
resource busy) = 36
write(2, "\n", 1
)                       = 1
delete_module("test")                   = 0
close(3)                                = 0
munmap(0x40013000, 4096)                = 0
_exit(1)                                = ?



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

From: [EMAIL PROTECTED] (Michael F Gordon)
Subject: Re: is a given IP adress local
Date: 16 Sep 2000 16:25:10 GMT

In <syuw5.17632$[EMAIL PROTECTED]> "Vik Heyndrickx" 
<[EMAIL PROTECTED]> writes:
>1. how can I (=what is the best way to) know if a given IPv4 address is the
>IP address of one of the local network interfaces (, or that is is not a
>local IP address).

We use the program below (ami - pronounced 'am I?') in our startup scripts
to work out if a machine should start a particular server - for example

  if ami imap
  then
    # start IMAP server
  fi

to start the IMAP server if the 'imap' host alias belongs to the current
machine.  It does this by getting the IP address of each interface, the
list of IP addresses associated with the host alias and comparing.  The
code that gets the interface addresses should be straightforward to
extract.  It's only been used on Solaris machines but the method is
standard enough that it should work on Linux (perhaps with a few
#include changes).


Michael


=========================================================================

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include <sys/sockio.h>
#include <netdb.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>

#define MAX_INTERFACES 10

extern char *optarg;
extern int optind;


int
main(int argc,char **argv)
{
        char ifbuf[MAX_INTERFACES*sizeof(struct ifreq)];
        struct ifconf ifconf;
        struct ifreq *ifreqp;
        int num_interfaces;
        struct sockaddr_in ifaddr;
        long our_addrs[MAX_INTERFACES];
        struct hostent *hep;
        char **rem_addrp;
        int s,verbose,c,i;
        
        verbose=0;
        while ((c=getopt(argc,argv,"v"))!=-1) {
                switch (c) {
                  case 'v':
                        verbose=1;
                        break;
                        
                  default:
                        exit(2);
                }
        }
        if (optind!=argc-1) {
                fprintf(stderr,"usage: ami [-v] name\n");
                exit(2);
        }
        
        /* Get the IP addresses of all of the attached interfaces */
        if ((s=socket(AF_INET,SOCK_STREAM,0))==-1) {
                perror("ami:socket");
                exit(2);
        }
        ifconf.ifc_buf=ifbuf;
        ifconf.ifc_len=sizeof(ifbuf);
        if (ioctl(s,SIOCGIFCONF,&ifconf)==-1) {
                perror("ami:ioctl(SIOCGIFCONF)");
                exit(2);
        }
        num_interfaces=ifconf.ifc_len/sizeof(struct ifreq);
        ifreqp=ifconf.ifc_req;
        for (i=0;i<num_interfaces;i++) {
                memcpy(&ifaddr.sin_port,ifreqp->ifr_addr.sa_data,14);
                our_addrs[i]=ifaddr.sin_addr.s_addr;
                ifreqp++;
        }

        /* Get all of addresses for 'name' and check for a match */
        if ((hep=gethostbyname(argv[argc-1]))==NULL) {
                fprintf(stderr,"ami:cannot get address for %s\n",argv[argc-1]);
                exit(2);
        }
        rem_addrp=hep->h_addr_list;
        while (*rem_addrp!=NULL) {
                for (i=0;i<num_interfaces;i++) {
                        if (our_addrs[i]==*(long *)*rem_addrp) {
                                if (verbose) {
                                        printf("yes\n");
                                }
                                exit(0);
                        }
                }
                rem_addrp++;
        }
        
        if (verbose) {
                printf("no\n");
        }
        exit(1);
}
--
Quidquid latine dictum sit, altum viditur.

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

From: Paul Reilly <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.misc
Subject: ext2 file size limit?
Date: Sat, 16 Sep 2000 17:53:18 -0700

Hi

Can someone tell me what the max size for a single file is in linux?

I'm trying to creat a 6GB loopback device, but using dd if=/dev/zero
of=file
crashes out after filling the file with 2GB. I presume this is happening
as I've reached some file system limit? Is there any way around this or
any plans on making ext2 handle larger files?

Thanks,

Paul



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


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