fang zhengshu | 6 Jul 03:51
Picon

Re: l4-hackers Digest, Vol 72, Issue 8

hi all,

when I write a function in the IDL file, there is a problem:want to write a different-length string to a array like:

interface test{
        int write([string]char* str, int len);
        int read([out,prealloc_client, size_is(size), prealloc_server]char str[], int size);
       };

I have defined a fixed size array in the server like array[256].
In the write() function I write a different length string to the array, then I want to read parts or all of the array in the read() function, the process will be like the following:

string[len]                               str[size]
        |                                        ^
        |                                         |
        --------->array[256] -----------|


but when I put the function above and compile it, there are some error happen. I have change the size_is() with length_is() or max_is(), but there still error when I compile it. I know if I define a fix array str[256] the code can be work, but I just want to use a unfixed length array to get the string.
could someone please give me some advice?if I describe the problem clearly, please let me know.

thank you!


--
fang,
_______________________________________________
l4-hackers mailing list
l4-hackers <at> os.inf.tu-dresden.de
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
Bjoern Doebel | 7 Jul 14:57
Picon
Favicon

Re: l4-hackers Digest, Vol 72, Issue 8

Hello,

> 
> but when I put the function above and compile it, there are some error
> happen. 

Which error is this exactly?

Bjoern
_______________________________________________
l4-hackers mailing list
l4-hackers <at> os.inf.tu-dresden.de
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
fang zhengshu | 8 Jul 12:15
Picon

Re: l4-hackers Digest, Vol 72, Issue 8



2009/7/6 fang zhengshu <fangzhsh07 <at> gmail.com>
hi all,
when I write a function in the IDL file, there is a problem:want to write a different-length string to a array and then read  parts of the array to another string like:

interface test{
        int write([string]char* str, int len);
        int read([out,prealloc_client, size_is(size), prealloc_server]char str[], int size);
       };

I have defined a fixed size array in the server like array[256].
In the write() function I write a different length string to the array, then I want to read parts or all of the array in the read() function, the process will be like the following:

string[len]                               str[size]
        |                                        ^
        |                                         |
        --------->array[256] -----------|


but when I put the function above and compile it, there are some error happen. I have change the size_is() with length_is() or max_is(), but there still error when I compile it. I know if I define a fix array str[256] the code can be work, but I just want to use a unfixed length array to get the string.
could someone please give me some advice?if I describe the problem clearly, please let me know.

thank you!

I don't know whether  I describe what I want to do clearly,so I put the simple code below:

read-client                                                                                 write-client
#define STR_TO 30                                                                  #define STR_FROM 30
...                                                                                              ...
char str_to[SRR_TO];                                                               char str_from[STR_FROM];
...                                                                                              ...
read(str_to, STR_TO);                                                              write(str_from, STR_FROM);
...                                                                                               ...

                                                      server
                                                     #define SIZE 256
                                                     ...
                                                    char string[SIZE];
                                                    ...
                                                    int write(char *str_from, int str_from)
                                                   {
                 //write str_from size chars of str_from array to the string array which is in server
                                                   }
                                                   int read(char *str_to, int str_to)
                                                  {
                //read str_to size chars from the string array which is in server to str_to
                                                   }

Then I define write functions as the above in a .idl file,but when I compile it,there will be the following error:
terminate called after throwing an instance of 'std::out_of_range'
  what():  CBEMsgBuffer::IsEarlier
