From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35BC8C47404 for ; Wed, 9 Oct 2019 03:44:53 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E65ED20B7C for ; Wed, 9 Oct 2019 03:44:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=americana-edu-co.20150623.gappssmtp.com header.i=@americana-edu-co.20150623.gappssmtp.com header.b="GtC8lLTi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E65ED20B7C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=americana.edu.co Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.92.3) (envelope-from ) id 1iI2u3-0004mE-Qk; Tue, 08 Oct 2019 23:44:43 -0400 Received: from mail-io1-xd2e.google.com ([2607:f8b0:4864:20::d2e]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.3) (envelope-from ) id 1iI2u0-0004ls-EC for kernelnewbies@kernelnewbies.org; Tue, 08 Oct 2019 23:44:40 -0400 Received: by mail-io1-xd2e.google.com with SMTP id q10so1893575iop.2 for ; Tue, 08 Oct 2019 20:44:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=americana-edu-co.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=xRSG2jJLgiwVIpWw9ZtF9ZmrMW/eLQSgwal8UlBQN8I=; b=GtC8lLTisgccTJgEINrum0/6elsKPcpb9aNARP2NBkgP8UyJckqcGNSuHpdy3BFTtt bRdbQ1edtZR1Rn99SuoV46neRVBBq+9W4w7+kKVYQW3oRxI5Hweg6lHyfpE1kCh5xLlg Qo3jKj5lcE8KaPJMzt/qX+A3MhSmJ+/2eMH1qaFRK9OsLeo7sCd0Wo0JGMVBn76U4mXb KSzuYJBQOcQABjnN/URcCr3viLiOGHKuixAbPq7cmsKG6/yD3/BBdJ9hvclq8vUGWr8C XvCJiNQw2Wd1pvB0UQxXZXPNqAsvlTSpW+OrGe4EH3zmarXWcU83vWVO5feoExXfK9IV p52w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=xRSG2jJLgiwVIpWw9ZtF9ZmrMW/eLQSgwal8UlBQN8I=; b=KWmztUHjgjUXXjUpEmypbLmJ+TFMisgTXy6DdrtMGkvzDNQM/TZQwlospMhloAAPMJ 7yNy7fIn05gSCFr06B7Tna52eo/bDcaperhCsQqFdCRrmRlP0FYwBDJTVlhdRwiXlmc0 jrqKdUQC5TbAJfALjP/movLfZZWG0jMPQiPNrRbxUA2BbYIfCBSiemop5JRw1Zup3464 kz7GpJWyDkLHPFCBmw+2yoep3sxrR5mc8K4WVWqGUhDKd1dnEMlm9EI6pud7R+ZWn9GA ymhpITF0yD5vcwgdeEPVtBy2lHaBIkOd5qzxlF7vEGmKZ1BL7xug5nFzGX5GSkHMtr2W +TsQ== X-Gm-Message-State: APjAAAUT5/35OIGCrzrtCbIAHhbfqVS5G0NsIAAye5zXVhvDlNGGjgGJ 4Aa7D1/okKNsXaQGbpj/sA0ES0C79c4Fl06Bp+a/qSo+028= X-Google-Smtp-Source: APXvYqxxxcHmLo2JRohPcjr28GjKM27vPmqvTz1BfCAX+Rmx0ZtIW0EkxhgjdzCYZIUiWcgFZfK9Rh3LgcJXj5w03Vo= X-Received: by 2002:a5d:8991:: with SMTP id m17mr1619880iol.106.1570592678026; Tue, 08 Oct 2019 20:44:38 -0700 (PDT) MIME-Version: 1.0 From: CRISTIAN ANDRES VARGAS GONZALEZ Date: Tue, 8 Oct 2019 22:44:26 -0500 Message-ID: Subject: Are there global constructors in the Linux kernel? To: kernelnewbies@kernelnewbies.org X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============4672373793454322794==" Errors-To: kernelnewbies-bounces@kernelnewbies.org --===============4672373793454322794== Content-Type: multipart/alternative; boundary="000000000000a935600594721aab" --000000000000a935600594721aab Content-Type: text/plain; charset="UTF-8" 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. --000000000000a935600594721aab Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Good day=C2=A0

=C2=A0I 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 construc= tors.

Suppose I write a program in c, for the user space, for my cod= e to run I must have the main function
int main() { /*Code*/}

The gcc compiler searches f= or 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, bu= t in the case of writing a kernel, why do I need to run lines of code befor= e the kernel is executed ?, I understand that when writing a kernel there i= s 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 thing= s are executed before starting the kernel?
att: cristian vargas.
--000000000000a935600594721aab-- --===============4672373793454322794== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --===============4672373793454322794==--