I've done some general researched and saw that reboots is done by first shutting down and also sending a "message" to the motherboard that right before you power off, you cancel, reset some values, and instead act if you just pressed the button and powered on the computer.
Remember, If it's possible, I don't want to implement some complicated library and so on. I would want pure assembly and from scratch (if possible). And what I want is when I reboot, I want BIOS to go through the boot order, so if the user has my OS to boot after for example Windows, which means he has to go into bios manually and then start my OS manually, then when my OS performs a reboot, BIOS should go though the boot order and see "aah, I should boot Windows". Get it? So I don't just want to reload my bootloader from scratch. I want the whole system to reboot, kind of the reboot button on Windows XP/7/8/8.1/10 etc... So how do I add a reboot functionality to my code? Please show code to help me understand what to do



