Kernel Newbies archive on lore.kernel.org
 help / color / Atom feed
* Re: Kernelnewbies Digest, Vol 107, Issue 9
       [not found] <mailman.1.1570636802.1872.kernelnewbies@kernelnewbies.org>
@ 2019-10-10 13:42 ` CRISTIAN ANDRES VARGAS GONZALEZ
  0 siblings, 0 replies; only message in thread
From: CRISTIAN ANDRES VARGAS GONZALEZ @ 2019-10-10 13:42 UTC (permalink / raw)
  To: kernelnewbies

[-- Attachment #1.1: Type: text/plain, Size: 3486 bytes --]

Thank you very much, I understand better, I will continue checking the
links that happened to me

regards
att cristian vargas


El mié., 9 oct. 2019 a las 11:00, <kernelnewbies-request@kernelnewbies.org>
escribió:

> Send Kernelnewbies mailing list submissions to
>         kernelnewbies@kernelnewbies.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> or, via email, send a message with subject or body 'help' to
>         kernelnewbies-request@kernelnewbies.org
>
> You can reach the person managing the list at
>         kernelnewbies-owner@kernelnewbies.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Kernelnewbies digest..."
>
>
> Today's Topics:
>
>    1. Re: Are there global constructors in the Linux kernel?
>       (Konstantin Andreev)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 09 Oct 2019 11:54:26 +0300
> From: Konstantin Andreev <andreev@swemel.ru>
> To: CRISTIAN ANDRES VARGAS GONZALEZ <vargascristian@americana.edu.co>,
>         kernelnewbies@kernelnewbies.org
> Subject: Re: Are there global constructors in the Linux kernel?
> Message-ID: <5D9DA042.2090205@swemel.ru>
> Content-Type: text/plain; charset=utf-8; format=flowed
>
> Hi, Cristian. There are, a kinda of ...
>
> kernel/taskstats.c:
> | late_initcall(taskstats_init);
>
> kernel/rcu/update.c:
> | early_initcall(check_cpu_stall_init);
>
> There is a whole set of macros STAGE_initcall() in include/linux/init.h
>
> Arguments to these macros invokations are accounted and called by kernel
> initialization code at strictly defined stages of initialization. See
> https://0xax.gitbooks.io/linux-insides/content/Concepts/linux-cpu-3.html
>
> The only thing that is run before kernel is <a series of>
> platform-specific boot loaders, maybe under hypervisor control. Compiler
> has no power to insert something in between.
>
> Regards, Konstantin.
>
> CRISTIAN ANDRES VARGAS GONZALEZ, 09 Oct 2019 06:44 MSK:
> >
> > Good day
> >
> >   I have been doing a little kernel following some repositories of
> GitHub, videos and wikis, and I have found a topic that leaves me with
> doubts, the theme is the global constructors.
> >
> > Suppose I write a program in c, for the user space, for my code to run I
> must have the main function
> > int main() { /*Code*/}
> >
> > The gcc compiler searches for this function to run my program, but
> before that happens, I can use the global constructors and write a code
> that runs before the main function, but in the case of writing a kernel,
> why do I need to run lines of code before the kernel is executed ?, I
> understand that when writing a kernel there is no main function and that it
> is disabled to indicate it to the compiler. In the Linux kernel are there
> global constructors? If so, what things are executed before starting the
> kernel?
> > att: cristian vargas.
>
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
> ------------------------------
>
> End of Kernelnewbies Digest, Vol 107, Issue 9
> *********************************************
>

[-- Attachment #1.2: Type: text/html, Size: 5581 bytes --]

<div dir="ltr"><pre class="gmail-tw-data-text gmail-tw-text-large gmail-tw-ta" id="gmail-tw-target-text" dir="ltr" style="unicode-bidi:isolate;line-height:36px;background-color:rgb(248,249,250);border:none;padding:2px 0.14em 2px 0px;font-family:inherit;overflow:hidden;width:283.011px;white-space:pre-wrap"><span tabindex="0" lang="en" style="">Thank you very much, I understand better, I will continue checking the links that happened to me</span></pre><pre class="gmail-tw-data-text gmail-tw-text-large gmail-tw-ta" id="gmail-tw-target-text" dir="ltr" style="unicode-bidi:isolate;line-height:36px;background-color:rgb(248,249,250);border:none;padding:2px 0.14em 2px 0px;font-family:inherit;overflow:hidden;width:283.011px;white-space:pre-wrap"><span tabindex="0" lang="en" style="">regards
att cristian vargas</span></pre></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El mié., 9 oct. 2019 a las 11:00, &lt;<a href="mailto:kernelnewbies-request@kernelnewbies.org">kernelnewbies-request@kernelnewbies.org</a>&gt; escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Send Kernelnewbies mailing list submissions to<br>
        <a href="mailto:kernelnewbies@kernelnewbies.org" target="_blank">kernelnewbies@kernelnewbies.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" rel="noreferrer" target="_blank">https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
or, via email, send a message with subject or body &#39;help&#39; to<br>
        <a href="mailto:kernelnewbies-request@kernelnewbies.org" target="_blank">kernelnewbies-request@kernelnewbies.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:kernelnewbies-owner@kernelnewbies.org" target="_blank">kernelnewbies-owner@kernelnewbies.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than &quot;Re: Contents of Kernelnewbies digest...&quot;<br>
<br>
<br>
Today&#39;s Topics:<br>
<br>
   1. Re: Are there global constructors in the Linux kernel?<br>
      (Konstantin Andreev)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Wed, 09 Oct 2019 11:54:26 +0300<br>
From: Konstantin Andreev &lt;<a href="mailto:andreev@swemel.ru" target="_blank">andreev@swemel.ru</a>&gt;<br>
To: CRISTIAN ANDRES VARGAS GONZALEZ &lt;<a href="mailto:vargascristian@americana.edu.co" target="_blank">vargascristian@americana.edu.co</a>&gt;,<br>
        <a href="mailto:kernelnewbies@kernelnewbies.org" target="_blank">kernelnewbies@kernelnewbies.org</a><br>
Subject: Re: Are there global constructors in the Linux kernel?<br>
Message-ID: &lt;<a href="mailto:5D9DA042.2090205@swemel.ru" target="_blank">5D9DA042.2090205@swemel.ru</a>&gt;<br>
Content-Type: text/plain; charset=utf-8; format=flowed<br>
<br>
Hi, Cristian. There are, a kinda of ...<br>
<br>
kernel/taskstats.c:<br>
| late_initcall(taskstats_init);<br>
<br>
kernel/rcu/update.c:<br>
| early_initcall(check_cpu_stall_init);<br>
<br>
There is a whole set of macros STAGE_initcall() in include/linux/init.h<br>
<br>
Arguments to these macros invokations are accounted and called by kernel initialization code at strictly defined stages of initialization. See <a href="https://0xax.gitbooks.io/linux-insides/content/Concepts/linux-cpu-3.html" rel="noreferrer" target="_blank">https://0xax.gitbooks.io/linux-insides/content/Concepts/linux-cpu-3.html</a><br>
<br>
The only thing that is run before kernel is &lt;a series of&gt; platform-specific boot loaders, maybe under hypervisor control. Compiler has no power to insert something in between.<br>
<br>
Regards, Konstantin.<br>
<br>
CRISTIAN ANDRES VARGAS GONZALEZ, 09 Oct 2019 06:44 MSK:<br>
&gt;<br>
&gt; Good day<br>
&gt;<br>
&gt;   I have been doing a little kernel following some repositories of GitHub, videos and wikis, and I have found a topic that leaves me with doubts, the theme is the global constructors.<br>
&gt;<br>
&gt; Suppose I write a program in c, for the user space, for my code to run I must have the main function<br>
&gt; int main() { /*Code*/}<br>
&gt;<br>
&gt; The gcc compiler searches for this function to run my program, but before that happens, I can use the global constructors and write a code that runs before the main function, but in the case of writing a kernel, why do I need to run lines of code before the kernel is executed ?, I understand that when writing a kernel there is no main function and that it is disabled to indicate it to the compiler. In the Linux kernel are there global constructors? If so, what things are executed before starting the kernel?<br>
&gt; att: cristian vargas.<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org" target="_blank">Kernelnewbies@kernelnewbies.org</a><br>
<a href="https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" rel="noreferrer" target="_blank">https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br>
<br>
------------------------------<br>
<br>
End of Kernelnewbies Digest, Vol 107, Issue 9<br>
*********************************************<br>
</blockquote></div>

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.1.1570636802.1872.kernelnewbies@kernelnewbies.org>
2019-10-10 13:42 ` Kernelnewbies Digest, Vol 107, Issue 9 CRISTIAN ANDRES VARGAS GONZALEZ

Kernel Newbies archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \
		kernelnewbies@kernelnewbies.org
	public-inbox-index kernelnewbies

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git