Linux-Development-Sys Digest #666, Volume #8     Tue, 24 Apr 01 06:13:11 EDT

Contents:
  Re: Documentation on Linux scripts ? (Vilmos Soti)
  Help with PCI 9054 Direct Master-to-PCI Mamory Mapping ([EMAIL PROTECTED])
  Re: writing device drivers ([EMAIL PROTECTED])
  Re: Documentation on Linux scripts ? ([EMAIL PROTECTED])
  [Help:] File system programming ("J. Liu")
  action command in initd scripts (nomad)
  Re: Documentation on Linux scripts ? (Joe Pfeiffer)
  Re: Can Linux kernel ported on supercomputer (using 16 processor) (Paul Jackson)
  Re: SIGSEGV signal handler and pthread (Sang-Kwon Lee)
  Re: Documentation on Linux scripts ?
  Re: Documentation on Linux scripts ? (Francis Litterio)
  Re: action command in initd scripts (Chronos Tachyon)
  Re: pcmcia
  Re: pcmcia (Dave Platt)
  Linux Shells (Mandy)
  Re: Linux Shells (Paul Jackson)
  Re: Documentation on Linux scripts ? (Frank Ranner)
  Re: shell programming question (Roberto Nibali)
  Re: IP packet rewrite (Roberto Nibali)
  Re: Documentation on Linux scripts ? (Roberto Nibali)
  request_fn in 2.4? ("Andy Jeffries")

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

Crossposted-To: comp.os.linux.misc
Subject: Re: Documentation on Linux scripts ?
From: Vilmos Soti <[EMAIL PROTECTED]>
Date: Mon, 23 Apr 2001 20:14:54 GMT

Tarkus <[EMAIL PROTECTED]> writes:

> Where can I find documentation about linux scripting (Bash) ? I have got
> documentation about linux commands via several books and the man
> command, but I don't find anything about variable settings, or if
> structures, or loops syntax, etc...

http://www.linuxdoc/org/HOWTO/Adv-Bash-Scr-HOWTO/index.html (I hope right)

Vilmos

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

From: [EMAIL PROTECTED]
Subject: Help with PCI 9054 Direct Master-to-PCI Mamory Mapping
Date: Mon, 23 Apr 2001 20:44:03 GMT



I am trying to implement Direct Master Operation ( Local Master-to-PCI Target )
using 9054 chip on a PCI9054-860 RDK demo board from PLX Tech.  In plain
english, it means that the Local CPU accesses PCI memory or I/O. Here the Local
CPU is the Motorola 860 processor and the host CPU is Pentium. 
There are a bunch of registers in the 9054 chip, that are required to be
configured for this to work. I am having problems with one of them which is the
DMPBAM - PCI Base Address (Remap) Register for Direct Master-to-PCI Memory. Only
bits 31:16 are the remap bits ( only top 16 bits of 32 bit register). 
I tried to use __get_free_pages( ) call to get contigous memory in my linux
driver. This function call returned 0xc24a9000. Now, how do I use this value to
program my DMPBAM register's top half portion. I am assuming that the address
that goes into this register is virtual address. The get_free_pages call is
giving me a virtual address which includes the 'PAGE_OFFSET'. Do I have to
subtract this PAGE_OFFSET which is 0xc0000000 from my 0xc24a9000 and then plug
in the top 16 bits. Actually I tried it and it doesn't seem to work. Any help
would be appreciated. 




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

From: [EMAIL PROTECTED]
Subject: Re: writing device drivers
Date: Mon, 23 Apr 2001 20:56:43 GMT

It depends on the device you are dealing with. For example if it is a PCI
device, you will need the address of the Configuration registers, the PCI bus #
etc. to access and set the device. In general, for any device you have to find a
way to access it's registers so you can setup the device. 
You should first try to run the sample programs given in the device driver book
and see if you can run them.

In article <XGKE6.6410$[EMAIL PROTECTED]>, mark says...
>
>Hi all,
>
>I want to learn how write device drivers, I bought Alessandro Rubini's book
>last week and I am ready to start. I just have one questions:
>1. what kind of information about the device do I need to know?
> thanx
>hamza
>
>
>
>



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

Crossposted-To: comp.os.linux.misc
From: [EMAIL PROTECTED]
Subject: Re: Documentation on Linux scripts ?
Date: Mon, 23 Apr 2001 21:24:01 GMT

It means that it runs in kernel-context. Generally, if there are functions like
init, get etc., that share the same names, in order to distinguish in which
space ( User or Kernel space ) the particular function runs, they use a double
underscore to indicate that this is a kernel-space function. Hope, this helps.


