Pem3 wrote:Well I have written my code to 1st sector of partition (opened as logical in HxD, 2nd bootloader - right ?). Is it wrong ? As I have understood by what you have written above, then it's totally wrong, hmm ? Dunno what to think about it now. Am I wrong or you ?
If you read what I said more carefully, you'll notice that I told you that the
logical drive is the partition. If you want your code to run, you can indeed put it there, but you'll then need to make sure you have a proper MBR in the first sector (sector zero) of the physical drive containing code capable of finding the partition and booting your VBR. The partition table entry also needs to indicate that the partition contains a bootable VBR, so the first byte of that table entry needs to be set to 80h. The MBR code will then load in the VBR and hand control over to it, assuming the MBR contains valid code - it may well not do this though, because typically the first sector on a flash drive is empty apart from the partition table and contains no code capable of booting a VBR.
If there is no MBR code, you can put your bootloader in the MBR for now instead and see if it boots up. It should do, because if the BIOS is set up to boot from USB, all it will care about is that the boot sig is there and if so it will run your code. If you have more than one USB port though, it may be that only one of them will work for this.
[Edit: corrected bit in bold - I wrote "logical sector" instead of "logical drive" at the first attempt.]
Edit 2: I notice now that you know you've put it at the start of a partition, but it won't boot from there without a proper MBR at sector 0 of the physical drive with MBR code in it and a partition table entry set to label the partition as bootable. That's what you need to fix, but if you want to test quickly whether you can get your machine to boot from USB at all, you can try using your bootloader code in place of MBR code (sector 0 of the physical drive) and it ought to boot up and display your message.