make[1]: *** [test-server.c] Aborted
make[1]: *** [test-server.c] Deleting file `test-sys.h'
make[1]: *** [test-server.c] Deleting file `test-client.h'
make[1]: *** [test-server.c] Deleting file `test-client.c'
make: *** [/home/l4/tudos/build/pkg/
fifo/idl/OBJ-x86-l4v2] Error 2

must we use the format as the dice manual below?:
int read([out, prealloc_client, size_is(len)] char **str, [out,in]int *len)
and when I modify the function as
int read([out, prealloc_client, prealloc_server, size_is(len)] char *str, [out,in]int *len)
there is no error when compile it,but there will be another error called :fpage
could you give me some advice for the read function?
thank you.
--
fang,
_______________________________________________
l4-hackers mailing list
l4-hackers <at> os.inf.tu-dresden.de
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
fang zhengshu | 10 Jul 04:13
Picon

read string from server array error!



2009/7/8 fang zhengshu <fangzhsh07 <at> gmail.com>


2009/7/6 fang zhengshu <fangzhsh07 <at> gmail.com>
hi all,
when I write a function in the IDL file, there is a problem:want to write a different-length string to a array and then read  parts of the array to another string like:

interface test{
        int write([string]char* str, int len);
        int read([out,prealloc_client, size_is(size), prealloc_server]char str[], int size);
       };
I modify the idl file as the following:
          int write([in,string]char *str, int len)
          int read([out, prealloc_client]char *str, int len)
there no error when compile it,but

I have defined a fixed size array in the server like array[256].
In the write() function I write a different length string to the array, then I want to read parts or all of the array in the read() function, the process will be like the following:

string[len]                               str[size]
        |                                        ^
        |                                         |
        --------->array[256] -----------|


but when I put the function above and compile it, there are some error happen. I have change the size_is() with length_is() or max_is(), but there still error when I compile it. I know if I define a fix array str[256] the code can be work, but I just want to use a unfixed length array to get the string.
could someone please give me some advice?if I describe the problem clearly, please let me know.

thank you!

I don't know whether  I describe what I want to do clearly,so I put the simple code below:

read-client                                                                                 write-client
#define STR_TO 30                                                                  #define STR_FROM 30
...                                                                                              ...
char str_to[SRR_TO];                                                               char str_from[STR_FROM];
...                                                                                              ...
read(str_to, STR_TO);                                                              write(str_from, STR_FROM);
...                                                                                               ...

                                                      server
                                                     #define SIZE 256
                                                     ...
                                                    char string[SIZE];
                                                    ...
                                                    int write(char *str_from, int str_from)
                                                   {
                 //write str_from size chars of str_from array to the string array which is in server
                                                   }
                                                   int read(char *str_to, int str_to)
                                                  {
                //read str_to size chars from the string array which is in server to str_to
                                                   }

Then I define write functions as the above in a .idl file,but when I compile it,there will be the following error:
terminate called after throwing an instance of 'std::out_of_range'
  what():  CBEMsgBuffer::IsEarlier
make[1]: *** [test-server.c] Aborted
make[1]: *** [test-server.c] Deleting file `test-sys.h'
make[1]: *** [test-server.c] Deleting file `test-client.h'
make[1]: *** [test-server.c] Deleting file `test-client.c'
make: *** [/home/l4/tudos/build/pkg/
fifo/idl/OBJ-x86-l4v2] Error 2

must we use the format as the dice manual below?:
int read([out, prealloc_client, size_is(len)] char **str, [out,in]int *len)
and when I modify the function as
int read([out, prealloc_client, prealloc_server, size_is(len)] char *str, [out,in]int *len)
there is no error when compile it,but there will be another error called :fpage
could you give me some advice for the read function?
thank you.
--
fang,
when I run the test in qemu, the error come out:
   fifo    | L4RM: [PF] read at 0x00002000, ip 01800aa1, src B.02
   fifo    | [B.0] l4rm/lib/src/pagefault.c:81:__unknown_pf():
   fifo    |  unhandled page fault

the execute code of fifo binary is :
...
/home/l4/tudos/build/pkg/fifo/idl/OBJ-x86-l4v2/fifo-server.c:259
            l4_msgdope_t _dice_size_dope;
            l4_msgdope_t _dice_send_dope;
            l4_umword_t _word[2];
        } _word;
    } fifo_fifo_read_msg_buffer_t;
    l4_umword_t _dice_str_size = (str) ? (_dice_strlen(str)+1) : 0;
 1800a8b:    85 db                    test   %ebx,%ebx
 1800a8d:    0f 84 f9 00 00 00        je     1800b8c <fifo_dispatch+0x21c>
 1800a93:    80 3b 00                 cmpb   $0x0,(%ebx)
 1800a96:    0f 84 11 01 00 00        je     1800bad <fifo_dispatch+0x23d>
 1800a9c:    31 c0                    xor    %eax,%eax
 1800a9e:    66 90                    xchg   %ax,%ax
 1800aa0:    40                       inc    %eax
 1800aa1:    80 3c 18 00              cmpb   $0x0,(%eax,%ebx,1)
 1800aa5:    75 f9                    jne    1800aa0 <fifo_dispatch+0x130>
 1800aa7:    8d 58 01                 lea    0x1(%eax),%ebx
