Page 2 of 2

Re: Where in memory does an EL-Torito bootsector end?

Posted: Wed May 28, 2014 5:34 pm
by Isaac
I don't know which debugger to use or how to install it. I searched the internet for information on how to install a debugger or how to use one, but I didn't find anything useful.

Re: Where in memory does an EL-Torito bootsector end?

Posted: Wed May 28, 2014 6:15 pm
by sortie
You potentially want the Bochs debugger. You can enable it when you compile your own custom Bochs.

Re: Where in memory does an EL-Torito bootsector end?

Posted: Mon Jun 16, 2014 4:11 pm
by Isaac
Say, isn't this weird? I took the same code and changed it a little:

Code: Select all

BITS 16
[org 0x7C00]
start:
mov ah,0xe
mov al,'F'
int 0x10
mov ah,0xe
mov al,'S'
int 0x10
jmp $
times 510-($-$$) db 0
dw 0xaa55
Then I assembled it and (without El Torito stuff) tested it out in QEMU. It prints both letters (the "F" and the "S")!

Re: Where in memory does an EL-Torito bootsector end?

Posted: Fri Jul 04, 2014 3:08 pm
by Isaac
I emailed Mike, the editor of the OS Development Series on BrokenThorn.com, asking him my question. He reformatted my code and sent it back to me in an email. When I looked at the way he reformatted my code, I understood what the problem with my code was. An ISO 9660 bootfile has a different format. At 8 bytes into your code, ISO 9660 puts in two system identifier fields, each one taking up 32 bytes. Since I didn't declare a space for these fields, they were put in anyway, overwriting some of my code. To avoid this problem, my code can be written like this:

Code: Select all

BITS 16
[org 0x0]
jmp 0x7c0:start
times 71-($-$$) db 0
start:
mov ah,0xe
mov al,'F'
int 0x10
mov al,'S'
int 0x10
jmp $
times 2048-($-$$) db 0
In the light of this, it can also be explained why when I wrote my code as shown below, assembled it and tested it out on QEMU without El Torito stuff, it worked.

Code: Select all

BITS 16
[org 0x7C00]
start:
mov ah,0xe
mov al,'F'
int 0x10
mov ah,0xe
mov al,'S'
int 0x10
jmp $
times 510-($-$$) db 0
dw 0xaa55
Since this is not an ISO 9660 bootfile, it doesn't need to declare a space for system identifier fields.