Linux-Development-Sys Digest #540, Volume #8      Mon, 5 Mar 01 00:13:13 EST

Contents:
  virtual ring buffer - Was: double mmap calls ([EMAIL PROTECTED])
  Re: New OS want ("Gene Heskett")
  Re: New OS want (Kasper Dupont)
  Re: Is there a time() with millisecond or better resolution? (Kasper Dupont)
  hi,Does anyone study Linux source code? I have a basic problem. ("hushui")
  Re: dynamic Libraries ("Peter T. Breuer")
  Re: Can linux be trusted? (Lars Duening)
  Re: Can linux be trusted? (Jem Berkes)
  Re: dynamic Libraries (Paul Kimoto)
  Private functions in shared library? (Roger Leigh)
  Re: Private functions in shared library? ("Arthur H. Gold")
  Re: Can linux be trusted? ("Gene Heskett")
  Re: Can linux be trusted? ("Nick J Chackowsky")
  Re: Private functions in shared library? ("Peter T. Breuer")
  Re: decrease the cache size? ("N. G.")
  measure the time for an IDE operation ("Peng, Gang")
  Re: Private functions in shared library? (Kaz Kylheku)
  Re: How to process a serial stream and publish as a web page? ("D. Stimits")
  Re: linux 2.4.2+loop (Daniel Franklin)

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

From: [EMAIL PROTECTED]
Subject: virtual ring buffer - Was: double mmap calls
Date: Sun, 04 Mar 2001 10:10:13 -0000

On Thu, 18 Jan 2001 23:39:00 -0000 I originally posted the question:

| Does Linux support double mmap calls where a 2nd mmap() can be used
| to overlay an existing memory map to another address?  I tired of
| following all the calls through from sys_mmap() to see if it does
| or not (got pretty deep, but nothing obvious one way or the other).

... and got a lot of useful answers.  Thanks!

I just wanted to let anyone interested in what I was doing with
all that know that I have now released working code in the form of
a library called "vrb" for "virtual ring buffer".  The API keeps
the buffer somewhat abstract, but it allows the caller to directly
access the buffer via returned pointers (actually implemented as
rather simple macros) and lengths.  The double mapping technique
allows the whole available space or the whole data content to be
viewed as a contiguous block regardless of where in the ring buffer
state the space or data is located.  This eliminates extra copying
of data and almost all wraparound testing.  Data can be read() into
and write() from the buffer directly, if desired.  It also allows
a caller or environment choice whether to use a temporary file or
the SysV shared memory (environment not used if running as root,
for security reasons).

Oh, the starting URL is:

http://freshmeat.net/projects/vrb/

-- 
=================================================================
| Phil Howard - KA9WGN |   Dallas   | http://linuxhomepage.com/ |
| [EMAIL PROTECTED] | Texas, USA | http://phil.ipal.org/     |
=================================================================

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

Date: 4 Mar 2001 4:44:3 -0500
From: "Gene Heskett" <[EMAIL PROTECTED]>
Subject: Re: New OS want

Gene Heskett sends Greetings to Steve Wrochna;

 SW> wow thats pretty impressive but i was talking more along the
 SW> lines of systems for the common person. and besides being a
 SW> windows NG i think it is safe to say that all here would love a
 SW> comp that booted in half the time
 SW> (well half would be a good start!)

 SW> if you find the url would you mind posting it i would love to
 SW> take a look at it.

 SW> steve

There is such a utility for the old commode-door amiga's.  It takes a
snapshot of the machine state and makes a disk file out of it, then at
reboot time, loads this snapshot and restores the machine to the
snapshot state, about 2 seconds for a machine with only 8 megs I'm told.
I have 64 megs of 32 bit wide fast alone in this one.

The disadvantage of course is that if it doesn't want to boot, only a
floppy boot can get it going again.  There are folks using it, but this
old machine has had so many hacks added that the horror stories have
scared me off.

Cheers, Gene
-- 
  Gene Heskett, CET, UHK       |Amiga A2k Zeus040, Linux @ 500mhz 
        email gene underscore heskett at iolinc dot net
#Amiga based X10 home automation program EZHome, see at:#
 <http://www.thirdwave.net/~jimlucia/amigahomeauto>
This messages reply content, but not any previously quoted material,
is © 2001 by Gene Heskett, all rights reserved.
-- 


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

