Adam Lackorzynski | 3 May 23:15
Picon
Favicon

Re: Do L4 Fiasco microkernel support multicore processor?


On Fri Apr 24, 2009 at 09:00:04 +0800, Neohtm wrote:
> > On Wed Apr 22, 2009 at 11:40:31 +0800, Neohtm wrote:
> > > I would like to know whether the Fiasco microkernel is able to run on
> > > multicore processor such as Intel Core 2 Duo or Quad Core???
> > > I want to try to compile the Fiasco + DOpE + L4Linux to run on it.
> >
> > >It will run there (albeit only use one CPU in the current version).
> 
> So, Fiasco is able to detect the multicore platform and use the first core
> (CPU0) ?

> In that case, is it possible to launch the L4Linux in another specific core
> of the processor by adding kernel command (-nosmp, -isolcpus ) in
> l4linux26.cfg?

In its current form Fiasco only supports uni-processor machines, i.e. it
will make only one CPU available and won't touch the possibly others.
Consequently applications, such as L4Linux, can only use one CPU.

Adam
--

-- 
Adam                 adam <at> os.inf.tu-dresden.de
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/
Adam Lackorzynski | 3 May 23:30
Picon
Favicon

Re: Warning from ORe stub driver

Hi,

On Mon Apr 27, 2009 at 18:08:33 +0400, Alexey Zaytsev wrote:
> Alexander Valitov wrote:
>> Hi,
>>
>>   
>>> I found the source of problem. It is GCC bug.
>>> The bug is DSE (dead storage elimination) related.
>>> The issue is valid for GCC 4.3.x, 4.4.x, 4.5.x.
>>> In 4.2.x and earlier problem does not exist.     
>>
>> I was wrong. It's not GCC bug. "GCC guys" told that problem is in l4sys
>> package.
>> Please see file:
>> /l4/pkg/l4sys/include/ARCH-x86/L4API-l4v2/ipc-l42-gcc3-nopic.h
>> here l4_ipc_send_tag() misses "memory" constraint in clobber list.
>> It definitely must have one.
>> Please fix it.
>>
>> At the same time following file contains correct l4_ipc_send_tag()
>> implementation:
>> /l4/pkg/l4sys/include/ARCH-x86/L4API-l4v2/ipc-l42-gcc3-nopic.h
>> So i guess the bug is just oversight. Anyway I think it's wise to look
>> through l4sys for similar errors.

Thanks for the fix!

>> Best Regards,
>>   Alexander Valitov
(Continue reading)

Sean | 9 May 09:29
Picon

The behavior of scheduler in L4Linux on ARM architecture

Dear

Now I am studying the scheduler design issue of DROPS including Fiasco and L4Linux.
In the reference document, "L4Linux Porting Optimizations", it said that

"   In an L4Linux system two schedulers are active. One is in the L4 kernel scheduling all L4
threads including L4Linux processes. The L4 scheduler uses static priorities and schedules
threads with the same priority round-robin.
   
    The other scheduler is in the Linux server, deciding which Linux process to run next. L4Linux
is designed in a way that from the view of the Linux server multiple user processes can be
running in the L4 system. Furthermore, the Linux scheduler can only consider those processes
that are blocked in the server. Consequently, the Linux server needs to distinguish between user
processes being served by the Linux server and the ones running."

For the behavior of the scheduler in L4Linux, I got some questions below.

  1. In L4Linux, the process/thread will map to several L4 Threads. How the scheduler in the Linux Server considers user processes in L4Linux whether to execute in L4 system ? According to the document, does L4Linux scheduler only control the user process whether block or not?

  2. Based on the L4Linux source code from currently SVN, the behavior of schedule() function (kernel/sched.c line 4546) is
    => If next != prev, call context_switch() function
    => In context_switch() function (kernel/sched.c Line 2649), it calls architecture dependent function switch_to()
    => In switch_to() function (arch/l4/include/asm/arch-arm/system.h Line 222), it calls l4x_switch_to() function and   __switch_to() function
    => In l4x_switch_to() function (arch/l4/kernel/arch-arm/dispatch.c Line 170), it logs the message to Trace Buffer of Fiasco and set l4x_current_process
    => In __switch_to() function (arch/l4/kernel/arch-arm/switch_to.S Line 5), it store the registers to CPU context of thread_info and load all regs saved previously

    Based on the source code analysis, it seems that when the L4Linux scheduler decide to do the context switch, the architecture dependent function __switch_to() will do the register restore and load. According to the document, I think the behavior here should set the corresponding thread status of prev and next user process to block or unblock these L4 threads. But here it does low level register restore and reload operations to change the current running process directly. It confuses me. Can anyone give me any ideas to address this?  

