Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    May 2004
    Location
    New Hampshire, America
    Posts
    246
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Program To Boot Before Windows

    Hi everyone, so I'm interested in designing a program that would be capable of booting before everything else on the computer. What I mean is, something like a boot-time scan on an anti-virus program which can be scheduled to run at boot, in a sort of DOS style screen. My questions are as follows:

    Would I need to edit the autoexec.bat / .nt file?
    Will I need to compile my program without accessing any APIs requiring windows?
    Can I use standard C++ with printf/scanf for input/output?
    So basically: How exactly is this accomplished?

    I'm academically interested in this because I've been programming C/C++ for a long time and never had to do this before. The thought popped into my head the other day and I can't stop wondering how it's done. How do I design and implement a program to run before windows?

  • #2
    New Coder
    Join Date
    May 2009
    Posts
    88
    Thanks
    4
    Thanked 4 Times in 4 Posts
    You could install the program to a separate partition and boot to this partition from the bootloader on the MBR. Then once you've done your scanning, you could "forward" the boot to the windows partition. Programming above the OS could be a little tricky... You could install a minimalist linux distro to the partition or work on a Linux from Scratch system and you should be able to use the same commands as normal.

  • #3
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    On Windows at least, there must be some standardized way of doing this. I've seen boot time defragmenters and such do it, what usually happens is they run shortly after the kernel is initialized but before the GUI is loaded. That way you can leverage having a working operating system to do whatever it is you need to do before a lot of the other components are loaded.

    On Linux there are very few cases where this needs to be done. The reason for this is that programs are executed differently, the executable is loaded into memory and no longer requires the copy on the disk while it is running. This is actually pretty nice because it makes upgrading stuff so much easier. You can replace the binaries and then once you are done, just restart the program and you are running the new version.
    OracleGuy


  •  

    Posting Permissions

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