Linux-Development-Sys Digest #351, Volume #8     Fri, 15 Dec 00 08:13:09 EST

Contents:
  Re: changing BASH's path searching (Josef Moellers)
  Re: How to make a BIOS call in Linux (Kasper Dupont)
  Re: injecting virtual console keystrokes (Kasper Dupont)
  Linux Driver Development ("Crymund")
  how to use "pthread_rwlock_t" in linux? ("Victor")
  Re: sys_close & fd's ??? (Kasper Dupont)
  Re: Compiling C++ programs with GCC --> no GPL license implications (jbs)
  Re: Linux Driver Development (Richard Kolb)
  shared libs ... an idiot question (Steve Houseman)
  Re: kernel page cache vs executable image (Steve Houseman)
  Kernel supporting more than 2GB of Ram ("[LsD]Tanis")
  Re: shared libs ... an idiot question (Josef Moellers)
  Re: Kernel supporting more than 2GB of Ram (Josef Moellers)
  Re: Allocating memory for multiple pages (Arne Driescher)
  Re: Problem with LVM and LILO (Kasper Dupont)
  Re: Allocating memory for multiple pages (Marc SCHAEFER)
  Re: Problem with LVM and LILO (Josef Moellers)
  Re: A faster memcpy and bzero for x86 (Kasper Dupont)
  Re: log message from linuxrc script (Kasper Dupont)
  >1 processes on 1 file at same time (Michael Palme)
  Re: changing BASH's path searching ("Peter T. Breuer")

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

From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: changing BASH's path searching
Date: Fri, 15 Dec 2000 08:56:15 +0100

"Peter T. Breuer" wrote:

> >> updatedb takes less than 2 mins on my P450.
> =

> > You haven't seen what I've seen ... I'm not talking tens of gigabytes=

> > ...
> =

> I'm talking 5GB.

That doesn't even reach the size of our boot disk B-{) I'm talking 50,
maybe 500GB or more of mail files, news group articles, web pages, ...

> > No it's not. It's also reversing all modifications made to some
> > configuration files of other packages. Example: Installing a networke=
d
> =

> I would never do such a thing.
> =

> > server might modify /etc/inetd.conf. Neither is this entry made by "t=
ar
> =

> It WOULDN'T. That's MY business. A package has no right to add ANY
> line to MY system without MY say-so. And when I do it, I'll reverse it,=

> if I feel like, thank you.

That may be your approach to installing a package on a single P450 based
box. We have customers with >100 machines. Tell them to manually keep
track of the modifications to make. =


> > xvzf foo.tgz" nor is this entry removed by "xargs rm -f <
> > /var/log/packages/foo". Also, removing a package might break
> > dependencies (suddenly a binary needed by package bar is missing).
> =

> I don't remove packages that are needed my other packages :),
> and if ever I accidently do, I put it back again sharpish (tcl/tk for
> versions back to 4.0 is an example of stuff I've several times given up=

> on and removed, only to have to go and put back as I discover some
> other misbegotten scribble that relies on 4.0).

That's the point I'm trying to make. I don't know what your profession
is nor do I know how many systems running Linux you manage. If it's just
this one P450 box and if your business doesn't depend on 24/7
availability, then you have my blessing to manually do everything you
need to do. If, however, you have to manage 100s of servers (nice little
pizzaboxes, 20 of these in a 19" rack, rows of these in a web server
farm sometimes accumulating to 1000 servers), I think you might
appreciate any help you can get from the people who wrote the software
in installing the stuff and being back on-line without your customers
noticing.

-- =

Josef M=F6llers (Pinguinpfleger bei FSC)
        If failure had no penalty success would not be a prize (T.  Pratchett)

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: How to make a BIOS call in Linux
Date: Fri, 15 Dec 2000 09:51:33 +0100

