Linux-Development-Sys Digest #339, Volume #8     Mon, 11 Dec 00 19:13:20 EST

Contents:
  Re: this sucks! (Joseph Virzi)
  Linux GUI programming (Joseph Virzi)
  Re: Is there a TWAIN driver in development for Linux? (Philip Armstrong)
  Re: A faster memcpy and bzero for x86 (Boris Gjenero)
  Re: sorting apache access_log (Peter Pointner)
  Re: How to optimize the Kernel-Compile (Andi Kleen)
  Re: Linux GUI programming (Philip Armstrong)
  missing symbol "_iob" in C libraries ("Mohammad Donyaee")
  Re: help : assembler & linux kernel (Gordon McNutt)
  Re: open ttyS0 from kernel (Gordon McNutt)
  Re: How to optimize the Kernel-Compile (Juergen Heinzl)
  Re: How to make a BIOS call in Linux (bill davidsen)
  Re: A faster memcpy and bzero for x86 (bill davidsen)
  Re: how to create install diskettes? (Jerry Peters)
  Re: A faster memcpy and bzero for x86 (bill davidsen)
  Re: Am I seeing IPv5, or am I hallucinating? (Warren Young)
  Re: A faster memcpy and bzero for x86 (bill davidsen)
  Re: About software raid1 (bill davidsen)
  slow asymmetric half-duplex communication (ADSL) (Michael Buro)

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

From: Joseph Virzi <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: Re: this sucks!
Date: Mon, 11 Dec 2000 10:33:33 -0800

There is a book by Alessandro Rubini ( O'Reilly publisher ) called Writing
Linux Drivers.

I do not know how to open a TTY device from kernel mode. Maybe you can get
by printing to the screen in kernel mode, which is something I do often
debugging drivers. Use the printk ( yes, with a K! ) function that is
otherwise identical in usage to printf() ( with an F ) You can call it
from your driver, and it writes onto your screen, and into a message log (
/var/log/messages, I believe )

Hope I helped. Sorry if I didn't.

-Joe


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

From: Joseph Virzi <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Crossposted-To: linux.redhat.development
Subject: Linux GUI programming
Date: Mon, 11 Dec 2000 10:42:04 -0800

I would like to write a GUI based application, just like I can with
Windows. As an application and device driver writer, I have been forced
to use Windows because of the GUI. In all other respects, Linux is
superior.

I have done some research, and all I can find reference to are functions
to plot polygons, fills, etc.

I would like functions such as CreateWindow(), SetFocus() and
GetEvents() so that I can control my application with my mouse as it
becomes to wieldy with my keyboard.

Surely this exists. Does anyone know of a package that might look and
feel just like Windows GUI programming. On GUI, from what I have seen so
far, I thnk Windows is superior. It doesn't have to be that way.

-Joe


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

From: [EMAIL PROTECTED] (Philip Armstrong)
Subject: Re: Is there a TWAIN driver in development for Linux?
Date: 11 Dec 2000 18:41:26 -0000

In article <[EMAIL PROTECTED]>,
jtnews  <[EMAIL PROTECTED]> wrote:
>twain isn't just for scanners it's for a lot of different
>digital devices.  see www.twain.org
>
*shrug*

my post still applies, whether TWAIN applies to multiple device types
or not. TWAIN is an API exposed by device drivers to
applications. Unix applications therefore don't need TWAIN since they
use a different API, and unix device drivers have no need to implement
the TWAIN API since only windows/dos programs will use that API.

Phil
-- 
http://www.kantaka.co.uk/ .oOo. public key: http://www.kantaka.co.uk/gpg.txt


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

From: Boris Gjenero <[EMAIL PROTECTED]>
Subject: Re: A faster memcpy and bzero for x86
Date: Mon, 11 Dec 2000 13:34:40 -0500

Robert Redelmeier wrote:
> 
> It matters in the kernel because of the "copy-on-write" virtual
> memory policy.  When a fresh page is written for the first time,
> it gets remapped from the zeroeth page to real memory, and this
> real memory cleared before the write.  For the bzero, REP STOSD
> is optimum in the same way as REP MOVSD.

What about if the kernel kept some zeroed pages ready?  Pages could be
zeroed when the CPU is free and then when you need a new page all you
need to do is change a page table entry.

Of course if the CPU is busy all the time, if an application writes to a
large number of new pages quickly, or if memory is outrageously limited
in size then this wouldn't help, but perhaps in most cases it would
help.

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

From: Peter Pointner <[EMAIL PROTECTED]>
Subject: Re: sorting apache access_log
Date: 11 Dec 2000 20:38:08 +0100

Stone <[EMAIL PROTECTED]> wrote:
> I got 3 clusternodes that log to diffrent access_log files.
> What I need to do is to
> cat access_log_1 access_log_2 accesss_log_3 | sort .....  > access_log
> In c code. I'm did in shell like above (slow). Switched to perl (little
> better)  but now need to write it all in c.

