Hello Willem,
> > > We also tried -O2 and a reference to "__module_kernel_version" in our code,
> > Do I misunderstand you ? Why do you refer to this symbol. It's build/imported
> > by module.h and used by kernel module loader. Imo there is no other use on it.
> By referring to it, we had hoped that the compiler would not optimise it away. 
The optimizer.....
As I assume the optimizer for c/c++ are the same for gnu compiler - only the
language definition differs. I'm not a guru for standards, maybe the kernel
developer assumes some optimizing for their C code which is not guaranteed for
c++ (like unused symbols). This is the reason why do you have to turn on the
optimizer flag for c kernel modules. This is how can I explain the behavior to
me.

> But using -O0 for a small module would be a good solution. It would be nice
> to have a standard module for all the C++ goodies. Perhaps a special version of
> crtbegin.o could made. What is the function of crtbegin and crtend anyway, or
> where can I find information about them?
This are "pre/post" loader of the OS. In case of linux it uses the .init/.fini
section of the elf code format. These all ins the regions are executed by the
OS programm loader. Unfortunally, the is no elf binary supportt by the kernel
loader (further more there is no need for having symbols like init_module - the
loader looks for this symbol but doesn't prevent laoding if the symbol is
missed - imo funny).

> Do you have the intention to deal with the eh problem for C++ in RTLinux?
Yep 8)
This solves many problems for porting sources to kernel resp. shared source
files for user and kernel mode.

> In an assembly listing I found quite a number of support functions to
> implement (__register_exceptions, __find_first_exception_table_match,
> __unwind_function and terminate__Fv) I was surprised by the "EXCEPTION_TABLE",
> I would have expected extra link/chain in the stack for eh. 
Take the source of gcc-2.95.2/gcc/libgcc2.c and crtsuff.c Here is all
necessary stuff. At moment I try to port the eh for linux kernel /rtl.  I can
throw exceptions but can not catch! The problem is related to the crtstuff which
initializes the eh_frame. I tried to rip the related stuff in
libkc++/tester/test_mod.cc but there is a secret left. At moment I can't work
on this lib due to limited time (a have an problem with daq/rt controlling an
activ magnetic bearing and need progress for my boss as well as
I'm unsuspecting on remote communication using GoF Patterns ...). I will send
the state of libkc++ to the mailing list. Hopefully you will get the eh working.
One problem is abort(). At moment it gives onyl a message. Later it should
remove the module by it self and close all opened resources like the user mode
abort(). The problem is the module counter of other used module and that a
module doesn't is a thread, icp like signals are not working if it
isn't supportet (not for shure). Therfore test_mod.cc acts/starts like a wrapper
for the kernel interface and eh/gloabal XTors. Later maybe with a catch(...) for
uncatched exceptions (default behavior on user mode is to call abort). C++
gives a way of cleaning up resources using the destuctor, if it doesn't wrote
clean .....

Anyway I/We would be happy if you could get the eh working - it seems you have
mor experience wtih asm as me 8) Handling with ABI like elf, Asm etc. is a big
task.....

Alexander Lichius <[EMAIL PROTECTED]> and me are working on
a rtl framework for c++ and kernel with a comedi wrapper using the posix
interface and other wrapper. At this point of view it's usefull to have the
signal/slot technique in the kernel like libsigc++. libsigc++ is working in
kernel mode (without thread support due to the limited posix interface). It's
working if it doesn't throw: eh - this is the key. The other problem I'm an
electronic engineer, no computer scientist 8)

Regards
Olaf

----------------------
It seems my attachement is crahsed on the 40 k boundary mentioned by Herr
Hofrat in his last email concerning M$ (?) virus attack. Well, who is
interested in the start of libkc++ source (Please only email to rtl mailing OR
me list - else I will get it twice 7>} )

Regards
Olaf
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to