...

the fifo-server.c:259 code is:

inline
void
fifo_read_marshal (CORBA_Object _dice_corba_obj,
                   int _dice_return /* out */,
                   l4_msgtag_t *_dice_tag,
                   char* str /* out */,
                   fifo_msg_buffer_t *_dice_msg_buffer,
                   CORBA_Server_Environment *_dice_corba_env)
{

 ...
    l4_umword_t _dice_str_size = (str) ? (_dice_strlen(str)+1) : 0;
 ...


so anyone can give me some advice?

thank you!
--
fang,
_______________________________________________
l4-hackers mailing list
l4-hackers <at> os.inf.tu-dresden.de
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
fang zhengshu | 10 Jul 05:59
Picon

Re: read string from server array error!



2009/7/10 fang zhengshu <fangzhsh07 <at> gmail.com>


2009/7/8 fang zhengshu <fangzhsh07 <at> gmail.com>


2009/7/6 fang zhengshu <fangzhsh07 <at> gmail.com>
hi all,
when I write a function in the IDL file, there is a problem:want to write a different-length string to a array and then read  parts of the array to another string like:

interface test{
        int write([string]char* str, int len);
        int read([out,prealloc_client, size_is(size), prealloc_server]char str[], int size);
       };
I modify the idl file as the following:
          int write([in,string]char *str, int len)
          int read([out, prealloc_client]char *str, int len)
there no error when compile it,but

I have defined a fixed size array in the server like array[256].
In the write() function I write a different length string to the array, then I want to read parts or all of the array in the read() function, the process will be like the following:

string[len]                               str[size]
        |                                        ^
        |                                         |
        --------->array[256] -----------|


but when I put the function above and compile it, there are some error happen. I have change the size_is() with length_is() or max_is(), but there still error when I compile it. I know if I define a fix array str[256] the code can be work, but I just want to use a unfixed length array to get the string.
could someone please give me some advice?if I describe the problem clearly, please let me know.

thank you!

I don't know whether  I describe what I want to do clearly,so I put the simple code below:

read-client                                                                                 write-client
#define STR_TO 30                                                                  #define STR_FROM 30
...                                                                                              ...
char str_to[SRR_TO];                                                               char str_from[STR_FROM];
...                                                                                              ...
read(str_to, STR_TO);                                                              write(str_from, STR_FROM);
...                                                                                               ...

                                                      server
                                                     #define SIZE 256
                                                     ...
                                                    char string[SIZE];
                                                    ...
                                                    int write(char *str_from, int str_from)
                                                   {
                 //write str_from size chars of str_from array to the string array which is in server
                                                   }
                                                   int read(char *str_to, int str_to)
                                                  {
                //read str_to size chars from the string array which is in server to str_to
                                                   }

Then I define write functions as the above in a .idl file,but when I compile it,there will be the following error:
terminate called after throwing an instance of 'std::out_of_range'
  what():  CBEMsgBuffer::IsEarlier
make[1]: *** [test-server.c] Aborted
make[1]: *** [test-server.c] Deleting file `test-sys.h'
make[1]: *** [test-server.c] Deleting file `test-client.h'
make[1]: *** [test-server.c] Deleting file `test-client.c'
make: *** [/home/l4/tudos/build/pkg/
fifo/idl/OBJ-x86-l4v2] Error 2

must we use the format as the dice manual below?:
int read([out, prealloc_client, size_is(len)] char **str, [out,in]int *len)
and when I modify the function as
int read([out, prealloc_client, prealloc_server, size_is(len)] char *str, [out,in]int *len)
there is no error when compile it,but there will be another error called :fpage
could you give me some advice for the read function?
thank you.
--
fang,
when I run the test in qemu, the error come out:
   fifo    | L4RM: [PF] read at 0x00002000, ip 01800aa1, src B.02
   fifo    | [B.0] l4rm/lib/src/pagefault.c:81:__unknown_pf():
   fifo    |  unhandled page fault

the execute code of fifo binary is :
...
/home/l4/tudos/build/pkg/fifo/idl/OBJ-x86-l4v2/fifo-server.c:259
            l4_msgdope_t _dice_size_dope;
            l4_msgdope_t _dice_send_dope;
            l4_umword_t _word[2];
        } _word;
    } fifo_fifo_read_msg_buffer_t;
    l4_umword_t _dice_str_size = (str) ? (_dice_strlen(str)+1) : 0;
 1800a8b:    85 db                    test   %ebx,%ebx
 1800a8d:    0f 84 f9 00 00 00        je     1800b8c <fifo_dispatch+0x21c>
 1800a93:    80 3b 00                 cmpb   $0x0,(%ebx)
 1800a96:    0f 84 11 01 00 00        je     1800bad <fifo_dispatch+0x23d>
 1800a9c:    31 c0                    xor    %eax,%eax
 1800a9e:    66 90                    xchg   %ax,%ax
 1800aa0:    40                       inc    %eax
 1800aa1:    80 3c 18 00              cmpb   $0x0,(%eax,%ebx,1)
 1800aa5:    75 f9                    jne    1800aa0 <fifo_dispatch+0x130>
 1800aa7:    8d 58 01                 lea    0x1(%eax),%ebx
...

the fifo-server.c:259 code is:

inline
void
fifo_read_marshal (CORBA_Object _dice_corba_obj,
                   int _dice_return /* out */,
                   l4_msgtag_t *_dice_tag,
                   char* str /* out */,
                   fifo_msg_buffer_t *_dice_msg_buffer,
                   CORBA_Server_Environment *_dice_corba_env)
{

 ...
    l4_umword_t _dice_str_size = (str) ? (_dice_strlen(str)+1) : 0;
 ...


so anyone can give me some advice?

thank you!
--
fang,

thank you for people's help:)
I have handle the problem that can't read data from server.
I modify the read function in the idl file:

      int read([in, out, size_is(len), max_is(256)] char str[], [in, out] int *len);

and in the client-read side, malloc a array with 256 size(malloc(sizeof(char)*256)]),then there is no error in the read_component function and I can read the data from  the server side which define a static array.

--
fang,
_______________________________________________
l4-hackers mailing list
l4-hackers <at> os.inf.tu-dresden.de
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
Roman Beslik | 14 Jul 08:04
Favicon

compiling Fiasco trunk, Bison trouble

Hello.
I'm trying to compile Fiasco trunk using this manual: 
http://os.inf.tu-dresden.de/fiasco/use.html . When I compile tudos/l4 
tree, many errors appear in tudos/dice/src/parser/idl :
{{{
g++ -DHAVE_CONFIG_H -I. -I. -I../../..  -I../../../src -Wall 
-I../../../src  -g -O2 -MT idl-scanner.o -MD -MP -MF 
.deps/idl-scanner.Tpo -c -o idl-scanner.o idl-scanner.cc
In file included from ../../../src/parser/idl/location.hh:44,
                 from idl-parser.tab.hh:65,
                 from idl-parser-driver.hh:35,
                 from idl-scanner.ll:6:
position.hh: In function ‘bool yy::operator==(const yy::position&, const 
yy::position&)’:
position.hh:136: warning: suggest parentheses around ‘&&’ within ‘||’
In file included from idl-parser-driver.hh:35,
                 from idl-scanner.ll:6:
idl-parser.yy: At global scope:
idl-parser.yy:76: error: use of enum ‘EXPT_OPERATOR’ without previous 
declaration
idl-parser.yy:78: error: ISO C++ forbids declaration of ‘CFETypeSpec’ 
with no type
idl-parser.yy:78: error: expected ‘;’ before ‘*’ token
idl-parser.yy:79: error: ISO C++ forbids declaration of ‘CFEAttribute’ 
with no type
idl-parser.yy:79: error: expected ‘;’ before ‘*’ token
idl-parser.yy:80: error: ISO C++ forbids declaration of ‘CFEExpression’ 
with no type
idl-parser.yy:80: error: expected ‘;’ before ‘*’ token
{{{many errors skipped}}}
make[6]: *** [idl-scanner.o] Error 1
make[6]: Leaving directory `/tudos/dice/src/parser/idl'
}}}