> Do anyone have any pointers to source of have examples?

You should get a copy of Rubini's book about linux device drivers.
Then write a kernel module which opens the log files, reads them
to non-swappable kernel memory and does a quick sort on this memory.

If you think that is a bit strange, please note that
comp.os.linux.development.system is about "Linux kernels, device drivers,
modules."

Peter


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

From: Andi Kleen <[EMAIL PROTECTED]>
Subject: Re: How to optimize the Kernel-Compile
Date: 11 Dec 2000 21:06:46 +0100

Robert Resch <[EMAIL PROTECTED]> writes:

> Hi!
> 
> I want to use a 486 DX-2-66 as a router. For a little more performance i
> want to compile the Kernel for 486.
> I've modified all Makefile 's from '-O2' to '-O9 -march=i486 -mcpu=i486'
> but the kernel doesn't start.

Any -Ox, x > 2 will very likely make your kernel slower.

-Andi

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

From: [EMAIL PROTECTED] (Philip Armstrong)
Crossposted-To: linux.redhat.development
Subject: Re: Linux GUI programming
Date: 11 Dec 2000 19:45:36 -0000

In article <[EMAIL PROTECTED]>,
Joseph Virzi  <[EMAIL PROTECTED]> wrote:
>I would like to write a GUI based application, just like I can with
>Windows. As an application and device driver writer, I have been forced
>to use Windows because of the GUI. In all other respects, Linux is
>superior.
>
>I have done some research, and all I can find reference to are functions
>to plot polygons, fills, etc.
>
>I would like functions such as CreateWindow(), SetFocus() and
>GetEvents() so that I can control my application with my mouse as it
>becomes to wieldy with my keyboard.
>
>Surely this exists. Does anyone know of a package that might look and
>feel just like Windows GUI programming. On GUI, from what I have seen so
>far, I thnk Windows is superior. It doesn't have to be that way.

Err. Qt, GTK+ ? Tk ? Motif if you're feeling 'old skool'. Pick one and
run with it...

You really haven't done very much research by the looks of things.

Phil
-- 
http://www.kantaka.co.uk/ .oOo. public key: http://www.kantaka.co.uk/gpg.txt


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

From: "Mohammad Donyaee" <[EMAIL PROTECTED]>
Subject: missing symbol "_iob" in C libraries
Date: Mon, 11 Dec 2000 16:28:30 -0500

Hi guys,
I am trying to port my application from Venix(a System V flavor OS) to Linux
Redhat 6.0, this application uses a library to do DOS operation, but I do
not have library source code, just I have the archive file, libdos.a, using
a utility I converted object files in this library from XCOFF to ELF, then
Linux can read the object files, but during link, it looks for some missing
symbols such as "_iob", "_flsbuf", "_filbuf","__fltused", apparently these
symbols do not exist in C libraries of Linux. any idea is welcome on the
following:
1) Am I wrong to try to convert this library and use it on another OS?
2) Where can I find information about the job of those missing symbols?
3) Any idea to compile my application without having to write DOS library
from scratch?
In advance thanks to all experts who contribute to the newsgroup.
Regards
MDonyaee



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

From: Gordon McNutt <[EMAIL PROTECTED]>
Subject: Re: help : assembler & linux kernel
Date: Mon, 11 Dec 2000 15:22:18 -0700

vallee geoffroy wrote:

> Hello,
>
> I have a problem with an assembler code of the Linux kernel.
> I don't understand the instruction .previous
> Someone can help me?
>
> thanks.
> GV

Mysterious little fellow, isn't it? Not that I've ever managed to find
it written down anywhere, but .previous tells the assembler to go back
and start working in the section previously being written to prior to
the last .section directive. If you have a macro which inserts a symbol
in a special section, then you typically follow this pattern:

asm( ".section <my_section> <code to put in that section> .previous");

If you didn't have the .previous, the assembler would keep generating
code in <my_section>, instead of wherever it was generating code before
it encountered your macro.

Hope this helps.

--Gordon


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

