View previous topic :: View next topic |
Author |
Message |
Gentoopc Guru
Joined: 25 Dec 2017 Posts: 364
|
Posted: Mon Jul 08, 2024 7:28 pm Post subject: question to kernel Gentoo developers |
|
|
I see that many people want to learn how to program under the Linux kernel. But even if they learn, for example, C++ or Python, they will only write something Hello World, because the Linux kernel system will not allow more. Why don't you have engineers and developers of the Gentoo distribution ready to help them? Open doors for them, give them the opportunity to write programs that surpass hello world. Let me run custom functions from the Linux kernel module. You have everything for this, both the knowledge and your core. Look for yourself, you have Gentoo, but what is its special feature? Is it difficult to install Gentoo? Is this his main advantage? I spent a lot of time installing Gentoo to convince myself that I had succeeded. Am I proud that I was able to install a distribution full of bugs? Maybe it's better to make the main advantage of Gentoo - more features than others? And if you take the time to install, you will get something that is unattainable in other distributions. Give users the opportunity to realize their plans and dreams with Gentoo. |
|
Back to top |
|
|
John R. Graham Administrator
Joined: 08 Mar 2005 Posts: 10655 Location: Somewhere over Atlanta, Georgia
|
Posted: Mon Jul 08, 2024 7:55 pm Post subject: Re: question to kernel Gentoo developers |
|
|
Gentoopc wrote: | ...because the Linux kernel system will not allow more. | That's just not true at all. What led you to believe that?
- John _________________ I can confirm that I have received between 0 and 499 National Security Letters. |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3421
|
Posted: Mon Jul 08, 2024 8:06 pm Post subject: |
|
|
Honestly, I have no idea what you wrote there.
I know all words you used, but the whole thing just doesn't compute. _________________ Make Computing Fun Again |
|
Back to top |
|
|
Gentoopc Guru
Joined: 25 Dec 2017 Posts: 364
|
Posted: Mon Jul 08, 2024 8:12 pm Post subject: Re: question to kernel Gentoo developers |
|
|
John R. Graham wrote: | That's just not true at all. What led you to believe that?
|
From the Linux kernel module, is it possible to start a code for C ++? As an example
Code: |
int FM(int a){return a; };
int main(){ FM(123); };
|
Can this be done from the Linux kernel module? |
|
Back to top |
|
|
pingtoo Veteran
Joined: 10 Sep 2021 Posts: 1238 Location: Richmond Hill, Canada
|
Posted: Mon Jul 08, 2024 8:18 pm Post subject: Re: question to kernel Gentoo developers |
|
|
Gentoopc wrote: | John R. Graham wrote: | That's just not true at all. What led you to believe that?
|
From the Linux nucleus module, is it possible to start a code for C ++? As an example
Code: |
int FM(int a){return a; };
int main(){ FM(123); };
|
Can this be done from the Linux kernel module? |
I want to have fun
Can you explain in you view, what is different have your example code as kernel module vs simple C (C++) program?
BTW, yes, it is possible to build you example code as kernel module. However kernel is unlikely will ever execute that code. it missing many element for kernel to know what it is. |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22619
|
Posted: Mon Jul 08, 2024 8:19 pm Post subject: |
|
|
Your newest post is not well-informed either. Although C++ does allow main to rely on an implied return, using main is only standard in a hosted environment. The kernel is a freestanding environment. What would even call your main? |
|
Back to top |
|
|
Gentoopc Guru
Joined: 25 Dec 2017 Posts: 364
|
Posted: Mon Jul 08, 2024 8:20 pm Post subject: |
|
|
szatox wrote: | Honestly, I have no idea what you wrote there.
I know all words you used, but the whole thing just doesn't compute. |
Gentoo is a very complex system. And she is no more. There is all the opportunity to make this system special. Then the time spent on its installation will be rewarded. |
|
Back to top |
|
|
Gentoopc Guru
Joined: 25 Dec 2017 Posts: 364
|
Posted: Mon Jul 08, 2024 8:24 pm Post subject: |
|
|
Hu wrote: | Your newest post is not well-informed either. Although C++ does allow main to rely on an implied return, using main is only standard in a hosted environment. The kernel is a freestanding environment. What would even call your main? |
No. int main () {} // Return here is only for the kernel and informs either the presence of an error or about its absence. The kernel linux is not necessary. |
|
Back to top |
|
|
Gentoopc Guru
Joined: 25 Dec 2017 Posts: 364
|
Posted: Mon Jul 08, 2024 8:28 pm Post subject: |
|
|
It doesn’t matter, the main thing is that you have your own modified Gentoo nucleus. Why don't you want to bypass the API to allow user functions from the Kernel Linux module? what are you afraid of? |
|
Back to top |
|
|
pingtoo Veteran
Joined: 10 Sep 2021 Posts: 1238 Location: Richmond Hill, Canada
|
Posted: Mon Jul 08, 2024 8:38 pm Post subject: |
|
|
Gentoopc wrote: | It doesn’t matter, the main thing is that you have your own modified Gentoo nucleus. Why don't you want to bypass the API to allow user functions from the Kernel Linux module? what are you afraid of? |
Please note, what you intend to do is NOT Gentoo, It is Linux (The kernel).
So please don't refer to Gentoo for your question.
You are welcome to ask kernel specific question, but please know it is kernel not Gentoo. |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3421
|
Posted: Mon Jul 08, 2024 9:33 pm Post subject: |
|
|
Here, I'm actually running a modified kernel. It's only a few bytes, but nobody stopped me.
Code: | # ls -lh /etc/portage/patches/sys-kernel/gentoo-sources/
razem 8,0K
-rw-r--r-- 1 root root 573 05-08 21:45 force_mptcp.patch
-rw-r--r-- 1 root root 484 2023-07-06 not_charging.patch
|
If you want to do stuff in kernel space, you work with kernel's code. If you want to do stuff in user space, you work with applications.
So, what's your goal?
Trying to compile stuff with the uber power of GPU again? _________________ Make Computing Fun Again |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5094 Location: Bavaria
|
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20484
|
Posted: Mon Jul 08, 2024 10:55 pm Post subject: Re: question to kernel Gentoo developers |
|
|
Gentoopc wrote: | Why don't you have engineers and developers of the Gentoo distribution ready to help them? | As people, they get to choose how they spend their time.
Gentoopc wrote: | Open doors for them, give them the opportunity to write programs that surpass hello world. | The opportunity already exists. If "them" aren't taking advantage of what is already available, I can only guess why someone isn't offering to spoon feed them.
Gentoopc wrote: | you have Gentoo, but what is its special feature? | I think many would refer to Gentoo's capabilities as a tool.
Gentoopc wrote: | Am I proud that I was able to install a distribution full of bugs? | Since you didn't specify, I can only guess. Did you open bug reports to help reduce the number of bugs?
Gentoopc wrote: | Maybe it's better to make the main advantage of Gentoo - more features than others? | More isn't necessarily better.
Gentoopc wrote: | Give users the opportunity to realize their plans and dreams with Gentoo. | That opportunity already exists. If people don't put in the work, it isn't going to happen.
What you are asking others to do could be your own kernel. Do you have a publicly available repository for others to contribute to what you've already done? _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
Gentoopc Guru
Joined: 25 Dec 2017 Posts: 364
|
Posted: Tue Jul 09, 2024 9:18 am Post subject: Re: question to kernel Gentoo developers |
|
|
pingtoo wrote: |
I want to have fun
Can you explain in you view, what is different have your example code as kernel module vs simple C (C++) program?
BTW, yes, it is possible to build you example code as kernel module. However kernel is unlikely will ever execute that code. it missing many element for kernel to know what it is. |
Here, many simply do not understand the essence of the issue. I can write a Kernel module. But this is done only in the special programming language "C". The question was to launch a user function from the module. User function. Do you understand this?
Code: | int init_module(void){return 0;} // This is the function of the module |
Code: | void Mfynction(void){printf("This is a user function. I can start it in Linux with a distribution, for example in /home "); }; |
I asked you for the Gentoo Distribution Developers, which has its special Kernel for Gentoo to allow everyone to launch the user functions of the kernel Module of directly to bypass the API. Agree this is very correct. The nuclei modules are best suited for this. This will open the way to many programmers both in Python and in other languages. Now Kenrel has only been accepted by Rust. It cost a lot of effort and has little benefit. It would be better if they did what I ask about, made it possible to launch user functions from the Kernel module.
Last edited by Gentoopc on Tue Jul 09, 2024 10:39 am; edited 1 time in total |
|
Back to top |
|
|
Gentoopc Guru
Joined: 25 Dec 2017 Posts: 364
|
Posted: Tue Jul 09, 2024 9:26 am Post subject: |
|
|
szatox wrote: |
So, what's your goal?
|
Making life is easier and more colorful.
I have already said that your distribution is now glory only as the most difficult because there are a lot of bugs. The one who correct all errors during the installation process and gather Gentoo is proud. That's what Gentoo needs. I suggest you make a Gentoo distribution with unlimited possibilities. Then the game will cost to candle. Open the possibility of starting user functions from module bypassing API. It will be a huge step in development. |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3421
|
Posted: Tue Jul 09, 2024 12:18 pm Post subject: |
|
|
Quote: | Here, many simply do not understand the essence of the issue. |
Yes, that's exactly the problem. You suck at putting your thoughts to paper. You need to do better.
Quote: | I can write a Kernel module. But this is done only in the special programming language "C". The question was to launch a user function from the module. User function. Do you understand this? |
There's nothing special about C. It gets translated to machine code anyway.
You can change programming language as long as both functions (the caller and the subroutine) follow the same call convention. I'm pretty sure you can do that in C++. No idea about python, it usually works the other way around, so probably no, but it can do some kind of complilation too, so it's a maybe.
If you want to learn about calling conventions, you basically need to make friends with assembler. Making a simple toy based on a microcontroller is a great way to do that.
Quote: | I suggest you make a Gentoo distribution with unlimited possibilities. Then the game will cost to candle. Open the possibility of starting user functions from module bypassing API. It will be a huge step in development. | ok, cool. Show me. _________________ Make Computing Fun Again |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22619
|
Posted: Tue Jul 09, 2024 12:44 pm Post subject: |
|
|
If kernel code must be written in C, how is the Rust for Linux project getting anywhere? Rust is not C, so if C is mandatory for the kernel, then Rust for Linux cannot possibly work - yet it does. |
|
Back to top |
|
|
pingtoo Veteran
Joined: 10 Sep 2021 Posts: 1238 Location: Richmond Hill, Canada
|
Posted: Tue Jul 09, 2024 12:48 pm Post subject: Re: question to kernel Gentoo developers |
|
|
Gentoopc wrote: | Here, many simply do not understand the essence of the issue. I can write a Kernel module. But this is done only in the special programming language "C". The question was to launch a user function from the module. User function. Do you understand this?
Code: | int init_module(void){return 0;} // This is the function of the module |
Code: | void Mfynction(void){printf("This is a user function. I can start it in Linux with a distribution, for example in /home "); }; |
|
I don't understand this, can you help me to get better understanding? can you tell me how those two function relate to each other? I don't see them calling each other.
Gentoopc wrote: | I asked you for the Gentoo Distribution Developers, which has its special Kernel for Gentoo to allow everyone to launch the user functions of the kernel Module of directly to bypass the API. Agree this is very correct. The nuclei modules are best suited for this. This will open the way to many programmers both in Python and in other languages. Now Kenrel has only been accepted by Rust. It cost a lot of effort and has little benefit. It would be better if they did what I ask about, made it possible to launch user functions from the Kernel module. |
I am not familiar nuclei module is it a existing kernel module? or external kernel module project? can you point me a direction so I can study it?
Please correct me if I am misinterpret your idea, it seems to me you are thinking embedded a script language interpreter as a kernel module, am I right? I know few script language interpreter have API to help make it embedded as module, for example perl, tcl and python as they are most popular.
Do you intend to start such project? or you expecting someone else create such thing?
If you wish someone can start such development, can you share you idea on why this is good, how to use in a real world case?
If you wish to start such project, let me know when you are ready I love to joint you for development.
BTW, I am not Gentoo developer. |
|
Back to top |
|
|
ChrisJumper Advocate
Joined: 12 Mar 2005 Posts: 2400 Location: Germany
|
Posted: Tue Jul 09, 2024 8:33 pm Post subject: Re: question to kernel Gentoo developers |
|
|
Gentoopc wrote: | because the Linux kernel system will not allow more. |
You hold it just wrong. Open Source give you Power on Home-Devices and by Editing the Source Code. With Gentoo you can do whatever you want, but you have to update your own code if upstream change Functions APIs and so on, used buy your changes.
The Gentoo Kernel Code is different from the Linux Core one but only in parts. Try to play and to understand the Gentoo chances and the Upstream Linux Kernel Changes - in parts. And then try to add some benefit. Or just use your own overlay for your personal additions on your own code.
Its cool if you exchange yourself knowledge with other. I think the Linux Day, LUGS in your location or Computer or Information Communities with Focus on free Software would be a good start. Gentoo, too. But its not so easy and open for beginners cause we have not a large group here with enough free time. Gentoo is nice and powerful, really.
Gentoopc give it a try have patience. If you add some better working code on bugs.gentoo.org to an issue you will be welcome. |
|
Back to top |
|
|
Gentoopc Guru
Joined: 25 Dec 2017 Posts: 364
|
Posted: Tue Jul 09, 2024 9:56 pm Post subject: Re: question to kernel Gentoo developers |
|
|
pingtoo wrote: |
Code: | int init_module(void){return 0;} // This is the function of the module |
Code: | void Mfynction(void){printf("This is a user function. I can start it in Linux with a distribution, for example in /home "); }; |
|
I don't understand this, can you help me to get better understanding? can you tell me how those two function relate to each other? [/quote]
Guys, these functions should not call each other. This is just an example to show how different they are! one is a user function, the other is a kernel module function. they are different. this is what we are talking about! You can’t just take and run a simple function from a kernel module. and there should be such a possibility. The kernel must be programmed by professionals. Let Linus Torvalds and Microsoft engineers do it. We simple users need to run code from modules. this is very logical. You created your kernel module, wrote functions, assemble it and run it. do you understand this? Now you won’t be able to do this, because the kernel and modules are written in a specific “C” language. Why then C++, which was created for Linux, but neither the kernel nor the module can be written on it? what the hell is going on! just think well. |
|
Back to top |
|
|
Gentoopc Guru
Joined: 25 Dec 2017 Posts: 364
|
Posted: Tue Jul 09, 2024 10:00 pm Post subject: |
|
|
Hu wrote: | If kernel code must be written in C, how is the Rust for Linux project getting anywhere? Rust is not C, so if C is mandatory for the kernel, then Rust for Linux cannot possibly work - yet it does. |
We don't understand each other at all. I'm surprised how you managed to install Gentoo? you don't understand the problem. If you knew the Linux kernel, you would immediately understand what I'm talking about, and what I'm suggesting should have been suggested by other people a long time ago. |
|
Back to top |
|
|
Gentoopc Guru
Joined: 25 Dec 2017 Posts: 364
|
Posted: Tue Jul 09, 2024 10:04 pm Post subject: |
|
|
guys, I asked the developers a question. Why do you come with stupid questions and comments? You have absolutely no idea what the essence of the problem is and what is needed from the developers. |
|
Back to top |
|
|
pingtoo Veteran
Joined: 10 Sep 2021 Posts: 1238 Location: Richmond Hill, Canada
|
Posted: Tue Jul 09, 2024 10:23 pm Post subject: Re: question to kernel Gentoo developers |
|
|
Gentoopc wrote: | pingtoo wrote: |
Code: | int init_module(void){return 0;} // This is the function of the module |
Code: | void Mfynction(void){printf("This is a user function. I can start it in Linux with a distribution, for example in /home "); }; |
I don't understand this, can you help me to get better understanding? can you tell me how those two function relate to each other? |
Guys, these functions should not call each other. This is just an example to show how different they are! one is a user function, the other is a kernel module function. they are different. this is what we are talking about! You can’t just take and run a simple function from a kernel module. and there should be such a possibility. |
You notion of kernel should just call it without some sort of registration is just wrong. How do you expect kernel to know which function to call (assume there are more than just one function in the kernel module)
but it can be relative easy to change your code to execute the user function for example using your code Code: | int init_module(void){Mfynction(); return 0;} // This is the function of the module |
Code: | void Mfynction(void){printf("This is a user function. I can start it in Linux with a distribution, for example in /home "); }; | I don't think it is too much to understand.
Gentoopc wrote: | ...
Why then C++, which was created for Linux, but neither the kernel nor the module can be written on it?
... | Where did you got this idea? do you have any prove for this statement? I think it is only in you head that C++ is created for Linux. I am pretty sure I encounter C++ before I encounter Linux |
|
Back to top |
|
|
sublogic Apprentice
Joined: 21 Mar 2022 Posts: 269 Location: Pennsylvania, USA
|
Posted: Tue Jul 09, 2024 10:34 pm Post subject: Re: question to kernel Gentoo developers |
|
|
Gentoopc wrote: | I can write a Kernel module. But this is done only in the special programming language "C". The question was to launch a user function from the module. User function. Do you understand this? | No. |
|
Back to top |
|
|
Gentoopc Guru
Joined: 25 Dec 2017 Posts: 364
|
Posted: Wed Jul 10, 2024 12:08 am Post subject: Re: question to kernel Gentoo developers |
|
|
pingtoo wrote: |
Why then C++, which was created for Linux, but neither the kernel nor the module can be written on it?
Where did you got this idea? do you have any prove for this statement? I think it is only in you head that C++ is created for Linux. I am pretty sure I encounter C++ before I encounter Linux |
Linux was not created from scratch. therefore, it cannot be said that he is 30 years old and younger than C++.
The "C" language was created to write the kernel. Well, one way or another, “C” found itself in the Linux kernel. it is not needed anywhere else. C++ is a superset of "C". C++ couldn't come before "C". and if “C” is for the Linux kernel, then its add-on should also have found application in Linux. C++, like its father, “C” is not needed anywhere. Just don’t tell tales that they are widely used. All professional programmers avoid C++ like the plague. but we are not talking about C++, we are talking about the ability to run custom functions from a Linux module in other languages. now it's only a specific "C". You are trying to turn everything into nonsense. it's mean. the problem exists. And many would need such an opportunity. I don’t understand why you defend your existing position so much.
Last edited by Gentoopc on Wed Jul 10, 2024 12:26 am; edited 2 times in total |
|
Back to top |
|
|
|