In article <[EMAIL PROTECTED]>, Tarkus says...
>
>Hi,
>
>Where can I find documentation about linux scripting (Bash) ? I have got
>documentation about linux commands via several books and the man
>command, but I don't find anything about variable settings, or if
>structures, or loops syntax, etc...
>
>Any direction ?
>
>Thanks for your help.
>
>Tarkus
>
>



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

From: "J. Liu" <[EMAIL PROTECTED]>
Subject: [Help:] File system programming
Date: Mon, 23 Apr 2001 17:25:13 -0400

Hi all,

I'm kind of a newbie in kernel programming and and working on file
systems.

I'd like to know where is "struct inode" defined ?

thanks in advance.




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

From: [EMAIL PROTECTED] (nomad)
Subject: action command in initd scripts
Date: Mon, 23 Apr 2001 21:35:49 +0000 (UTC)

Hi,

Does anybody knows what the command "action" means in
the initd scripts ?
I didn't find any information on the man and Howtos...

Here is a sample of its utilisation:
action "Bringing up interface lo" ./ifup ifcfg-lo

I've tried to use it in a sh script, but the system resturned me an
error...

Thanks,
nomad




-- 
Posted from smarthost2.mail.easynet.fr [212.180.1.69] 
via Mailgate.ORG Server - http://www.Mailgate.ORG

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

From: Joe Pfeiffer <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.misc
Subject: Re: Documentation on Linux scripts ?
Date: 23 Apr 2001 15:33:54 -0600

[EMAIL PROTECTED]  writes:

> It means that it runs in kernel-context. Generally, if there are functions like
> init, get etc., that share the same names, in order to distinguish in which
> space ( User or Kernel space ) the particular function runs, they use a double
> underscore to indicate that this is a kernel-space function. Hope, this helps.
What on earth does this answer have to do with the question?

> 
> In article <[EMAIL PROTECTED]>, Tarkus says...
> >
> >Hi,
> >
> >Where can I find documentation about linux scripting (Bash) ? I have got
> >documentation about linux commands via several books and the man
> >command, but I don't find anything about variable settings, or if
> >structures, or loops syntax, etc...
> >
> >Any direction ?
> >
> >Thanks for your help.
> >
> >Tarkus

man bash(1)
See /etc/init.d (or wherever your system puts the boot-time rc
scripts) for tons of examples.
-- 
Joseph J. Pfeiffer, Jr., Ph.D.       Phone -- (505) 646-1605
Department of Computer Science       FAX   -- (505) 646-1002
New Mexico State University          http://www.cs.nmsu.edu/~pfeiffer
SWNMRSEF:  http://www.nmsu.edu/~scifair

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

From: [EMAIL PROTECTED] (Paul Jackson)
Subject: Re: Can Linux kernel ported on supercomputer (using 16 processor)
Date: 23 Apr 2001 23:02:30 GMT


|> And Silicon Graphics sells boxes with 256 processors.

Up to 512 or 1024, actually (running Irix over MIPS processors).

It is our goal, with a few other companies, to bring Linux
into this same space.  We are several years into the work of
making the Linux improvements needed for this.  I believe we
have announced the first SGI ccNUMA (*) systems running Linux
on Intel IA64 processors will be shipping later this year.

I'd say it takes about 10 years to turn a single processor Unix
variant into a serious big-iron operating environment, and that
Linux is perhaps 3 or 4 years into this process.

 (*) ccNUMA: cache coherent Non-Uniform Memory Architecture
-- 

                          I won't rest till it's the best ...
                          Manager, Linux System Software
                          Paul Jackson <[EMAIL PROTECTED]> 1.650.933.1373

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

From: Sang-Kwon Lee <[EMAIL PROTECTED]>
Subject: Re: SIGSEGV signal handler and pthread
Date: Tue, 24 Apr 2001 09:16:19 +0900

I used the following makefile.
Is there any problem?

OBJS    = main.o
CC      = /usr/bin/cc
CFLAGS  = -g
LDFLAGS = -lpthread
TARGET  = main

$(TARGET) : $(OBJS)
        gcc -o $@ $(OBJS) $(CFLAGS) $(LDFLAGS)

clean:
        rm *.o $(TARGET)


>


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

From: [EMAIL PROTECTED] ()
Crossposted-To: comp.os.linux.misc
Subject: Re: Documentation on Linux scripts ?
Date: Tue, 24 Apr 2001 00:19:56 -0000

