zap8600 wrote:
Hi. Bochs wasn't able to detect a bootable drive. I did try to convert my .bin file to a .img file, but I don't think that worked. I'm going to try rebuilding my cross-compiler because on the current laptop I'm using to code, I just copied the compiler from another system I had. As of writing this, I'm in school, so when I get home I will upload a new .bin file and my bochsrc.txt file. Before I uploaded my code, it did successfully compile. When I downloaded the code from Github, it did compile, but instead, when I tried to run the compiled image Bochs, it said it wasn't bootable. When I tried to run the compiled image (not the converted one) in QEMU, my OS gave me a disk error after trying to load the kernel into memory. all the registers are the same. My bootloader has a memory offset of 0x7c00.
This usually means you don't have the necessary signature at the end of the sector.
zap8600 wrote:
P.S. For the IDE drive, how do I read and write with an offset?
I don't know what you mean. When you tell the controller to read a sector, you have to read the whole sector from word 0 to word 255. You cannot read just one word within that sector. You have to read the whole sector.
zap8600 wrote:
Also, do USBs have an IDE Compatibility Mode?
:-)
zap8600 wrote:
Also, how do I save the dl register so that the kernel knows what drive it booted from?
I have discussed this in previous posts and within my book, in quite detail. Search previous posts for this exact question.
zap8600 wrote:
Also, do I have to put the drive into IDE Compatibility Mode from the bootloader?
No, you simply rely on the fact that the BIOS has done everything necessary to read sectors simply by calling the service. I think you need to forget about IDE Compatibility mode. It is used in older PCI devices (and not really required) and with newer AHCI devices. If you place the correct line in your bochsrc.txt file, you will have an IDE drive, period. Same with QEMU. If your real hardware doesn't have an IDE drive, you are out of luck when testing your IDE code on it.
Ben