Linux-Development-Sys Digest #990, Volume #7      Sun, 2 Jul 00 00:13:10 EDT

Contents:
  Re: making a boot/root disk- >libraries too big!! (Mario Klebsch)
  Re: making a boot/root disk- >libraries too big!! (Kaz Kylheku)
  Re: compiling 2.4-test2 kernel problem (J Wendel)
  Re: DNS problems ("Giampaolo Tomassoni")
  Linux Resource (Cory Rauch)
  Re: a better process kill ([EMAIL PROTECTED])
  BLKRRPART ioctl - can it be smarter? ([EMAIL PROTECTED])
  Re: UDP: how to ..? (Chetan Ahuja)
  Adding Another Keyboard to Mouse Port (Kirk I Reiten)
  Re: Network Drivers: How to write them? (Donald Becker)
  Re: Two really easy (I'm sure) questions (Robert Sherry)
  Re: non-blocking IO to /dev/dsp (sound). why Not supported in linux? 
([EMAIL PROTECTED])

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

From: [EMAIL PROTECTED] (Mario Klebsch)
Subject: Re: making a boot/root disk- >libraries too big!!
Date: Sat, 1 Jul 2000 13:17:24 +0200

"Alex DeLarge" <[EMAIL PROTECTED]> writes:

>> I am trying to make a boot/root disk
>> I want to use sysVinit and bash, they use the following libraries:
>> init:
>>     libc.so.6 => /lib/libc.so.6 (0x40018000)
>>     /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

/sbin/init can be a shell script!

>> bash:
>>     libtermcap.so.2 => /lib/libtermcap.so.2 (0x40018000)
>>     libc.so.6 => /lib/libc.so.6 (0x4001d000)
>>     /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
>> some of those libraries are rather large and won't fit on my disk:
>> libtermcap.so.2 -> 15kb
>> /lib/libc.so.6 -> 4118kb
>> /lib/ld-linux.so.2 -> 344k
>>
>> what can i do about it? is it possible to reduce the size of the
>> libraries and keeping only what i need in it? would it be better to
>> recompile init and bash in static mode? any other suggestion?

Compiling a static shell may reduce its size. But you also should
reduce the shells functionality. Bash has many extensiosn, which all
add to the size of the executable as well as to the part of the lib,
needed. Most of them can be disabled using configure options.

When I first made a small linux system, libc still had version 5.x and
on my distibutions boot disk, I found a really small libc.so. I don't
know, what it had left out, but it worked for all programs, I
needed. Later I upgraded my main system to glibc2.1.2, but I found no
configure option to build a minimal version. :-(

>> (i know there are some smaller shell (ash...) but i'd like to use bash
>> anyway, so that i don't have to rewrite the rc script to suit the
>> smaller shell)

Unless you include all the programs needed by those rc scripts, you
will not be able to use them anyway. As I wrote above, I even would
rewrite /sbin/init as a shell script. There is too much to leave out
on a small system, to be able to use the standard rc scripts. It is a
bit like doing autoexec.bat in the old MS-DOS days. :-)

73, Mario
-- 
Mario Klebsch                                           [EMAIL PROTECTED]
PGP-Key available at http://www.klebsch.de/public.key
Fingerprint DSS: EE7C DBCC D9C8 5DC1 D4DB  1483 30CE 9FB2 A047 9CE0
 Diffie-Hellman: D447 4ED6 8A10 2C65 C5E5  8B98 9464 53FF 9382 F518

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: making a boot/root disk- >libraries too big!!
Reply-To: [EMAIL PROTECTED]
Date: Sat, 01 Jul 2000 14:15:54 GMT

On Fri, 30 Jun 2000 14:30:17 GMT, Jerome Corre <[EMAIL PROTECTED]> wrote:
>some of those libraries are rather large and won't fit on my disk:
>libtermcap.so.2 -> 15kb
>/lib/libc.so.6 -> 4118kb
>/lib/ld-linux.so.2 -> 344k

If you run size on these binaries, you will note that most of the bulk is just
bloat, rather than actual code. You can strip it away.

Your libc does not actually contain 4 megabytes of code, but probably closer to
around 950 or so.

I just ran strip on my libc-2.1.3.so and it went from 4101324 to 1060168 bytes.

>I want to create a boot disk to run a old pc with no hard disk, 16MB of
>ra, no screen, and a network car. this 'bizare' old pc is connected to
>a newer one (with a screen) via a LAN. what i want to do is telnet the
>noscreen PC from the newer PC, what do i need on the boot/root disk?

All you need is a kernel that will NFS mount its root filesystem from the
bigger machine, and you have yourself a diskless workstation.

-- 
#exclude <windows.h>

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

From: [EMAIL PROTECTED] (J Wendel)
Crossposted-To: linux.dev.kernel,alt.os.linux
Subject: Re: compiling 2.4-test2 kernel problem
Date: Sat, 01 Jul 2000 16:52:21 GMT


On Fri, 30 Jun 2000 10:12:24 -0400, John Gluck
<[EMAIL PROTECTED]> wrote:

>Morten Liljeberg wrote:
>
>> John Gluck <[EMAIL PROTECTED]> wrote:
>> > gcc: Internal compiler error: program cc1 got fatal signal 11

>The problem was actually a kernel bug(s) . They were fixed by applying
>patches.
>
>Everything works normally now on 2.4 ...

Could you pass along exactly which patches you have installed?

I'm running 2.4.0-test2-AC2 and I still get signal 11 when building
a new kernel. I'm also looking for a PPP fix (posting this from
Winduhs).

