How to make a c program run on boot time

This is a discussion on How to make a c program run on boot time within the Tech Board forums, part of the Community Boards category; I want a c program which copies a file from one location to another to run at boot time that ...

  1. #1
    Registered User
    Join Date
    Mar 2011
    Posts
    3

    How to make a c program run on boot time

    I want a c program which copies a file from one location to another to run at boot time that is before operating system starts.......Any body please help.....

  2. #2
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    What you are talking about here is a rootkit ... a technique commonly used to implant viruses into computers...

    Can't speak for anyone else, but I think I'll follow the Forum policy and not discuss it here.

    Just a rhetorical question really but...
    Why is it the first thing I usually see from noobs is the burning desire to do something awful?
    Last edited by CommonTater; 03-11-2011 at 02:12 PM.

  3. #3
    Registered User
    Join Date
    Mar 2011
    Posts
    3
    @CommonTater
    Actually i was planning to create a software which backups the system files in ubuntu....As a part of my mini project......And i need c program to run on boot time while restoring the os files...That is why i am seeking help..I need only how to make my c object file to execute on boot time...
    Last edited by muhammed irshad; 03-11-2011 at 02:16 PM.

  4. #4
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    What about using a bootable CD?
    "I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

    "the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010

  5. #5
    THANK YOU KINDLY SIR Phenax's Avatar
    Join Date
    Mar 2011
    Posts
    74
    Quote Originally Posted by muhammed irshad View Post
    @CommonTater
    Actually i was planning to create a software which backups the system files in ubuntu....As a part of my mini project......And i need c program to run on boot time while restoring the os files...That is why i am seeking help..I need only how to make my c object file to execute on boot time...
    That is totally dependent on your operating system. You'd want to ask this question on the Ubuntu forums, or the General section because this isn't really related to C coding. Most Linux distributions have some kind of initialization/boot system that handles things like mounting file systems and loading kernel modules. Often times these initialization systems allow you to write "hooks" where you can do your own stuff. But I'm not an expert nor do I know what Ubuntu uses.
    Quote Originally Posted by Plato
    Never discourage anyone...who continually makes progress, no matter how slow.

  6. #6
    Third Eye Babkockdood's Avatar
    Join Date
    Apr 2010
    Posts
    352
    I believe /etc/rc is a shell script that's executed once on boot. You could call your programs from the shell script, but make sure it doesn't drag down your computer.
    Quote Originally Posted by The Jargon File
    Microsoft Windows - A thirty-two bit extension and graphical shell to a sixteen-bit patch to an eight-bit operating system originally coded for a four-bit microprocessor which was written by a two-bit company that can't stand one bit of competition.

  7. #7
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,499
    The only way to do anything useful before the OS starts is to boot another OS on another partition, then mount the partition of the original OS in read-only mode.

    To that, the easiest thing to do is install one of the small Linux distributions on another partition (ones which give you only a console), and then run your normal C program from there.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Grouping Question
    By baikal_m in forum C Programming
    Replies: 7
    Last Post: 10-26-2010, 04:41 PM
  2. Hi,how do I make this program run?
    By Jasper in forum C Programming
    Replies: 2
    Last Post: 06-30-2009, 08:49 PM
  3. how to make my program run on windows start up
    By kantze in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 03-24-2007, 11:14 AM
  4. plz help me run this program!!!
    By galmca in forum C Programming
    Replies: 8
    Last Post: 02-01-2005, 12:00 PM
  5. freebsd and redhat dual boot.
    By xddxogm3 in forum Linux Programming
    Replies: 1
    Last Post: 05-09-2004, 06:06 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21