Thanks a lot!

Best Regards,
Sean



_______________________________________________
l4-hackers mailing list
l4-hackers <at> os.inf.tu-dresden.de
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
mx@sven-fuelster.com | 11 May 14:29

USB for L4

Hi,

I'm just reading Dirk Vogt's thesis about 'USB for the L4 Environment' and I'd like to check out the corresponding code.

I'm afraid it's not included in your svn-tree - is there any chance to obtain it?

Kind regards

Sven
_______________________________________________
l4-hackers mailing list
l4-hackers <at> os.inf.tu-dresden.de
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
Björn Döbel | 11 May 15:00
Picon
Favicon

Re: USB for L4

Hi,

> I'm just reading Dirk Vogt's thesis about 'USB for the L4 Environment'
> and I'd like to check out the corresponding code.
> 
> I'm afraid it's not included in your svn-tree - is there any chance to
> obtain it?

$> cd l4/pkg
$> svn up usb

should do the trick.

Cheers,
Bjoern
_______________________________________________
l4-hackers mailing list
l4-hackers <at> os.inf.tu-dresden.de
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
Adam Lackorzynski | 11 May 22:38
Picon
Favicon

Re: The behavior of scheduler in L4Linux on ARM architecture

Hi,

On Sat May 09, 2009 at 15:29:02 +0800, Sean wrote:
>    1. In L4Linux, the process/thread will map to several L4 Threads. How the
>    scheduler in the Linux Server considers user processes in L4Linux whether to
>    execute in L4 system ? According to the document, does L4Linux scheduler
>    only control the user process whether block or not?

The document is a bit out-dated regarding this area. The scheduler in
L4Linux does nothing different than the one in Linux.

>    2. Based on the L4Linux source code from currently SVN, the behavior of
>    schedule() function (kernel/sched.c line 4546) is
>    => If next != prev, call context_switch() function
>    => In context_switch() function (kernel/sched.c Line 2649), it calls
>    architecture dependent function switch_to()
>    => In switch_to() function (arch/l4/include/asm/arch-arm/system.h Line
>    222), it calls l4x_switch_to() function and   __switch_to() function
>    => In l4x_switch_to() function (arch/l4/kernel/arch-arm/dispatch.c Line
>    170), it logs the message to Trace Buffer of Fiasco and set
>    l4x_current_process
>    => In __switch_to() function (arch/l4/kernel/arch-arm/switch_to.S Line
>    5), it store the registers to CPU context of thread_info and load all regs
>    saved previously
> 
>    Based on the source code analysis, it seems that when the L4Linux
>    scheduler decide to do the context switch, the architecture dependent
>    function __switch_to() will do the register restore and load. According to
>    the document, I think the behavior here should set the corresponding thread
>    status of prev and next user process to block or unblock these L4 threads.
>    But here it does low level register restore and reload operations to change
>    the current running process directly. It confuses me. Can anyone give me any
>    ideas to address this?

switch_to switches the kernel stack and does nothing with the user state
of the process. Nowadays only one L4 thread is active at a time, i.e.
the one whose context is currently active in L4Linux. All others are
blocked until the Linux scheduler decides to switch to those contexts
and they're ready to be released.

Adam
--

-- 
Adam                 adam <at> os.inf.tu-dresden.de
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/
Gianfranco Ricci | 12 May 14:59
Picon

USB Smartcard reader unter L4Linux

Hello l4hackers!

I'm trying to set up an L4Linux environment in which a USB smartcard
reader [ReinerSCT cyberjack e-com(a) ] can be used but I'm encountering
problems.

I'm using:

L4Linux 2.6.22 with complete USB support
libusb 1.0
usbutils 0.11
Driver 3.3.2Beta3 for the smartcard reader
PCSC-lite 1.53