Thanks,

John



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

From: "Giampaolo Tomassoni" <[EMAIL PROTECTED]>
Subject: Re: DNS problems
Date: Sat, 01 Jul 2000 18:03:16 GMT

"Thomas Waight" <[EMAIL PROTECTED]> ha scritto nel messaggio
news:[EMAIL PROTECTED]...
> Hi !
>
> I have Linux running off a Disk On Chip. With only 24 MB space for Linux
> I built my own File System and got it up and running. Network
> configuration worked fine except for DNS, wich I can't get to work. I
> have my DNS Server mentioned in the /etc/resolv.conf File, but I can't
> even ping the hosts in my local Network I specify in the /etc/hosts
> File.
> As I said, the rest of the networking is fine, I can ping inside and
> outside my local network (routing works).
>
> my questions are:
> - are there any Files I could have missed when I built my file system
> that
>    could cause these problems (!!ONLY!! with DNS) ?

I probably didn't catch this: your machine supplies a DNS service or is a
DNS consumer?

In the first case, you have to configure the DNS server through
/etc/named.conf, possibly /etc/named.boot and the database files in the
server directory (usually /var/lib/named.d/ or /etc/named.d). You may test
DNS functionality through the nslookup tool.

In the latter, you're probably missing the 'domain' keyword in
/etc/resolv.conf. The minimal /etc/resolv.conf file should look like:

    domain   YourDomainName.Com
    server    xxx.xxx.xxx.xxx

where, obviously, YourDomainName.Com must be replaced with the name of your
domain, and xxx.xxx.xxx.xxx with the IP address of the DNS server you want
to use.

Missing the domain keyword your machine won't send a full machine name (ie:
Machine.YourDomainName.Com) request to the DNS, so that the server can't
find any associated ip address.


> - Is it possible that I compiled Name Resolution out of my Kernel
>    (Net device is a module), have heard that name resolution is
>    built into the Kernel, but haven't found any Information on it ?

For what I know, BIND (this is the name of the Domain Name Resolution stuff)
isn't embedded into the kernel. It is part of the C library.


> - Can anybody think of other possible causes (solutions!) for my problem
> ??

If you setup an /etc/resolv.conf file, and your DNS server replies to
missing requested with an 'unknown' packet, your /etc/hosts may not get
scanned, depending on the version of BIND you are using.


> Please anyone help me on this, I've been going mad on it for days!
> thanks a lot for any answers!

Never mind...

--
 ------------------------------------------------------