In article <[EMAIL PROTECTED]>, Tarkus  <[EMAIL PROTECTED]> wrote:

>Where can I find documentation about linux scripting (Bash) ? I have got
>documentation about linux commands via several books and the man
>command, but I don't find anything about variable settings, or if
>structures, or loops syntax, etc...
>
>Any direction ?

Have you tried looking in /usr/doc?

--
http://www.spinics.net/linux/

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

Crossposted-To: comp.os.linux.misc
From: Francis Litterio <[EMAIL PROTECTED]>
Subject: Re: Documentation on Linux scripts ?
Date: Tue, 24 Apr 2001 00:30:11 GMT

Tarkus <[EMAIL PROTECTED]> writes:

> Where can I find documentation about linux scripting (Bash) ?

Type "man bash".  Also see the Bash Programming Intro HOWTO at:

        http://www.linuxdoc.org/HOWTO/Bash-Prog-Intro-HOWTO.html

and the Advanced Bash Scripting HOWTO at:

        http://www.linuxdoc.org/HOWTO/Adv-Bash-Scr-HOWTO/index.html

O'Reilly also publishes "Learning the bash Shell, 2nd Edition":

        http://www.oreilly.com/catalog/bash2/
--
Francis Litterio
[EMAIL PROTECTED]
PGP public keys available on keyservers.

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

From: Chronos Tachyon <[EMAIL PROTECTED]>
Subject: Re: action command in initd scripts
Date: Tue, 24 Apr 2001 01:22:09 GMT

On Mon 23 Apr 2001 04:35, nomad wrote:

> Hi,
> 
> Does anybody knows what the command "action" means in
> the initd scripts ?
> I didn't find any information on the man and Howtos...
> 
> Here is a sample of its utilisation:
> action "Bringing up interface lo" ./ifup ifcfg-lo
> 
> I've tried to use it in a sh script, but the system resturned me an
> error...
> 
> Thanks,
> nomad
> 
> 
> 
> 

This is probably a shell function declared in a separate file that is 
source-d in toward the top of the script.  Different distros do things in 
very different ways, but you might poke around for something like 
/etc/init.d/functions.

-- 
Chronos Tachyon
Guardian of Eristic Paraphernalia
Gatekeeper of the Region of Thud
[Reply instructions:  My real domain is "echo <address> | cut -d. -f6,7"]


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

From: <[EMAIL PROTECTED]>
Subject: Re: pcmcia
Date: Mon, 23 Apr 2001 18:25:44 -0700

Well, currently I am running the RH6.2 distribution whith is 2.2.14 and it
includes a pcmcia-cs-3.1.9 subdirectory. The device itself is functioning in
this laptop as the other half of the hard disk is a windows image and the
card does talk on the local LAN just fine.