The problem is that the driver could not be loaded (into USB userspace).
Maybe the libusb (compiled under Linux 2.6.25) is not complete
compatible with L4Linux 2.6.22. Using Blockdevices such exernal
Harddisks is possible, so USB support in general should be okay.

Executing "lsusb" don't show ANY USB device.  Only "lsusb -t" shows a
correct result in which my cardreader is listed. Other parameter have
the same output as "lsusb".

Bus#  7

`-Dev#   1 Vendor 0x0000 Product 0x0000
Bus#  6
`-Dev#   1 Vendor 0x0000 Product 0x0000
Bus#  5
`-Dev#   1 Vendor 0x0000 Product 0x0000
Bus#  4
`-Dev#   1 Vendor 0x0000 Product 0x0000
  `-Dev#   2 Vendor 0x0c4b Product 0x0400  << my smartcard reader
Bus#  3
`-Dev#   1 Vendor 0x0000 Product 0x0000
  |-Dev#   2 Vendor 0x0a5c Product 0x2110
  `-Dev#   3 Vendor 0x0483 Product 0x2016
Bus#  2
`-Dev#   1 Vendor 0x0000 Product 0x0000
Bus#  1
`-Dev#   1 Vendor 0x0000 Product 0x0000
  `-Dev#   5 Vendor 0x04b3 Product 0x4485
    `-Dev#   6 Vendor 0x046d Product 0xc03e

Using "cat /proc/bus/usb/devices" shows ALL devices (here listed only my
smartcard reader)

T:  Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0c4b ProdID=0400 Rev= 0.01
S:  Manufacturer=Reiner-SCT
S:  Product=cyberJack e-com(a)
S:  SerialNumber=1776760900
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr= 96mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none) // Driver=usbfs under Linux after
starting pcsc!!!
E:  Ad=83(I) Atr=03(Int.) MxPS=  64 Ivl=5ms
E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms

When i try so start PCSC-Lite which should load the ReinerSCT driver the
syslog tells:

May 12 14:25:51 (none) user.info pcscd: hotplug_libhal.c:307:get_driver() Looking a driver for VID:
0x0C4B, PID: 0x0400
May 12 14:25:51 (none) user.info pcscd: hotplug_libhal.c:342:HPAddDevice() Adding USB device: usb_device_c4b_400_1776760900_if0
May 12 14:25:52 (none) user.info pcscd: readerfactory.c:1024:RFInitializeReader() Attempting
startup of REINER SCT CyberJack ecom_a (1776760900) 00 00 using /usr/lib/pcsc/drivers/ifd-cyberjack.bundle/Contents/Linux/ifd-cyberjack.so
May 12 14:25:52 (none) user.info pcscd: readerfactory.c:877:RFBindFunctions() Loading IFD Handler 3.0
May 12 14:26:10 (none) user.info pcscd: readerfactory.c:1050:RFInitializeReader() Open Port 200000
Failed (usb:0c4b/0400:libhal:/org/freedesktop/Hal/devices/usb_device_c4b_400_1776760900_if0)
May 12 14:26:10 (none) user.info pcscd: readerfactory.c:914:RFUnloadReader() Unloading reader driver.
May 12 14:26:10 (none) user.info pcscd: readerfactory.c:233:RFAddReader() REINER SCT CyberJack
ecom_a (1776760900) init failed.
May 12 14:26:10 (none) user.info pcscd: hotplug_libhal.c:397:HPAddDevice() Failed adding USB device: usb_device_c4b_400_1776760900_if0

and debug output from ReinerSCT driver:

CTAPI :[00000402]:2009/04/12 14:26:04:590976:[LOG]:ctapi.cpp:init:334:Initialised CTAPI
library (3.3.2.0/7.0.0)
CTAPI :[00000402]:2009/04/12 14:26:04:590976:[LOG]:ctapi.cpp:_init_common1:424:ctn=0, pn=0, devName=usb:0c4b/0400:libhal:/org/freedesktop/Hal/devices/usb_device_c4b_400_1776760900_if0
CTAPI :[00000402]:2009/04/12 14:26:04:650977:[LOG]:ctapi.cpp:_init_common1:605:Device path is: [usb:0c4b/0400:libhal:/org/freedesktop/Hal/devices/usb_device_c4b_400_1776760900_if0]

[trying several times (5sec)]
COMIN :[00000402]:2009/04/12 14:26:04:650977:[<USB>]:ausb.c:  308: Looking for HAL device
COMIN :[00000402]:2009/04/12 14:26:04:650977:[<USB>]:ausb.c:  383: Looking for device at 004/002
COMIN :[00000402]:2009/04/12 14:26:04:650977:[<USB>]:ausb.c:  386: Device not found

COMIN :[00000402]:2009/04/12 14:26:10:711068:[<USB>]:ausb.c:  426: Device
[usb:0c4b/0400:libhal:/org/freedesktop/Hal/devices/usb_device_c4b_400_1776760900_if0] not
found within 5 secs, giving up
COMERR:[00000402]:2009/04/12 14:26:10:711068:[<USB>]:Device not found
CTAPI :[00000402]:2009/04/12 14:26:10:711068:[LOG]:ctapi.cpp:_init_common1:711:Unable to
connect device 0
[usb:0c4b/0400:libhal:/org/freedesktop/Hal/devices/usb_device_c4b_400_1776760900_if0]: -1
CTAPI :[00000402]:2009/04/12 14:26:10:711068:[LOG]:ctapi.cpp:fini:348:Deinitializing CTAPI library
IFD   :[00000402]:2009/04/12
14:26:10:711068:[LOG]:ifdhandler.c:IFDHCreateChannelByName:243:-127=CT_init_name(0,usb:0c4b/0400:libhal:/org/freedesktop/Hal/devices/usb_device_c4b_400_1776760900_if0) 

Has anyone experience using a smartcard reader (or a usb device using
userspace driver under L4Linux) ?
Could the problem be the libusb compiled under Linux?  Has anyone an
other idea where the problem could come from?

Thanks in advance!

Gianfranco
Gianfranco Ricci | 18 May 11:20
Picon

Re: USB Smartcard reader unter L4Linux

Hi L4 Hackers,

i have solved the problem after a lot of hours by myself.

The problem is the 2.6.22-4 which neither have devFS nor udev so that
/dev/bus/usb is not populated. But the directory  is used by libusb. So
libusb were not able to communicate the the devices and the driver for
the smartcard reader could not be loaded.

I tried a "hack" and now all works fine :-), lsusb shows all devices und
the smartcard reader functions.

I just tried a ln - s /proc/bus/usb /dev/bus/usb. I know thats  some
dirty hack, if someone has an nicer solution I would be happy to hear it.

Gianfranco

Gianfranco Ricci schrieb:
> Hello l4hackers!
>
> I'm trying to set up an L4Linux environment in which a USB smartcard
> reader [ReinerSCT cyberjack e-com(a) ] can be used but I'm encountering
> problems.
>
> I'm using:
>
> L4Linux 2.6.22 with complete USB support
> libusb 1.0
> usbutils 0.11
> Driver 3.3.2Beta3 for the smartcard reader
> PCSC-lite 1.53
>
>
> The problem is that the driver could not be loaded (into USB userspace).
> Maybe the libusb (compiled under Linux 2.6.25) is not complete
> compatible with L4Linux 2.6.22. Using Blockdevices such exernal
> Harddisks is possible, so USB support in general should be okay.
>
> Executing "lsusb" don't show ANY USB device.  Only "lsusb -t" shows a
> correct result in which my cardreader is listed. Other parameter have
> the same output as "lsusb".
>
> Bus#  7
>
> `-Dev#   1 Vendor 0x0000 Product 0x0000
> Bus#  6
> `-Dev#   1 Vendor 0x0000 Product 0x0000
> Bus#  5
> `-Dev#   1 Vendor 0x0000 Product 0x0000
> Bus#  4
> `-Dev#   1 Vendor 0x0000 Product 0x0000
>   `-Dev#   2 Vendor 0x0c4b Product 0x0400  << my smartcard reader
> Bus#  3
> `-Dev#   1 Vendor 0x0000 Product 0x0000
>   |-Dev#   2 Vendor 0x0a5c Product 0x2110
>   `-Dev#   3 Vendor 0x0483 Product 0x2016
> Bus#  2
> `-Dev#   1 Vendor 0x0000 Product 0x0000
> Bus#  1
> `-Dev#   1 Vendor 0x0000 Product 0x0000
>   `-Dev#   5 Vendor 0x04b3 Product 0x4485
>     `-Dev#   6 Vendor 0x046d Product 0xc03e
>
>
> Using "cat /proc/bus/usb/devices" shows ALL devices (here listed only my
> smartcard reader)
>
> T:  Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12  MxCh= 0
> D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
> P:  Vendor=0c4b ProdID=0400 Rev= 0.01
> S:  Manufacturer=Reiner-SCT
> S:  Product=cyberJack e-com(a)
> S:  SerialNumber=1776760900
> C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr= 96mA
> I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none) // Driver=usbfs under Linux after
starting pcsc!!!
> E:  Ad=83(I) Atr=03(Int.) MxPS=  64 Ivl=5ms
> E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
> E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
>
>
> When i try so start PCSC-Lite which should load the ReinerSCT driver the
> syslog tells:
>
> May 12 14:25:51 (none) user.info pcscd: hotplug_libhal.c:307:get_driver() Looking a driver for VID:
0x0C4B, PID: 0x0400
> May 12 14:25:51 (none) user.info pcscd: hotplug_libhal.c:342:HPAddDevice() Adding USB device: usb_device_c4b_400_1776760900_if0
> May 12 14:25:52 (none) user.info pcscd: readerfactory.c:1024:RFInitializeReader() Attempting
startup of REINER SCT CyberJack ecom_a (1776760900) 00 00 using /usr/lib/pcsc/drivers/ifd-cyberjack.bundle/Contents/Linux/ifd-cyberjack.so
> May 12 14:25:52 (none) user.info pcscd: readerfactory.c:877:RFBindFunctions() Loading IFD Handler 3.0
> May 12 14:26:10 (none) user.info pcscd: readerfactory.c:1050:RFInitializeReader() Open Port 200000
Failed (usb:0c4b/0400:libhal:/org/freedesktop/Hal/devices/usb_device_c4b_400_1776760900_if0)
> May 12 14:26:10 (none) user.info pcscd: readerfactory.c:914:RFUnloadReader() Unloading reader driver.
> May 12 14:26:10 (none) user.info pcscd: readerfactory.c:233:RFAddReader() REINER SCT CyberJack
ecom_a (1776760900) init failed.
> May 12 14:26:10 (none) user.info pcscd: hotplug_libhal.c:397:HPAddDevice() Failed adding USB
device: usb_device_c4b_400_1776760900_if0
>
>
> and debug output from ReinerSCT driver:
>
> CTAPI :[00000402]:2009/04/12 14:26:04:590976:[LOG]:ctapi.cpp:init:334:Initialised CTAPI
library (3.3.2.0/7.0.0)
> CTAPI :[00000402]:2009/04/12 14:26:04:590976:[LOG]:ctapi.cpp:_init_common1:424:ctn=0, pn=0, devName=usb:0c4b/0400:libhal:/org/freedesktop/Hal/devices/usb_device_c4b_400_1776760900_if0
> CTAPI :[00000402]:2009/04/12 14:26:04:650977:[LOG]:ctapi.cpp:_init_common1:605:Device path
is: [usb:0c4b/0400:libhal:/org/freedesktop/Hal/devices/usb_device_c4b_400_1776760900_if0]
>
> [trying several times (5sec)]
> COMIN :[00000402]:2009/04/12 14:26:04:650977:[<USB>]:ausb.c:  308: Looking for HAL device
> COMIN :[00000402]:2009/04/12 14:26:04:650977:[<USB>]:ausb.c:  383: Looking for device at 004/002
> COMIN :[00000402]:2009/04/12 14:26:04:650977:[<USB>]:ausb.c:  386: Device not found
>
> COMIN :[00000402]:2009/04/12 14:26:10:711068:[<USB>]:ausb.c:  426: Device
[usb:0c4b/0400:libhal:/org/freedesktop/Hal/devices/usb_device_c4b_400_1776760900_if0] not
found within 5 secs, giving up
> COMERR:[00000402]:2009/04/12 14:26:10:711068:[<USB>]:Device not found
> CTAPI :[00000402]:2009/04/12 14:26:10:711068:[LOG]:ctapi.cpp:_init_common1:711:Unable to
connect device 0
[usb:0c4b/0400:libhal:/org/freedesktop/Hal/devices/usb_device_c4b_400_1776760900_if0]: -1
> CTAPI :[00000402]:2009/04/12 14:26:10:711068:[LOG]:ctapi.cpp:fini:348:Deinitializing CTAPI library
> IFD   :[00000402]:2009/04/12
14:26:10:711068:[LOG]:ifdhandler.c:IFDHCreateChannelByName:243:-127=CT_init_name(0,usb:0c4b/0400:libhal:/org/freedesktop/Hal/devices/usb_device_c4b_400_1776760900_if0) 
>
>
>
> Has anyone experience using a smartcard reader (or a usb device using
> userspace driver under L4Linux) ?
> Could the problem be the libusb compiled under Linux?  Has anyone an
> other idea where the problem could come from?
>
>
> Thanks in advance!
>
> Gianfranco
>
>
>
>
>
>
> _______________________________________________
> l4-hackers mailing list
> l4-hackers <at> os.inf.tu-dresden.de
> http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
>   
fang zhengshu | 19 May 09:55
Picon