[EMAIL PROTECTED] wrote:
> 
> I'm using a type of bios called smbios
> ( http://www.phoenix.com/products/specs-smbios.pdf ) The spec is
> written by various PC and BIOS companies, eg, Intel and Phoenix tech.
> The smbios knows various aspects about the PC, including temperature,
> voltage, bios rev, bios build date, manufacturing, etc.
> 
> The static info, e.g., bios rev, bios date, etc, I can get them by
> reading from a known location in memory. But for dynamic info,
> temperature, voltage, etc, it looks like I need to make the bios call.
> If there are other ways to get this info that would be great.
> 
> Thanks
> 
[...]

The information is supplied by hardware through
some I/O-ports. The BIOS includes some code for
reading/writing these ports and return whatever
information you want. But accessing the ports
does not have to be done by the BIOS, it could
be done by some other code.

What you really need is a driver for your
particular hardware. How the driver should
present the information to user programs is an
open issue, but I think a /proc entry would be
the right solution.

You should contact your hardware vendor and ask
for an appropriate driver or hardware
specifications so the driver can be written.

If the vendor does not cooperate you might need
to reverse engineer the BIOS.

-- 
Kasper Dupont

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: injecting virtual console keystrokes
Date: Fri, 15 Dec 2000 10:02:42 +0100

[EMAIL PROTECTED] wrote:
> 
> I've looked in the kernel source, and it looks like it should be
> very easy to inject at least a few ASCII input characters into a
> virtual console tty.  There are some escape sequences that cause
> responses to come back, and what they do seems rather easy.  So
> my thought is I could add a new ioctl call where the argument is
> a string of characters to be injected.  It doesn't look like it
> would be very much code, either, since the important stuff seems
> to all be there already.
> 
> Although I believe I can just do this, I'm intersted in feedback
> about variations or alternatives you think may be more helpful
> to others and/or would increase the likelihood of being rolled
> into the official kernel source.
> 
> Any particular ioctl symbol you think I should use?
> 
> Should I test to make sure it isn't used for minor numbers beyond
> the 0-63 or 1-63 range?
> 
> Any limits I should place on size of data, or even data content?
> 
> Any security issues you can see?

First of all you have to copy data from userspace to kernel space,
you could study getname in fs/namei.c to see how that can be done,
remember to free the page when done or your system will slowly be
lacking all of its memory.

Beeing able to send commands to another users shell is definitely
an issue. If you are able to write output to this users terminal
can also inject some chars by using escape codes, but that is very
limited. I think it should only be possible to inject chars into
the terminal which the fd refers to, and perhaps only if it is
open both for reading and writing. Perhaps root should not have
this limitation.

Does this have to be restricted to the virtual consoles? Couldn't
it be made to work with xterms as well?

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

-- 
Kasper Dupont

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

From: "Crymund" <[EMAIL PROTECTED]>
Subject: Linux Driver Development
Date: Fri, 15 Dec 2000 17:03:21 +0800

Dear all,

I am an absolute newbie to Linux. However, I would like to know how you
gurus develop Linux drivers. Any available tools? any suitable development
environment? Any debugger?

I just would like to start learning Linux development. Please help. Thank
you in advance.



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

From: "Victor" <[EMAIL PROTECTED]>
Subject: how to use "pthread_rwlock_t" in linux?
Date: Fri, 15 Dec 2000 17:08:11 +0800
Reply-To: "Victor" <[EMAIL PROTECTED]>

I want to use Process_shared "pthread_rwlock_t" in my program.

But it seems that my Linux(Redhat 6.1) doesn't support it and always report
compiling error "aggregate `struct pthread_rwlock_t rw_lock' has incomplete
type and cannot be initialized".

I found its definition in the  "/usr/include/bits/pthreadtypes.h", but it
fellows
a switch "__USE_UNIX98". Maybe it was not opened yet.

How can I use it?  Need I re-compile my Linux and how to open
"__USE_UNIX98"?

Thanks.

Regards,
Victor



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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: sys_close & fd's ???
Date: Fri, 15 Dec 2000 10:14:16 +0100

Erik Hensema wrote:
> 
> byteme ([EMAIL PROTECTED]) wrote:
> >Does anyone know how to assoc. a fd to a file name ??
> 
> Can't be done.
> 

You are mistaken, it is posible. The kernel
present the information to userspace programs
in /proc/<pid>/fd.

If you want to use the information inside the
kernel you should probably use the function:
char * d_path(struct dentry *dentry,
              char *buffer,
              int buflen)
The struct file contains a pointer to a struct
dentry.

-- 
Kasper Dupont

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

From: jbs <[EMAIL PROTECTED]>
Crossposted-To: comp.lang.c++,gnu.misc.discuss
Subject: Re: Compiling C++ programs with GCC --> no GPL license implications
Date: Fri, 15 Dec 2000 01:34:49 -0800

"E. Robert Tisdale" wrote:
> It is off-topic in these newsgroups.

It is not offtopic in the newsgroup I am reading.

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

From: Richard Kolb <[EMAIL PROTECTED]>
Subject: Re: Linux Driver Development
Date: Fri, 15 Dec 2000 11:51:26 +0200

Hi,

I'm not much of a guru but,

Best thing is to look at the kernel source and learn,
The book Linux Device Drivers is also good, ( a bit old )

A suitable development environment is a simple test editor,
e.g. vi / vim / emacs / Joe and the list goes on
and if you like X , code crusader

When it comes to debuggers, (of sorts anyway )
ksymoops decodes those lovely oops messages

Have Fun,
Richard.


Crymund wrote:

> Dear all,
>
> I am an absolute newbie to Linux. However, I would like to know how you
> gurus develop Linux drivers. Any available tools? any suitable development
> environment? Any debugger?
>
> I just would like to start learning Linux development. Please help. Thank
> you in advance.


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

From: [EMAIL PROTECTED] (Steve Houseman)
Subject: shared libs ... an idiot question
Date: 15 Dec 2000 09:49:28 -0000

are the code (or read only) bits of a shared lib, shared in ram
between all users (of the lib)?

is the code part of an executable shared between all instantiations
of that exe ?

Thanks,

Steve Houseman


-- 

currently  steve.houseman at virgin net      

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

From: [EMAIL PROTECTED] (Steve Houseman)
Subject: Re: kernel page cache vs executable image
Date: 15 Dec 2000 09:47:33 -0000

Ok, forget this .

Cheers,

Steve Houseman

-- 

currently  steve.houseman at virgin net      

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

From: "[LsD]Tanis" <[EMAIL PROTECTED]>
Subject: Kernel supporting more than 2GB of Ram
Date: Fri, 15 Dec 2000 11:00:59 +0100

Hi guys, does anybody out there know where I can find a kernel for an Intel
Based Server with 4 GB of RAM?

Thanks a lot.

Corrado Mollica





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

From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: shared libs ... an idiot question
Date: Fri, 15 Dec 2000 11:30:10 +0100

Steve Houseman wrote:
> =

> are the code (or read only) bits of a shared lib, shared in ram
> between all users (of the lib)?

That's what sharing is all about, so: Yes.

> is the code part of an executable shared between all instantiations
> of that exe ?

Since it's read only and can't be modified, it would be a waste of the
resource "memory" not to do this, so: Yes.

-- =

Josef M=F6llers (Pinguinpfleger bei FSC)
        If failure had no penalty success would not be a prize (T.  Pratchett)

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

From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: Kernel supporting more than 2GB of Ram
Date: Fri, 15 Dec 2000 11:30:54 +0100

"[LsD]Tanis" wrote:
> =

> Hi guys, does anybody out there know where I can find a kernel for an I=
ntel
> Based Server with 4 GB of RAM?

Look for a kernel which includes the BIGMEM patches.
This patche enables the use of 4 GB of RAM.

-- =

Josef M=F6llers (Pinguinpfleger bei FSC)
        If failure had no penalty success would not be a prize (T.  Pratchett)

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

From: Arne Driescher <[EMAIL PROTECTED]>
Subject: Re: Allocating memory for multiple pages
Date: Fri, 15 Dec 2000 09:35:22 +0100

Hi,

your question pops up every now and than
and the asnwer is basically always the same:
There is no simple/clean way of allocating _big_
physically continuous memory areas in Linux
with an out of the box kernel. As someone posted
here there is a bigphys-patch available that
will do the trick but I haven't tried it myself.

Normaly, people requesting access to big
phys. mem areas whould like to use it for
DMA. Certainly, a continuous memory area
is very convenient for this purpose but
not really required. You can set up
the DMA transfer to use smaller memory blocks.
Please not that you can remap the small
phys. blocks into _one_ big virt. block.
This means a user space application can
access your scattered memory blocks as if it
is _one_ big memory area (using mmap()). This is the reason
why most standard device driver (e.g. SCSI)
don't need big phys. blocks (and what I have done
to solve my own driver problem).