From: Kasper Dupont <[EMAIL PROTECTED]>
Crossposted-To: com.sys.hp.hpux,comp.sys.sun.admin,comp.os.ms-windows.misc
Subject: Re: New OS want
Date: Sun, 04 Mar 2001 12:25:05 +0000

Steve Wrochna wrote:
> 
> wow thats pretty impressive but i was talking more along the lines of
> systems for the common person. and besides being a windows NG i think it is
> safe to say that all here would love a comp that booted in half the time
> (well half would be a good start!)
> 
> if you find the url would you mind posting it i would love to take a look at
> it.
> 
> steve

It's easy to find:
1. Start at google
2. Type "Linux Bios"
3. Select I'm Feeling Lucky

<URL:http://www.acl.lanl.gov/linuxbios/>

-- 
Kasper Dupont

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Is there a time() with millisecond or better resolution?
Date: Sun, 04 Mar 2001 13:01:34 +0000

[EMAIL PROTECTED] wrote:
> 
> On Fri, 02 Mar 2001 13:44:27 +0000 Kasper Dupont <[EMAIL PROTECTED]> wrote:
> 
> | Today I don't think it matters whether a system call
> | uses microseconds or nanoseconds, I don't know any
> | architecture where the overhead of a system call
> | will be much less than one microsecond. But perhaps
> | sometime in the future we will appreciate nanosecond
> | timers, but still you will have to have some very
> | special needs if microseconds is not good enough for
> | you.
> 
> If we can architecture for nanoseconds, we should.  Since a 32-bit
> integer can hold the part of a second to that resultion, it is then
> feasible.  Most programs would not need to deal with it that way,
> and most systems don't even have a clock that can give it that good.
> OTOH, I find that poll()'s resolution of milliseconds to be something
> I'm somewhat concerned about for the future.

I agree, if you have the choice between specifying
microseconds or nanoseconds of course choose
nanoseconds. The difference between 10^9 and 2^32
is large enough that you will hardly ever have
problems with sign, overflow and the like.

OTOH if you have the choice between two different
syscalls you shouldn't choose the one using
nanoseconds if the one using microseconds is more
fit for your purpose.

Hopefully some day we will get nanoselect() and
nanogettimeofday() syscalls using struct timespec
instead of struct timeval, but we don't need them
yet.

> 
> Most systems (Solaris and Linux I've noticed, so I'm speculating
> about most) actually manipulate wakeup times.  I've had programs
> calculate sleep times to cause them to wake up right on the dot
> for some interval, such as one minute or one hour, and at times
> I find they have woken up a few milliseconds before that time.
> Apparently the operating systems don't consider the need for much
> timer accuracy to be very important.  Then again, I don't know if
> the need is that critical.  I can make my program sleep again for
> a smaller time period.