From: Gordon McNutt <[EMAIL PROTECTED]>
Subject: Re: open ttyS0 from kernel
Date: Mon, 11 Dec 2000 15:11:56 -0700

[EMAIL PROTECTED] wrote:

> I'm constructing a kernel module (software modem) that must open the a
> serial port (ttyS?).
> The construction looks like:
> <user mode app> | <modem driver> | <ttyS> | <serial driver> | hardware
>
> I don't want to implement the whole serial driver my self (yes, I
> could, but that is not the design choosen) instead I want to use it as
> I would from user mode.
>
> The problem is: How do I open and read/write to it? I've tried
> both "open" (which fails) and "filp_open".
> filp_open() succeeds, and I get a lot of pointer to read/write.
>
> However, when I call write I get -29 in return, and nothing is written.
>
> Have anybody done somwthing like this before, and if so, what am I
> doing wrong?
>
> Finally, NO - the driver needs to be in the kernel, so I can't
> implement it as a user mode program.
>
> Thanks,
> Eric
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.

This is perhaps harder to do than you might think, but here's the general
solution used by drivers like IrDA, PPP and Bluetooth (all of which sit on
top of a tty):

First, your driver needs to implement a tty line discipline and register
it when it loads. It will register under a particular LDISC number (for an
example, see linux/drivers/net/ppp_async.c in your linux kernel source
tree).

Second, you'll need a user-space daemon or startup up (analogous to pppd
for PPP) which can open /dev/ttyS0 and make the TIOCSETD ioctl call on it.
For example:

int my_ldisc = MY_LDISC_NUMBER;

// This next call will link the tty away from the default line discipline
// to yours, and will result in a call to your line discipline's open()
routine,
// where you should save a pointer to the tty struct passed in.
ioctl(tty_fd, TIOCSETD, &my_ldisc);

This will effectively setup your driver to communicate with the tty.

Then, whenever you need to send data to the tty, you will call tty->write,
where tty is a pointer to the tty passed in to your line discipline's
open() routine.

And to receive data from the tty, your line discipline's receive_buf()
routine will be called. Note that this is a different model from the
read() interface user space apps see over char drivers. A tty will push
recevied data up to the line discipline as it appears.

I can understand your frustration with Linux tty's. Good documentation is
hard to find. The only way I've found to learn is to look at existing
examples. ppp_generic.c is one. Another one is the bluetooth stack
available from developers.axis.org, The src/bluetooth.c file in their
tarball shows how to register and implement a pretty simple line
discipline.

--Gordon


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

From: [EMAIL PROTECTED] (Juergen Heinzl)
Subject: Re: How to optimize the Kernel-Compile
Date: 11 Dec 2000 22:58:16 GMT

In article <[EMAIL PROTECTED]>, Robert Resch wrote:
>Hi!
>
>I want to use a 486 DX-2-66 as a router. For a little more performance i
>want to compile the Kernel for 486.
>I've modified all Makefile 's from '-O2' to '-O9 -march=i486 -mcpu=i486'
>but the kernel doesn't start.
[-]
You can modify the Makefile's until the cows come home, but -O3 is the
limit anyway.

>What modification options can be used in a 2.2.17 Kernel?
[-]
You might have triggered a compiler bug and the next question is which
compiler do you use to compile the kernel ? At least 2.7.2.3 does not
understand -march=... -mcpu=... and I can't remember whether egcs-1.n.m
does.

Ta',
Juergen

-- 
\ Real name     : J�rgen Heinzl         \       no flames      /
 \ EMail Private : [EMAIL PROTECTED] \ send money instead /

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

From: [EMAIL PROTECTED] (bill davidsen)
Subject: Re: How to make a BIOS call in Linux
Date: 11 Dec 2000 23:01:01 GMT

In article <[EMAIL PROTECTED]>,
Tim Roberts  <[EMAIL PROTECTED]> wrote:

| There is a package called "lrmi" (Linux Real-Mode Interface) which provides
| a conveniently packaged wrapper around the built-in vm86 system call in
| Linux.  This lets you allocate and manage memory in the low megabyte,
| including the ROM BIOS region, and lets you execute code in that region in
| V86 mode.  The S3 Savage code in the XFree86 3.3.6 server uses this package
| to call the video BIOS for doing mode switches.  It works surprisingly
| well.

  Thanks, I will have to look at this, since the 2.4 kernel series does