It seems that tudos/dice/src/fe/*.h files is not included with 
"#include" in tudos/dice/src/parser/idl/idl-parser.tab.hh, because when 
I include them by hand, "g++ ..." works out without an error.

 >yacc --version
bison (GNU Bison) 2.4.1
 >g++ --version
g++ (GCC) 4.4.0 20090630 (prerelease)
 >ls -l /usr/local/bin/byacc
lrwxrwxrwx 1 root root 13 2009-07-14 04:24 /usr/local/bin/byacc -> 
/usr/bin/yacc

-- Best regards, Roman Beslik.

_______________________________________________
l4-hackers mailing list
l4-hackers <at> os.inf.tu-dresden.de
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
Bjoern Doebel | 15 Jul 21:40
Picon
Favicon

Re: read string from server array error!

Hi,

I fear I still don't really get the problem. Could you please post your
complete sample code (client, server, idl file, Makefiles) so I can try
to repeat your steps here?

Bjoern
_______________________________________________
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 Jul 16:27
Picon

Re: problem with l4linux

sorry for not putting the error message:
(EE) VESA(0): No V_BIOS found.
(EE)Screen(s) found, but none have a usable configureation.
Fatal server error:
no screen found


In my debian system,I have a gome desktop environment, and the vesa driver for the card.

thank you:)

2009/7/19 fang zhengshu <fangzhsh07 <at> gmail.com>
hi,
I'm sorry to trouble you,but I have a question with X server when start l4linux on dope.
I have search a mail which you have sent:
>
Yes, I know that this setup is not easy. For overlay_wm driver to work it is necessary to apply
patches to X Server sources, as I read. But I thought it must work with linux server with ordinary
l4con/dope frambuffer driver. So, it won't, ok. -- When I checked on real machine (not with ramdisk),
l4linux started and XServer starts OK.
>
I can start l4linux on dope and con,and also on serial console.The below is what I use in l4linux.cfg:

task "vmlinuz" "earlyprintk=yes mem=64M video=l4fb root=/dev/hda9 "
all_sects_writable
allow_vga
allow_cli
could you please tell me what I missing?
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
fang zhengshu | 19 Jul 16:17
Picon

problem with l4linux

hi,
I'm sorry to trouble you,but I have a question with X server when start l4linux on dope.
I have search a mail which you have sent:
>

Yes, I know that this setup is not easy. For overlay_wm driver to work it is necessary to apply
patches to X Server sources, as I read. But I thought it must work with linux server with ordinary
l4con/dope frambuffer driver. So, it won't, ok. -- When I checked on real machine (not with ramdisk),
l4linux started and XServer starts OK.
>
I can start l4linux on dope and con,and also on serial console.The below is what I use in l4linux.cfg:

task "vmlinuz" "earlyprintk=yes mem=64M video=l4fb root=/dev/hda9 "
all_sects_writable
allow_vga
allow_cli
could you please tell me what I missing?
thank you.
--
fang,
_______________________________________________
l4-hackers mailing list
l4-hackers <at> os.inf.tu-dresden.de
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
Andre Puschmann | 21 Jul 11:03
Picon
Favicon

Howto implement a periodic real-time task?

Hey guys,

I got a L4 real-time application that should run strictly periodic. In 
each cycle I have to communicate with at least two other L4 threads in 
different address spaces. The cycle period is in the order of 1000Hz to 
5000Hz.
As described in [1] I tried to use the CPU reservation server but the 
sample implementations did not work. Anyway, I figured out that even the 
CPU reservation server depends on the kernel timer and thus the 
granularity is 1ms (in PIT mode), which is too coarse for cycle periods 
larger then 1000Hz.
Although I like the idea to use OS primitives to keep the application as 
portable as possible (ARM port is a goal), I thought about implementing 
the periodic execution with an extra timer decoupled from the scheduling 
timer which generates an IRQ at each hit.
Any comment/suggestions/ideas about that? Any other experience with 
periodic real-time tasks on L4?

Cheers,
Andre

[1] http://os.inf.tu-dresden.de/pipermail/l4-hackers/2009/004179.html

Gmane