Re: time problem

these days I try to use another way to test the time used by the operation:
I use l4_rdtsc() function,but after I using it as following:

#include <l4/util/rdtsc.h>
...
...
l4_cpu_time_t tsc1,tsc2;
l4_uint32_t args;
...
...
tsc1 = l4_rdtsc();
...
/*operations*/
...
tsc2 = l4_rdtsc();
args = l4_tsc_to_us(tsc2 - tsc1);
printf("start_tsc = %ld\n end_tsc = %ld\n us_time = %u",tsc1,tsc2,args);

why can't I test the time?
for example,one result is:
tsc1 = -2036300143
tsc2 = 1
us_time = 3129796927

thank you!





2009/4/6 fang zhengshu <fangzhsh07 <at> gmail.com>
hi all,
I write a simple test example about time function.but when I use the "time()" function,the code can not be compiled correctly.
I just have include the <time.h>,any question?
the error I put following:
l4 <at> 192:~/tudos/l4/pkg/test_fifo/examples/client$ make
PWD=/home/l4/tudos/build/pkg/test_fifo/examples/client/OBJ-x86_586-l4v2 make  -C /home/l4/tudos/build/pkg/test_fifo/examples/client/OBJ-x86_586-l4v2 -f Makefile
make[1]: Entering directory `/home/l4/tudos/build/pkg/test_fifo/examples/client/OBJ-x86_586-l4v2'
  ... Compiling main.o
  LD_PRELOAD=/home/l4/tudos/build/tool/gendep/libgendep.so GENDEP_TARGET=main.o GENDEP_BINARY=cc1   gcc -m32 -c     -DUSE_UCLIBC=y -DRAM_BASE=0x0    -DSYSTEM_x86_586_l4v2 -DARCH_x86 -DCPUTYPE_586 -DL4API_l4v2 -DCONFIG_L4_CALL_SYSCALLS -DCONFIG_L4_ABS_SYSCALLS  -I/home/l4/tudos/build/pkg/test_fifo/idl/OBJ-x86-l4v2 -I/home/l4/tudos/build/include/x86/l4v2 -I/home/l4/tudos/build/include/l4v2 -I/home/l4/tudos/build/include/x86 -I/home/l4/tudos/build/include -I/home/l4/tudos/l4/../dice/include -I/home/drops/include/x86/l4v2 -I/home/drops/include/l4v2 -I/home/drops/include/x86 -I/home/drops/include -nostdinc -I/home/l4/tudos/build/include/x86/uclibc -I/home/l4/tudos/build/include/uclibc -I/home/l4/tudos/build/include/uclibc++ -I/home/drops/include/x86/uclibc -I/home/drops/include/uclibc -I/home/drops/include/uclibc++ -I/usr/lib/gcc/i486-linux-gnu/4.2.4/include -I/usr/lib/gcc/i486-linux-gnu/4.2.4/include-fixed -gstabs+      -g -O2 -fno-strict-aliasing  -march=i586 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations  -fno-common -fno-stack-protector /home/l4/tudos/l4/pkg/test_fifo/examples/client/main.c -o main.o
    ==> Linking test_fifo-client
    LD_PRELOAD=/home/l4/tudos/build/tool/gendep/libgendep.so GENDEP_TARGET=test_fifo-client GENDEP_BINARY=ld  GENDEP_BINARY_ALT1=ld ld -m elf_i386 -o test_fifo-client /home/l4/tudos/build/lib/x86_586/crt0.o main.o test-client.o -Ttext=0x1100000 --hash-style=sysv  -L/home/l4/tudos/build/lib/x86_586/l4v2 -L/home/l4/tudos/build/lib/x86_586 -L/home/l4/tudos/build/lib -L/home/drops/lib/x86_586/l4v2 -L/home/drops/lib/x86_586 -L/home/drops/lib  -T/home/l4/tudos/build/lib/x86_586/main_stat.ld   -static -lgeneric_ts -ll4env -ll4rm -ldm_generic -ldm_mem -lthread -lsemaphore -llogserver_capsule -lnames -ll4util_root -ll4util -lsigma0 -lroot -ll4env -ll4env_err -ll4rm -ldm_generic -ldm_mem -lthread -lslab -ll4sys -nostdlib  -luc_c -luclibc_support -u mmap_anon -lc_be_simple_mem -lc_be_mmap -lc_be_mmap_util -lc_be_l4env_start_stop -lc_be_minimal_log_io -luc_be_simple_sleep -ll4env -llogserver_capsule -ll4rm -ldm_generic -ldm_mem -lthread -lgeneric_ts -luc_c /usr/lib/gcc/i486-linux-gnu/4.2.4/libgcc.a -luc_c -ll4sys -Ttext=0x1100000 --warn-common -gc-sections
    main.o: In function `main':
    /home/l4/tudos/l4/pkg/test_fifo/examples/client/main.c:36: undefined reference to `time'
    /home/l4/tudos/l4/pkg/test_fifo/examples/client/main.c:40: undefined reference to `time'
    /home/l4/tudos/l4/pkg/test_fifo/examples/client/main.c:36: undefined reference to `time'
    make[1]: *** [test_fifo-client] Error 1
    make[1]: Leaving directory `/home/l4/tudos/build/pkg/test_fifo/examples/client/OBJ-x86_586-l4v2'
    make: *** [/home/l4/tudos/build/pkg/test_fifo/examples/client/OBJ-x86_586-l4v2] Error 2


