Linux-Development-Sys Digest #220, Volume #8     Mon, 16 Oct 00 21:13:15 EDT

Contents:
  Re: get frequency of video station tuned (Matthias Kleinmann)
  Re: Red Hat 7.0: So Much for the Myth of "2.4 Ready" ("Kevin D. Kissell")
  table entries in /proc ("Ron")
  OOP in /proc ("Ron")
  Re: basic question(s) on libc5 vs. libc6 (B'ichela)
  Re: to sync or not to sync
  Re: to sync or not to sync ([EMAIL PROTECTED])
  looking for ("Roee Bachar")
  Re: table entries in /proc (Kaz Kylheku)
  Re: HOWTO? Boundary aligned memory allocation (for PCI device driver) ("Jim Fischer")
  Re: executing applications without using filesystem (The Ghost In The Machine)
  Re: OOP in /proc (Alexander Viro)
  Accessing Memory on Device Boards ("Anders Prisak")
  Re: table entries in /proc (Karl Heyes)
  Re: File cache (Karl Heyes)
  Re: Most popular Linux development environment(s)? Graphical? (Robert Redelmeier)
  Re: sockets per process (The Ghost In The Machine)
  Re: LILO version 21.6 released (John in SD)
  Re: storing tabular variables (The Ghost In The Machine)

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

From: [EMAIL PROTECTED] (Matthias Kleinmann)
Subject: Re: get frequency of video station tuned
Date: 16 Oct 2000 18:08:01 GMT

>Its properly protection to stop two consumers on the same device.
I agree with that.

>Modify the TV Watching program so that you see the frequency. (if
>possible)
I can not modfiy all tv programs around, I guess. (remember, this is
d.o.l._development_.system). I even think it would be no problem
to free the device for most of the time for this programs...

[...]
>> So how can I get the frequence of the station tuned in
>> while a tv app like xawtv running
[...]

In detail, it is a deamon which puts every incomming videotext
page into a in-memory database. To make this database any usefull
I need the frequency of each page. You cann free both
/dev/vbi and /dev/video at any time, but it would be very nice to
collect pages also during any running tv app.

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

From: "Kevin D. Kissell" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.networking,linux.redhat
Subject: Re: Red Hat 7.0: So Much for the Myth of "2.4 Ready"
Date: Mon, 16 Oct 2000 19:46:01 +0200

"Kevin D. Kissell" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
...
> It looks as if perhaps the intent is to clean up some unneeded
> explicit interfacing between nfsd and lockd, but the result here
> is  that the system call fails, and rpc.lockd doesn't start up.
> Not good if one wants the system to be an NFS server.

OK, OK, the problem does appear to be cosmetic.  The
NFS startup script does not abort due to the error.  The
lock daemon *should* have started automatically in any
case, so the failure may well be a noisy no-op.

Anyone out there know a good quickie test to verify that
the kernel lockd is functional?

            Regards,

            Kevin K.



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

From: "Ron" <[EMAIL PROTECTED]>
Subject: table entries in /proc
Date: Mon, 16 Oct 2000 15:45:34 -0400

I want to be able to store data in table format (rows columns) in the proc
fs. Is there any way to do this.

Ron





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

From: "Ron" <[EMAIL PROTECTED]>
Subject: OOP in /proc
Date: Mon, 16 Oct 2000 15:49:59 -0400

Will the proc system support OOP like classes and data structures (arrays,
objects)

Thanks,
ROn





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

From: [EMAIL PROTECTED] (B'ichela)
Subject: Re: basic question(s) on libc5 vs. libc6
Date: Mon, 16 Oct 2000 14:18:44 -0400
Reply-To: [EMAIL PROTECTED]

On Mon, 16 Oct 2000 05:36:12 -0000, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>If you have 30 processes linked to libc5 and 40 processes linked to
>libc6 you have the libraries taking up at most the space of both
>just once.  That is, as long as everything is shared.  We're talking
>about less than a meg of memory for libc5, and that isn't a problem
>at least on today's machines of 64 meg and larger.  Of course if you
>are still running on that old 8 meg 386, that's another issue.
        Being one of those people who still uses a 486 DX2/66 with
20mb of ram as well as two 486 DX/33 8mb client machines. bigger libs
hurt my system badly. thats why I never moved up from kernel 2.0.38 on
slackware 3.9. I don't have the memory to throw around. How big is
libc5 vs libc6 anyway?

-- 

                        B'ichela


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

From: <[EMAIL PROTECTED]>
Subject: Re: to sync or not to sync
Date: 16 Oct 2000 19:29:40 GMT

[EMAIL PROTECTED] wrote:
> Asyncronous I/O is in some cases unsatisfactory.  Yet I also find the
> alternative, syncronous, to be equally unsatisfactory in many of the
> same cases.  While looking over kernel code for something unrelated,
> I notice indications that the compromise solution really isn't being
> considered.

...snip...

Um... fork() a synchronous write. While the write is active, allow
the parent to enqueue at most one write. When the synchronous write
returns, issue the pending write (and allow the next write to be
enqueued). In the high(er) level write routine, wait on a signal
from the child that indicates the write is complete if and only
if another write is already queued.

write
        if write is queued,
                wait for signal
        if write is issued
                queue write
        issue write

issue write
        fork
                child -> do write, 
                        if write queued, issue write
                        signal
                parent -> write issued

Or something like that. Implementation is left as an exersise for the
reader.


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

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

From: [EMAIL PROTECTED]
Subject: Re: to sync or not to sync
Date: Mon, 16 Oct 2000 20:17:46 -0000

On 16 Oct 2000 19:29:40 GMT [EMAIL PROTECTED] wrote:

| Um... fork() a synchronous write. While the write is active, allow
| the parent to enqueue at most one write. When the synchronous write
| returns, issue the pending write (and allow the next write to be
| enqueued). In the high(er) level write routine, wait on a signal
| from the child that indicates the write is complete if and only
| if another write is already queued.
|
| write
|       if write is queued,
|               wait for signal
|       if write is issued
|               queue write
|       issue write
|
| issue write
|       fork
|               child -> do write, 
|                       if write queued, issue write
|                       signal
|               parent -> write issued
|
| Or something like that. Implementation is left as an exersise for the
| reader.

I've simulated that by having a process write the same buffer over and over.
It's not quite the full speed of letting the kernel do it.  And the process
CAN get swapped out.  The above is so far the best way to do it.  I just
wanted to have the queueing in the kernel.

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

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

From: "Roee Bachar" <[EMAIL PROTECTED]>
Subject: looking for
Date: Mon, 16 Oct 2000 21:48:38 +0200

Hello all

I have Redhat 6.2 Linux and I'm looking for good help material on
programming in linux
my favorite programming language is C.

I want to know better on :
    *    all of c libraries (such as stdio.h, graphics.h, bios.h ) for
linux.
    *    system programming ( how to us the ROM BIOS interrupts for
example).
    *    how to program graphics in linux .
    *    multitasking commands for c.

I mean all the help I can get :
    *    files to read.
    *    names of good books ( not for beginners ).


Thanks all

ROEE BACHAR





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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: table entries in /proc
Reply-To: [EMAIL PROTECTED]
Date: Mon, 16 Oct 2000 20:38:42 GMT

On Mon, 16 Oct 2000 15:45:34 -0400, Ron <[EMAIL PROTECTED]> wrote:
>I want to be able to store data in table format (rows columns) in the proc
>fs. Is there any way to do this.

The proc filesystem doesn't store anything. It's a way for kernel modules to
dynamically publish status and configuration information.  Usually, the
information takes the form of text.  Proc also provides a way to set
parameters, usually done by writing text to the virtual files.

-- 
Any hyperlinks appearing in this article were inserted by the unscrupulous
operators of a Usenet-to-web gateway, without obtaining the proper permission
of the author, who does not endorse any of the linked-to products or services.

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

From: "Jim Fischer" <[EMAIL PROTECTED]>
Subject: Re: HOWTO? Boundary aligned memory allocation (for PCI device driver)
Date: Mon, 16 Oct 2000 13:33:57 -0700


"Joe Pfeiffer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...

> You need to allocate some extra space, and then adjust the pointer to
> be properly aligned.  The maximum amount you need to adjust is 2^n-1
> (since if you need to adjust by 2^n, you'd already be in the right
> place.  So the code is something like
>
> mallocptr = malloc(size + (1 << n) - 1);
> myptr = (myallocptr + (1 << n) - 1) & ~((1 << n) - 1);

I probably should have mentioned in my original message that I'm working on
an embedded system project, and that my physical memory resources are very
limited (16MB). IOW, I don't want to use a physical memory allocation scheme
that allocates (essentially) 2x the amount of physical RAM that I actually
need, just so I can ensure my address boundary alignment requirements can be
met.

Of course, one possible solution is to manually tweak the MMU's page tables
via a custom device driver; however, I'd like to avoid this solution if the
2.4.0-testX kernels provide a "built in" mechanism for this sort of memory
allocation. Considering Linux's popularity in the embedded systems sector,
I'm hoping that this sort of memory allocation task is already (or, IMO,
should be) supported by the 2.4.0 kernel...


Jim




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

From: [EMAIL PROTECTED] (The Ghost In The Machine)
Crossposted-To: comp.os.linux.development.apps
Subject: Re: executing applications without using filesystem
Date: Mon, 16 Oct 2000 20:49:15 GMT

In comp.os.linux.development.apps, Roger Leigh
<[EMAIL PROTECTED]>
 wrote
on 14 Oct 2000 20:56:16 GMT
<[EMAIL PROTECTED]>:
>On Sat, 14 Oct 2000 17:56:18 GMT, The Ghost In The Machine wrote:
>>I'm curious as to that, too, if only because the Amiga's ramdisk
>>device didn't have a fixed size and I kinda liked that. :-)
>
>A bit like tmpfs on Solaris then? That uses part of the VM as a
>filesystem, and it grows and shrinks as needed (there is a hard limit on
>the maximum size IIRC). As it's VM, and not just real memory, it can be in
>swap space too. Has anyone tried porting this to Linux as it's really
>neat? 

Yeah, that's more or less what I would want; dunno about the original
requester.

[.sigsnip]

-- 
[EMAIL PROTECTED] -- insert random misquote here

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

From: [EMAIL PROTECTED] (Alexander Viro)
Subject: Re: OOP in /proc
Date: 16 Oct 2000 17:00:02 -0400

In article <8sfm0o$hjt$[EMAIL PROTECTED]>,
Ron <[EMAIL PROTECTED]> wrote:
>Will the proc system support OOP like classes and data structures (arrays,
>objects)

Sorry, mindreading equipment seems to be down today. Care to spend a couple
of minutes explaining WTF do you want?

-- 
Fairy Tails start "Once upon a time."
Army/Sea stories start "This is no shit."
Software proposals start "1.0."
                                Joe Zeff in the Monastery

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

From: "Anders Prisak" <[EMAIL PROTECTED]>
Subject: Accessing Memory on Device Boards
Date: Mon, 16 Oct 2000 23:17:11 +0200

Hi,
I'm trying to write a device driver for 82C200 based  ISA CANBus card for
linux as the driver I've found doesn't seem to work. I'm quite new at this
stuff, I know how to write and insert modules but I have problems contacting
the device board. The registers are supposed to be located at 0xDA00 up to
0xDC00. I've tried to use readb() and writeb() to access them but I don't
think I'm getting anything through to the card. For example I wrote:

    writeb(0x1, 0xDA00)

I don't get any error message when inserting the module and running the code
but it just doesn't write anything to the registers on the board (I was able
to check that in dos).


==============
Anders Prisak



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

From: Karl Heyes <[EMAIL PROTECTED]>
Subject: Re: table entries in /proc
Date: Mon, 16 Oct 2000 23:59:30 +0000

In article <8sflof$hf9$[EMAIL PROTECTED]>,
 "Ron" <[EMAIL PROTECTED]> wrote:
> I want to be able to store data in table format (rows columns) in the proc
> fs. Is there any way to do this.
> 

Be aware what /proc is for.  To present system information in a reasonably 
easy format for user programs/utilites to read without special privileges.  It
also has entries for tuning the kernel, networking, disk caches etc. 

The way your question sounds is something akin to SQL.

karl.


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

From: Karl Heyes <[EMAIL PROTECTED]>
Subject: Re: File cache
Date: Tue, 17 Oct 2000 00:02:43 +0000

In article <8sebh4$6ku$[EMAIL PROTECTED]>, "Vladimir"
<[EMAIL PROTECTED]> wrote:
> How can I disable file caching in Linux. I am testing disk driver and file
> caching really makes my life difficult.
> 

this sounds like the Raw IO stuff.  ie your disk is attached to a block device
but you use the raw command to attache a different device which treats it as
raw.

karl.


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

Date: Mon, 16 Oct 2000 18:24:34 -0500
From: Robert Redelmeier <[EMAIL PROTECTED]>
Subject: Re: Most popular Linux development environment(s)? Graphical?

Larry Ebbitt wrote in small part:
> 
> My wife thinks I type well, I think I'm fair but, beyond the typing,
> there's remembering the correct spelling of all the files. and the
> correct format of the commands. which is almost never intuitive.

A good CLI interpreter helps as well.  A command history (up arrow)
and filename completion [TAB] are _musts_.  The MS-DOS and OS/2 
COMMAND interpreters are brain-dead to the point of unusibility.  
4DOS makes good replacements for each.  Otherwise, bash and tcsh 
are good.  I often forget options, but the manpages are there.
For me it's better than hitting "OK" and hoping the GUI does the 
right thing.  

> A GUI takes care of that for me. I have RSI and get to wear these
> cute little wrist braces.  I don't think it cam from my lovable
> little red-tailed rodent, I think it came from pounding on things
> when I misspelled a file name or option name.  I think GUIs are
> easier cuz they prevent a lot of that set of brain farts.

My sympathies on your RSI.  Where I work, many more people have
RSI problems from their mouse than the kbd.  It usually manifests
itself in the right [mouse] hand.  Normal kbd RSI is worse in the
left hand since it is weaker and has more work on QWERTY kbds.

 [...]
> holy war, but I thought, on re-reading. that I sounded a little
> too imperious.

I had that impression too.  It takes a big man to apologize.
Thanks.

-- Robert

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

From: [EMAIL PROTECTED] (The Ghost In The Machine)
Subject: Re: sockets per process
Date: Tue, 17 Oct 2000 00:07:08 GMT

In comp.os.linux.development.system, Eclipse mail
<[EMAIL PROTECTED]>
 wrote
on Thu, 12 Oct 2000 22:41:07 -0400
<[EMAIL PROTECTED]>:
>i have realized that we can have only 255 file descriptors open per
>process ( including sockets).
>is it possible to have more than 255 file descriptors per process so
>that we can have a lot more tcp/ip connections per process ?
>

The limit is controlled by a #define constant (NR_OPEN) which
sits in /usr/include/linux/limits.h.  One can define this to be
anything up to 1048576.  Be advised that this may cause problems
with fd_set, which assumes the maximum fd possible to be 1023.
Go over that, and one might corrupt memory unless one also
modifies /usr/include/linux/posix_types.h.  Note that file
descriptors are allocated first-fit starting at 0, so memory
corruption isn't much of an issue for existing programs that
know how to limit their open files.  But if they don't, well... :-/

A better solution would probably be to fork children off;
each child can then do what it wants regarding file sockets.
httpd employs this, for example.

If you really needed 10240 file sockets open, and you had no other
descriptors open in your children (unlikely), you could spawn
off 10 children, each with 1024 sockets.

This solution is also more portable, as other Unices are usually
limited to 1024 open descriptors.

-- 
[EMAIL PROTECTED] -- insert random misquote here

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

From: John in SD <[EMAIL PROTECTED]>
Subject: Re: LILO version 21.6 released
Reply-To: [EMAIL PROTECTED]
Date: Tue, 17 Oct 2000 00:07:21 GMT

RedHat has based their release 7.0 version of LILO on 21.4.4.  The mods for a
PCX file are theirs, not mine, and will only work on VGA systems.

The menu interface introduced with LILO 21.5 is based on a text screen, and
works on MDA, EGA, and VGA systems.

--John



On Mon, 16 Oct 2000 17:20:13 GMT, Rudi Sluijtman <[EMAIL PROTECTED]> wrote:

>Hi Leonard,
>
>Leonard Evens <[EMAIL PROTECTED]> writes:
>
>> Rudi Sluijtman wrote:
>> > 
>> > Hi John,
>> > 
>> > John in SD <[EMAIL PROTECTED]> writes:
>> > 
>> > > >John in SD <[EMAIL PROTECTED]> writes:
>> > > >> LILO release 21.6 is based upon Werner Almesberger's LILO version 21.
>> > > >
>> > > >Could you please provide us with, or point to, some documentation about
>> > > >the usage of the "- Completely new menu-driven user interface."
>> 
>> I don't know if this is any help, but under RH 7, the file
>> /boot/message consists of data which presumably creates the
>I know,
>
>> lilo boot screen.  I have no idea how one goes about creating
>> such a file to one's own specifications.
>
>This whas what my question was about.
>
>Anyway I had a look at the /boot/message file with xv, and it seems to
>be a PCX file. I will mess around with some PCX files and see what
>happens.
>
>Thanks,
>Rudi Sluijtman.
>
>


LILO version 21.6 (04-Oct-2000) source at
http://www.ibiblio.org/pub/Linux/system/boot/lilo

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

From: [EMAIL PROTECTED] (The Ghost In The Machine)
Subject: Re: storing tabular variables
Date: Tue, 17 Oct 2000 00:23:02 GMT

In comp.os.linux.development.system, Ron
<[EMAIL PROTECTED]>
 wrote
on Thu, 12 Oct 2000 16:30:23 -0400
<8s56ss$ii$[EMAIL PROTECTED]>:
>I've been using an array of objects in C++ to store variables that are in a
>tabular fashion (ie. columns and rows).
>
>I have to store these same variables in the kernel space, however, this is
>done using C. What is the best way to store tabular variables in C.
>
>I'm thinking of something along these lines (struct of struct)
>
>struct bye{
>    int hi;
>    struct hello;
>}
>
>Any help would be appreciated,
>Ron

That's not quite a "table of tables", although it's not too far off.
A table would more likely look like an array of structures.

One way to accomplish this in C would be to declare something
along the following:

struct example {
        int f1;
        int f2;
};

struct example data[5][10];

would declare a 5 x 10 data table named data; fields within the
table could be accessed as data[i][j].f1.  C does not have a
true multidimensional bracket operator, unlike languages such
as FORTRAN or Pascal; if one writes data[i,j].f1, one will
get a semantic error because (i,j) == j (',' is the comma operator,
usually used in if(), for(), and while() statements) and therefore
data[i,j] == data[j] == a pointer to an array of struct example,
not a struct example, and the compiler will complain.

Another alternative is to declare a fixed-sized array of substructures
within the main structure:

struct subexample {
        int f3;
        int f4;
};

struct example {
        int f1;
        struct subexample f2[10];
};

struct example data[5];

and then one gets fields using either data[i].f1 or data[i].f2[j].f3.

What you've got in this example is a singly-dimensioned array of structures,
each of which contains another singly-dimensioned array of structures.

Still another is to declare a pointer.

struct subexample {
        int f3;
        int f4;
};

struct example {
        int f2;
        struct subexample *f2;
        int nf2;
};

which has access deceptively similar to the preceding example, but
the construction of the example structure will require initialization
of the f2 pointer.  nf2 is added for completeness, should one want to test
the index; after all, the pointer can point to any size of memory it wants.

Pointers can be tricky; one has to be careful with them.  In C,
a pointer to an array has the exact same syntax as a pointer to
a single element, unlike Pascal, which differentiates between
the two:

type
        record1 = record f1: integer; f2: integer end;

        record1p = ^record1;
        record1array = array[1..10] of record1;
        record1ap = ^record1array;

var
        a: record1array;
        p : record1p;
        pa: record1ap;

and then one uses expressions such as a[i].f1, p^.f1, but pa^[i].f1.
In C, one uses p->f1 and p[i].f1, but p->f1 == p[0].f1 == (*p).f1;
all generate exactly the same code and are all valid.  Occasionally
useful for steping through an array (for(p = pa; p - pa < 10; p++) {...}),
but can be dangerous.

As for the specifics of allocating memory in the kernel, I'll have to
point you elsewhere, as I'm not much of a kernel hacker specifically
(but you asked a *very* general question :-) ).

HTH

-- 
[EMAIL PROTECTED] -- insert random misquote here

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


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