Linux-Development-Sys Digest #715, Volume #7 Wed, 29 Mar 00 11:13:16 EST
Contents:
Re: Recomendation for a graphical 'diff' style program for Linux? (Erik de Castro
Lopo)
File Read/Write from Kernel (Alex Au)
System Immutable Request (apex)
Re: implementing restartable system calls in a module (nilesh patel)
ld not found libdb.so ("Alexander N. Ryzhov")
Re: Precision of Linux's libm??? (Gordon Haverland)
Re: Advice on PowerPC MPC823 Dev. Tools? (James Moger)
Re: How do I make shared libraries? ("Marc E. Christensen")
Re: Kernel modules development (Fabrice Peix)
Re: latest 2.3.99-pre3 won't boot on I-OPENER (Bryan)
bootsect.s ("filipesinclair")
Re: Free BSD (Bryan)
Re: ld not found libdb.so (Massimo Cafaro)
----------------------------------------------------------------------------
From: Erik de Castro Lopo <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Recomendation for a graphical 'diff' style program for Linux?
Date: Wed, 29 Mar 2000 10:36:47 +0000
Tim Harvey wrote:
>
> Greetings,
>
> I'm looking for recomendations for a nice graphical diff program for
> Linux. I'm looking for something very close to 'Beyond Compare' for
> windows or like the diff that comes on an Irix system. I'm aware of
> 'kdiff' but it doesn't have the features I'm looking for. I'm looking
> for something that can diff directories as well as files, and that can
> allow you to edit files by moving diffs back and forth between right and
> left panes.
I use mgdiff which I think is great. I links quite happily against
the Lesstif libraries. I think there's a link to in on the Lesstif
website at:
http://www.lesstif.org
Here it is:
ftp://ftp.x.org/contrib/applications/mgdiff.tar.gz
There's also someone developing a GTK+ based diff viewer (gtkdiff??)
although last time I looked at it, it was rather raw. Search for it
on Freshmeat
http://freshmeat.net/
Erik
--
+-------------------------------------------------+
Erik de Castro Lopo [EMAIL PROTECTED]
+-------------------------------------------------+
"In civilian equipment, such as computers, the number
of components alone makes miniaturization essential if
the computer is to be housed in a reasonable-sized
building." Electronics Oct. 1, 1957, p. 178
------------------------------
From: Alex Au <[EMAIL PROTECTED]>
Subject: File Read/Write from Kernel
Date: Wed, 29 Mar 2000 19:28:53 +0800
I'm now modifying the console part of the kernel.
I want to read some data from a file outside. But I can't find
the function(s) to do that.
I've try the sys_open() in fs/open.c to open the file, but it fail and
return
error code EFAULT.
Then I try to bypass the checkings in sys_open() and call the
flip_open() in fs/open.c directory. It seems work and I get the fd.
I try to use the fd to read data from that file and it give me EFAULT
again!
Does anyone konw the correct method to open/read/write/close files in
the Kernel? Thanks a lot!
Alex
------------------------------
From: apex <[EMAIL PROTECTED]>
Subject: System Immutable Request
Date: Wed, 29 Mar 2000 11:58:55 GMT
Hi there,
As I'm realy paranoid about my security I would like to adress the
chattr command under Linux
System Immutable is not realy possible with the current implementation.
This is because (as you all know)
you can change the flags right back. So if I were to make a log system
immutable append only and there
is a root compromise the perpetrator would only have to remove the
immutable flags, run his/her cleaning
script and walla, all logs are doctored.
Could this changed in an easy way. If so I would like to give it a try,
but right now I have a problem .. I don't
know if Linux remembers it's current runlevel. It's in /var/run/utmp but
that is writeable by root so not very handly.
In short:
Is it generaly a good idea to change the ioctl function so the you can
only change the system immutable flag in single user mode ?
Does the kernel keep track of what runlevel it's currently in, (and how
do I get it) ?
Anyone have anything more to add, suggest, tips, etc.
-Michiel-
[EMAIL PROTECTED]
------------------------------
From: nilesh patel <[EMAIL PROTECTED]>
Subject: Re: implementing restartable system calls in a module
Date: Wed, 29 Mar 2000 17:58:16 +0530
Alan Donovan wrote:
> nilesh patel wrote:
>
> > It is the responsibility of the driver to undo the writes in case if any
> > signal occurs.
> > However it is not a big job to undo the writes , it involves only shifting
> > the buffer pointer for the kernel buffer where the bytes are written.
>
> In my driver, the "write" method (when blocking) fills the DMA buffer
> and then, if there is more data still to write, does a sleep on a wait
> queue. When the DMA is complete, the interrupt BH wakes the process,
> which fills the DMA buffer again with the next chunk, and so on, until
> the whole block passed to write(2) in user mode has been put in the DMA
> buffer.
I also had faced similar problems . The approach I took was that in write
you should not commit to write all what the application is sending at one time
, you guarantee that you write at least one byte in case of blocking write ,
that is if your buffer has say X bytes of space to write and the application
sends X + Y , in such case you take just X bytes and return (X). It is the
responsiblity ofthe application to check weather all the data it sent had been
written or not. If however your buffers are full and you did not write anyting
then you let application sleep. And after coming out from the sleep you can
check for the signals.
Also the approach I took when writing data to hardware was that , I allowed the
bottom half to write data from my buffers only if the buffers are full else you
dont write any thing.
The checking of the buffer is full or not should be atomic . that is when
application fill up the buffer till end it sets a buffer_full = TRUE
In bottom half you if (buffer_full) {
write data to hardware;
}
else
zero_data_written ++;
As buffer_full is accessed both by your write and bottom half the access
/modification should be atomic.
>
> If, when the sleep is woken, the process has been signalled, then to
> implement restartable semantics you say I must be able to undo the
> writes: however the data might already have been DMAd and consumed by
> the hardware.I
> 've included some code below: am I doing it wrong?
>
> alan
>
> BTW: another question: if during a cli..sti lock, you execute code that
> faults while probing user space, does the kernel's exception handler
> reenable interrupts, or simply return the top-level method with EFAULT
> leaving them disabled? Would this be bad?
Yes you should not say get_user() in cli () sti () as they may fault and since
the interrupts are cleared the disk which contains our page wont interrupt and
there would be a deadlock.
I am also a newbie on driver writing.
Nilesh
>
>
> ------------------------------------------------------------------------
> Alan Donovan [EMAIL PROTECTED] http://www.imerge.co.uk
> Imerge Ltd. +44 1223 875265
>
> Note: add_to_dma_buf adds adds up to "count" bytes from "buf" to the DMA
> buffer. It may fault.
>
> Note: "chan" points to data that is modified by the interrupt handler's
> BH, hence locks.
>
> ssize_t linn_write(struct file *filp,
> const char *buf, size_t count, loff_t *ppos)
> {
> Linn_Channel *chan = filp->private_data;
> ssize_t bytes_written = 0;
>
> if(filp->f_flags & O_NONBLOCK) /* nonblocking */
> {
> /* add up to "count" bytes to the DMA buffer */
> // cli();
> bytes_written = add_to_dma_buf(chan, buf, count);
> // sti();
if (dma_buf_full) { // dma_buf_full is local static variable
> cli ();
> buffer_full = TRUE; // buffer_full accessed by botom
> half also.
sti ();
}
return bytes_written == 0 ? -EWOULBLOCK : bytes_written;
>
>
> /* note -- this is safe when add_to_dma_buf faults */
not safe.
>
>
> /* there is no space left in the DMA buffer: try again later */
> if(bytes_written == 0)
> return -EWOULDBLOCK;
> }
> else /* blocking */
> {
> while(count > 0)
> {
> /* add up to "count" bytes to the DMA buffer */
> ssize_t chunk, bytes;
> bool _continue;
>
> cli(); /* lock access through "chan" */
> chunk = add_to_dma_buf(chan, buf, count);
> bytes = chan->bytes;
> sti();
>
> if(chunk == -EFAULT)
> return -EFAULT;
>
> bytes_written += chunk;
> count -= chunk;
>
> /* once the last of the user data is in the DMA buffer, break */
> if(count == 0)
> break;
>
> /* DMA buffer is full but write is not complete: must
> * block until DMA buffer is emptied. */
> do
> {
> /* wait for the magic to happen */
> interruptible_sleep_on(&chan->wq_write);
>
> /* if we are signalled, just return our current progress */
> if(signal_pending(current))
> {
> /* NOTE: not all of "bytes_written" may have been
> * written to the device yet, but the point is,
> * that's how many are in the DMA buffer and
> * therefore will get written.
> */
> return bytes_written;
> }
>
> /* This check is to ensure that the bytes have been
> * written and that we didn't wake up for some
> * spurious reason (e.g. blocked signal) */
> cli();
> _continue = (chan->bytes != bytes);
> sti();
>
> } while(_continue);
> }
> }
>
> return bytes_written;
> }
------------------------------
From: "Alexander N. Ryzhov" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: ld not found libdb.so
Date: Wed, 29 Mar 2000 16:29:51 +0400
I build and install Berkeley DB from Sleepycat Software in
/usr/local/BDB, /usr/lib(/usr/include) and /lib but can not link simply
program:
#include<stdio.h>
#include<db.h>
int main(){
printf("%s", db_version(NULL, NULL, NULL) );
return(0);
}
Explain me please, why it take place:
1.I do $gcc -v -o dbv db_version.c
it returned: undefined reference to `db_version' , ld returned 1 exit
status
2.I do $gcc -v -o dbv db_version.c -I/usr/local/BDB/include
-L/usr/local/BDB/lib
it returned: undefined reference to `db_version' , ld returned 1 exit
status
3.I do $gcc -v -o dbv db_version.c /lib/libdb.so
in this case OK.
But I can't understand it.
------------------------------
From: Gordon Haverland <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.misc
Subject: Re: Precision of Linux's libm???
Date: Wed, 29 Mar 2000 06:27:15 -0700
Tom Mitchell wrote:
> On Thu, 17 Feb 2000, Johan Kullstam wrote:
> > From: Johan Kullstam <[EMAIL PROTECTED]>
> > chad <[EMAIL PROTECTED]> writes:
> > > I am looking into doing so molecular modeling on Linux platforms because
> > > they are cost effective. After running some tests, I find errors,
> > > albeit small, in the results as compared to similar tests on SGIs or
> > > SUNs.
[...]
> Any author needs to do some basic numerical analysis of his
> application. As the exponents vary by orders of magnitude
> it matters more and more.
[...]
> Most quant chem classes spend weeks on accuracy and
> precision issues. Build those lessons into your
> applications and test suites. Consider basic numerial
> analysis tests too (call a math guy this is hard stuff).
If you are working with integers, there may be a "correct"
answer, but a soon as you move to floating point you will
find that no answer is "correct", some are just closer
than others. If your problem is important enough, you
might want to do some trial solutions with a multi-precision
math library, or interval arithmetic. So that you can
estimate bounds on accuracy and precision. But don't expect
to
get the same answer on different hardware, heck sometimes
you
don't even get the same answer on the same hardware. Just
changing "string" libraries or compilers can produce changes
in results. (String libraries from different ways of
converting strings to floats.)
Gordon Haverland
#include <disclaimer.h>
------------------------------
From: James Moger <[EMAIL PROTECTED]>
Crossposted-To: comp.arch.embedded,comp.sys.powerpc.tech
Subject: Re: Advice on PowerPC MPC823 Dev. Tools?
Date: Wed, 29 Mar 2000 08:45:46 -0500
Reply-To: [EMAIL PROTECTED]
Ooops. I meant ftp://mvista.com
Sorry for any confusion.
--
James Moger
===---------------------===
Software Engineer
Transonic Systems, Inc.
{C/C++} {Java} {Smalltalk}
Cornell Engineering '98
===---------------------===
------------------------------
From: "Marc E. Christensen" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.misc
Subject: Re: How do I make shared libraries?
Date: Wed, 29 Mar 2000 06:47:43 -0700
"Arthur H. Gold" wrote:
> Make sure that your *.o files are compiled with the -fPIC option to gcc.
> Then link (libyourlib.so) with the options -nostartfiles -shared.
>
> That should get you started.
Thanks a bunch - since I host an official LDP mirror, I should have
checked there first... 8^). Thanks anyway.
> BTW - the whole deal is in the ELF HOWTO (IIRC)
> --
> Artie Gold, Austin, TX (finger the cs.utexas.edu account for more info)
> mailto:[EMAIL PROTECTED] or mailto:[EMAIL PROTECTED]
> --
> A: Look for a lawyer who speaks Aramaic...about trademark infringement.
--
Marc C.
An Official LDP Mirror:
http://www.mecworks.com
------------------------------
From: Fabrice Peix <[EMAIL PROTECTED]>
Subject: Re: Kernel modules development
Date: Wed, 29 Mar 2000 16:09:16 +0200
Fabrizio wrote:
>
> Hello!
> I'm having a (basic) problem while building a kernel module using Linux
> 2.2.x (RedHat and Mandrake).
> Practically after the includes:
>
> #include <linux/kernel.h>
> #include <linux/modules.h>
>
> when I add
>
> #include <linux/fs.h>
>
> the gcc reports me a long list of errors, starting with a missing definition
> of ino_t types. I'm following the "Linux kernel module programming" of O.
> Pomerantz.
>
> Can somebdoy help me ?
>
> Thanks!
>
> Fabrizio
It's strange ino_t is define in linux/types.h and this file is include
in linux/fs.h
check you link and verify if all yhe header of kernel is present.
------------------------------
From: Bryan <[EMAIL PROTECTED]>
Subject: Re: latest 2.3.99-pre3 won't boot on I-OPENER
Crossposted-To: comp.os.linux.hardware
Date: Wed, 29 Mar 2000 15:25:14 GMT
In comp.os.linux.hardware bill davidsen <[EMAIL PROTECTED]> wrote:
: In article <1wAD4.1159$[EMAIL PROTECTED]>,
: Bryan <[EMAIL PROTECTED]> wrote:
: | but when I use lilo to boot 2.3.99-pre3, it just hangs. lilo doesn't
: | even get very far, it hangs within 1-2 seconds of printing '...'
: | (dots). again, 2.2.13 works just fine: lilo loads to completion and
: | the kernel/system works.
: No answers, but something you can try, make your boot floppy as a
: direct boot (bzdisk) instead of LILO, and don't forget to specify the
: root device.
: Example:
: make bzdisk ROOT_DEV=/dev/sdb3
problem is: there IS no floppy on this box! no easy way to make one, either.
I did find a workaround. I patched 2.2.14 with usb and that did load.
but here's the weird part: when I use the stock slackware 7.0 kernel
(2.2.13, as build by slackware and untouched by me) the system boots
AND you see textmode come up after the screen freaks out a bit ;-) the
bootup msgs can be read after the first few lines have come out.
BUT when I build a custom kernel and launch it via lilo, I get
'loading 2.2.14 ..." but after that, the video does NOT show text msgs
scrolling up. I took this as a broken kernel, when IN FACT IT WASN'T.
it DID boot and when I did a startx after loggin in, X did come up ok.
so there's something having to do with resetting the funky video mode
that the bios set (there's a welcome graphic at bios/boot time) that
the slackware kernel resets by ALL of my kernels don't ;-( damned if I
can figure it out, too.
I tried vidmode, I even tried 'vga=ask' at lilo. lilo won't ask for
my kernel, only for the slackware kernels. very very weird.
but if I just type blindly (the user/pass) after I hear the disk quiet
down, I can login and if I type startx, X does come up and resets the
garbage on the screen.
so the problem might be related to some kind of hardware probing or
init that the slackware kernel does NOT do and all the other ones do.
and of course. 2.3.99 still won't even BOOT from lilo.
--
Bryan, http://Grateful.Net (ANTISPAM: email is my name at my web's domain)
(c) 2000. Publishing and/or relaying of this material on all forums other than
USENET implies agreeing to a consultancy fee of US$150 per posting. You must
obtain a written permit before you publish. Violators are subject to civil
prosecution for Copyright Infringement as applicable. Publication by C|NET
and Microsoft Networks expressly prohibited.
------------------------------
From: "filipesinclair" <[EMAIL PROTECTED]>
Subject: bootsect.s
Date: Wed, 29 Mar 2000 16:17:10 +0100
Who can tell me where can i find more comments on this file
some portions of the source code doesn�t have comments
I cannot understand some parts
thank you .
------------------------------
From: Bryan <[EMAIL PROTECTED]>
Subject: Re: Free BSD
Date: Wed, 29 Mar 2000 15:35:30 GMT
Kaz Kylheku <[EMAIL PROTECTED]> wrote:
: On Tue, 28 Mar 2000 20:48:55 GMT, Pjtg0707 <[EMAIL PROTECTED]> wrote:
: >On Tue, 28 Mar 2000 11:06:46 -0800, Sebastien Dessimoz
: ><[EMAIL PROTECTED]> wrote:
: >>What is the advantage to use Linux instead of FreeBSD or the opposite???
: >>
: >
: >One is a bagel, the other is a donut. Which do you prefer?
: The one without the big security hole in the middle.
: Flame away, brother. ;)
after 3 break-in's to my home linux box, I finally gave up and
installed openbsd. we'll see how well that works.
its true, at least for now, the Kiddies go to linux boxes. they know
the exploits. there are few (or no) exploits of openbsd. and freebsd
is only marginally better than linux.
if you want few security holes, try openbsd.
(I'm a 5 yr linux person, started way back in the 1.1 kernel days. I
DO know what I'm doing - I just don't have time to track all the
latest Kiddie exploits. and I'm sick and tired of getting hacked.
no, I dn't run telnet or ftp - only ssh and mail. they STILL got in
;-( )
--
Bryan, http://Grateful.Net (ANTISPAM: email is my name at my web's domain)
(c) 2000. Publishing and/or relaying of this material on all forums other than
USENET implies agreeing to a consultancy fee of US$150 per posting. You must
obtain a written permit before you publish. Violators are subject to civil
prosecution for Copyright Infringement as applicable. Publication by C|NET
and Microsoft Networks expressly prohibited.
------------------------------
From: Massimo Cafaro <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: ld not found libdb.so
Date: Wed, 29 Mar 2000 17:39:30 +0200
"Alexander N. Ryzhov" wrote:
> I build and install Berkeley DB from Sleepycat Software in
> /usr/local/BDB, /usr/lib(/usr/include) and /lib but can not link simply
> program:
> #include<stdio.h>
> #include<db.h>
> int main(){
> printf("%s", db_version(NULL, NULL, NULL) );
> return(0);
> }
>
> Explain me please, why it take place:
> 1.I do $gcc -v -o dbv db_version.c
> it returned: undefined reference to `db_version' , ld returned 1 exit
> status
> 2.I do $gcc -v -o dbv db_version.c -I/usr/local/BDB/include
> -L/usr/local/BDB/lib
> it returned: undefined reference to `db_version' , ld returned 1 exit
> status
> 3.I do $gcc -v -o dbv db_version.c /lib/libdb.so
> in this case OK.
> But I can't understand it.
A shared library MUST have a link in the same directory that ends in .so,
e.g. if you have in /usr/lib the shared library
libcrack.so.2.7 then you need a symbolik link to this file called
libcrack.so.
In order to use the shared library, you set properly the LD_SHARED_LIBRARY
environmental variable or use the -L
option to compile your executable. Check also if /etc/ld.so.conf contains
the directory where your shared library is, this should suffice once you
set the symbolik link.
--
======================================================================
Massimo Cafaro, Ph.D. Voice : +39 0832 320304
University of Lecce Fax : +39 0832 320279
Via per Monteroni E-mail : [EMAIL PROTECTED]
73100 Lecce, Italy Web : http://sara.unile.it/~cafaro
------------------------------
** 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
******************************