"bill davidsen" <[EMAIL PROTECTED]> wrote in message
news:9c1ue3$6vga$[EMAIL PROTECTED]...
> In article <RjJE6.46$[EMAIL PROTECTED]>,  <[EMAIL PROTECTED]>
wrote:
> | Well, Er, Ahh, I continuously manage to stump myself. Having had a
modicum
> | of success in other areas, I foolishly am trying to get a PCMCIA network
> | card working in a laptop. It is a Xircom XE-2000. I can see that cardmgr
> | says in the log file that it loads the entry I gave this card in
> | /etc/pcmcia/config which is "pcnet_cs". After the "executing insmod
> | pcnet_cs.o" message I see cardmgr say "get dev info on socket 0 failed:
No
> | such device". I can hear the computer give a high beep followed by a low
> | beep (which according to my researches at
> | http://pcmcia-cs.sourceforge.net/ftp/doc/PCMCIA-HOWTO-4.heml is 'a card
was
> | identified, but could not be configured for some reason'. Invoking
'cardctl
> | ident' shows the card is in the socket with the appropriate product info
and
> | manfid of 0x0105, 0x010a.
> |
> | Any suggestions, will as always, be greatly appreciated.
>
> 1 - how about config for this device, is it setup?
> 2 - hardware / kernel info?
>
> --
>   bill davidsen <[EMAIL PROTECTED]>  CTO, TMR Associates, Inc
> "I am lost. I am out looking for myself. If I should come back before I
> return, please ask me to wait."  -seen in a doctor's office
>



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

From: [EMAIL PROTECTED] (Dave Platt)
Subject: Re: pcmcia
Date: Tue, 24 Apr 2001 02:27:51 -0000

>Well, currently I am running the RH6.2 distribution whith is 2.2.14 and it
>includes a pcmcia-cs-3.1.9 subdirectory. The device itself is functioning in
>this laptop as the other half of the hard disk is a windows image and the
>card does talk on the local LAN just fine.

I'd suggest downloading, building, and installing a more recent
version of the pcmcia-cs package (try freshmeat.net for a link to the
home site on SourceForge).  The package is up to 3.1.25 now, last time
I looked, and it's quite possible that there has been a revision to
the driver-ID tables needed to identify your card.

-- 
Dave Platt                                           [EMAIL PROTECTED]
Visit the Jade Warrior home page:  http://www.radagast.org/jade-warrior/
  I do _not_ wish to receive unsolicited commercial email, and I will
     boycott any company which has the gall to send me such ads!

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

From: Mandy <[EMAIL PROTECTED]>
Subject: Linux Shells
Date: Tue, 24 Apr 2001 03:30:09 -0000

What a lixus shells? What types are there? And a brief description of each.

--
Posted via CNET Help.com
http://www.help.com/

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

From: [EMAIL PROTECTED] (Paul Jackson)
Subject: Re: Linux Shells
Date: 24 Apr 2001 03:46:51 GMT


|> What a lixus [Linux?] shells? What types are there? And a
|> brief description of each.

Try searching google.com for "Linux Shells".  One or more of
the first 20 hits exactly answers your question.
-- 

                          I won't rest till it's the best ...
                          Manager, Linux System Software
                          Paul Jackson <[EMAIL PROTECTED]> 1.650.933.1373

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

From: Frank Ranner <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.misc
Subject: Re: Documentation on Linux scripts ?
Date: Tue, 24 Apr 2001 13:48:54 +1000

Tarkus wrote:
> 
> Hi,
> 
> Where can I find documentation about linux scripting (Bash) ? I have got
> documentation about linux commands via several books and the man
> command, but I don't find anything about variable settings, or if
> structures, or loops syntax, etc...
> 
> Any direction ?
> 
> Thanks for your help.
> 
> Tarkus
try:
info bash
info bash2

gnome: help->info pages->bash,bash2

regards, Frank Ranner

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

From: Roberto Nibali <[EMAIL PROTECTED]>
Subject: Re: shell programming question
Date: Tue, 24 Apr 2001 11:22:55 +0200

Hello,

> I'm kind of a newbie in shell porgramming and I'm wanting to do something I
> can't do.
> So I hope somebody will be able to help me.

This is not the best ng to ask stuff about shell programming. Next time
or for followup you might try comp.unix.shell. There are more people that
can help you (maybe).
 
> The purpose of the script is to launch a program. The problem is that the
> program often crashes and has to be relaunched. Also, when the program
> crashes, some processe stays alive and have ot be killed before trying to
> launch the program antoher time.

This is not so simple and most of the time cannot be done reliably. Since
I have no time to write the whole code for you I give you a starter that
should help you to solve your problem. Generally, I suggest you fix that 
broken program. A program that crashes often is not usefull and should either
be banned or rewritten.
 
> To do that I did a simple while loop :
> 
> while [ 1 -ne 0 ];
> do
>     echo launching prog
>     ./prog > prog.log 2>&1
> done

Not so good. Your launched program blocks the bash from doing more stuff.
You should write it as a daemon. See below.
 
> You can see that I did not write the part that kills the processes...
> Because I do not know how to do that !

It's also the toughest part :)
 
> If somebody could help me !

This is a basic approach for a system with bash support and ps -p:

================8<=====================8<===============================

#! /bin/bash

LOG=./my_buggy_prog.log
daemon_timeout=5
my_prog=./my_buggy_prog
my_prog_pid=$$
running=0

> $LOG

test_if_running(){
        ex=0
        ps -p $my_prog_pid | grep "${my_prog##*/}" 1>/dev/null
        if [ $? -ne 0 ]; then
                ex=1
                echo "Warning, not running anymore" >> $LOG
        fi
        return $ex
}

while :; do
        if [ $running -eq 0 ]; then
                echo "launching prog ..." >> $LOG
                # Here you should add the checking of pending daemons!
                ($my_prog >> $LOG 2>&1) &
                my_prog_pid=$!
                echo "prog launched with pid=$my_prog_pid" >> $LOG
                running=1
        fi
        sleep $daemon_timeout
        echo "retesting if $my_prog is still running" >> $LOG
        test_if_running 
        if [ $? -ne 0 ]; then
                running=0
        else
                echo "$my_prog is still running" >> $LOG
        fi
done

================8<=====================8<===============================

HTH a little bit. You can get further information posting to c.u.s. Best
regards,
Roberto Nibali, ratz


-- 
mailto: `echo [EMAIL PROTECTED] | sed 's/[NOSPAM]//g'`

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

From: Roberto Nibali <[EMAIL PROTECTED]>
Subject: Re: IP packet rewrite
Date: Tue, 24 Apr 2001 11:38:38 +0200

Snehal Khandkar wrote:
> 
> Hi,
> 
> I have to make a load balancer between servers. My machine is a host (with
> one IP addr)  and the servers are on the same network as the machine. So I
> can't use masquerade.

I would still suggest you check out our project at http://www.linux-vs.org :)

> So I am trying to rewrite the IP addresses (src and dest) and the ports,
> ie. every packet that comes from client to loadbalancer, I select a
> server. Then I change the src addr from CLIENT_ADDR to LODBAL_ADDR and the
> dest addr from LOAD_BAL addr to SERVER_ADDR and give it a new sourse
> port right when it comes in ip_rcv. I assume that this packet should now
> be treated as a packet that should be sent to the server from the load
> balancer.

Is the client on the same physical segment as the load balancer?
Does the server listen on the same IP (on a virtual loopback) as the 
load balancer because else it wouldn't accept the packet you rewrote.

> I have also commented out the check for RTN_UNICAST in
> fib_validate_source. But this packet goes as follows -

:) Don't do that, you open a lot of potential security holes.
 
