Hi,
Now I am learning the kernel code of Fiasco. But as I do not know much about C++, I feel confused about some code.
In the file obj_space-virt.cpp, we have such code EXTENSION class Generic_obj_space : Obj_space_virt<Generic_obj_space<SPACE>
And similarly, in the file obj_space-phys.cpp, we have EXTENSION class Generic_obj_space : Obj_space_phys<Generic_obj_space< SPACE
1. What's the meaning of these tow line code? Does it mean that the class Generic_obj_space inherit from both class Obj_space_virt and class Obj_space_phys?
2. I note that class Obj_space_virt and Obj_space_phys have some methods with the same name, such as lookup_local method. When such a method is called, how can I know which class is invoked?
Thanks a lot.
Hi,
On Tue May 27, 2014 at 13:51:31 -0800, Yuxin Ren wrote:
Now I am learning the kernel code of Fiasco. But as I do not know much about C++, I feel confused about some code.
Some C++ knowledge is required I think...
In the file obj_space-virt.cpp, we have such code EXTENSION class Generic_obj_space : Obj_space_virt<Generic_obj_space<SPACE>
And similarly, in the file obj_space-phys.cpp, we have EXTENSION class Generic_obj_space : Obj_space_phys<Generic_obj_space< SPACE
- What's the meaning of these tow line code? Does it mean that the class
Generic_obj_space inherit from both class Obj_space_virt and class Obj_space_phys?
It inherits from just Obj_space_phys which however takes another class as a parameter to implement some specific functionality at compile time.
- I note that class Obj_space_virt and Obj_space_phys have some methods
with the same name, such as lookup_local method. When such a method is called, how can I know which class is invoked?
That depends on the type of the object the method is called on. In this particular case with obj_space-*.cpp, only one file of the two files is compiled, so only one version of Generic_obj_space can ever exist.
Adam
Thank you very much. But how can I know which file is compiled?
On Wed, May 28, 2014 at 6:55 AM, Adam Lackorzynski < adam@os.inf.tu-dresden.de> wrote:
Hi,
On Tue May 27, 2014 at 13:51:31 -0800, Yuxin Ren wrote:
Now I am learning the kernel code of Fiasco. But as I do not know much about C++, I feel confused about some code.
Some C++ knowledge is required I think...
In the file obj_space-virt.cpp, we have such code EXTENSION class Generic_obj_space :
Obj_space_virt<Generic_obj_space<SPACE>
And similarly, in the file obj_space-phys.cpp, we have EXTENSION class Generic_obj_space : Obj_space_phys<Generic_obj_space<
SPACE
- What's the meaning of these tow line code? Does it mean that the class
Generic_obj_space inherit from both class Obj_space_virt and class Obj_space_phys?
It inherits from just Obj_space_phys which however takes another class as a parameter to implement some specific functionality at compile time.
- I note that class Obj_space_virt and Obj_space_phys have some methods
with the same name, such as lookup_local method. When such a method is called, how can I know which class is invoked?
That depends on the type of the object the method is called on. In this particular case with obj_space-*.cpp, only one file of the two files is compiled, so only one version of Generic_obj_space can ever exist.
Adam
Adam adam@os.inf.tu-dresden.de Lackorzynski http://os.inf.tu-dresden.de/~adam/
l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
On 2014-05-28 03:59, Yuxin Ren wrote:
Thank you very much. But how can I know which file is compiled?
This is decided during build time based on your configuration. The vuild system decides which file to build based on the CONFIG_VIRT_OBJ_SPACE setting. See src/Modules.generic.
- Marcus
On Wed, May 28, 2014 at 6:55 AM, Adam Lackorzynski adam@os.inf.tu-dresden.de wrote:
Hi,
On Tue May 27, 2014 at 13:51:31 -0800, Yuxin Ren wrote:
Now I am learning the kernel code of Fiasco. But as I do not know much about C++, I feel confused about some code.
Some C++ knowledge is required I think...
In the file obj_space-virt.cpp, we have such code EXTENSION class Generic_obj_space : Obj_space_virt<Generic_obj_space<SPACE>
And similarly, in the file obj_space-phys.cpp, we have EXTENSION class Generic_obj_space : Obj_space_phys<Generic_obj_space< SPACE
- What's the meaning of these tow line code? Does it mean that the
class Generic_obj_space inherit from both class Obj_space_virt and class Obj_space_phys?
It inherits from just Obj_space_phys which however takes another class as a parameter to implement some specific functionality at compile time.
- I note that class Obj_space_virt and Obj_space_phys have some
methods with the same name, such as lookup_local method. When such a method is called, how can I know which class is invoked?
That depends on the type of the object the method is called on. In this particular case with obj_space-*.cpp, only one file of the two files is compiled, so only one version of Generic_obj_space can ever exist.
Adam
Adam adam@os.inf.tu-dresden.de Lackorzynski http://os.inf.tu-dresden.de/~adam/ [1]
l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers [2]
Links:
[1] http://os.inf.tu-dresden.de/~adam/ [2] http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
On Tue, May 27, 2014 at 11:44 PM, Marcus Hähnel < mhaehnel@os.inf.tu-dresden.de> wrote:
On 2014-05-28 03:59, Yuxin Ren wrote:
Thank you very much. But how can I know which file is compiled?
This is decided during build time based on your configuration. The vuild system decides which file to build based on the CONFIG_VIRT_OBJ_SPACE setting. See src/Modules.generic.
Marcus
Thanks a lot.
But can you tell me a little in detail which kernel compile configuration decides this? I am using x86 and ia32..
Best
On Wed, May 28, 2014 at 6:55 AM, Adam Lackorzynski adam@os.inf.tu-dresden.de wrote:
Hi,
On Tue May 27, 2014 at 13:51:31 -0800, Yuxin Ren wrote:
Now I am learning the kernel code of Fiasco. But as I do not know much about C++, I feel confused about some code.
Some C++ knowledge is required I think...
In the file obj_space-virt.cpp, we have such code
EXTENSION class Generic_obj_space : Obj_space_virt<Generic_obj_ space<SPACE>
And similarly, in the file obj_space-phys.cpp, we have EXTENSION class Generic_obj_space : Obj_space_phys<Generic_obj_space< SPACE
- What's the meaning of these tow line code? Does it mean that the
class Generic_obj_space inherit from both class Obj_space_virt and class Obj_space_phys?
It inherits from just Obj_space_phys which however takes another class as a parameter to implement some specific functionality at compile time.
- I note that class Obj_space_virt and Obj_space_phys have some methods
with the same name, such as lookup_local method. When such a method is called, how can I know which class is invoked?
That depends on the type of the object the method is called on. In this particular case with obj_space-*.cpp, only one file of the two files is compiled, so only one version of Generic_obj_space can ever exist.
Adam
Adam adam@os.inf.tu-dresden.de Lackorzynski http://os.inf.tu-dresden.de/~adam/ [1]
l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers [2]
Links:
[1] http://os.inf.tu-dresden.de/~adam/ [2] http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
On 2014-05-29 18:22, Yuxin Ren wrote:
On Tue, May 27, 2014 at 11:44 PM, Marcus Hähnel mhaehnel@os.inf.tu-dresden.de wrote:
On 2014-05-28 03:59, Yuxin Ren wrote:
Thank you very much. But how can I know which file is compiled?
What do you mean with 'how can I know'? Do you mean how you can set it?
The menuconfig option is [Kernel options] -> [No virtually mapped array for cap tables], which is only visible if you enable experimental features in the main menu.
Or do you mean how you can find out which one is compiled?
I already pointed you to src/Modules.generic which has an if clause that decides which one to use based on the config option in lines 33 and following. The Modules.generic file is included by the build system during the build process.
Does that answer your Question?
- Marcus
This is decided during build time based on your configuration. The vuild system decides which file to build based on the CONFIG_VIRT_OBJ_SPACE setting. See src/Modules.generic.
- Marcus
Thanks a lot. But can you tell me a little in detail which kernel compile configuration decides this? I am using x86 and ia32..
Best
On Wed, May 28, 2014 at 6:55 AM, Adam Lackorzynski adam@os.inf.tu-dresden.de wrote:
Hi,
On Tue May 27, 2014 at 13:51:31 -0800, Yuxin Ren wrote:
Now I am learning the kernel code of Fiasco. But as I do not know much about C++, I feel confused about some code.
Some C++ knowledge is required I think...
In the file obj_space-virt.cpp, we have such code EXTENSION class Generic_obj_space : Obj_space_virt<Generic_obj_space<SPACE>
And similarly, in the file obj_space-phys.cpp, we have EXTENSION class Generic_obj_space : Obj_space_phys<Generic_obj_space< SPACE
>
- What's the meaning of these tow line code? Does it mean that
the class Generic_obj_space inherit from both class Obj_space_virt and class Obj_space_phys?
It inherits from just Obj_space_phys which however takes another class as a parameter to implement some specific functionality at compile time.
uch as lookup_local method. When such a method is called, how can I know which class is invoked?
That depends on the type of the object the method is called on. In this particul
obj_space-*.cpp, only one file of the two files is compiled, so only one version of Generic_obj_space can ever exist.
Adam
Adam adam@os.inf.tu-dresden.de Lackorzynski http://os.inf.tu-dresden.de/~adam/ [1] [1]
l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers [2] [2]
Links:
[1] http://os.inf.tu-dresden.de/~adam/ [1] [2] http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers [2]
l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers [2]
l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers [2]
Links:
[1] http://os.inf.tu-dresden.de/~adam/ [2] http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
Thank you very much for your detail reply. It is really useful and helpful.
On Thu, May 29, 2014 at 9:17 AM, Marcus Hähnel < mhaehnel@os.inf.tu-dresden.de> wrote:
On 2014-05-29 18:22, Yuxin Ren wrote:
On Tue, May 27, 2014 at 11:44 PM, Marcus Hähnel mhaehnel@os.inf.tu-dresden.de wrote:
On 2014-05-28 03:59, Yuxin Ren wrote:
Thank you very much.
But how can I know which file is compiled?
What do you mean with 'how can I know'? Do you mean how you can set it?
The menuconfig option is [Kernel options] -> [No virtually mapped array for cap tables], which is only visible if you enable experimental features in the main menu.
Or do you mean how you can find out which one is compiled?
I already pointed you to src/Modules.generic which has an if clause that decides which one to use based on the config option in lines 33 and following. The Modules.generic file is included by the build system during the build process.
Does that answer your Question?
- Marcus
This is decided during build time based on your configuration. The vuild
system decides which file to build based on the CONFIG_VIRT_OBJ_SPACE setting. See src/Modules.generic.
- Marcus
Thanks a lot. But can you tell me a little in detail which kernel compile
configuration decides this? I am using x86 and ia32..
Best
On Wed, May 28, 2014 at 6:55 AM, Adam Lackorzynski
adam@os.inf.tu-dresden.de wrote:
Hi,
On Tue May 27, 2014 at 13:51:31 -0800, Yuxin Ren wrote:
Now I am learning the kernel code of Fiasco.
But as I do not know much about C++, I feel confused about some code.
Some C++ knowledge is required I think...
In the file obj_space-virt.cpp, we have such code
EXTENSION class Generic_obj_space : Obj_space_virt<Generic_obj_ space<SPACE>
> And similarly, in the file obj_space-phys.cpp, we have EXTENSION class Generic_obj_space : Obj_space_phys<Generic_obj_space< SPACE
>>
- What's the meaning of these tow line code? Does it mean that the
class Generic_obj_space inherit from both class Obj_space_virt and class Obj_space_phys?
It inherits from just Obj_space_phys which however takes another class as a parameter to implement some specific functionality at compile time.
uch as lookup_local method. When such a method is called, how can I
know which class is invoked?
That depends on the type of the object the method is called on. In this particul
obj_space-*.cpp, only one file of the two files is
compiled, so only one version of Generic_obj_space can ever exist.
Adam
Adam adam@os.inf.tu-dresden.de Lackorzynski http://os.inf.tu-dresden.de/~adam/ [1] [1]
l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers [2] [2]
Links:
[1] http://os.inf.tu-dresden.de/~adam/ [1] [2] http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers [2]
l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers [2]
l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers [2]
Links:
[1] http://os.inf.tu-dresden.de/~adam/ [2] http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
Am 28.05.2014 00:55, schrieb Adam Lackorzynski:
Hi,
On Tue May 27, 2014 at 13:51:31 -0800, Yuxin Ren wrote:
Now I am learning the kernel code of Fiasco. But as I do not know much about C++, I feel confused about some code.
Some C++ knowledge is required I think...
Also Fiasco is written in a strange dialect that is not easily comprehensible even if you are acquainted with C++. "EXTENSION" for example is a keyword of the fiasco specific preprocessor and does neither belong to C++ nor the C-preprocessor.
Hint: When I browse the fiasco code I usually extract the preprocessed files - the ones that end up in "<your fiasco build dir>/auto" - then use a sed script to remove the #line directives and have them indexed by an IDE (Eclipse CDT in my case). That way you will find out that actually pretty decent C++ code hides under the "preprocess"-clutter. ;-)
This helps me to browse and understand fiasco code. If you want to modify it there is no way around getting used to this dialect though.
Janis
In the file obj_space-virt.cpp, we have such code EXTENSION class Generic_obj_space : Obj_space_virt<Generic_obj_space<SPACE>
And similarly, in the file obj_space-phys.cpp, we have EXTENSION class Generic_obj_space : Obj_space_phys<Generic_obj_space< SPACE
- What's the meaning of these tow line code? Does it mean that the class
Generic_obj_space inherit from both class Obj_space_virt and class Obj_space_phys?
It inherits from just Obj_space_phys which however takes another class as a parameter to implement some specific functionality at compile time.
- I note that class Obj_space_virt and Obj_space_phys have some methods
with the same name, such as lookup_local method. When such a method is called, how can I know which class is invoked?
That depends on the type of the object the method is called on. In this particular case with obj_space-*.cpp, only one file of the two files is compiled, so only one version of Generic_obj_space can ever exist.
Adam
l4-hackers@os.inf.tu-dresden.de