>>>>> Peter �strand writes:
PA> mov bx, 0x7c00 ; Buffer
[...]
PA> jmp 0x7c00 ; Jump to bootsector
PA> What conditions must be met before one can load a bootsector,
PA> besides DL loaded with current drive?
Your code does not deal with the segment registers. You cannot load
to just any 0x7c00, it has to be 0:0x7c00.
I don't know exactly how to do this in NASM, but it should look
something like:
xor bx, bx ; Zero data segment
mov ds, bx
mov bx, 0x7c00 ; Buffer
Then, you also need to load the code segment register with 0. I think
the only way to do that is to load the stack with 0:0x7c00, then do a
far return. I'm not sure of the byte order, though, so you may have
to swap the xor and mov lines:
xor ax, ax ; Push 0 on the stack
push ax
mov ax, 0x7c00 ; Push 0x7c00 on the stack
push ax
retf ; Jump to 0:0x7c00
PA> What about memory-pollution: does it matter that the memory isn't
PA> completely cleared?
The only thing I can think of that would matter is the fact the
interrupt table isn't reset to its initial state. If you have any
TSRs, then very bad things will happen when NT (or whatever) assumes
that, say, INT13 points to a ROM BIOS routine, when it actually points
to a DOS TSR that was overwritten during loading.
Assuming a perfectly clean (i.e. unmodified) interrupt table, you
probably will be lucky.
I hope this gives you a hint about how to proceed,
--
Gordon Matzigkeit <[EMAIL PROTECTED]> //\ I'm a FIG (http://www.fig.org/)
Committed to freedom and diversity \// I use GNU (http://www.gnu.org/)