There are a few devices where you really
need big phys. blocks. In this case your
are out of luck.

-Arne

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Problem with LVM and LILO
Date: Fri, 15 Dec 2000 12:44:31 +0100

Bruce Stephens wrote:
> 
[...]
> 
> I don't know.  Try the LVM web site, and the mailing lists there.
> Personally, I kept my root partition and /boot as ordinary partitions.
> If you have any ordinary partitions (for example, the root partition),
> you should be able to stick kernel images on one of those and use
> LILO.  Even an MSDOS partition ought to work, I think, so long as
> you're careful not to defragment the partition.

You may defragment the partition if the files are marked
with the system attribute. I don't know if you can do
that from within Linux.

I have read somewhere that ext2 automatically defragments
filesystems, how does LILO handle that?

-- 
Kasper Dupont

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

From: Marc SCHAEFER <[EMAIL PROTECTED]>
Subject: Re: Allocating memory for multiple pages
Date: 15 Dec 2000 08:19:59 GMT

Kang Mo Yang <[EMAIL PROTECTED]> wrote:
: I need to allocte a size like 4MBytes.

bigphysarea

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

From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: Problem with LVM and LILO
Date: Fri, 15 Dec 2000 13:23:39 +0100


> I have read somewhere that ext2 automatically defragments
> filesystems, how does LILO handle that?

