Linux-Development-Sys Digest #665, Volume #6     Fri, 30 Apr 99 14:14:05 EDT

Contents:
  programming with MMX instructions (Damian Weber)
  Re: Idea:  Make a seperate "i686" tree for Redhat Linux 6.0 (Geoff McCaughan)
  Re: Threads >> PThreads or LinuxThreads?? (Geoffrey KEATING)
  Re: Driver access to File System (Andrew McDonald)
  Re: pc-speaker driver (Robert Kaiser)
  Re: How to mount FreeBSD on Linux? (Alexander Viro)
  Re: tcp delayed ack (Andi Kleen)
  How to mount FreeBSD on Linux? (Patrick Hsieh)
  Best way-Kernel notify User (DMA) (herman)
  Re: programming with MMX instructions (Arun Sharma)
  Kernel Debugging (David Grothe)
  LD: how does it find symbols?? why doesn't it?? ("Dan Miller")
  Maybe Oops in 2.2.7 (David Ronis)
  Re: Can you make a driver that runs as an application? (Christopher B. Browne)
  Re: Possible?: glibc-2 system and (old?) Motif libraries (George MacDonald)

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

From: [EMAIL PROTECTED] (Damian Weber)
Subject: programming with MMX instructions
Date: 30 Apr 1999 09:10:10 GMT

I'm trying to set up some example code which
uses MMX instructions on a Pentium III.

uname -a
Linux hostxy 2.0.35 #2 Thu Apr 15 17:50:21 CEST 1999 i686 unknown


I started writing a sample assembler function
as func.s
which compiles fine with 'as' from binutils-2.9.1.0.23:

                     mult_p3:
  001e 55                    pushl %ebp
  001f 89E5                  movl %esp,%ebp
               
  0021 0F58C8                addps %xmm0,%xmm1
               
  0024 5D                    popl %ebp
  0025 C3                    ret

So I link this with a C program which calls func().

At run-time I get "Illegal instruction" - the GNU debugger
(gdb-4.18) tells me, that it's at the location of addps.

Disassembling doesn't help much, because gdb-4.18 doesn't
seem to recognize "addps":

Dump of assembler code for function func:
0x804869e <func>:    push   %ebp
0x804869f <func+1>:  mov    %esp,%ebp
0x80486a1 <func+3>:  (bad)  

Does anybody have an idea what's wrong?

         -- Damian




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

From: [EMAIL PROTECTED] (Geoff McCaughan)
Crossposted-To: comp.os.linux.misc
Subject: Re: Idea:  Make a seperate "i686" tree for Redhat Linux 6.0
Date: 16 Apr 1999 21:08:37 GMT
Reply-To: [EMAIL PROTECTED]

