Find the answer to your Linux question:
Results 1 to 6 of 6
Hi everybody! Is there any way to run a my own C program when booting linux? Actually I'm thinking about printing "Hello World!" and hold when I turn my machine ...
  1. #1
    Just Joined!
    Join Date
    Sep 2009
    Posts
    2

    Booting C programs!!

    Hi everybody!
    Is there any way to run a my own C program when booting linux? Actually I'm thinking about printing "Hello World!" and hold when I turn my machine on. Which configuration files I should edit or where I should put my program in the file system? Thanx!

  2. #2
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,422
    Add it to the init script of the Distro
    In arch this is /etc/rc.sysinit
    New Users, please read this..
    Google first, then ask..

  3. #3
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    If you want your system to really just give out that message and nothing else, try out the kernel "init=(your/program" option. (If you use GRUB as bootloader, you can directly edit the booting line when starting).
    http://www.linuxjournal.com/article/3109

    Then your application will be loaded and executed right after kernel initialization as the "master application". This means no other program like bash will be loaded.
    Debian GNU/Linux -- You know you want it.

  4. #4
    Just Joined!
    Join Date
    Sep 2009
    Posts
    2
    Thanx everybody! Linux is very much customizable no? That's great!!!

  5. #5
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,422
    Linux is made for Software Hackers by Software Hackers.
    Meaning you can do ANYTHING, this might be a shock if you come from that one system were you are limited to what the company thinks you should do on your system

    Linux (I should say Unix) is everywhere: Phones, DVD Players, Microwaves, TiVO and yes sometimes even in ATMs.
    This is since you can Mod if how you want it.
    New Users, please read this..
    Google first, then ask..

  6. #6
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    Quote Originally Posted by asanka View Post
    Thanx everybody! Linux is very much customizable no? That's great!!!
    Not only Linux is, I would like to point out.
    For example, if you modify GNU GRUB, you not only have the last word, but also the first word your machine prints out after BIOS.

    And with Coreboot, we now even start claiming the right to a say in the realm that has been regarded closed hardware for some decades
    Debian GNU/Linux -- You know you want it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...