; SS register. That is the responsibility of the caller.
;
; Inputs:
-; DS:BX -> Pointer to list of (dst, src, len) pairs
+; DS:BX -> Pointer to list of (dst, src, len) pairs(*)
; AX -> Number of list entries
; [CS:EntryPoint] -> CS:IP to jump to
; On stack - initial state (fd, ad, ds, es, fs, gs)
;
+; (*) If dst == -1, then (src, len) entry refers to a set of new
+; descriptors to load.
+; If src == -1, then the memory pointed to by (dst, len) is bzeroed;
+; this is handled inside the bcopy routine.
+;
shuffle_and_boot:
+.restart:
and ax,ax
jz .done
.loop:
mov edi,[bx]
mov esi,[bx+4]
mov ecx,[bx+8]
+ cmp edi, -1
+ je .reload
call bcopy
add bx,12
dec ax
popfd
jmp far [cs:EntryPoint]
+.reload:
+ mov bx, trackbuf ; Next descriptor
+ movzx edi,bx
+ push ecx ; Save byte count
+ call bcopy
+ pop eax ; Byte count
+ xor edx,edx
+ mov ecx,12
+ div ecx ; Convert to descriptor count
+ jmp .restart
+
;
; trampoline_to_pm:
;
(FFFFFFFFh) then the block specified by the destination
address and the length is set to all zero.
+ Starting in version 3.50, if the destination address is -1
+ (FFFFFFFFh) then the data block is loaded as a new set of
+ descriptors, and processing is continued (and unprocessed
+ descriptors are lost, this is thus typically only used as the
+ last descriptor in a block.) The block must still fit in the
+ internal descriptor buffer (see function 0011h), but can, of
+ course, itself chain another block.
+
+
Normal boot sectors expect DL to contain the drive number,
and, for hard drives (DL >= 80h) DS:SI to contain a pointer to
the 16-byte partition table entry. The memory between
; The secondary BSS section, above the text; we really wish we could
; just make it follow .bcopy32 or hang off the end,
; but it doesn't seem to work that way.
-LATEBSS_START equ 0B200h
+LATEBSS_START equ 0B300h
; Reserve memory for the stack. This causes checkov to abort the
; compile if we violate this space.