Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
question to kernel Gentoo developers
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
This topic is locked: you cannot edit posts or make replies.    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 364

PostPosted: Mon Jul 08, 2024 7:28 pm    Post subject: question to kernel Gentoo developers Reply with quote

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
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10655
Location: Somewhere over Atlanta, Georgia

PostPosted: Mon Jul 08, 2024 7:55 pm    Post subject: Re: question to kernel Gentoo developers Reply with quote

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
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3430

PostPosted: Mon Jul 08, 2024 8:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 364

PostPosted: Mon Jul 08, 2024 8:12 pm    Post subject: Re: question to kernel Gentoo developers Reply with quote

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
View user's profile Send private message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1245
Location: Richmond Hill, Canada

PostPosted: Mon Jul 08, 2024 8:18 pm    Post subject: Re: question to kernel Gentoo developers Reply with quote

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 :D

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
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22648

PostPosted: Mon Jul 08, 2024 8:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 364

PostPosted: Mon Jul 08, 2024 8:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 364

PostPosted: Mon Jul 08, 2024 8:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 364

PostPosted: Mon Jul 08, 2024 8:28 pm    Post subject: Reply with quote

Hu 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?
Back to top
View user's profile Send private message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1245
Location: Richmond Hill, Canada

PostPosted: Mon Jul 08, 2024 8:38 pm    Post subject: Reply with quote

Gentoopc wrote:
Hu 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
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3430

PostPosted: Mon Jul 08, 2024 9:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5104
Location: Bavaria

PostPosted: Mon Jul 08, 2024 9:51 pm    Post subject: Re: question to kernel Gentoo developers Reply with quote

Gentoopc,

I can still remember these two threads very well:

https://forums.gentoo.org/viewtopic-t-1167616.html
https://forums.gentoo.org/viewtopic-p-8818804.html

Gentoopc wrote:
[...] Why don't you have engineers and developers of the Gentoo distribution ready to help them? [...]

If you go to your bank and ask them how IT systems work, they will answer: We do use IT systems, but we advise our customers on money matters; we don't do any training on IT.

Gentoo is a Linux (Meta-) distribution ... yes the kernel is a part of Linux ... but we do no training for the kernel. Use this link:

https://kernelnewbies.org/
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20485

PostPosted: Mon Jul 08, 2024 10:55 pm    Post subject: Re: question to kernel Gentoo developers Reply with quote

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
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 364

PostPosted: Tue Jul 09, 2024 9:18 am    Post subject: Re: question to kernel Gentoo developers Reply with quote

pingtoo wrote:


I want to have fun :D

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
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 364

PostPosted: Tue Jul 09, 2024 9:26 am    Post subject: Reply with quote

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
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3430

PostPosted: Tue Jul 09, 2024 12:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22648

PostPosted: Tue Jul 09, 2024 12:44 pm    Post subject: Reply with quote

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
View user's profile Send private message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1245
Location: Richmond Hill, Canada

PostPosted: Tue Jul 09, 2024 12:48 pm    Post subject: Re: question to kernel Gentoo developers Reply with quote

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
View user's profile Send private message
ChrisJumper
Advocate
Advocate


Joined: 12 Mar 2005
Posts: 2400
Location: Germany

PostPosted: Tue Jul 09, 2024 8:33 pm    Post subject: Re: question to kernel Gentoo developers Reply with quote

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
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 364

PostPosted: Tue Jul 09, 2024 9:56 pm    Post subject: Re: question to kernel Gentoo developers Reply with quote

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
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 364

PostPosted: Tue Jul 09, 2024 10:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 364

PostPosted: Tue Jul 09, 2024 10:04 pm    Post subject: Reply with quote

szatox wrote:


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
View user's profile Send private message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1245
Location: Richmond Hill, Canada

PostPosted: Tue Jul 09, 2024 10:23 pm    Post subject: Re: question to kernel Gentoo developers Reply with quote

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
View user's profile Send private message
sublogic
Apprentice
Apprentice


Joined: 21 Mar 2022
Posts: 269
Location: Pennsylvania, USA

PostPosted: Tue Jul 09, 2024 10:34 pm    Post subject: Re: question to kernel Gentoo developers Reply with quote

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
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 364

PostPosted: Wed Jul 10, 2024 12:08 am    Post subject: Re: question to kernel Gentoo developers Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies.    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum