Linux-Development-Sys Digest #203, Volume #8     Tue, 10 Oct 00 01:13:11 EDT

Contents:
  Re: Driver Loading FPGA Device (Pete Zaitcev)
  Re: Newbie question: ioremap (Gunnar Proppe)
  Re: About keymap (The Ghost In The Machine)
  Re: Kernel 2.4.0-test7, 8, and 9 "Warning pasting would not give a valid  
preprocessing token" ? ("E-mu")
  Re: A new directory hierarchy standard - need opinions (The Ghost In The Machine)
  Re: Kernel 2.4.0-test7, 8, and 9 "Warning pasting would not give a valid  
preprocessing token" ? (Frank Sweetser)
  Accurate CPU utilization ("Kim Liu")
  file open by insmod, file close by rmmod ([EMAIL PROTECTED])
  Re: Most popular Linux development environment(s)? Graphical? (Bob Hauck)
  Re: What is Linux equivalent of Mac Toolbox? (Dean LaVergne)
  Re: A new directory hierarchy standard - need opinions (Equinox)
  Re: A new directory hierarchy standard - need opinions (Alexander Viro)
  lp under kernel 2.4.0test9 (Chirok Han)

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

From: [EMAIL PROTECTED] (Pete Zaitcev)
Subject: Re: Driver Loading FPGA Device
Date: Mon, 09 Oct 2000 22:48:55 GMT

On Mon, 09 Oct 2000 18:03:20 GMT, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> One of the first tasks the driver I am writing must do is to read a .pof
> file off of the system disk and program a FPGA device on the device
> board.  This is for a PCI device but I am not sure that is relevant to
> this situation.  Does anyone have or know of any code that implements
> this?
> 
> Thank you.

This is normally done with a helper application. The application
reads the file, then issues an ioctl() into the driver that programs
the FPGA.

--Pete

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

From: Gunnar Proppe <[EMAIL PROTECTED]>
Subject: Re: Newbie question: ioremap
Date: Mon, 09 Oct 2000 16:17:58 -0700

Hi,

I just helped someone out on this very newsgroup.  The answer is that you
must #include <asm/io.h> and compile with -O3, instead of -O2.

Look for the message in this forum with subject "ioremap not in
namespce...?" for more details.  deja.com has nice usenet search
facilities:
http://www.deja.com/home_ps.shtml

Cheers,
Gunnar


Mads Soerensen wrote:

> Hello
> As a part of a project, we are trying to communicate with a PC-labcard
> in our PC. It is a ISA card, and are mapped at 0xDB000 and 4kb more.
> However, the problem is that we are not able to communicate with the
> labcad.
> As a total newbie, I have searched the net for examples and comed up
> with a little piece of code that should print the value of the first
> byte
>
> #include <asm/io.h>
> #define BASEADR 0xDB000
>
> unsigned char * mapped;
>
> int main(){
>   mapped = ioremap(BASEADR, 1024);
>   printf("Value: %x \n", *mapped);
> }
>
> But even this simple program dosn't work as we get the error:
> undefined reference to ' __ioremap'
>
> currently we compile using:
>
> gcc -O2 -D__KERNEL__  -I/usr/src/kernel-source-2.2.16-storm/include -o
> example example.c
>
> As we cant compile the very basic example, we must obviously do
> something very wrong. Please help!!!!!
>
> Regards
> Mads Sorensen
>
> P.S: We know about the book Linux Device Drivers, but we won't be able
> to get our hands on it for at least a week.


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

From: [EMAIL PROTECTED] (The Ghost In The Machine)
Subject: Re: About keymap
Date: Mon, 09 Oct 2000 23:42:24 GMT

In comp.os.linux.development.system, Viking
<[EMAIL PROTECTED]>
 wrote
on Mon, 9 Oct 2000 10:23:47 +0800
<8rracr$[EMAIL PROTECTED]>:
>My keyboard has a button which is "A" like character (ascii code 142), how
>could I show this character in Linux terminal when I press this button?
>Thanks for your reply in advance!

If you are using the Linux console (non-X), press and hold ALT
and then hit the numeric keys on the keypad, and you will get
your desired character.  (Pedant point: note that ASCII codes
proper are from 0 to 127.)

I don't know how to key in an 8-bit character on X's xterm.
Guess I'll have to leave that to someone else. :-)   (I'm
curious, too.)

>
>Viking Yuan
>
>


-- 
[EMAIL PROTECTED] -- insert random misquote here

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

From: "E-mu" <[EMAIL PROTECTED]>
Subject: Re: Kernel 2.4.0-test7, 8, and 9 "Warning pasting would not give a valid  
preprocessing token" ?
Date: 09 Oct 2000 23:48:20 GMT

Hey,

Iwas just told by Red Hat Tech support to change the symlinc from cc-> gcc
to cc-> kgcc.   I did this but when I was compiling another kernel I did not
see it say kgcc just gcc when it was compiling.  WIll I see it say kgcc or
not when I am compiling?


Thanks


P.S. If you still only will see gcc while its compiling, how will I know its
using kgcc?



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

From: [EMAIL PROTECTED] (The Ghost In The Machine)
Crossposted-To: comp.os.linux.admin,comp.os.linux.networking,comp.os.linux.setup
Subject: Re: A new directory hierarchy standard - need opinions
Date: Mon, 09 Oct 2000 23:57:03 GMT

In comp.os.linux.development.system, jtnews
<[EMAIL PROTECTED]>
 wrote
on Mon, 09 Oct 2000 21:48:49 GMT
<[EMAIL PROTECTED]>:
>Alexander Viro wrote:
>> 
>> In article <[EMAIL PROTECTED]>,
>> jtnews  <[EMAIL PROTECTED]> wrote:
>> 
>> >I'd appreciate a lot of input on my proposal.
>> 
>> NFS stands for No Filesystem Security. Read on security issues with NFS
>> and if after that you will still think that your proposal makes sense -
>> seek professional help. NFS over untrusted network is a disaster waiting
>> to happen and it's not going to wait long, especially if you use it for
>> executables.
>Can you give a specific example of a security problem using this setup?
>
>Note that it is the client that mounts a read only filesystem from the
>server
>which is presumably on the application service provider's side and is
>secured
>on that end.

1. One can "jam" the filesystem, by injecting packets (NFS works over
   UDP) into the network.  If one's extremely lucky, one can even
   insert nasty viruses this way, although on most NFS installations,
   the damage is limited to the user's account unless it gets into
   /tmp, where it can wreak havoc to naive programs (think: symbolic
   link to fool programs to writing anywhere on the disk; if the program
   is SUID, very nasty things can happen).  A more likely happening
   is that the executable or data becomes corrupted (because part
   of the data is cmoing frmo the rogue injector) and nothing works
   reliably.

   Therefore, putting sensitive data or executables on an NFS server
   is not all that good of an idea unless you can guarantee that the
   subnetwork access is absolutely secure.  Note also that root can't
   write to NFS volumes unless no_squash_root is set during mount;
   this is a feature!  (There's another option which is also set by
   default that disables the suid and sgid bits.)

2. NFS is easily sniffable, as it does not have cryptographic capability
   as far as I know.  This may be addressed sometime in the future,
   and there may be good replacements for NFS that do have crypto.
   I certainly hope so, but I haven't looked.

3. Locking on NFS is a hit-and-miss proposition.  Fortunately, this
   doesn't appear to be part of your proposal (which appears to be a
   method of centralizing executables for a common architecture -- a
   nice idea in theory admittedly, but NFS isn't the way to go).

4. I'm not sure how standard NFS implementations are.  I've had problems
   when sharing a file from a modern Linux system to an old Amiga,
   for example -- although I think that one's a function of buffer size.
   But I've heard of some interesting problems when a Linux box is acting
   as an NFS file server to other Unix boxes.  (It works fine to other
   Linux boxes, of course...)

In short: don't do it.  Use rdist, rpm, or other such management tools
instead.  Disk space is cheap anyway. :-)

-- 
[EMAIL PROTECTED] -- insert random misquote here

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

From: [EMAIL PROTECTED] (Frank Sweetser)
Subject: Re: Kernel 2.4.0-test7, 8, and 9 "Warning pasting would not give a valid  
preprocessing token" ?
Date: 10 Oct 2000 00:19:12 GMT

E-mu <[EMAIL PROTECTED]> wrote:
>Hey,
>
>Iwas just told by Red Hat Tech support to change the symlinc from cc-> gcc
>to cc-> kgcc.   I did this but when I was compiling another kernel I did not
>see it say kgcc just gcc when it was compiling.  WIll I see it say kgcc or
>not when I am compiling?
>
>
>Thanks
>
>
>P.S. If you still only will see gcc while its compiling, how will I know its
>using kgcc?

Try instead setting CC=kgcc in the top level linux/Makefile (there should
already be a line assigning CC=(something else, probably gcc))

-- 
Frank Sweetser rasmusin at wpi.edu, fs at suave.net  | $ x 12
Full-time WPI Network Tech, Part time Linux/Perl guy |
Sam:  What are you up to Norm?
Norm: My ideal weight if I were eleven feet tall.
                -- Cheers, Bar Wars III: The Return of Tecumseh

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

From: "Kim Liu" <[EMAIL PROTECTED]>
Subject: Accurate CPU utilization
Date: Mon, 9 Oct 2000 18:34:04 -0700

How accurate are the CPU utilization numbers returned by calls like times()
and getrusage(), and commands like top and ps?

I once heard that the accounting activity is done in the following way:
When the clock interrupts, the interrupt handler looks at which process is
running at that moment. It then assumes that process has been running for
the whole previous time slice. Say a timeslice is 10ms, it will then add 10
ms to that process's CPU time (either user or system, depending on which
mode the process is in at that moment). It does not care about processes
that run between clock ticks.

I have a program that runs for a few ms, sleeps for a ms, runs for a few ms
again ... As I understand, sleeping for 1 ms does not really sleep for
exactly 1 ms. The process does not get a chance to run until the next clock
tick. So it's very likely that this process will wake up at a clock tick,
run a little bit, sleep again, and wake up at the next clock tick. Because
this process almost never runs at the time the clock ticks, it will have
very little CPU time accumulated. My program shows only a few seconds of CPU
time after running for a day. Is this the cause?

How do I get a more accurate measurement of CPU utilization?

-Kim




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

From: [EMAIL PROTECTED]
Subject: file open by insmod, file close by rmmod
Date: Tue, 10 Oct 2000 01:33:14 GMT

Hi, all.

I'd like to write a kernel module
which opens a file when installed
and closes the file when removed.

In most cases, I have no problem
in repeating insmods and rmmods.
But, sometimes, my system
(1) restarts,
(2) is blocked within open(), or
(3) oops with segmentation-fault within open()
    ("Unable to handle kernel paging request...")
when I redo insmod right after error-free rmmod.

What's wrong with my program?
Any experienced comments are appreciated.
(My linux kernel verson is 2.2.14.)

Thank you in advance.

Joosun Hahn
[EMAIL PROTECTED]

--
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/sched.h>
#include <linux/tty.h>
#include <linux/fs.h>
#include <asm/uaccess.h>
#include <sys/syscall.h>

#define BEGIN_KMEM                          \
        {                                   \
            mm_segment_t old_fs = get_fs(); \
            set_fs(get_ds());

#define END_KMEM                            \
            set_fs(old_fs);                 \
        }

extern void *sys_call_table[];

static struct file *filp;
static int close_on_init = 0;
static int (*open)(char *, int, int);
static int (*close)(int);

inline void
put_unused_fd (unsigned int fd)
{
    FD_CLR(fd, current->files->open_fds);
    FD_CLR(fd, current->files->close_on_exec);

    if (fd < current->files->next_fd)
        current->files->next_fd = fd;
}

int init_module(void)        /* module setup */
{
    int fd = 0;

    /* again the open(...) way */
    open = sys_call_table[SYS_open];
    close = sys_call_table[SYS_close];

    /* supply kernel space data for systemcall */
    BEGIN_KMEM
    fd = open("/dev/ttyS0", O_RDWR, 0);
    END_KMEM
    if (fd < 0) goto ret_FAIL2;

    filp = current->files->fd[fd];
    if (IS_ERR(filp)) goto ret_FAIL;

    current->files->fd[fd] = NULL;
    put_unused_fd(fd);

    return 0;

ret_FAIL:
    close(fd);
ret_FAIL2:
    close_on_init = 1;
    return -EINVAL;
}

void cleanup_module(void)    /* module shutdown */
{
    int fd = 0;

    if (close_on_init) {
        close_on_init = 0;
        return;
    }

    fd = get_unused_fd();
    if (fd < 0) return;

    current->files->fd[fd] = filp;
    close(fd);
}


Sent via Deja.com http://www.deja.com/
Before you buy.

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

From: [EMAIL PROTECTED] (Bob Hauck)
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Most popular Linux development environment(s)? Graphical?
Reply-To: bobh{at}haucks{dot}org
Date: Mon, 09 Oct 2000 23:04:53 GMT

On Mon, 09 Oct 2000 17:16:00 -0400, jazz <[EMAIL PROTECTED]>
wrote:

>I develop code to do a particular job (usually experiment control or data
>analysis) in our lab, on a particular platform. 

You might want to look at scripting languages such as Python.  No, they
don't have much for IDE's either, but they typically work at a higher
level of abstraction and are easier to work with for rapid prototyping
and GUI development.

Just a thought.


-- 
 -| Bob Hauck
 -| To Whom You Are Speaking
 -| http://www.haucks.org/

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

From: [EMAIL PROTECTED] (Dean LaVergne)
Crossposted-To: comp.os.linux.x,comp.os.linux.development.apps
Subject: Re: What is Linux equivalent of Mac Toolbox?
Date: Tue, 10 Oct 2000 01:50:08 GMT

Is this true for all platforms, or only Linux:?

Dean LaVergne
[EMAIL PROTECTED]

On Mon, 9 Oct 2000 00:20:50 GMT, John Hasler <[EMAIL PROTECTED]> wrote:

>Prasanth Kumar writes:
>> 'QT' a fully C++ based GUI toolkit but there is a restriction that it is
>> free only if you own resultant product is free or otherwise you must
>> purchase a commercial license from them (www.trolltech.com).
>
>Qt has now been released under the GPL.
>-- 
>John Hasler
>[EMAIL PROTECTED] (John Hasler)
>Dancing Horse Hill
>Elmwood, WI


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

From: [EMAIL PROTECTED] (Equinox)
Crossposted-To: comp.os.linux.admin,comp.os.linux.networking,comp.os.linux.setup
Subject: Re: A new directory hierarchy standard - need opinions
Date: Tue, 10 Oct 2000 03:22:34 GMT

On Mon, 09 Oct 2000 19:53:24 GMT, jtnews <[EMAIL PROTECTED]>
wrote:

>I propose a new naming scheme for the /usr directory, it should be
>/usr/domain/com/company/subnet/applicationName/architecture/i386, then
>you just make a simple script /usr/bin which links to every executable
>in the /usr/domain directory.

You've been spending too much time around Java programmers. :)


>An advantage of this scheme is that you can easily create maps for
>automount to automatically mount the application remotely via NFS.
>Looking forward, when broadband becomes widely available and bandwidth
>becomes very cheap, there won't be any need to create distributions.
>In addition, it might be possible to implement Sun's cachefs in        Linux
>so that the applications are automatically cached to a local hard disk
>so you wouldn't have to use NFS all the time either.

It seems that your proposal tries to lend itself to computing in a
large-scale, heterogeneous network environment.  A major problem with
this is that, while "network computing" makes a bit of sense within
the boundaries of an organization, it makes very little sense for the
world-at-large.  There are far too many issues of security and
privacy.  People would rather have their data (and the applications
that manipulate it) within their control.

Besides, I'd go nuts if I had to use a thin-client with only an
itty-bitty "caching disk" all the time.


>Another advantage of this scheme is that since /usr/domain lies outside
>of the current Linux FHS, it can be gradually phased in and need not
>disrupt the current Linux environment.

