I was trying to write a bootloader in the assembly language to a USB drive, to test it on another computer. The bootloader (should) work with intel processors. The computer I'm testing it on (windows 7 with intel celeron and 2 GB ram) should be running it, it even has an option for booting from a USB drive in the BIOS (and it detects the drive). When I run the boot from the drive, it boots into windows. It should be displaying my custom-OS, which is basically just a Hello-World type assembly program. I am assuming this is because it could not find the operating system: Either the OS-tag (which I found should be "dw 0xAA55") is not correct, the USB drive isn't bootable, or I'm just not putting the bootloader bin file in the first sector.
My questions are: How do I test if (a) the USB drive is capable of booting an OS, (b) if the OS is being recognized, and (c) if the bin file is in the correct sector (the first sector).
Here is the assembly code:
org 7C00h jmp 0x0:start start: cli mov ax, 0x9000 ;Set up stack mov ss, ax ;Tell processor where stack is mov sp, 0xFB00 ;Set stack offset sti mov AH, 0Eh ;Tell bios we're writing a char to screen! mov AL, 'T' ;Load a new character into memory int 10h ;Call BIOS video interrupt jmp start ;And so on and so on times 510-($-$$) db 0 ;Fill rest of sector up with 0s to make this 512B (a sector) dw 0xAA55 ;Let BIOS know this is an OS! (defines a word)
I am rather new to assembly, so if the comments after some of the lines don't match up to what they should be, then this is probably why. Thanks for your help!