Home arrow Forums
OSDEV Forums  


Mike359
User

Senior Osdever
Posts: 27
graphgraph
Karma: 1  
BOCHS issue - 2006/07/25 12:45
We all know the last 2 lines that should go at the bottem of the bootloader are:

Code:

  times 510-($-$$) db 0 dw 0xAA55



Well I added that. I tested my kernel on my computers and they all booted. When I try using Bochs it calls my floppy "Not a bootable" disk. Well figuring that it was my fault I tried differnt varations. All my computers (8 of them) booted it perfectly. Bochs refused.

I went on Osdever.net and downloaded a quick bootloader and tried it on Bochs. It didnt boot that either.
This appears to be a Bochs issue. Does anyone know how to fix this?
  | | The administrator has disabled public write access.
OSDEV
Community
Advertisement
   
gaf
Visitor
 
Re:BOCHS issue - 2006/07/26 07:42 Hello Mike
from what I know some/most computers don't actually check if the signature is correct. Bochs is a bit stricter here and really makes sure that the bootsector is valid before executing it. Therefore I'm not quite sure if it's really a problem with bochs. What you could do is checking if the signature is in the right position by opening the image of the floppy in a hex-editor (java editor). Normally the magic number should be stored in bytes 0x1FE (0x55) and 0x1FF(0xAA) - if it isn't there might be some problem with NASM.

Maybe you could also post the commands you use to copy the bootsector to the floppy. It's possible that the signature is in the binary, but never gets written to the disk. Also, are you using a precompiled version of bochs or did you build it by yourself ?

regards,
gaf
  | | The administrator has disabled public write access.
Mike359
User

Senior Osdever
Posts: 27
graphgraph
Karma: 1  
Re:BOCHS issue - 2006/07/26 14:09 Well to put it this way "it just stopped working".
I compiled my code and put it on a floppy with the same stuff I always use and it stopped working with Bochs. (I am using the compiled version from sourceforge)
  | | The administrator has disabled public write access.
gaf
User

Platinum Osdever
Posts: 153
graph
Karma: 10  
Re:BOCHS issue - 2006/07/27 05:54 Just a wild guess, but could it be that your bootsector code simply grew too large ? If it's more than 512bytes long, the signature of course can't get appended. Another possibility is, that some of the sectors of your floppy have become corrupted. Have you tried using some other disk ?

regards,
gaf
  | | The administrator has disabled public write access.
root
User

Platinum Osdever
Posts: 121
graphgraph
Karma: 1  
Re:BOCHS issue - 2006/07/27 09:31 Mike359 wrote:
Well to put it this way "it just stopped working".

If you paste here the contents of your boot sector source code we could help, otherwise we base only on assumptions.
  | | The administrator has disabled public write access.
Mike359
User

Senior Osdever
Posts: 27
graphgraph
Karma: 1  
Re:BOCHS issue - 2006/07/27 11:00 Nope its exactly 512 bytes.
  | | The administrator has disabled public write access.
gaf
User

Platinum Osdever
Posts: 153
graph
Karma: 10  
Re:BOCHS issue - 2006/07/27 13:17 You don't happen to have touched your bochsrc-file lately ? If bochs is told to load from a non-existant drive, the very same error message is printed. Maybe you should make sure that "floppya: 1_44=X" point to the correct letter/image..

cheers,
gaf
  | | The administrator has disabled public write access.
Mike359
User

Senior Osdever
Posts: 27
graphgraph
Karma: 1  
Re:BOCHS issue - 2006/07/28 12:06 It reads from the disk. The soure file is ok.
  | | The administrator has disabled public write access.
gaf
User

Platinum Osdever
Posts: 153
graph
Karma: 10  
Re:BOCHS issue - 2006/07/28 14:36 Sorry, I'm running out of ideas . Just as ciprian already said: Post your bootloader's code and we can have a closer look at it..

regards,
gaf
  | | The administrator has disabled public write access.
Mike359
User

Senior Osdever
Posts: 27
graphgraph
Karma: 1  
Re:BOCHS issue - 2006/07/31 10:43 Well I fixed it. I wrote my own file copy program!
  | | The administrator has disabled public write access.

A WebArticles site. Sponsored by Evoleto. Motorola V525 / Business Directory / Delaware Incorporation / Home Made Bazaar