not interface to APM (in spite of notes in the Change log saying that
power down does work, even with SMP). When my UPS says the party's over,
I want to shut the system off, not run the UPS dead supporting a halted
system. There's no real hope of getting this in the kernel, so I want to
unmount all filesystems except the ramdisk root and then turn out the
lights.

  There's even an option to use a real mode APM BIOS call to power down
in the kernel, but the SMP stuff doesn't use use it. One of my clients
wrote code to use the "-R" option in lilo to reboot into Windows just
so the APC code there can do the shutdown Linux can't. To quote my
youngest, "Yuckie-Poo!"

-- 
  bill davidsen <[EMAIL PROTECTED]>  CTO, TMR Associates, Inc
The line from the immutable past to the desired future is useful to
justify continuing to tack into the wind, making a major change in
course, or coasting into safe harbor. It is not a map of where you are
going, just how to get where you want to go.

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

From: [EMAIL PROTECTED] (bill davidsen)
Subject: Re: A faster memcpy and bzero for x86
Date: 11 Dec 2000 23:14:21 GMT

In article <3RGX5.79374$[EMAIL PROTECTED]>,
 <[EMAIL PROTECTED]> wrote:
| Boris Gjenero <[EMAIL PROTECTED]> wrote:

| Actually, the P4 FPU is slower than the P3, albeit it at much higher
| clock speeds. 

  Clock speed comparisons between two chips based on totally diferent
cores, even if they execute the same instructions, is essentially
meaningless. We heard that about the Pentium and 486 as well, only no
one ran their pentium at 66MHz. And I suspect by that definition the 486
would beat the P-III today, if you ran them at the same speed.

  See www.realworldtech.com and the article on the P-IV.

-- 
  bill davidsen <[EMAIL PROTECTED]>  CTO, TMR Associates, Inc
The line from the immutable past to the desired future is useful to
justify continuing to tack into the wind, making a major change in
course, or coasting into safe harbor. It is not a map of where you are
going, just how to get where you want to go.

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

From: Jerry Peters <[EMAIL PROTECTED]>
Subject: Re: how to create install diskettes?
Date: Mon, 11 Dec 2000 23:16:53 GMT

Marty Ross <[EMAIL PROTECTED]> wrote:
> I'm continuing to try to get my installation diskettes to work, and after
> much experimentation, I'm pretty sure that I've got something terribly wrong
> in my rootdisk/bootdisk configuration.  I'm building from a 2.2.14-5 kernel,
> from RedHat 6.2, according to the reccommendations of the "Bootdisk HOWTO".

> One thing I'm still not real clear on: my "boot disk" has the kernel image,
> and LILO is run on it.  When I boot it, it asks me to insert the "root
> disk"--which I do.  But the "root disk" contains no kernel image--should it?
> Is the kernel completely loaded from the boot disk and then locked into
> memory, or does it need to get at it also on the "root" filesystem?

The kernel is completely loaded into memory from the boot disk,
except perhaps some loadable modules. All device & FS drivers must be
compiled into the kernel if they're required to mount the root FS.
This is all assuming no initrd, which I don't use and therefore won't
comment on.