> ip_rcv -> ip_route_input_slow (just for the first time) -> ip_forward

ip_route_input_slow() is called every time the routing cache timeout
for this specific route_lookup expires.

> ->ip_send ->ip_finish_output -> dev_queue_xmit (gets enqueued here)

Are you sure the skb never goes into ip_local_deliver()?
 
> I can't trace where it goes after that. It certainly doesnt come on the
> wire.

Says who? tcpump? Don't trust tcpdump, especially if you're modifying
skb's. The kernel does a skb_header_copy and markes the packet. tcpdump
registers as a different receiver as the NIC driver. So maybe you won't
see the the packet or more likely not the modified one. You have to add
printk()'s to the enqueue function.
 
> Can someone please tell me what may be happening? Is there something else
> that I should change when I change the ip source and dest addresses and
> source port? Or is changing this in ip_rcv not okay?

It depends where you've changed stuff in ip_rcv :)

Is the firewalling code enabled in your kernel? Because then the packet
travels slightely different. How about socket_filtering, transparent proxy
mode? I asked you in the last mail about this.
 
> Or is there anything else I am missing. I will really appreciate any help.

Check your /proc/sys/net/ipv4/conf/eth0/*. Did you enable stuff like
rp_filter, hidden, mc_forwarding, accept_source_route?

Please, check out the LVS project. We have been mucking around with these
issues for over 2.5 years. [http://www.linuxvirtualserver.org, in case you
forgot :)].

Have phun smashing the ip_route_input(). I'm sorry I can't help you more.
Best regards,
Roberto Nibali, ratz

-- 
mailto: `echo [EMAIL PROTECTED] | sed 's/[NOSPAM]//g'`

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

From: Roberto Nibali <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.misc
Subject: Re: Documentation on Linux scripts ?
Date: Tue, 24 Apr 2001 11:45:50 +0200

Tarkus wrote:
> 
> Hi,
> 
> Where can I find documentation about linux scripting (Bash) ? I have got
> documentation about linux commands via several books and the man
> command, but I don't find anything about variable settings, or if
> structures, or loops syntax, etc...

For bash: http://cnswww.cns.cwru.edu/~chet/bash/bashref.html
It is for Bash 2.05, the newest released bash. If you need older
documentation, check out http://www.gnu.org/manual/bash/index.html.

Best regards,
Roberto Nibali, ratz

-- 
mailto: `echo [EMAIL PROTECTED] | sed 's/[NOSPAM]//g'`

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

From: "Andy Jeffries" <[EMAIL PROTECTED]>
Subject: request_fn in 2.4?
Date: Tue, 24 Apr 2001 10:44:52 +0100

I am trying to write a 2.4 device driver but (basing it on the code in
Linux Device Drivers by Mr Rubini) it complains about blk_dev[MAJOR] nor
having a member named request_fn.

I see from some of the kernel source code that there is a new style for
request functions, something called make_request_fn.  But I can't find
any documentation on how to port it (or how to write 2.4 drivers from
scratch).

Any web sites or pointers anyone?



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

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


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

Reply via email to