I think that the entire FHS, not just /usr/ , needs to be cleaned up.
Some examples:

  1) A lot of cruft that should be stored elsewhere seems to have
     collected in /usr/ .  Shouldn't the directory containing include
     files be under a src/ directory somewhere?

  2) /opt/ seems to be a "Program Files"-like directory [please excuse
     the reference to Windoze] for the installation of software
     packages that don't fit neatly into the /usr/* and /usr/local/*
     hierarchies.  Why, then, do we have /opt/bin/ , /opt/lib/ , and
     so forth?

  3) Another /opt/ issue... /opt/ is described in section 3.8 of the
     current FHS as a place for "add-on application software
     packages".  I interpret "add-on" to mean "not essential to system
     operation".  In light of this, why do we have /opt/ , instead of
     /usr/opt/ and /usr/local/opt/ ?

  4) All special allowances for X11 need to be done away with.  It's
     just another program, but its current convoluted directory
     structure makes configuration and administration needlessly
     difficult.  Gathering up this monster's sprawling pieces and
     sticking them into /usr/opt/X11R6/ might not be a bad idea.

I could go on...  Note that this little rant shouldn't be taken to
mean that I have come up with all the answers, and can produce a draft
for my idea of FHS 3.0 right now.  I haven't, and I can't.  But I'll
let you know when I have and I can. :)

Just my two cents worth.



--Russell

============================================================
email (spam-disabled):
rdh *at* salug *dot* org

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

From: [EMAIL PROTECTED] (Alexander Viro)
Crossposted-To: comp.os.linux.admin,comp.os.linux.networking,comp.os.linux.setup
Subject: Re: A new directory hierarchy standard - need opinions
Date: 10 Oct 2000 00:38:48 -0400

In article <[EMAIL PROTECTED]>,
jtnews  <[EMAIL PROTECTED]> wrote:
>Alexander Viro wrote:
>> 
>> In article <[EMAIL PROTECTED]>,
>> jtnews  <[EMAIL PROTECTED]> wrote:
>> 
>> >I'd appreciate a lot of input on my proposal.
>> 
>> NFS stands for No Filesystem Security. Read on security issues with NFS
>> and if after that you will still think that your proposal makes sense -
>> seek professional help. NFS over untrusted network is a disaster waiting
>> to happen and it's not going to wait long, especially if you use it for
>> executables.
>Can you give a specific example of a security problem using this setup?
>
>Note that it is the client that mounts a read only filesystem from the
>server
>which is presumably on the application service provider's side and is
>secured
>on that end.

Spoofing of all kinds. Wide-open to middleman attacks. Traffic analysis
gives a _lot_ of interesting information. Any routing problems on major
ISP immediately turn into massive DoS. Too many points where single failure
brings a lot of damage. And server itself becomes extremely tasty morsel
for every cracker on the planet - get in and you've got all clients.
Could you spell "DDoS of really majestic proportions"? Could you spell
"gain control over server, change the clients' idea of the IP of said
server redirecting them to your mirror, then get the fsck out of server
restoring everything in pristine condition"? Could you spell "mother of
all class action lawsuits as soon as the shit will hit the fan"? Same
applies for DNS spoofing, etc. The question with security problems is
not "if", it's "when and how hard". Shit _will_ hit the fan and with your
scheme consequences of a single compromise are going to be really nasty.
Please, get real.

-- 
"You're one of those condescending Unix computer users!"
"Here's a nickel, kid.  Get yourself a better computer" - Dilbert.

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

From: Chirok Han <[EMAIL PROTECTED]>
Subject: lp under kernel 2.4.0test9
Date: Tue, 10 Oct 2000 04:44:29 GMT

Hi.

So far, lp.o has been successfully loaded under my 2.2.17 kernel.
But when I upgraded the kernel to 2.4.0-test9,
it suddenly stopped working.  I get the following message

kernel: lp: driver loaded but no devices found

as I try to load lp.o module.  As I go back to 2.2.17, 
I can again use the printer.  What would be the problem?
Thank you in advance.

CH

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


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