Crashes when booting as CD image
Posted: Fri Aug 01, 2008 7:03 pm
Hey everyone!
I have a quick question... I am having a problem in my (kind of new) 2nd stage boot loader.
The problem relates to the BIOS INT 0x13 function 0x02 (READ SECTOR(S) INTO MEMORY).
If I boot it from a floppy image, it runs fine in both Bochs and Virtual PC (No errors nor crashes, runs my kernel fine too). However, if I create a CD image of it (with floppy emulation) and boot from it, it fails at my ReadSectors() int 13 bios interrupt call (It never seems to return from it).
All of my other ReadSectors() int 0x13 calls work (they load below the 1MB mark). This ReadSectors() int 0x13 call that is crashing was set up to load the file to 1MB and is the only one that fails. Can me loading at 1MB be the problem? If so, why would it work when booting form floppy but not CD?
Virtual PC just hangs and Bochs gives me this when booting from the CD image:
Please keep in mind that my code works fine with Bochs and VirtualPC when booting from a floppy image. This only seems to happen with CD images.
I will be more then happy to post any code if requested--I just don't quite know what I should post here.
ES:BX was set by me (0xffff:0x0010) = 0x100000 (1 MB). This is the buffer for the Bios interrupt handler to copy the sectors to.
Thanks for any suggestions
I have a quick question... I am having a problem in my (kind of new) 2nd stage boot loader.
The problem relates to the BIOS INT 0x13 function 0x02 (READ SECTOR(S) INTO MEMORY).
If I boot it from a floppy image, it runs fine in both Bochs and Virtual PC (No errors nor crashes, runs my kernel fine too). However, if I create a CD image of it (with floppy emulation) and boot from it, it fails at my ReadSectors() int 13 bios interrupt call (It never seems to return from it).
All of my other ReadSectors() int 0x13 calls work (they load below the 1MB mark). This ReadSectors() int 0x13 call that is crashing was set up to load the file to 1MB and is the only one that fails. Can me loading at 1MB be the problem? If so, why would it work when booting form floppy but not CD?
Virtual PC just hangs and Bochs gives me this when booting from the CD image:
Code: Select all
00001280102p[CPU ] >>PANIC<< prefetch: RIP > CS.limit
00001280102i[SYS ] Last time is 1217637822
00001280102i[CPU ] real mode
00001280102i[CPU ] CS.d_b = 16 bit
00001280102i[CPU ] SS.d_b = 16 bit
00001280102i[CPU ] | EAX=04e40e2e EBX=00000010 ECX=00300102 EDX=00000000
00001280102i[CPU ] | ESP=0000ffcb EBP=00000010 ESI=00000749 EDI=00000005
00001280102i[CPU ] | IOPL=0 OV UP DI NG NZ AC PO NC
00001280102i[CPU ] | SEG selector base limit G D
00001280102i[CPU ] | SEG sltr(index|ti|rpl) base limit G D
00001280102i[CPU ] | DS:0000( 0000| 0| 0) 00000000 0000ffff 0 0
00001280102i[CPU ] | ES:ffff( 0000| 0| 0) 000ffff0 0000ffff 0 0
00001280102i[CPU ] | FS:07c0( 0000| 0| 0) 00007c00 0000ffff 0 0
00001280102i[CPU ] | GS:07c0( 0000| 0| 0) 00007c00 0000ffff 0 0
00001280102i[CPU ] | SS:0000( 0000| 0| 0) 00000000 0000ffff 0 0
00001280102i[CPU ] | CS:0eba( 0000| 0| 0) 0000eba0 0000ffff 0 0
00001280102i[CPU ] | EIP=00010460 (00010460)
00001280102i[CPU ] | CR0=0x60000010 CR1=0x00000000 CR2=0x00000000
00001280102i[CPU ] | CR3=0x00000000 CR4=0x00000000I will be more then happy to post any code if requested--I just don't quite know what I should post here.
ES:BX was set by me (0xffff:0x0010) = 0x100000 (1 MB). This is the buffer for the Bios interrupt handler to copy the sectors to.
Thanks for any suggestions