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.