Click here to Skip to main content
15,885,998 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am trying to make a interface for boot. (Batch styled) but I know TrueCrypt does it. But I have been unable to find a way to do it. I wanted it because I wanted to test what I can do in the boot and learn more about how boot system works. If you know how to execute a file on boot that would be very helpful

Thanks in advance

What I have tried:

I have looked everywhere online for a method I can play with and learn more.
Posted
Updated 27-Jan-19 11:48am

Quote:
How do I write a program to load on boot

The way you ask the question, suggest that you don't really know how "boot" works.
On a PC, there is many boots at different levels.
- First, a PC boots on BIOS: you can't add an external program on it.
- then BIOS goes to MBR (Master Boot Record): here, you can replace the standard boot loader by your own program. LILO is such a program.
LILO (boot loader) - Wikipedia[^]
For EFI enabled PC, boot loader is on a little partition, like MBR, it choose which partition will boot. that partition is the one with the OS (windows, linux ...)

If you have more than 1 OS, this is where you choose which OS will boot.

Then the OS start to boot by loading the file system driver.
Usually, It is at this point that OS utilities are doing their stuff in console mode, before windows starts.
You can also have automatic start of program after windows boot by copying the program shortcut in 'start' submenu.

So depending on what the program does and when it is supposed to start, there is different places to start.
 
Share this answer
 
If you're talking about running code before Windows even starts, Google for "how to write a bootloader". Warning, this is NOT easy and NOT easy to get working. Remember, you don't have a runtime nor an O/S to handle stuff for you, so you have to write EVERYTHING yourself.
 
Share this answer
 
Comments
WOLF 2018 27-Jan-19 16:16pm    
Ok I will give that a try but I thought you could boot Windows OS and use they bootloader and inject a process.
Dave Kreskowiak 27-Jan-19 16:27pm    
Good luck with that. You're not going to get much help with it here. That can be used for malicious purposes.
WOLF 2018 27-Jan-19 16:36pm    
No I am doing it because I wanted to Learn more about the window boot process and get a program in to log the info to a txt file to read when I login.
Dave Kreskowiak 27-Jan-19 20:53pm    
Or you could just skip rewriting a part of Windows (NOT a good idea!) and just turn on boot logging.

How To Enable Boot Log in Windows 10[^]
Here is a CodeProject article about it: How to develop your own Boot Loader[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900