Christopher Browne ([EMAIL PROTECTED]) wrote:
> On 8 Apr 1999 17:07:45 -0400, Alexander Viro <[EMAIL PROTECTED]> wrote:
> >In article <[EMAIL PROTECTED]>,
> >Johan Kullstam  <[EMAIL PROTECTED]> wrote:
> >>not if you're from a commonwealth country - which includes new zealand
> >>(where is the old zealand btw?).  in *english* (as opposed to american
> >                ^^^^^^^ - Zeeland.
> >
> >     Gaak... Across the North Sea (looking from England, that is).
> >Netherlands. Heck, they *really* don't teach history and geography
> >in schools, or what?
> 
> Not even in commonwealth countries... :-(
> 
> I was not aware of that; the surprising factor is that it was named
> after a "foreign" nation, or am I showing *complete* ignorance in being
> unaware of a transition of New Zealand from Dutch control to English
> control?

NZ was named by Abel Tasman, but it was never under Dutch control. The next
European on the scene was James Cook, almost 100 years later.

I'm not sure what you mean by "named after a foreign nation". Zeeland is not
a nation, and it was not foreign to Tasman.

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

Crossposted-To: gnu.misc.discuss
Subject: Re: Threads >> PThreads or LinuxThreads??
From: Geoffrey KEATING <[EMAIL PROTECTED]>
Date: 30 Apr 1999 17:44:55 +1000

"G. Sumner Hayes" <[EMAIL PROTECTED]> writes:

> Harald Schreiber wrote:
...
> > glibc-2.1 has been removed from prep.ai.mit.edu by the GNU people
> > because the documentation of glibc-2.1 recommends compiling with
> > egcs and not with gcc.
> 
> I believe that it was removed because there is some concern about the
> copyright on the db implementation...

No, it was really because of the gcc thing.  Note that gcc and egcs
are still different projects (for the moment), although now run by the
same people.

...
> Does anyone know if the copyright issues have been resolved and what
> exactly they were to begin with?  I've heard that glibc-2.1 uses some
> variant of the sleepycat db, but am unsure...

It does.  If you look at the 'Contributors' node of the libc manual,
it says what terms this part of the library are under.  Notice that
all libdb is under this licence, so there is no incompatibility with
the LGPL because libdb is a separate shared object.  There's also a
weird exemption:

As a special exception, when Berkeley DB is distributed along with the
GNU C Library, in any program which uses the GNU C Library in accord
with that library's distribution terms, it is also permitted for
Berkeley DB to be loaded dynamically by the GNU C Library to implement
standard ISO/IEC 9945 and Unix interface functionality.

I think that what this means is that if you don't link libdb.so
directly, you need not worry about its licence just because you might
be using NIS routines.


Apart from the DB library, some parts of the resolver and a number of
minor files also have an advertising clause.  It would be easy, and
probably a good idea, to rewrite the minor files to remove it.  The
problem is that it needs someone who hasn't seen the files, because
many of the files are so trivial that there's probably only one way to
write them.  [If you think you qualify, contact me, and I'll send you 
descriptions of what the routines must do.]

-- 
Geoff Keating <[EMAIL PROTECTED]>

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

From: [EMAIL PROTECTED] (Andrew McDonald)
Subject: Re: Driver access to File System
Date: 30 Apr 1999 12:48:06 GMT

On Thu, 29 Apr 1999 12:01:12 -0600,
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Does anyone know how to read the file system from a kernel driver?  I
> have been trying sys_open with no luck.

Have a look how linux/drivers/sound/sound_firmware.c does it.


Andrew
-- 
Andrew McDonald
andrew at mcdonald.org.uk
http://ban.joh.cam.ac.uk/~adm36/


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

From: [EMAIL PROTECTED] (Robert Kaiser)
Subject: Re: pc-speaker driver
Date: 30 Apr 1999 08:44:33 GMT

In article <[EMAIL PROTECTED]>,
        Kent Friis <[EMAIL PROTECTED]> writes:
> When you use the PC'speaker, you don't have anything
> to make the sound (except for the speaker itself), and
> thus you'll need to use the main CPU instead. Kind of
> like a winmodem.
> 
> However if all you want from the pcspeaker is beeping
> and tiny melodies, but no samples, etc. you don't need
> a special driver. ascii 7 handles the beep, and both
> duration and frequency can be changed by console ESC
> codes or with xset.

But doesn't that imply the same resource consumption ?
I mean, isn't the beep generated in much the same way
as what the pc speaker driver does (having the CPU
actively toggle the speaker output at the desired
frequency) ?

Rob

================================================================
Robert Kaiser                  email: rkaiser AT sysgo DOT de
SYSGO RTS GmbH
Mainz / Germany

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

From: [EMAIL PROTECTED] (Alexander Viro)
Subject: Re: How to mount FreeBSD on Linux?
Date: 30 Apr 1999 10:17:25 -0400

In article <7gcd53$94q$[EMAIL PROTECTED]>,
Paul Hughett <[EMAIL PROTECTED]> wrote:
>Patrick Hsieh ([EMAIL PROTECTED]) wrote:
>: I have a hard disk with FreeBSD file system.
>: Now I want to mount it on Linux.
>: What should I do with /etc/fstab ??
>: Thank you!!
>
>The default FreeBSD file type is ufs and is--according the the Linux
>man page--also supported by Linux.  Put "ufs" instead of "ext2fs" in
>the fstab file and it should work
        ... if you will add to options ufstype=44bsd

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

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

Crossposted-To: comp.os.linux.networking
Subject: Re: tcp delayed ack
From: Andi Kleen <[EMAIL PROTECTED]>
Date: 30 Apr 1999 16:46:40 +0200

Du Jinsong <[EMAIL PROTECTED]> writes:

Your cross posting is not appropiate.

> Hi!
> 
> In kernel V2.2.6, /net/ipv4/tcp_output.c, it seems to me that if not in
> quickack mode, an ACK can been sent out only when ato expires or when a
> data packet need to be sent (so piggyback the ack).
> But the standard algorithm(RFC 2581)says when two data packets received,
> 
> one ack need to be sent, right?

Linux 2.2 uses a more complicated algorithm for that. It estimates a 
"receive mss" based on incoming packet sizes and forces an ACK when
rcvmss * 2 bytes are received. This gives better behavior for slow serial
lines. 

Linux 2.0 used the MSS of the connection for the same algorithm.
The concept of the rcvmss was added with 2.2 to get better
behaviour on links with very high MTU (e.g. HIPPI), where often 
implementations send bulk transfer packets with less than the announced
MSS.


> >From tcp_input.c: tcp_delack_estimator(), it seems ato roughly equals
> to
> 1.5*received_packet_interval.
> If what I understanding of tcp_output.c is correct,
> then delayed acks are sent solely according to calculated ato if the
> connection only has one-way traffic.
> Can this improve performance or cause trouble?
> Thanks a lot!

When you have two way traffic you can always piggy back the ack and
you don't need much special ack sending policy.

-Andi

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

From: [EMAIL PROTECTED] (Patrick Hsieh)
Subject: How to mount FreeBSD on Linux?
Date: 30 Apr 1999 13:29:30 GMT

I have a hard disk with FreeBSD file system.
Now I want to mount it on Linux.
What should I do with /etc/fstab ??
Thank you!!

--
Patrick Hsieh <[EMAIL PROTECTED]>
Webmaster of NCCU English Department http://english.nccu.edu.tw
Say Hello to Pahud http://pahud.dorm9.nccu.edu.tw
TEL 0933201800

--
�� Origin: �F�j�̯�����BBS�� 140.119.185.146 �� From: Pahud.Dorm9.nccu.edu.tw

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

From: herman <[EMAIL PROTECTED]>
Subject: Best way-Kernel notify User (DMA)
Date: 30 Apr 1999 08:30:53 PDT

Hi,

I am writing a Bus Master DMA driver to collect streaming data to hard
disk drive files.  The buffer size is 16MBytes with 256KByte pages (64
pages total) and a data rate around 1MB/sec.  I am going to use either
Matt Welch's BigPhysArea Patch or Allesandro Rubini's Allocator to set
up the large DMA area.  The transfers are whole page (256KByte)
transfers handled by the bus master hardware.  An interrupt occurs when
a page is filled and ready to dump to disk.

When the interrupt occurs, the driver needs to notify the user to write
page data to a hard disk file.

I have three potential ways of notifying the user...which way would be
the best?

1.  The user calls 'read', and the driver blocks with
'interuptible_sleep_on' till a page is full.  When  page is full, the
read call can return with info about the buffer.

2.  The User program can continuously poll a variable that is changed
with 'put_user' when a page is ready to write to the disk.

3.  Use sigaction to initialize a system notification.  Question: this
would be initialized by the user or module init?  The driver then would
'raise' or 'kill' to notify the user process that a page is ready to
write.  User program would idle till notification process is activated.

One last question about buffer addresses.  When the area is allocated,
ioremap/vremap is used to translate the physical addresses to virtual
addresses.

I need confirmmation that the virtual addresses (vremap) of the buffer
are the same on both the kernel and user side (since the buffer is
outside of both).

Thanks in advance for responses.

Herman Watson
[EMAIL PROTECTED]



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

Subject: Re: programming with MMX instructions
From: Arun Sharma <[EMAIL PROTECTED]>
Date: Fri, 30 Apr 1999 16:04:33 GMT

"Richard Krehbiel" <[EMAIL PROTECTED]> writes:

> The Pentium III's new SSE instructions (ADDPS is one) are not available
> unless the operating system enables them, because they provide a new set of
> registers which must be context-switched by the kernel.  Linux 2.0.35 just
> doesn't have this support.

But a recent version of Linux 2.2 with the Pentium III patch does have
that support.

        -Arun


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

From: David Grothe <[EMAIL PROTECTED]>
Crossposted-To: revue.linux-kernel
Subject: Kernel Debugging
Date: 30 Apr 1999 18:04:24 +0200
Reply-To: [EMAIL PROTECTED]

>From time to time I get asked about remote GDB support for kernel
versions 2.2.x.  Well, here it is.  Download
ftp://ftp.gcom.com/pub/linux/src/kgdb-2.2.6/kgdb-2.2.6.tgz and install
it. As you might infer from the file name, I tested it on kernel version
2.2.6.  I have submitted this one to Linus for inclusion in the kernel
source -- the other, non-Intel, architectures have such a feature
already.  Thanks to Tigran Aivazian <tigran"at"sco.COM> for recasting
the patch into a selection item on the menuconfig "Kernel Hacking" menu.

-- Dave


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/

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

From: "Dan Miller" <[EMAIL PROTECTED]>
Subject: LD: how does it find symbols?? why doesn't it??
Date: Fri, 30 Apr 1999 09:12:05 -0700

When one rebuilds the kernel (v 2.0.36), how does ld resolve symbols that
are in loadable modules??  It's not finding one, and I think it should.
Here's my situation:

I have a loadable module myOtherMod, which depends upon a symbol in myTCPMod
in order to load.  If I load myTCPMod with "insmod myTCPMod.o", it exports
its entire symbol table, and myOtherMod loads without trouble.  However,
I've been loading it with "insmod myTCPMod.o -x", which does not export the
symbols.  I am trying to do the standard technique of exporting just the
symbol that I want, by putting an X() entry in kernel/ksyms.c, with an
extern function prototype at the top so gcc knows what that symbol is.  I've
done this many times before without trouble, but this time, LD is failing
during the kernel build, saying the symbol is not defined.

So, again, my question:  how does ld normally locate symbols that are
actually located in loadable modules??  Does the module have to be loaded???
That doesn't seem like it's been the case when I've done this in the past...

        [EMAIL PROTECTED]




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

From: David Ronis <[EMAIL PROTECTED]>
Subject: Maybe Oops in 2.2.7
Date: Fri, 30 Apr 1999 17:26:40 GMT

This may not have anything to do with the current release, but I just
encountered an oops in 2.2.7 , compiled using the latest CVS release
of egcs (gcc version egcs-2.93.20 19990428 (gcc2 ss-980929
experimental).  The problem may very well be the compiler.  

What was strange was that I couldn't reboot the machine, neither by
running /sbin/reboot or by pressing CTRL-ALT-DEL.

Here's the kernel log:

David


Apr 30 11:35:28 ronispc kernel: Unable to handle kernel
         paging request at virtual address 536d585f
Apr 30 11:35:28 ronispc kernel: current->tss.cr3 = 0033c000, Lr3 = 0033c000
Apr 30 11:35:28 ronispc kernel: *pde = 00000000
Apr 30 11:35:28 ronispc kernel: Oops: 0000
Apr 30 11:35:28 ronispc kernel: CPU:    0
Apr 30 11:35:28 ronispc kernel: EIP:    0010:[<c0123bd2>]
Apr 30 11:35:28 ronispc kernel: EFLAGS: 00010206
Apr 30 11:35:28 ronispc kernel: eax: 536d585f   ebx: 0001404f  
         ecx: 00000301   edx: 536d585f
Apr 30 11:35:28 ronispc kernel: esi: 00000400   edi: 00000400   
        ebp: 00000301   esp: c0351e30
Apr 30 11:35:28 ronispc kernel: ds: 0018   es: 0018   ss: 0018
Apr 30 11:35:28 ronispc kernel: Process update 
        (pid: 10, process nr: 9, stackpage=c0351000)
Apr 30 11:35:28 ronispc kernel: Stack: c0123c09 00000301 0001404f 
        00000400 00000096 00000000 c0351fac c0351fc4 
Apr 30 11:35:28 ronispc kernel:        c0123e97 00000301 0001404f 
        00000400 c01072c0 0001404f 00000140 c1e87ba0 
Apr 30 11:35:28 ronispc kernel:        00011480 00000002 c2bc06e0 
        c0351fc4 c01240f0 c2bc06e0 00010087 c01cd59c 
Apr 30 11:35:28 ronispc kernel: Call Trace: [<c0123c09>] [<c0123e97>] 
        [<c01072c0>] [<c01240f0>] [<c01241f5>] [<c0138420>] [<c013865e>] 
Apr 30 11:35:28 ronispc kernel:        [<c012e5ac>] [<c012e5c4>] 
        [<c0124f23>] [<c0124f19>] [<c0106a88>] [<c01250ef>] [<c0107a04>] 
Apr 30 11:35:28 ronispc kernel: Code: 8b 12 39 58 04 75 f3 
        39 70 08 75 ee 66 39 48 0c 75 e8 89 c2 

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

From: [EMAIL PROTECTED] (Christopher B. Browne)
Subject: Re: Can you make a driver that runs as an application?
Reply-To: [EMAIL PROTECTED]
Date: Sat, 17 Apr 1999 03:56:57 GMT

On Sat, 17 Apr 1999 01:50:32 GMT, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> posted: 
>       It's been quite some time since I've written a driver for Linux.  In
>fact it's been quite a while since I've used Linux.
>
>       I wanted to do a proof of concept experiment with Linux.  I would like
>to write a driver that is SEPERATE from the kernel so that when I screw up
>I don't take the system down.  I work in the real time embedded arena and
>am used to working with threads instead of processes.  What I would like to
>do is make an API available to several programs that is loaded into one
>location in memory and is completely reentrant - basically a driver.  Is there
>any way I can divorce the "driver" from the kernel so that I can do this?
>
>       You may need to know what I plan to do:  Basically I want to make
>a GUI api that runs on top of X with XSHM.  This will be a low level graphics
>library that will support fonts, sprites, etc., but only at the low level.
>I would then like to make it possible for applications to access the GUI
>API but without having to send data via a TCP/IP pipe or something slow
>and ugly like that and without a context switch.  I understand that X11 will
>need to make a context switch, but the only reason I'm using X11 is because
>I already know it quite well and that it's ubiquitous.  I may dump X11
>after a point to go directly to the hardware, but only after it is working
>reliably.
>
>       So is this possible to do without making it an actual driver?  I'd
>hate to be crashing my system everytime I make some stupid mistake.  Being
>able to use X11 would be a strong plus as well which I don't think would be
>possible to do with a real driver.

I think that what you *really* need to do is to look at GGI, which has
the intent to provide that low level stuff.

<http://www.ggi-project.org/>

It does low level interfacing to a framebuffer kernel interface in
order to get out to graphics hardware, and then you define successive
levels of libraries on top of that to layer on functionality.

"libggi" knows how to run on top of X, which means that you can
program to the lower level GGI interface (preparing for it to be
generally available/usable as such), and running (at present) atop X.

Eventually, the theory is that they'll have graphics card drivers for
GGI for various sorts of hardware, and you can then take out the X
layer.

[I think people will *actually* care about it when GTk runs directly
atop GGI, and Tk does, perhaps via
<http://www.multimania.com/fbonnet/Tcl/TkGS/specs.htm> TkGS, and ditto
for several other graphics libraries that are presently used atop
X...]
-- 
Those who do not understand Unix are condemned to reinvent it, poorly.  
-- Henry Spencer          <http://www.hex.net/~cbbrowne/lsf.html>
[EMAIL PROTECTED] - "What have you contributed to free software today?..."

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

From: George MacDonald <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Possible?: glibc-2 system and (old?) Motif libraries
Date: Fri, 30 Apr 1999 17:45:27 GMT

Remco van den Berg wrote:
> 
> When I try to compile motif applications like Nedit I get linker errors
> of undefined references:
> 
> libXm.so: undefined reference to '_xstat'
>                                  '_fxstat'
>                                  '_Xsetlocale'
> 
> These problems are caused by the fact that I upgraded my system to the new
> glibc-2.x
> 
> Is it possible to solve this problem with a linker trick, or do I have to
> buy a new Motif release?
> 
> -Remco

A couple of possibilities come to mind. Perhaps the symbols are defined
elsewhere, you can check the libraries by using the nm(1) command.

If you find a lib with the symbols defined, then link to it.

If not then you can create your own version of these symbols and link to
that. If they are non-required/used routines then a stub will do.
Failing that if you have the old libs you can cut out the old symbols/funcs
out of a lib.a into a new lib/file and link with that. I'm not sure if/how
to do the same thing with a dynamic lib, i.e lib.so or if it's possible.
Also make sure you don't violate any copyright's in doing so.




-- 
We stand on the shoulders of those giants who coded before.
Build a good layer, stand strong, and prepare for the next wave.
Guide those who come after you, give them your shoulder, lend them your code.
Code well and live!   - [EMAIL PROTECTED] (7th Coding Battalion)

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


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