Linux-Development-Sys Digest #425, Volume #8 Wed, 17 Jan 01 10:13:11 EST
Contents:
Re: newbie question: mapping heap to shared memory (Kasper Dupont)
Re: 2.4.0 ISDN Problems (Holger Eitzenberger)
New protocol ("hebre")
Re: How to get CPU & Memory status in kernel? (Kasper Dupont)
Re: New protocol (Kasper Dupont)
Re: GetTickCount() in Linux? ("Slawek Grajewski")
Block device driver for flash ("Slawek Grajewski")
Re: make bzImage fails (Hauser Sepp)
Re: su cannot run /bin/bash? was: 2.2.18 won't boot diskless (Ulrich Hahn)
Re: realloc crashes with SIGSEGV ([EMAIL PROTECTED])
modify /proc/sys/net/core/wmem_max from a kernel module (Jerome Tollet)
Re: New protocol ("hebre")
Re: Emacs window size. ("Slawek Grajewski")
Re: Emacs window size. ("Slawek Grajewski")
Re: Simple way to display an animation? (Michael Wimmer)
Re: how to turn on/off the 3 LEDs on the keyboard? (Simon)
depmod making dependecies of wrong modules dir ([EMAIL PROTECTED])
Re: Emacs window size. (Thaddeus L Olczyk)
----------------------------------------------------------------------------
From: Kasper Dupont <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: newbie question: mapping heap to shared memory
Date: Wed, 17 Jan 2001 09:10:34 +0000
adwait wrote:
>
> Kasper,
> I want to create a single data structure in shared memory and use it from
> number of processes using semaphores and appropriate access privileges. I
> should be able to dynamically cast the heap in different processes and then
> use it. I can rephrase my question as follows;
>
> I need to know a way where by I can create a data structure in shared memory
> i.e. when I say new to create an object I should be able to create the object
> with staring address of shared memory.
>
> Please help....
>
> Adwait
I can think of two ways to do this either by using a shared
memory segment or a shared memory mapped file.
The shared memory segment can be allocated using shmget,
mapped using shmat, and deleted using shmctl.
The file is created using open or creat, mapped using mmap,
resized using truncate, and deleted using unlink.
Which solution you should use depends on the lifetime of
the datastructure. If the datastructure should exist even
at times when no program is using it I suggest files, if
the datastructure should be deleted when the last process
stops using it you can use a shared memory segment.
You cannot expect to map the structure at same address in
all processes, so shared memory should never contain
pointers. Instead of pointers write offset in bytes from
start of shared memory.
You might have to write some routines to handle allocation
and deallocation of shared memory. For example you could
implement two routines:
int shared_malloc(size_t size);
void shared_free(int ptr);
I don't know about synchronisation, but I would expect
file locks using fcntl would work for the file solution.
I don't know if you can allocate C++ objects in the shared
memory, but I can point out lots of potential problems.
Imagine the problem when an object created by one
executable is at a later mapped by another executable. The
executables could be two different programs or just two
different versions of the same program. The objects class
might not exist in the other executable, or if it exists
the methods could have changed or just be located at
another address in the executable.
--
Kasper Dupont
------------------------------
From: [EMAIL PROTECTED] (Holger Eitzenberger)
Subject: Re: 2.4.0 ISDN Problems
Date: Wed, 17 Jan 2001 10:08:55 +0100
In article <941i0b$6hd$[EMAIL PROTECTED]>, Morten B�hmer wrote:
>I'm experiencing problems with the 2.4 release of the linux kernel. After
>compiling my kernel configuration, and recompiling the other packages
>(isdn4kutils etc.). When I connect one isdn line i works ok, but when i
>disconnect the machine freezes!!!
>
>Does anyone have a solution to this problem?
Did you read ./linux/Documentation/Changes for the things you need to
update? I am running 2.4.0 with recompiled isdnutils 3.0 and all works
fine here but i had to update several things (like modutils, e2fsprogs,
...).
Regards.
Holger
--
+++ Debian GNU/Linux <[EMAIL PROTECTED]> +++ ICQ: 2882018 +++
++ GnuPG public key -> http://www.t-online.de/~eitzenberger ++
------------------------------
From: "hebre" <[EMAIL PROTECTED]>
Subject: New protocol
Date: Wed, 17 Jan 2001 12:09:11 +0300
Does anybody know how write some protocol to use it with Sockets.
I want to use SSL with standard Sockets API. This protocol sould be over
TCP/IP.
If You'll put here some links, I'll happy.
Thanks.
------------------------------
From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: How to get CPU & Memory status in kernel?
Date: Wed, 17 Jan 2001 09:24:31 +0000
Chien-Hwa Hwang wrote:
>
> Hi,
>
> I have a question. Does anybody know that how to get CPU usage and
> Memory status in linux kernel. I just trace source code of kernel, and found
> out it call si_meminfo() to get these. But it seems call assembly code to do
> works at bottom layer. So I want to know how do kernel achieve this. Thanks.
>
> Jack.
Some of this code has to be specific to the given architecture.
si_meminfo is implemented for a large number of architectures,
so code using it will be portable. Therefore code should not
start going into the internals of si_meminfo, because that
would not be portable.
The kernel has some architecture specific code to detect size
of physical memory and to setup page tables. The algorithms
used to manage memory and to compute amount of used memory and
CPU time I think is the same across architectures.
The way memorysize is detected on i386 is simply by looking
what the BIOS found. This can be overrided by an option to the
kernel.
--
Kasper Dupont
------------------------------
From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: New protocol
Date: Wed, 17 Jan 2001 09:33:56 +0000
hebre wrote:
>
> Does anybody know how write some protocol to use it with Sockets.
> I want to use SSL with standard Sockets API. This protocol sould be over
> TCP/IP.
>
> If You'll put here some links, I'll happy.
>
> Thanks.
First of all a protocol build on top if TCP/IP
is best implemented in user space. That is either
in program or shared library.
You can probably find a library implementing SSL,
if you can it will save you lots of work.
The following man pages contains relevant
information:
socket(2), accept(2), bind(2), connect(2),
gethostbyname(3)
If you want to implement SSL you will also have
to find documentation on that protocol.
If you want I can post some code examples using
sockets. And perhaps also a reference for
documentation on the SSL protocol.
--
Kasper Dupont
------------------------------
From: "Slawek Grajewski" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: GetTickCount() in Linux?
Date: Wed, 17 Jan 2001 11:03:34 +0100
Maybe times() libc call is what you need?
"Marc SCHAEFER" <[EMAIL PROTECTED]> wrote in message
news:93bsp1$eoo$[EMAIL PROTECTED]...
> In comp.os.linux.development.system Nils M. Lunde <[EMAIL PROTECTED]>
wrote:
> : I need to know the time used by a certain part of a program.
> : In MS Windows I use the GetTickCount() function.
> : This function does not tend to exist in Linux, so I wonder what I should
> : do!?
------------------------------
From: "Slawek Grajewski" <[EMAIL PROTECTED]>
Subject: Block device driver for flash
Date: Wed, 17 Jan 2001 11:10:02 +0100
Hi,
I'm looking for a linux block device driver for flash memory (model not
important). Is anyone aware of such driver?
Thanks,
Slawek
------------------------------
From: Hauser Sepp <[EMAIL PROTECTED]>
Crossposted-To:
alt.os.linux.redhat,comp.os.linux.questions,linux.dev.c-programming,linux.dev.config,linux.dev.kernel,linux.redhat,linux.redhat.development,linux.redhat.devel,linux.sources.kernel
Subject: Re: make bzImage fails
Date: Tue, 16 Jan 2001 20:10:52 +0100
Hi Michael,
I had the same Problem with Kernel 2.4.0. I included a "#define smp_num_cpus
1" in /usr/src/linux/include/linux/kernel_stat.h. It works.
Sepp
Michael Makuch wrote:
> I just did a clean install of Red Hat 7.0, went to /usr/src/linux-2.2.16
> and did a 'make bzImage' and I get the following errors:
>
> $ make bzImage
> kgcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2
> -fomit-frame-pointer -fno-strict-aliasing -pipe -fno-strength-reduce
> -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=686 -c
> -o init/main.o init/main.ckgcc -D__KERNEL__ -I/usr/src/linux/include
> -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing
> -pipe -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2
> -malign-functions=2 -DCPU=686 -DUTS_MACHINE='"i386"' -c -o
> init/version.o init/version.c
> make -C kernel
> make[1]: Entering directory `/usr/src/linux-2.2.16/kernel'
> make all_targets
> make[2]: Entering directory `/usr/src/linux-2.2.16/kernel'
> kgcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2
> -fomit-frame-pointer -fno-strict-aliasing -pipe -fno-strength-reduce
> -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=686
> -DEXPORT_SYMTAB -c ksyms.c
> In file included from /usr/src/linux/include/linux/modversions.h:51,
> from /usr/src/linux/include/linux/module.h:19,
> from ksyms.c:14:
> /usr/src/linux/include/linux/modules/i386_ksyms.ver:6: warning:
> `cpu_data' redefined
> /usr/src/linux/include/asm/processor.h:96: warning: this is the location
> of the previous definition
> /usr/src/linux/include/linux/modules/i386_ksyms.ver:28: warning:
> `smp_num_cpus' redefined
> /usr/src/linux/include/linux/smp.h:77: warning: this is the location of
> the previous definition
> /usr/src/linux/include/linux/modules/i386_ksyms.ver:118: warning:
> `smp_call_function' redefined
> /usr/src/linux/include/linux/smp.h:83: warning: this is the location of
> the previous definition
> In file included from /usr/src/linux/include/linux/interrupt.h:51,
> from ksyms.c:21:
> /usr/src/linux/include/asm/hardirq.h:23: warning: `synchronize_irq'
> redefined
> /usr/src/linux/include/linux/modules/i386_ksyms.ver:138: warning: this
> is the location of the previous definition
> In file included from /usr/src/linux/include/linux/interrupt.h:52,
> from ksyms.c:21:
> /usr/src/linux/include/asm/softirq.h:75: warning: `synchronize_bh'
> redefined
> /usr/src/linux/include/linux/modules/i386_ksyms.ver:142: warning: this
> is the location of the previous definition
> /usr/src/linux/include/linux/kernel_stat.h: In function `kstat_irqs':
> In file included from ksyms.c:17:
> /usr/src/linux/include/linux/kernel_stat.h:47: `smp_num_cpus' undeclared
> (first use in this function)
> /usr/src/linux/include/linux/kernel_stat.h:47: (Each undeclared
> identifier is reported only once
> /usr/src/linux/include/linux/kernel_stat.h:47: for each function it
> appears in.)make[2]: *** [ksyms.o] Error 1
> make[2]: Leaving directory `/usr/src/linux-2.2.16/kernel'
> make[1]: *** [first_rule] Error 2
> make[1]: Leaving directory `/usr/src/linux-2.2.16/kernel'
> make: *** [_dir_kernel] Error 2
>
> I've attached the .config as distributed from RedHat.
>
> Why doesn't this build?
>
> Thanks,
>
> [EMAIL PROTECTED]
>
------------------------------
From: Ulrich Hahn <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.networking
Subject: Re: su cannot run /bin/bash? was: 2.2.18 won't boot diskless
Date: Wed, 17 Jan 2001 12:04:01 +0100
Reply-To: [EMAIL PROTECTED]
Russ Bixby wrote:
>
> Um... have you checked the pernmissions on the mounted filesystem and
> on bash...? Also, have you checked the /etc/shells database?
hmm - of course. But I dont think this is it. I even mounted the home
directories no_root_squash,
but this cannot stay - no result either. You may not log (except as root) in
even if you homedir is / .
server's /etc/exports snippet:
/usr (ro)
/tftpboot/129.10.3.121 129.10.3.121(rw,no_root_squash)
(.. several lines)
# ll /etc/shells
-rw-r--r-- 7 root root 55 Aug 28 1998 /etc/shells
# cat /etc/shells
/bin/bash
/bin/sh
/bin/ash
/bin/bsh
/bin/tcsh
/bin/csh
--
kind regards
-ulrich-
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: realloc crashes with SIGSEGV
Date: Wed, 17 Jan 2001 10:59:47 GMT
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] wrote:
> On Thu, 11 Jan 2001 16:05:55 +0000, Kasper Dupont
<[EMAIL PROTECTED]> wrote:
> >When malloc, realloc or free causes a SIGSEGV
> >it is in most cases because you have written
> >outside an allocated address range and overwritten
> >some of the memory managements datastructures.
>
> And in some cases it is because an indeterminate pointer value was
> freed or realloc'ed (such as a pointer to an object that has already
> been freed, or to one which did not come from the allocator).
Brilliant! I tried out dmalloc and it showed that in certain
circumstances a pointer was being freed TWICE.
Now fixed. Thanks for your help.
Colin
Sent via Deja.com
http://www.deja.com/
------------------------------
From: Jerome Tollet <[EMAIL PROTECTED]>
Subject: modify /proc/sys/net/core/wmem_max from a kernel module
Date: Wed, 17 Jan 2001 12:28:17 +0100
Hello,
I wourld like to modify "sysctl_wmem_max" and the "sysctl_wmem_default"
(sock.c) from a kernel module.
My problem is that those variables are not exported so i can modify them
from a module.
I tryied to modify them through root_table / net_table / core_table
(ctl_table) but the root_table is also not exported.
How can i do that from the kernel ?
Thanks a lot for helpers
Jerome Tollet
--
========================
Jerome Tollet
[EMAIL PROTECTED]
www.qosmos.net
========================
------------------------------
From: "hebre" <[EMAIL PROTECTED]>
Subject: Re: New protocol
Date: Wed, 17 Jan 2001 14:39:45 +0300
> hebre wrote:
> >
> > Does anybody know how write some protocol to use it with Sockets.
> > I want to use SSL with standard Sockets API. This protocol sould be over
> > TCP/IP.
> >
> > If You'll put here some links, I'll happy.
> >
> > Thanks.
>
> First of all a protocol build on top if TCP/IP
> is best implemented in user space. That is either
> in program or shared library.
I know, but it's a technical requirements to make it transparent. :(
>
> You can probably find a library implementing SSL,
> if you can it will save you lots of work.
>
> The following man pages contains relevant
> information:
>
> socket(2), accept(2), bind(2), connect(2),
> gethostbyname(3)
>
> If you want to implement SSL you will also have
> to find documentation on that protocol.
>
> If you want I can post some code examples using
> sockets. And perhaps also a reference for
> documentation on the SSL protocol.
>
No, thanks. I have OpenSSL sources. And it is not a big problem to write my
own SSL code . I want make SSL using as flexible as possible. External
libraries is not well. As I see, only new protocol layer over TCP/IP is a
good implementation.
But I have no documentation which describes creating such layer. It is not
concerned to SSL directly. It's an abstract question: How do write some
protocol, whch will be over TCP/IP and should be used via Sockets API?
> --
> Kasper Dupont
Paul Tanaskov.
------------------------------
From: "Slawek Grajewski" <[EMAIL PROTECTED]>
Subject: Re: Emacs window size.
Date: Wed, 17 Jan 2001 11:23:43 +0100
Try putting emacs.geometry: 80x50 (or something more suitable) into
.Xdefaults file in your home directory.
Slawek
"Thaddeus L Olczyk" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> I've asked this question to no avail on the emacs newsgroup.
> From an emacs standpoint I seem to be doing everything
> right, so it must be a linux problem.
> From linux, when I open emacs or create a new frame, I am disatisified
> with the size of the window.
> I've create both a default-frame-alist and initial-frame-alist,
> configured them accordingly with (height . x) (width . y) and
> no matter what the windows come up the same size.
> I don't have this problem with Windows. I figure there must be
> something strange about linux, or gnome ( version 1.2.1 ). ANy ideas?
> TIA
>
>
------------------------------
From: "Slawek Grajewski" <[EMAIL PROTECTED]>
Subject: Re: Emacs window size.
Date: Wed, 17 Jan 2001 11:24:08 +0100
Try putting emacs.geometry: 80x50 (or something more suitable) into
.Xdefaults file in your home directory.
Slawek
"Thaddeus L Olczyk" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> I've asked this question to no avail on the emacs newsgroup.
> From an emacs standpoint I seem to be doing everything
> right, so it must be a linux problem.
> From linux, when I open emacs or create a new frame, I am disatisified
> with the size of the window.
> I've create both a default-frame-alist and initial-frame-alist,
> configured them accordingly with (height . x) (width . y) and
> no matter what the windows come up the same size.
> I don't have this problem with Windows. I figure there must be
> something strange about linux, or gnome ( version 1.2.1 ). ANy ideas?
> TIA
>
>
------------------------------
From: Michael Wimmer <[EMAIL PROTECTED]>
Subject: Re: Simple way to display an animation?
Date: Wed, 17 Jan 2001 14:07:11 +0100
Kasper Dupont wrote:
>
--snip
> I have attached some code I once wrote, which more or
> less does the same as you requested. I think you might be
> able to use parts of it.
>
> --
> Kasper Dupont
Thank you! I�ll have a close look at it.
------------------------------
From: Simon <[EMAIL PROTECTED]>
Subject: Re: how to turn on/off the 3 LEDs on the keyboard?
Date: Wed, 17 Jan 2001 21:54:49 +0800
Kasper Dupont wrote:
> Hackker Wong wrote:
> >
> > hi,
> >
> > do u know how to turn on/off the 3 LEDs (caps lock, num lock, scroll
> > lock) on the keyboard? i want to control the LEDs in my program. is
> > there any system call to do this? i found a function register_led() in
> > /usr/src/linux/drivers/char/keyboard.c, but i don't know how to use it.
> >
> > pls help! thx a lot!
> >
> > --
> > - By Hackker
> > ****************************************************
> > Mr. Hackker Wong,
> > Y99 Student of Computer Science,
> > The Chinese University of Hong Kong.
> > ****************************************************
> > -The World can't run without computer technicians-
>
> On the virtual terminals you can use some ioctl's
> KDGKBLED, KDSKBLED, KDGETLED, KDSETLED.
>
> If your program runs under X you will have to do
> something else.
>
> What do you want to do, change only the light in the
> leds or change also the function of the keyboard?
>
> --
> Kasper Dupont
I think he is mentioning about which system calls can be implemented to turn
on/off keyboard LEDs, since this can be done in the kernel level.
------------------------------
From: [EMAIL PROTECTED]
Subject: depmod making dependecies of wrong modules dir
Date: Wed, 17 Jan 2001 13:55:44 GMT
Hi,
I'm facing a small problem on my linux box (Running SuSE6.4) upgrading
from 2.2.14 to the new 2.4.0 kernel. The problem is that when I install
the new kernel, depmod creates the dependencie file modules.dep (in
/lib/modules/2.4.0 upon the old modules directory, saying ->
*** Unresolved symbols in /lib/modules/2.2.14/xx/yyyy.o
I can not figure out how depmod selects the 2.2.14 directory to check
the dependencies.
Anyone any idea ?
Eric
Sent via Deja.com
http://www.deja.com/
------------------------------
From: [EMAIL PROTECTED] (Thaddeus L Olczyk)
Subject: Re: Emacs window size.
Date: Wed, 17 Jan 2001 14:58:19 GMT
Reply-To: [EMAIL PROTECTED]
On Wed, 17 Jan 2001 11:23:43 +0100, "Slawek Grajewski"
<[EMAIL PROTECTED]> wrote:
>Try putting emacs.geometry: 80x50 (or something more suitable) into
>.Xdefaults file in your home directory.
>Slawek
>
>"Thaddeus L Olczyk" <[EMAIL PROTECTED]> wrote in message
>news:[EMAIL PROTECTED]...
>> I've asked this question to no avail on the emacs newsgroup.
>> From an emacs standpoint I seem to be doing everything
>> right, so it must be a linux problem.
>> From linux, when I open emacs or create a new frame, I am disatisified
>> with the size of the window.
>> I've create both a default-frame-alist and initial-frame-alist,
>> configured them accordingly with (height . x) (width . y) and
>> no matter what the windows come up the same size.
>> I don't have this problem with Windows. I figure there must be
>> something strange about linux, or gnome ( version 1.2.1 ). ANy ideas?
>> TIA
>>
>>
>
Doesn't even look like emacs cares.
------------------------------
** 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
******************************