Sounds strange, waking up a litle too late is OK,
but too early is not. (Whish it was that way in
real life too. {-: )

> 
> --
> -----------------------------------------------------------------
> | Phil Howard - KA9WGN |   Dallas   | http://linuxhomepage.com/ |
> | [EMAIL PROTECTED] | Texas, USA | http://phil.ipal.org/     |
> -----------------------------------------------------------------

-- 
Kasper Dupont

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

From: "hushui" <[EMAIL PROTECTED]>
Subject: hi,Does anyone study Linux source code? I have a basic problem.
Date: Mon, 5 Mar 2001 22:54:31 +0800

There are GDR ,LDT in 386 protected mode.
In Linux,is there no LDT discriptor in GDT???
I have just read a book . It emulate a unix on i386.
Since many people told me Linux and Unix use page to manage memory, I think
the vitual memoty addresses of all process are converted in a same address
space (lener address).
Is it right??
I am a new learner.
Is there any Doc in linux documents(/usr/Doc/...) which is on the field of
booting the OS on i386???
Thank you . and sorry my english is not very good.



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

From: "Peter T. Breuer" <[EMAIL PROTECTED]>
Subject: Re: dynamic Libraries
Date: Sun, 04 Mar 2001 18:07:29 GMT

Daniel Koerner <[EMAIL PROTECTED]> wrote:
> I want to create, link and runtime use dynamic Libraries with gcc. Does
> anybody know an FAQ or some documentation site ? Maybe a book ?

It happens automatically. Man gcc or info gcc for more info. Look at
the loader docs too.

Peter

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

From: [EMAIL PROTECTED] (Lars Duening)
Crossposted-To: 
comp.lang.c,comp.os.linux.development.apps,comp.sys.be.programmer,comp.sys.mac.programmer.misc,comp.unix.bsd.freebsd.misc,comp.unix.bsd.misc,gnu.gcc,linux.debian.bugs.reports,linux.dev.gcc
Subject: Re: Can linux be trusted?
Date: 4 Mar 2001 19:13:34 GMT

On 01 Mar 2001 15:09:56 -0500, Robert Krawitz <[EMAIL PROTECTED]> wrote:
> To explain what I'm talking about, what is the representation of 1/3
> to 10 significant decimals?  It's 0.3333333333.  What's 3 times that?
> 0.9999999999.  What do you get if you round *that* down to the closest
> integer?  0!  Do you understand my point now?

He, the whole discussion reminded me of a project done back at my university:
it involved a huge number of operations on rational numbers, and in order to
get a result with two valid decimals all operations had to be carried out with
over 60 decimals.
-- 
Lars Duening; [EMAIL PROTECTED]
PGP Key: http://www.bearnip.com/lars/pgp-lars.asc

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

From: Jem Berkes <[EMAIL PROTECTED]>
Crossposted-To: 
comp.lang.c,comp.os.linux.development.apps,comp.sys.be.programmer,comp.sys.mac.programmer.misc,comp.unix.bsd.freebsd.misc,comp.unix.bsd.misc,gnu.gcc,linux.debian.bugs.reports,linux.dev.gcc
Subject: Re: Can linux be trusted?
Date: Sun, 04 Mar 2001 13:50:18 -0600

> > You must be kidding i think. No need to be at MIT to know that
> > 60/6=10 whatever way you compute it, and that 10*0.3=3 or 2.9999 or 3.1111
> > if you like, and that if this is rounded in any sensible way, this gives 3.
> 
> Fine.  What is the exact binary representation of .3000...?  Yes, 60
> and 6 *do* have exact binary representations, but .3 doesn't.

I can't believe this thread has gotten so large. It's an extremely
simple issue, well known in computer science for a very long time.
Floating point is not exact, so you have to be careful when you use it
in calculations.

And it's ludicrous to associate this well-known behaviour with a
"broken" operating system.

-- 
http://www.pc-tools.net/
DOS, Win32, Linux software

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

From: [EMAIL PROTECTED] (Paul Kimoto)
Subject: Re: dynamic Libraries
Date: 4 Mar 2001 15:36:22 -0500
Reply-To: [EMAIL PROTECTED]

In article <[EMAIL PROTECTED]>, 
Daniel Koerner wrote:
> I want to create, link and runtime use dynamic Libraries with gcc.

http://www.linuxdoc.org/HOWTO/GCC-HOWTO/index.html

-- 
Paul Kimoto
This message was originally posted on Usenet in plain text.  Any images, 
hyperlinks, or the like shown here have been added without my consent,
and may be a violation of international copyright law.

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

From: [EMAIL PROTECTED] (Roger Leigh)
Subject: Private functions in shared library?
Date: Sun, 4 Mar 2001 21:30:54 +0000
Reply-To: [EMAIL PROTECTED]

When making a shared library, I have to link it with a static library that
provides functions such as xmalloc, that the library uses. However, I do not
want these symbols exported. If I declare the functions static, I just get
undefined references though. Is there a better way?

I.e. the library is linked with otherlib.a at link time. All the code is PIC.

I am using libtool to make the library.

Thanks for any advice,
Roger

-- 
Roger Leigh ** Registration Number: 151826, http://counter.li.org **
Need Epson Stylus Utilities? http://gimp-print.sourceforge.net/
For GPG Public Key: finger [EMAIL PROTECTED] or see public keyservers.

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

Date: Sun, 04 Mar 2001 16:13:28 -0600
From: "Arthur H. Gold" <[EMAIL PROTECTED]>
Subject: Re: Private functions in shared library?

Roger Leigh wrote:
> 
> When making a shared library, I have to link it with a static library that
> provides functions such as xmalloc, that the library uses. However, I do not
> want these symbols exported. If I declare the functions static, I just get
> undefined references though. Is there a better way?
> 
> I.e. the library is linked with otherlib.a at link time. All the code is PIC.
> 
> I am using libtool to make the library.
> 
I'm not familiar with the libtool interface; however, the
answer to your problem is to use a version script when
linking your shared object. See the info pages for `ld' for
details.

HTH,
--ag
-- 
Artie Gold, Austin, TX  (finger the cs.utexas.edu account
for more info)
mailto:[EMAIL PROTECTED] or mailto:[EMAIL PROTECTED]
--
Verbing weirds language.

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

Date: 4 Mar 2001 17:0:19 -0500
From: "Gene Heskett" <[EMAIL PROTECTED]>
Subject: Re: Can linux be trusted?

Gene Heskett sends Greetings to Lars Duening;

 LD> On 01 Mar 2001 15:09:56 -0500, Robert Krawitz <[EMAIL PROTECTED]>
 LD> wrote:
>> To explain what I'm talking about, what is the representation of
>> 1/3 to 10 significant decimals?  It's 0.3333333333.  What's 3 times
>> that?
>> 0.9999999999.  What do you get if you round *that* down to the
>> closest integer?  0!  Do you understand my point now?

 LD> He, the whole discussion reminded me of a project done back at my
 LD> university: it involved a huge number of operations on rational
 LD> numbers, and in order to get a result with two valid decimals all
 LD> operations had to be carried out with over 60 decimals.

That was probably done with 'bcd' math functions, accurate as a piece of
paper and pencil, but just as slow to run, although modern cpu's could
at least make the pain bearable.

Cheers, Gene
-- 
  Gene Heskett, CET, UHK       |Amiga A2k Zeus040, Linux @ 500mhz 
        email gene underscore heskett at iolinc dot net
#Amiga based X10 home automation program EZHome, see at:#
 <http://www.thirdwave.net/~jimlucia/amigahomeauto>
This messages reply content, but not any previously quoted material,
is © 2001 by Gene Heskett, all rights reserved.
-- 


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

Reply-To: "Nick J Chackowsky" <[EMAIL PROTECTED]>
From: "Nick J Chackowsky" <[EMAIL PROTECTED]>
Crossposted-To: 
comp.lang.c,comp.os.linux.development.apps,comp.sys.be.programmer,comp.sys.mac.programmer.misc,comp.unix.bsd.freebsd.misc,comp.unix.bsd.misc,gnu.gcc,linux.dev.gcc
Subject: Re: Can linux be trusted?
Date: Sun, 4 Mar 2001 16:54:06 -0600

"Michel TALON" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> In comp.os.linux.development.system Chas2K
<[EMAIL PROTECTED]> wrote:
> I think you don't know the way work is done in the scientific
community.
> People expect to put a computation on the computer and get a correct
result.
> How do you want them to check the result since they don't know what
to get
> and will know only from the result of the computation. What is this
stuff

This is the difference between actually learning to program (computer
science) and learning just enough programming to get yourself into
trouble.
Now I'm not a biologist, so forgive me, but if I walked into a biology
lab
and futzed about on, I don't know, some fermenting equipment, and got
poison
instead of antibiotics out of it, who exactly would be to blame? Me,
I'd get
a biologist to do it instead, or at least to oversee my work. I
*suspect*,
on the other hand, that there are many biologists out there who just
assume
the computer will do what they think they want it to do! :)




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

From: "Peter T. Breuer" <[EMAIL PROTECTED]>
Subject: Re: Private functions in shared library?
Date: Sun, 4 Mar 2001 23:47:08 +0100

Roger Leigh <[EMAIL PROTECTED]> wrote:
> When making a shared library, I have to link it with a static library that
> provides functions such as xmalloc, that the library uses. However, I do not
> want these symbols exported. If I declare the functions static, I just get

It's impossible. You just said you wanted them exported .. to your
dynamic library. Do I misunderstand you? Ah, yes, I see that I do ...

> I.e. the library is linked with otherlib.a at link time. All the code is PIC.

When is "link time"? There is a link at compile time and there is a
link just before runtime, and there may be links during run time itself.

OK.  I think what you are saying is that you want to take the .o's out of
the .a and ln -r them into the final .so. but not to export them from
that .so again.

Well, that's impossible just using C. You'd have to make up a linker
file that tells the linker in detail what to do with each symbol. This
is deep linker magic, and I am not an expert (IANAE), but this looks
relevant

      -R filename
              Read symbol names and their  addresses  from  file
              name,  but  do not relocate it or include it in the
              output.  This allows your output file to refer sym
              bolically  to  absolute locations of memory defined
              in other programs.

You could also use -split-by-file to make separet sections for
the symbols from each component file, and then use objdump and
friends to selectively erase the symbol tables for selected files.

But really, I suspect you want one of them thar linker command files.
I hope someone comes up with one for you.

Actually, I think you can declare all the symbols static in the .a,
but provide an explicit linker table for the ones you want via the ld
symbol rename options.

> I am using libtool to make the library.

woooo. More deep magic!

Peter

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

From: "N. G." <[EMAIL PROTECTED]>
Subject: Re: decrease the cache size?
Date: Sun, 4 Mar 2001 19:58:45 -0500

Easily. You will need a torch and a fork.

"Weiguang Shi" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Hi people,
>
> This may not be directly relevant to system development, but is there a
way to
> decrease the level 2 cache size of say, an Intel PIII from 512K to 256K,
128K,
> etc?
>
> Thanks very much.
> Weiguang



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

Date: Sun, 4 Mar 2001 21:42:23 -0500
From: "Peng, Gang" <[EMAIL PROTECTED]>
Subject: measure the time for an IDE operation



Hi,

I want to add some code into Linux kernel 2.2.14 to measure how long the
IDE hard disk takes to handle an I/O operation. Where does the IDE
driver issue an I/O operation and handle the interrupt for the ending of
the operation?

thanks.

Jason


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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: Private functions in shared library?
Reply-To: [EMAIL PROTECTED]
Date: Mon, 05 Mar 2001 04:43:50 GMT

On Sun, 4 Mar 2001 21:30:54 +0000, Roger Leigh <[EMAIL PROTECTED]> wrote:
>When making a shared library, I have to link it with a static library that
>provides functions such as xmalloc, that the library uses. However, I do not
>want these symbols exported. If I declare the functions static, I just get
>undefined references though. Is there a better way?

You can use a version script to control what symbols are exported. Read
the GNU info documentation on ld.

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

Date: Sun, 04 Mar 2001 21:42:58 -0700
From: "D. Stimits" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.development.apps
Subject: Re: How to process a serial stream and publish as a web page?

Laurie wrote:
> 
> Thanks, also, I was after more corelevel stuff, such as easiest way to read
> data from the serial port in Perl or Shell Script or C.
> 
> In C on Linux can you do something similar to this (pseudocode):
> 
>    f = fopen("ttyS0","r");
>    while(true) {
>       s = fgets(f);
>       of = fopen("foo.html","w");
>       fputs(of,"<html><body><pre>");
>       fputs(of,s);
>       fputs(of,"</pre></body></html>");
>       fclose(of);
>      sleep(5 minutes);
>   }

I haven't done much serial port coding. I'm not sure about script style
access to serial ports without lower level routines. What you are
probably interested in is the family of inb, and outb, functions that
are used for transferring bytes through ports (serial). If you prefer
scripting, probably you would find a very small C program that does only
byte transfers to be useful for communicating with the script language
of choice.

> 
> .. or in fact, can it be done easily via shell script or via Perl - I'd
> prefer a script solution, rather than C/C++
> 
> Thanks .. Laurie     :-)
> 
> >
> > There are a lot of ways to do it, everyone with their own favorite. My
> > personal preference would be to use a C++ std::string, and do a replace
> > of anything that needs escaping or otherwise altering (the CR/LF is one
> > sample, which could be replaced by <BR>). You will find that you
> > probably have other characters that need escaping than just CR/LF, so a
> > general scheme can be helpful. You could also consider surrounding each
> > section with a "<BLOCKQUOTE>" if you aren't positive about content being
> > completely checked for special characters. A std::string would have a
> > big advantage over fixed buffers and regular C function string search
> > and replacement.
> >
> > D. Stimits, [EMAIL PROTECTED]

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

From: [EMAIL PROTECTED] (Daniel Franklin)
Subject: Re: linux 2.4.2+loop
Reply-To: [EMAIL PROTECTED]
Date: 5 Mar 2001 08:48:18 +1100

lfree wrote:
>I use redhat 7.0,the kernel is 2.4.2£¬compile loop is module ,when I run :
>
>dd if=/dev/zero of=/tmp/images bs=1M count=10
>mke2fs /tmp/images
>mount /tmp/images /mnt/loop -o loop
>
>I update uitl-linux 2.10s,but it is as before,why?

I get exactly the same problem with mounting an ISO disk image via loopback
in 2.4.2 on a Debian system. It may be worth trying this with the most
recent 2.4.2-acX patch from Alan Cox.

- Daniel

-- 
******************************************************************************
*      Daniel Franklin - Postgraduate student in Electrical Engineering
*      University of Wollongong, NSW, Australia  *  [EMAIL PROTECTED]
******************************************************************************

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


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