I've been trying this for 1 year now and can't seem to find anything useful (yeah, I know I suck). I've made a C++ application with WinAPI which allows me to read and write raw disk bytes with CreateFile(). However, now I need to do it with assembly so the program runs as a bootloader. It will interact with the user, but that part I can handle.
So I've tried many tutorials of making your own operating system, but none of the code there appears to work. I started with this and learned how to print text to the screen (which I will use to interact with the user):
http://www.howtodothings.com/computers/a1015-making-your-own-operating-system.html
Then I tried many tutorials on bootloaders and bootstraps which I don't have anymore because my bookmarks were deleted. However I recently tried the part of the following code to read sectors and tired to print them to the screen, but it didn't work:
http://www.omninerd.com/articles/PC_Bootstrap_Loader_Programming_Tutorial_in_ASM
I found that all tutorials talk about bootloaders and bootstraps loaded from a floppy disk, not a hard disk, and when I change the parameters for a hard disk it doesn't work.
I no longer know what to do, I've created and got rid of countless bootloaders until now because I couldn't make them work. Does anyone know of any code or tutorial that will allow me to read the MBR 512 bytes with a bootstrap and store them in a variable? That's where I'm stuck, I can't read them from the hard disk, much less store them in a variable (which I will then use teletype to print it to the screen).
I am using 16 bits assembly and emu8086 as compiler. Tried to look if one could make a bootloader with 32 bits assembly, but found no tutorial on 32 bits bootstraps.