ext2 doesn't "automaticall defragment", it is designed not to fragment
in the first place by allocating all blocks of a file within a cylinder
group, i.e. within a small range of cylinders.

LILO gets absolute disk addresses from where to load disk blocks. If you
modify the disk/filesystem structure of the partition containing the
files LILO needs (usually the filesystem containing /boot), then LILO
will load incorrect blocks and will probably make a hard landing.

-- =

Josef M=F6llers (Pinguinpfleger bei FSC)
        If failure had no penalty success would not be a prize (T.  Pratchett)

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: A faster memcpy and bzero for x86
Date: Fri, 15 Dec 2000 13:26:23 +0100

Johan Kullstam 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.
> 

The software raid detects MMX and uses MMX instructions
inside the kernel if it is faster than a compiled version.
That is for XORing datas which should be slightly more
complex than just copying. Is there a good explanation
why that should be a good idea then.

-- 
Kasper Dupont

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: log message from linuxrc script
Date: Fri, 15 Dec 2000 13:43:27 +0100

Jerome Corre wrote:
> 
> hi,
> 
> I have been playing with two step boot using an initial ramdisk,
> when my system boot an initial ramdisk is first loaded into /dev/ram0,
> then /dev/ram0 is mounted as root and the linuxrc script is executed.
> In the linuxrc script i perform several operations and then if possible
> /dev/hda1 is mounted as root, if for some reason /dev/hda1 is not
> available the linuxrc script modify /proc/sys/kernel/real-root-dev
> and /dev/ram0 is remounted as root and init start.
> 
> However I haven't been able to log message from the linuxrc script! I
> have tryed using logger, initlog but without success. Only message from
> the kernel when it boot and message coming from things which run in the
> rc.sysinit and other rc script get logged.
> what is going wrong? what else can i try?

One major problem is where the to place the log. The log file
is normally placed on root filesystem. Since the root filesystem
is not yet mounted that is obviously not possible.

What happens in a standard configuration is that messages from
the kernel is buffered until the system logger is started. When
the root filesystem has been mounted and made writeable the
logger is started and moves the buffer into whatever place is
appropriate.

If mounting the root filesystem fails you can only place log
messages on the ramdisk, which would probably not be of much
interest. If mounting the root filesystem succeds you probably
not have anything interesting to write into your log.