Giampaolo Tomassoni Information Systems Consultant
P.za 8 Aprile 1948, 4 Tel/Fax: +39-0578-21100
I-53044 Chiusi (SI)  e-mail: [EMAIL PROTECTED]
ITALY
homepage: http://www.geocities.com/Eureka/Park/2209/



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

From: Cory Rauch <[EMAIL PROTECTED]>
Subject: Linux Resource
Date: Sat, 01 Jul 2000 15:08:43 -0400

OSFAQ.com is a new Operating System and Programming Technical site
looking to expand. Please check it out and add a link.

http://www.osfaq.com


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

From: [EMAIL PROTECTED]
Subject: Re: a better process kill
Date: Sat, 01 Jul 2000 20:15:20 GMT

On Thu, 29 Jun 2000 05:15:09 GMT Kaz Kylheku <[EMAIL PROTECTED]> wrote:
| On Thu, 29 Jun 2000 04:26:57 GMT, [EMAIL PROTECTED]
| <[EMAIL PROTECTED]> wrote:
|>Having had a hardware failure that led to a hung process, I started to
|>think again about better ways to handle process kills.  The hardware
|>was a tape drive that lost an interrupt due to a loose SCSI cable.
|>
|>There are 2 things I think could be improved:
|>
|>1.  When a process is kiled with -KILL, this should be so terminal that
|>    it has no hope of ever running again (should the lost interrupt
|>    somehow mysteriously re-appear).  What I'd like for -KILL to also
|>    do to a process is to forcibly close all it's open file descriptors
|>    that are not actually the blocking ones, including disassociating
|>    the process with any current directory (e.g. I should be able to
|>    umount its current directory), and unmapping its program space (so
|>    I can umount the filesystem it ran from).  Short of the list I/O
|>    being on a filesystem mounted device, I should be able to get a clean
|>    unmount and shutdown done.
|
| SIGKILL does do these things. I suspect your process got hosed in an
| uninterruptible sleep. In an uninterruptible sleep, a process cannot be woken
| by a signal. The driver in question need to be bullet-proofed against
| lost interrupts. E.g. it should have a watchdog timer that will 
| unblock a process that has been waiting too long.

SIGKILL does not do these things in whatever state the process is in for
the situations I have encountered.

The state it is in may be the uninterruptible sleep you refer to.  But
I'm still saying that SIGKILL should do these things EVEN IN THIS CASE.

A running process should clearly wait for a driver to finish, but I see
no cause for a process you no longer want to be there to have to have
to also hold other resources open.  It may not be possible for a process
to be totally eliminated in that situation.  My point is, however, that
_preventing_ any clearing of any resources of a doomed process serves no
useful purpose that I can see.

I don't want to wake the process; I want to clear up its resources.
If things are organized where a process has to wake to do that, then
I think that's what's wrong.

Alternatively, something that can forcibly sync and umount a filesystem
despite open files (or remount it r/o despite open for write files) is
something that could be useful, too.  Since such a thing clearly can
cause problems, too, it might need to be restricted.  But one place
where it should be runnable is the final shutdown ... e.g. pid 1 should
be able to do so, and/or the kernel defers it to after pid 1 exits.

Still, it would be nice to be able to get everything else runnable again
on a system which otherwise has one thing hosed (say due to a hardware
problem poorly addressed by a driver) and I think the ability to cause
a process to _attempt_ to release all resources (i.e. should work for
all resources not hindered by a stuck driver) would be a very useful
ability.  I could come up with lots of detailed fictional scenarios if
you need to be convinced of the utility of it.

-- 
| Phil Howard - KA9WGN | My current websites: linuxhomepage.com, ham.org
| phil  (at)  ipal.net +----------------------------------------------------
| Dallas - Texas - USA | [EMAIL PROTECTED]

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

From: [EMAIL PROTECTED]
Subject: BLKRRPART ioctl - can it be smarter?
Date: Sat, 01 Jul 2000 20:29:24 GMT

The BLKRRPART ioctl, used to reread the (probably changed) partition table,
will refuse to do this if any partition on a disk is currently open.  This
is a less than optimal design.  Instead of this simplistic test, it should
instead compare the partition table from disk against the partition table
the kernel is currently working with, and apply this test _only_ for those
partitions which have a change in the position or (where it affects things)
the size.

