diff options
authorH. Peter Anvin <hpa@zytor.com>2007-03-30 13:33:47 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-03-30 13:33:47 -0700
commit48f62dd984768c64a4c481bf41578cb8a0e63c49 (patch)
parent5d85d394d3569191a930cd1dba1d7d68d824a787 (diff)
Support chaining shuffle descriptors when buffer is too smallsyslinux-3.50-pre1
Provide a method for re-loading shuffle descriptors from a buffer in high memory when the shuffle descriptors are too many to fit in the buffer. This can happen when trying to stitch an initramfs together from parts. Still need library support for this, however.
3 files changed, 30 insertions, 2 deletions
diff --git a/bcopy32.inc b/bcopy32.inc
index b8e1a5bd..a7b6d6bd 100644
--- a/bcopy32.inc
+++ b/bcopy32.inc
@@ -442,18 +442,26 @@ try_wbinvd:
; 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.
and ax,ax
jz .done
mov edi,[bx]
mov esi,[bx+4]
mov ecx,[bx+8]
+ cmp edi, -1
+ je .reload
call bcopy
add bx,12
dec ax
@@ -468,6 +476,17 @@ shuffle_and_boot:
jmp far [cs:EntryPoint]
+ 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:
diff --git a/comboot.doc b/comboot.doc
index 66b8bf2b..f5133e15 100644
--- a/comboot.doc
+++ b/comboot.doc
@@ -580,6 +580,15 @@ AX=0012h [3.50] Cleanup, shuffle and boot
(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
diff --git a/layout.inc b/layout.inc
index 7b122d74..1a9115bd 100644
--- a/layout.inc
+++ b/layout.inc
@@ -26,7 +26,7 @@ TEXT_START equ 7C00h
; 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.
; Reserve memory for the stack. This causes checkov to abort the
; compile if we violate this space.