Linux-Development-Sys Digest #834, Volume #7      Mon, 8 May 00 21:13:21 EDT

Contents:
  Re: Need to find my IP address ("Christos Karayiannis")
  Re: Need to find my IP address ("Christos Karayiannis")
  Re: Need to find my IP address ("Christos Karayiannis")
  Sys Calls from Device Drivers ("ELSID Software Systems LTD.")
  Re: A need for better insallation programs ("The Wogster")
  How to copy data between two processes space (Boczi)
  Re: Memory Hole (Simone Contini)
  Re: Real Time Programming in Linux (Simon Wakley)
  hardware incompatiblility or kernel problem? (Yuzheng Ding)
  Re: Need to find my IP address (Chris)
  Re: Two really easy (I'm sure) questions (Nate Eldredge)
  Re: Two really easy (I'm sure) questions (Kaz Kylheku)
  Create a new filesystem (Development System Linux OS)

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

From: "Christos Karayiannis" <[EMAIL PROTECTED]>
Subject: Re: Need to find my IP address
Date: Mon, 8 May 2000 23:09:40 +0300

> > > I used getsockname() as:
> > > if (getsockname(sock, (struct sockaddr *) &host, &addrlen) < 0 ) {
> > >     perror("getsockname");
> > >     exit(1);
> > > }
> > >
> > > printf("My port is %d\n", ntohs(host.sin_port));
> > > printf("My address is %s\n", inet_ntoa(host.sin_addr.s_addr));
> > >
> > >
> > > where host was of type struct sockaddr_in and
> > > addrlen  of type int.
> > >
> > >                         Christos Karayiannis


Doug Schulz <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> I have a sockets program an need to find the IP address of the machine
> the program is being run from so I can bind the socket to the correct
> address/port.  I have tried using gethostname coupled with gethostbyname
> and I can only get 127.0.0.1 (localhost address).  I want to find the
> actual IP address of the machine.  Is there a way of doing this.  Any
> help would be great.
>
> FYI this is a UDP app.
>
> Thanks,
>
> Doug
>



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

From: "Christos Karayiannis" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux,comp.os.linux.misc
Subject: Re: Need to find my IP address
Date: Mon, 8 May 2000 23:14:18 +0300

> I used getsockname() as:
> > > if (getsockname(sock, (struct sockaddr *) &host, &addrlen) < 0 ) {
> > >     perror("getsockname");
> > >     exit(1);
> > > }
> > >
> > > printf("My port is %d\n", ntohs(host.sin_port));
> > > printf("My address is %s\n", inet_ntoa(host.sin_addr.s_addr));
> > >
> > >
> > > where host was of type struct sockaddr_in and
> > > addrlen  of type int.
> > >
> > >                         Christos Karayiannis


Doug Schulz <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> I have a sockets program an need to find the IP address of the machine
> the program is being run from so I can bind the socket to the correct
> address/port.  I have tried using gethostname coupled with gethostbyname
> and I can only get 127.0.0.1 (localhost address).  I want to find the
> actual IP address of the machine.  Is there a way of doing this.  Any
> help would be great.
>
> FYI this is a UDP app.
>
> Thanks,
>
> Doug
>



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

From: "Christos Karayiannis" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux,comp.os.linux.misc
Subject: Re: Need to find my IP address
Date: Mon, 8 May 2000 23:15:36 +0300

> I used getsockname() as:
> > > if (getsockname(sock, (struct sockaddr *) &host, &addrlen) < 0 ) {
> > >     perror("getsockname");
> > >     exit(1);
> > > }
> > >
> > > printf("My port is %d\n", ntohs(host.sin_port));
> > > printf("My address is %s\n", inet_ntoa(host.sin_addr.s_addr));
> > >
> > >
> > > where host was of type struct sockaddr_in and
> > > addrlen  of type int.
> > >
> > >                         Christos Karayiannis


Doug Schulz <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> I have a sockets program an need to find the IP address of the machine
> the program is being run from so I can bind the socket to the correct
> address/port.  I have tried using gethostname coupled with gethostbyname
> and I can only get 127.0.0.1 (localhost address).  I want to find the
> actual IP address of the machine.  Is there a way of doing this.  Any
> help would be great.
>
> FYI this is a UDP app.
>
> Thanks,
>
> Doug
>



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

From: "ELSID Software Systems LTD." <[EMAIL PROTECTED]>
Subject: Sys Calls from Device Drivers
Date: Mon, 08 May 2000 16:56:30 -0700

Greetings:

I would like to be able to open a socket from within a device driver to
a data resource on another system and use it to communicate with that
resource.

Is this possible, has any one done this, are there any examples
anywhere?

Regards
Robert
[EMAIL PROTECTED]


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

From: "The Wogster" <[EMAIL PROTECTED]>
Subject: Re: A need for better insallation programs
Date: Mon, 8 May 2000 17:15:07 -0400


[EMAIL PROTECTED] wrote in message ...
>Michael Uman <[EMAIL PROTECTED]> wrote:
>[...]
>>> In Sweden journalists for a science program, without any computer ex-
>>> perience beside of using preloaded Apple or/and M$ Window$.* systems
>>> recenly thought they would demonstrate how Linux can be downloaded
>>> from the net. The system they did chose was intended to run in a DOS
>>> partition -- becuse they considered partitioning a hard disk be a too
>>> daunting task for them.
>[...]
>> Sounds to me like a bunch of idiots got together to prove how dumb they
>> are. Doesn't sound like scientific testing at all. I installed my
>> Mandrake Linux distro on three machines, each install was flawless. Each
>> machine has different CPU and different memory and different display. The
>> auto-install process was excellent, many times faster than Win98 or WinNT
>> install.
>
>The key phrase in all of this is "preloaded Apple or/and M$ Window$.*
>systems" Contrary to popular belief, _NO_ operating system is easy to
>install without a reasonable amount of knowledge. Many windows users
>are incapable of reinstalling windows given an unparitioned hard
>drive, the windows cd, and a working machine to hand-roll a boot disk
>on. There's nothing wrong with that, but obviously installing linux
>yourself is more difficult than letting someone at the factory install
>windows. Hell, installing a _toaster_ yourself is more difficult than
>having someone else plug it in.
>
>Every time I hear comparisions like these, I'm reminded of an early
>review of linux I saw in a PC-centric magazine. It procalimed
>something along the lines of "while it's a powerful operating system,
>it forced us to spend too much time interacting with the command
>line." The author, never having used a non-ms operating system
>apparantly, mistakenly equated /bin/sh with command.com.
>

There are different phases of installers, those that install the OS proper,
and those that install applications, for the former, no installer is truly
easy, although Corel Linux and Caldera's OpenLinux are both on the right
track, the problem with simple installers, is that they don't handle oddball
situations well.   Corel's is fine if everything in the machine is plug and
play devices on the PCI bus, although I have heard it's awful if you have a
mish-mash of old junk, like I do.  Anybody who says Linux is hard to
install, should be given a machine (with a completely bad HDD), a set of
boot disks,  WindowsNT CD, and the 25 minutes it takes for a typical Linux
install.

Application installers, these can win an ugly contest no matter what OS you
have, I have seen all of them, and they are all ugly.  Windows installs have
a nasty habit of replacing the latest version of a DLL with something from
1983, then you wonder why every application you own just died.  At least
Linux doesn't have that problem, RPM is about the best you can get, except
if another package is needed, why the heck can't it go find it and install
it as well, besides an RPM doesn't help for non-linux Unices.

I would like to see an installer, that could take a compressed file,
uncompress it, then intellegently do what is needed, if that is run
./configure; make; make install; run script xyz then it should do that.
Best would be if there where two programs, the first has the ability of
taking the source code, scrambling it if required (anybody know a good
source code obfusticator?), then building the compressed file.  The other
program uncompresses and does whatever is needed.










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

From: [EMAIL PROTECTED] (Boczi)
Subject: How to copy data between two processes space
Date: 8 May 2000 20:51:49 GMT
Reply-To: [EMAIL PROTECTED]


I'm writing a QNX like message passing between processes.
The main idea is to copy data only once, when both buffers (on sender and
receiver side) are ready. This involves copying into other process space. 

I want to copy data from receiver thread on kernel level. Should I just use
copy_to_user (or copy_from_user) specyfing adresses of both buffers (of
course after permission verification), or should I switch the memory
context?

Best regards

-- 
Andrzej Boczek  (boczi<at>pol.pl)

``The difference is that it takes a lot of courage to 
fuck other peoples' wives but even cowards can steal software''
                      Robert Maron

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

From: Simone Contini <[EMAIL PROTECTED]>
Subject: Re: Memory Hole
Date: Mon, 08 May 2000 23:48:36 +0200

> 
> This is due to  relying on memory autodetection.  You could
> give `mem=64M` [or whatever] at the bootprompt.  Linux will use
> whatever you tell it.  However, operation will be unstable if
> there isn't unique working RAM over the whole address space.
> 
> If your ISA card covers the entire memory hole with it's RAM,
> then there shouldn't be any problem.  Or if your device driver
> requests and blocks the entire hole, but only uses the RAM areas,
> then you should be fine.
> 
> But if there are "holes" or echoed RAM, sooner or later, Linux
> will try to use them, and some process is going to go haywire.
> 
> -- Robert

My ISA card have 768Kb of memory.
If I put in lilo `mem=64M` the system hangup during boot. I think that
the solution could be to tell to the kernel that I want to reserve an
address space. for example something like that:

mem=64M exclude=start-end

so the S.O. doesn't use these addresses.

What do you think about that?

bye

Simone Contini
Game & Tool Programmer
Florence - Italy

Email: [EMAIL PROTECTED]
WWW: http://gpi.eden.it/3dfx4ever/
     http://scontini.monrif.net/

ICQ # : 25879128


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

From: Simon Wakley <[EMAIL PROTECTED]>
Subject: Re: Real Time Programming in Linux
Date: Mon, 08 May 2000 21:22:59 GMT

Thanks Erik,

I tried using pthread_attr_setschedpolicy et al as in the following
code.  That did not work, and my thread still got de-scheduled for 300ms
which is pretty bad!  Did I do sthg wrong, or do I have to use rtlinux
(or QNX).

I started my code as a thread sharing the same code space and did not
want to start it as a totally separate process. (Am I losing out here??)


void make_thread(void)
{            
int code;    
pthread_attr_t attr;    
int policy = SCHED_RR;    
void *tick_tock_arg;    
pthread_t thread;    
pthread_attr_init(&attr);             
attr.__schedpolicy = 99;     // Tried 30, 50, 90 - none work
pthread_attr_setschedpolicy(&attr, policy);   
                                       
code =  pthread_create(&thread, &attr, tick_tock, tick_tock_arg);
//code =  pthread_create(&thread, NULL, tick_tock, tick_tock_arg);

    if (code == 0)     
        printf("Thread creation OK \n");
    else
    {
        printf("Thread creation failed %d - ", code);
        switch (code)
        {
            case 1  : printf("Not enough resources ? Not root? \n"); 
                break;
            default : printf("No idea %d \n", code);
        }
    }  
}                        

In article <[EMAIL PROTECTED]>, Erik de Castro Lopo
<[EMAIL PROTECTED]> writes
>Simon Wakley wrote:
>> 
>> I am porting a robotic controller system to linux, and my program has to
>> spew out data over the parallel port every 20ms.  It does not have to be
>> exactly every 20ms, but it must average exactly that.  I have tried
>> starting a high priority thread from my XWindows app, but it does not
>> run at very high priority and gets blocked when I do some windows
>> intensive activity.
>> 
>> Does anyone know about programming in real time for linux or how you go
>> about that.??  I had been handling this with a separate processor, but
>> would like to integrate it all into Linux for speed of operation.
>
>For soft realtime (which should be sufficient for you purposes) look at
>sched_setscheduler() (read the man page).
>
>There are also firm realtime and hard realtime extensions for Linux.
>
>http://www.ittc.ukans.edu/kurt/  (firm)
>http://www.rtlinux.com/          (hard)
>
>
>> (BTW the parallel port device driver that talks to the H/W is in C.
>> would it be a lot faster in assembler if that can be done???)
>
>Probably not.
>
>Erik

-- 
Simon Wakley

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

From: Yuzheng Ding <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.hardware,comp.os.linux.development.apps
Subject: hardware incompatiblility or kernel problem?
Date: Mon, 08 May 2000 18:00:07 -0400

I seem to have run into really wierd problem with gzip, of all the programs.

I installed Slackware 7.0 on an IBM made P100 (it is to be used as an
X terminal). I did the installation on a K6 and moved the disk over (the P100
does not have CDROM). The kernel was recompiled for "pentium" (it seems in
.config as 586TSC). Things worked fine until I tried to install Netscape. I
tried sevral versions downloaded from the net, as well as the version from
slackware CD (copied over the local net). 

For the ones downloaded form Netscape.com I could untgz the archive without
problem, but installation would complain about crc error when decompressing
netscape.nif although the installation could finish, and the netscape binary
appeared to have the right date and size. For the Slackware file (which is a
tgz'ed directory /usr/lib/netscape) the crc error occured during the untar
process, but again the size/date of the files looked fine.

Now I could run the installed netscape to some point -- some would crash
immediately, some would hang; some would load the default page and crash, and
some would crash later on a page with some bells and whistles. All crashes
were casued by bus error. 

To verify that the archives were fine, I copied them over to another slackware
7.0 machine (P133), and there they decomporessed and installed fine. 

Finally I took the disk off the P100 and put it back on the K6; and there the
installation went like a charm. And when I put the disk back to the P100, the
netscape worked just fine!

SO this seems a problem of gzip, which seems the least likely to have
compatibility problem. Suspecting that the 586TSC kernel on the P100 was
wrong, I changed to a 586 kernel (no TSC, supposed to work with the oldest
chip), but that did not help. I tried about all possible BIOS setup including
turning cache on and off, and nothing helped. 

Has anyone run into similar problems? Anyone has an explanation? This has to
be hardware related, but how? 

ED

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

From: [EMAIL PROTECTED] (Chris)
Crossposted-To: comp.os.linux.development.apps,comp.os.linux,comp.os.linux.misc
Subject: Re: Need to find my IP address
Date: Mon, 08 May 2000 23:17:13 GMT

On Sun, 07 May 2000 02:20:58 GMT, [EMAIL PROTECTED] (Kaz Kylheku)
wrote in comp.os.linux.development.apps:

>The recommended method is to not try to find your IP number.  Programs that try
>to discover the IP address of the local machine are kludgy, and will break
>under circumstances that the author did not take into account: multiple
>interfaces, IP aliasing, dynamic IP, etc.

What is the "reccommended method" of binding a program to only one
interface/port combination without first determining the address of that
interface?  The ip(7) man page says that you should either bind to a
specific address or to INADDR_ANY (which is effectively 0.0.0.0).  Say,
for example, I have an situation which requires me to run two different
daemons on the same port number of different interfaces of the same
machine....


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

From: Nate Eldredge <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development,comp.os.linux.development.apps
Subject: Re: Two really easy (I'm sure) questions
Date: 08 May 2000 13:19:54 -0700

Eric <[EMAIL PROTECTED]> writes:

> > Again - please explain in technical terms WHY 2<&1 (and void main()) is
> > incorrect.  I'm looking for solid technical reasons - not ethical reasons.
> 
> I haven't followed the entire thread, so forgive me if I make a remark
> that  was made before.
> void main() wouldn't be usable if you are interested in the succes of
> you're program. Catching a program's return value (0 on success, else
> failure) does require a return value.

Well... if you do

void main() {
...
exit(N);
}

then it's a slightly fuzzy case, because you will still have an exit
code.  However, there are some platforms where calling conventions are
different for `int' functions than for `void' functions, so this would
break there.

Another good reason is that the ANSI standard requires it, and it
would be silly to write non-standard code for no good reason.  Some
compiler down the line could easily reject it.

I'm not enough of a shell guru to speak about 2<&1.

-- 

Nate Eldredge
[EMAIL PROTECTED]

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Crossposted-To: comp.os.linux.development,comp.os.linux.development.apps
Subject: Re: Two really easy (I'm sure) questions
Reply-To: [EMAIL PROTECTED]
Date: Tue, 09 May 2000 00:13:46 GMT

On 08 May 2000 13:19:54 -0700, Nate Eldredge <[EMAIL PROTECTED]> wrote:
>Eric <[EMAIL PROTECTED]> writes:
>
>> > Again - please explain in technical terms WHY 2<&1 (and void main()) is
>> > incorrect.  I'm looking for solid technical reasons - not ethical reasons.
>> 
>> I haven't followed the entire thread, so forgive me if I make a remark
>> that  was made before.
>> void main() wouldn't be usable if you are interested in the succes of
>> you're program. Catching a program's return value (0 on success, else
>> failure) does require a return value.
>
>Well... if you do
>
>void main() {
>...
>exit(N);
>}
>
>then it's a slightly fuzzy case, because you will still have an exit
>code.

It's not a fuzzy case at all. The program's behavior is undefined,
hence its termination status is imponderable.

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

From: Development System Linux OS <[EMAIL PROTECTED]>
Subject: Create a new filesystem
Date: Mon, 08 May 2000 17:26:00 -0700

I am trying to create a new filesystem by doing this:
1. create a subdirectory named /newfs under /fs.
2. copy all *.c from /fs/ext2 to /fs/newfs
3. made global changes to all those occurances of ext2 to newfs,
   e.g. super.c, ialloc.c, balloc.c, trccate.c, ioctl.c, file.c,
   dir.c, symlink.c, inode.c, acl.c, fsync.c, bitmap.c, namei.c
4. use /fs/newfs/Makefile (copied from /fs/ext2) to make a new
   filesystem with a new file type (e.g. newfs)
I thought after I can get this "make" done, I then will write a
small program to call init_newfs_fs() and mount_root() in turn to see
if I can then create a new filesystem. But I got a long list of
errors saying "Dereferencing pointer to imcomplete type", these
might be the dependency problem, can someone help how to get around
with this? thanks!

Wade


* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!


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


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