Here's a peek at the simplistic test in the IDE code:

        if (drive->busy || (drive->usage > 1)) {
                spin_unlock_irqrestore(&io_request_lock, flags);
                return -EBUSY;
        };

What is the possibility that in a future version of Linux we can have
block device partitioning done in a virtual layering scheme, so that one
place handles the partitioning, for all partition/disklabel types, on
all device types?  Will volume manager support include this?

-- 
| Phil Howard - KA9WGN | My current websites: linuxhomepage.com, ham.org
| phil  (at)  ipal.net +----------------------------------------------------
| Dallas - Texas - USA | [EMAIL PROTECTED]

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

From: Chetan Ahuja <[EMAIL PROTECTED]>
Subject: Re: UDP: how to ..?
Date: 1 Jul 2000 20:38:30 GMT

  Well... I understand that English is not your first language... But
  maybe you could make your post clearer with a diagram or
  something. It's not at all clear what you want.

   My best guess is that you want to implement some sort of modified
   UDP in user space. If that is indeed the question, the answer is
   SOCK_RAW. Do  a 'man socket' and  'man packet' to get more details.

   Chetan
    

   

Maurizio Piana <[EMAIL PROTECTED]>  spoke thusly:
> ... make a copy of UDP, that actually works in kernel mode, fully functionally
> in user mode? I mean, for study project i have to make an application that uses
> directly a copy of the UDP in kernel; this application [user mode] have to get some
> input and have to produce an UDP packet; obviously after this step in user mode mine
> UDP packet will be wrapped in another UDP packet [the one of the kernel mode] and 
>sent
> in the web. The application (obviously!) have to work also in the opposite direction,
> i mean: the kernel unwrap the kernel-UDP packet and give to my application my 
>UDP-packet;
> my application unwrap my UDP-packet and return the original input to the user.
> In few words: i have to develop a superior level of UDP-wrapping that works in user 
>mode,
> without modifying nothing in his internal structure [that will be another future 
>step!] and
> without modifying any kernel component [i'm not so crazy!!]. My problem is that when 
>you
> make a normal application that works with the web you have to use the socket; in the 
>socket
> you specify what kind of service you desire [TCP or UDP]; you don't have to know 
>nothing about
> TCP and UDP components: they are hidden under "socket" call. Where have i to start 
>my work?
> I will study the files "socket.c" and "udp.c" and "udp.h", trying to understand how 
>it works,
> but you could help me much more telling me something deeper on my problem.

> Please excuse my English [i'm Italian].

> Any help is welcome.

> Many thanx to all you.

> MAURIZIO


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

From: Kirk I Reiten <[EMAIL PROTECTED]>
Subject: Adding Another Keyboard to Mouse Port
Date: Sat, 01 Jul 2000 21:07:51 GMT

Has anyone added a  keyboard to the psaux port?

Thanks

Kirk


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

From: [EMAIL PROTECTED] (Donald Becker)
Crossposted-To: linux.redhat.development,comp.os.linux.development.apps
Subject: Re: Network Drivers: How to write them?
Date: Sat, 01 Jul 2000 22:18:17 GMT

In article <8h5912$id3$[EMAIL PROTECTED]>,
Paolo Scaffardi <[EMAIL PROTECTED]> wrote:
>I have to write a network driver for Linux that works on a proprietary NIC
>interface, but i dont know how to develop it. I looked the
>/usr/src/linux/drivers/net/skeleton.c example, but it is not sufficient to
>me.
>
>I'd like to find any simple network driver source... for example for a
>NULL-MODEM 3 pin cable... but i dont know where to find it!
>
>Is there any starting point on internet or any network drivers developer's
>bible?

Read
  ftp://www.scyld.com/pub/network/pci-skeleton.c
and
  http://www.scyld.com/network/updates.html


-- 
Donald Becker                           [EMAIL PROTECTED]
Scyld Computing Corporation             http://www.scyld.com
410 Severn Ave. Suite 210               Beowulf Clusters / Linux Installations
Annapolis MD 21403

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

From: Robert Sherry <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development,comp.os.linux.development.apps
Subject: Re: Two really easy (I'm sure) questions
Date: Sat, 01 Jul 2000 23:26:25 GMT

I was an inactive member of the ANSI Standard committee for
C (X3J11). I was a representative from Manx Software Systems. I 
believe what you wrote is correct. 

                                Robert Sherry

Lew Pitcher wrote:
> 
> Charles Bryant wrote:
> >
> > In article <brsR4.50603$[EMAIL PROTECTED]>,
> > Mark Graybill <[EMAIL PROTECTED]> wrote:
> > >Again - please explain in technical terms WHY 2<&1 (and void main()) is
> > >incorrect.  I'm looking for solid technical reasons - not ethical reasons.
> [snip]
> > In the case of void main(), if you're using a Unix-like system a
> > program does return a value, so why would you try to declare it as
> > if it didn't? Again it's a case of saying what you mean. Even if you
> > call exit() the program returns a value (and why would you call
> > exit() directly from main() when you could use 'return'?), so it
> > makes sense to declare it properly.
> 
> Although these are excellent and correct reasons for the Unix
> environment (which Linux shares), the real and absolute reason why
> void main() is incorrect is "because the standards say so".
> 
> If you want to know _why_ the standards say that void main() is
> incorrect, I guess you'll have to ask the ISO C Committee. My guess
> (not being one of the committee) is that
> a) an unexpected return value given to the caller of main() can be
> ignored by the caller, but if the caller expects a return value and
> doesn't get one, then all heck breaks loose, and there are
> circumstances where main() must return a value, and
> b) it maintains backward compatability with prior (working) code.
> Even platforms for which authors recommend void main() (i.e. MSDOS)
> expect a value from main(). Other platforms sometimes recommend void
> main(), but violate the standards by not using main() functions anyway
> (i.e. MSWindows, where WinMain() is the system entrypoint).
> 
> --
> Lew Pitcher
> 
> Master Codewright and JOAT-in-training

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

From: [EMAIL PROTECTED]
Subject: Re: non-blocking IO to /dev/dsp (sound). why Not supported in linux?
Date: Sun, 02 Jul 2000 03:53:29 GMT

On 1 Jul 2000 01:11:17 -0700 [EMAIL PROTECTED] wrote:

| I just started to learn about audio IO, and I noticed this.
|
| On Solaris, it is possible to write() with NOBLOCKING to
| /dev/audio, while on Linux, /dev/dsp drivers do not support non blocking IO.
|
| Is there a reason why Linux does not support non blocking IO to
| /dev/dsp?

Based on what I see in the kernel source, this is not true.

| "Playing Audio Data
| The write() system call copies data from an applications buffer to 
| the STREAMS output queue. Ordinarily, write() blocks until the entire 
| user buffer is transferred. The device may alternatively be set to a
| non-blocking mode, in which case write() completes immediately, but 
| may have transferred fewer bytes than requested (see write(2))."

It is unclear whether this means transferred to the kernel buffer,
or driver buffer, or device buffer.  The last case would be a problem.


| For Linux, page 174, book 'Linux multimedia guide' by J. Tranter,
| it says (when talking about /dev/dsp) :
|
| "...Unlike some devices, there is no support for non-blocking
| I/O"

That might be old.


| So, given that there is no support for non-blocking IO to /dev/dsp,
| What is the best way to reduce process blocking time?, is
| it using SNDCTL_DSP_SETFRAGMENT to specify smaller fragment size of
| user audio data to write will be the best way to handle this? (smaller
| DMA transfer, less time the process blocked?)...

Dedicate a process to write to the device, and feed it via a pipe.


| Are there plans to add non-blocking IO support to /dev/dsp?

Looks to me like it is there.


-- 
| Phil Howard - KA9WGN | My current websites: linuxhomepage.com, ham.org
| phil  (at)  ipal.net +----------------------------------------------------
| Dallas - Texas - USA | [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 (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