> Where should I begin to check for problems on a boot/root diskette pair that
> boots always with no problems, but then always dies (complete lockup) when I
> go to format the hard drive (again, as I've written before, I have tried
> this software on about half a dozen platforms and the results are identical;
> I'm convinced its a software problem, not hardware as I thought before).

What exactly do you mean by "format the disk"? mkefs?  How much memory
do these machines have? You may need to do a mkswap and swapon before
doing the mkefs. IIRC there are/were some issues with mke2fs using
memory.

        Jerry

> Is there anything special I need to do for disk geometry (or other hardware
> setup)?  All the platforms are PCI, and the hard disks are from 1.2GB to
> 6GB.  I guess most are using LBA, but some not.  Does it matter?  BIOS
> interactions (now my kernel is compiled "direct", but I've tried all
> interactions).

> Any help appreciated.










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

From: [EMAIL PROTECTED] (bill davidsen)
Subject: Re: A faster memcpy and bzero for x86
Date: 11 Dec 2000 23:17:02 GMT

In article <[EMAIL PROTECTED]>,
Johan Kullstam  <[EMAIL PROTECTED]> wrote:

| you can't just clobber the FPU regs, something else might be using
| them.  the kernel cannot use FPU without saving and restoring them
| since they could be used in a userspace program (save/restore FPU every
| time you enter the kernel is too expensive, FPU is only save/restore'd
| at userspace program context switches).  when you factor in the
| overhead the FPU save/restore, using the FPU for memcpy suddenly
| becomes less attractive.  MMX also uses FPU registers so the same
| thing goes for that too.

  But the 2.4 kernel notes indicate that it does just this, since the
overhead of tracking FP use is higher with a threaded kernel, the cost
of the load/store is trivial with a modern CPU, and something else I
don't remember.

  In any case, the C library runs in user space, so this all doesn't
matter.

-- 
  bill davidsen <[EMAIL PROTECTED]>  CTO, TMR Associates, Inc
The line from the immutable past to the desired future is useful to
justify continuing to tack into the wind, making a major change in
course, or coasting into safe harbor. It is not a map of where you are
going, just how to get where you want to go.

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

Date: Mon, 11 Dec 2000 16:22:07 -0700
From: Warren Young <[EMAIL PROTECTED]>
Subject: Re: Am I seeing IPv5, or am I hallucinating?

[EMAIL PROTECTED] wrote:
> 
> Am I hallucinating?

Yes, you're hallucinating.  The IP version number is 4 bits of the first
byte in the IP header.  The upper 4 bits are the length of the IP header
measured in double-words.  Since the IP header is frequently 20 bytes
long, that 4-bit length field is often '5'.  You're no doubt reading the
wrong field.
-- 
= Warren -- See the *ix pages at http://www.cyberport.com/~tangent/ix/
= 
= ICBM Address: 36.8274040 N, 108.0204086 W, alt. 1714m

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

From: [EMAIL PROTECTED] (bill davidsen)
Subject: Re: A faster memcpy and bzero for x86
Date: 11 Dec 2000 23:23:16 GMT

In article <[EMAIL PROTECTED]>, Robert Redelmeier  <[EMAIL PROTECTED]> wrote:

| The original poster was benchmarking a plain Pentium where the
| FILD/FISTP instructions give ~20% better performance than anything
| else. (The FP integer instructions are necessary to avoid the
| FP exceptions that some data patterns (NaN, denormals) produce.)

  I'm not sure what the implications are, but the MMX processors have
larger L1 cache, for large stuff you don't want to glitch it, for small
stuff you might as well. Actually for small stuff, deciding which way to
do it might cost more than the move:-(

-- 
  bill davidsen <[EMAIL PROTECTED]>  CTO, TMR Associates, Inc
The line from the immutable past to the desired future is useful to
justify continuing to tack into the wind, making a major change in
course, or coasting into safe harbor. It is not a map of where you are
going, just how to get where you want to go.

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

From: [EMAIL PROTECTED] (bill davidsen)
Subject: Re: About software raid1
Date: 11 Dec 2000 23:35:41 GMT

In article <90num9$[EMAIL PROTECTED]>, Kunda <[EMAIL PROTECTED]> wrote:

| I setup two ide disks and use linux software raid1.
| How can I know if one ide disk fail, and how to detect it?

  If I understand your question, a look at /proc/mdstat will tell you
what is happening with RAID.

  2nd point, some BIOS boot implementations will not properly switch to
a 2nd hard drive if the first fails to return good data but is still
operational. So if the first drive dies, the 2nd will boot, if the first
has an error, 2nd may not boot.

  I have had some luck setting the BIOS to boot hd then floppy, which
worked in one case (100% of all cases ;-) when the primary hd went
sort-of bad. The floppy boots the secondary hd as root.

-- 
  bill davidsen <[EMAIL PROTECTED]>  CTO, TMR Associates, Inc
The line from the immutable past to the desired future is useful to
justify continuing to tack into the wind, making a major change in
course, or coasting into safe harbor. It is not a map of where you are
going, just how to get where you want to go.



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

From: Michael Buro <"mic"@(NO SPAM!)verizon.net>
Crossposted-To: linux.dev.kernel
Subject: slow asymmetric half-duplex communication (ADSL)
Date: Mon, 11 Dec 2000 23:58:47 GMT

Hello,

I recently got an ADSL connection (640kbaud down, 90kbaud up,
PPPoE). Installation went well, but a simultaneous upload &
download revealed that the download speed suffers big time
when uploading takes place at the same time (total speed <
120kbaud). I later learned that ADSL is indeed using a
half-duplex protocol! I could't believe it. Is there a way
to tell the kernel to throttle an interface's outgoing packets
to increase its overall performance? Packet schedulers come to
mind.

Thanks for any hints.

--
Michael Buro           | Michael.Buro@(NOSPAMDELETE)verizon.net
185 South Harrison St. | http://buro.dnsalias.net
Princeton NJ 08540 USA | Tel: +1 (609) 497-2095




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


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