I have search the same error in l4-hackers ,someone suggest use rtc server,I think it's a good idea.but I have found that the time() function  in time.h,why the error will happen?
The reason I just include time.h?

Thank you!

--
fang,




--
fang,
_______________________________________________
l4-hackers mailing list
l4-hackers <at> os.inf.tu-dresden.de
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
Michael Roitzsch | 19 May 11:05
Picon
Favicon

Re: time problem

Hi,

> these days I try to use another way to test the time used by the  
> operation:
> I use l4_rdtsc() function,but after I using it as following:
>
> #include <l4/util/rdtsc.h>
> ...
> ...
> l4_cpu_time_t tsc1,tsc2;
> l4_uint32_t args;
> ...
> ...
> tsc1 = l4_rdtsc();
> ...
> /*operations*/
> ...
> tsc2 = l4_rdtsc();
> args = l4_tsc_to_us(tsc2 - tsc1);
> printf("start_tsc = %ld\n end_tsc = %ld\n us_time =  
> %u",tsc1,tsc2,args);
>
> why can't I test the time?
> for example,one result is:
> tsc1 = -2036300143
> tsc2 = 1
> us_time = 3129796927

There's two things at work here: First, you have to call  
l4_calibrate_tsc() once before using the conversion functions from tsc  
to wallclock time like l4_tsc_to_us(). Second, l4_cpu_time_t is 64 Bit  
wide, so you cannot printf it with %ld as the format string. You  
should use %lld there.

Michael

Gmane