> 
> --
> Jerome Corre
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.

-- 
Kasper Dupont

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

From: Michael Palme <[EMAIL PROTECTED]>
Subject: >1 processes on 1 file at same time
Date: Fri, 15 Dec 2000 12:51:50 GMT

hello....

Im a rookie in kernel programming but very interested in system
details. I want to understand what appears (in 2.2 kernels) if
different processes (no father/son relation) opens the same file at the
same time. Ive read several books. There are two partys with 2
different explanations in one detail. One side says that for every
process that opens that file an entry (struct file) is made in the
global table of open files the other side says there is only one entry
in that table (like in the inode table) and all processes
filedescriptors (struct *file) that are related to the one file point
to that single entry. Ive tried to search for information in the
sources but im not good in finding such things. Please can somebody
explain to me how it is really made and what appears if 2 processes
open the same file at one time (an example would be nice). Im very
interested how the race conditions are avoided and the several request
for the file are managed.

I would be very thankful for every information i can get from you.

cheers Michael Palme


Sent via Deja.com
http://www.deja.com/

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

From: "Peter T. Breuer" <[EMAIL PROTECTED]>
Subject: Re: changing BASH's path searching
Date: Fri, 15 Dec 2000 13:50:58 +0100

Josef Moellers <[EMAIL PROTECTED]> wrote:
> "Peter T. Breuer" wrote:

>> >> updatedb takes less than 2 mins on my P450.
>> 
>> > You haven't seen what I've seen ... I'm not talking tens of gigabytes
>> > ...
>> 
>> I'm talking 5GB.

> That doesn't even reach the size of our boot disk B-{) I'm talking 50,
> maybe 500GB or more of mail files, news group articles, web pages, ...

Then I misinterpreted your remark. I took you to mean that you were
using less than 10s of gigabytes. But why are you running updatedb
over them? Run it over /usr and / partitions (or whatever) only. That's
where your system files are. It should take about 1-2 mins.

>> It WOULDN'T. That's MY business. A package has no right to add ANY
>> line to MY system without MY say-so. And when I do it, I'll reverse it,
>> if I feel like, thank you.

> That may be your approach to installing a package on a single P450 based
> box. We have customers with >100 machines. Tell them to manually keep
> track of the modifications to make. 

Thank you, but I run 100s of machines.  I certainly wouldn't ever do a
single install, and I certainly wouldn't trust some installer to modify
any config files for me.  As it happens, my machines are debian boxes,
and I do installs remotely using scheduled batch commands and dpkg with
a yes 'n' piped to its input, followed by md5sum tests and a voting
procedure on the server that decides how to correct mistakes. All
machines are tested for all files md5sums every day.

>> I don't remove packages that are needed my other packages :),
>> and if ever I accidently do, I put it back again sharpish (tcl/tk for
>> versions back to 4.0 is an example of stuff I've several times given up
>> on and removed, only to have to go and put back as I discover some
>> other misbegotten scribble that relies on 4.0).

> That's the point I'm trying to make. I don't know what your profession
> is nor do I know how many systems running Linux you manage. If it's just
> this one P450 box and if your business doesn't depend on 24/7
> availability, then you have my blessing to manually do everything you
> need to do. If, however, you have to manage 100s of servers (nice little
> pizzaboxes, 20 of these in a 19" rack, rows of these in a web server
> farm sometimes accumulating to 1000 servers), I think you might
> appreciate any help you can get from the people who wrote the software
> in installing the stuff and being back on-line without your customers
> noticing.

I do, and I don't.  In 99% of the cases, I know more than the maintainer
about it.  I use debian because the maintainer can be earwagged when he
gets it wrong, and changes can be passed back into the mainstream so I
don't have to maintain sperarate patches.

A current bugbear is that there is no easy way to tell debian to
disregard debian "official" dependencies.  It constantly tries to fix my
installations to install jdk1.1, when jdk1.2 is installed, for example.
A fix requires my own dependency maps kept locally on servers.  I
shouldn't have to do that.  The dependency info should be modificable on
the clients.

Peter

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


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