summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhpa <hpa>2001-12-10 07:38:23 +0000
committerhpa <hpa>2001-12-10 07:38:23 +0000
commit886a10a343516d7680600faba3ebfa9735cd3dc3 (patch)
treeddc7f2379f5bc9a8a52b3d51878023973ed2f31d
parenta47c6d65c1fbab9d821b869fc0bd30ae441f24fc (diff)
downloadsyslinux-886a10a343516d7680600faba3ebfa9735cd3dc3.tar.gz
Add support for "pseudo-kernels" < 64K in size.
-rw-r--r--NEWS2
-rw-r--r--isolinux.asm16
-rw-r--r--ldlinux.asm16
-rw-r--r--pxelinux.asm16
4 files changed, 44 insertions, 6 deletions
diff --git a/NEWS b/NEWS
index f18dc3e0..6c307067 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,8 @@ Changes in 1.65:
correctly; unfortunately many BIOSes apparently don't.
* Support Linux boot protocol version 2.03 (explicitly
specify the initrd address limit.)
+ * Handle small "pseudo-kernels"; images that use the Linux
+ kernel boot protocols but are less than 64K in size.
Changes in 1.64:
* Limited support for hardware flow control when using a
diff --git a/isolinux.asm b/isolinux.asm
index 5aaa3d06..1c165bc2 100644
--- a/isolinux.asm
+++ b/isolinux.asm
@@ -1726,14 +1726,20 @@ kernel_good:
; kernel code. The boot sector is never executed when using an external
; booting utility, but it contains some status bytes that are necessary.
;
-; First check that our kernel is at least 64K and less than 8M (if it is
+; First check that our kernel is at least 1K and less than 8M (if it is
; more than 8M, we need to change the logic for loading it anyway...)
;
+; We used to require the kernel to be 64K or larger, but it has gotten
+; popular to use the Linux kernel format for other things, which may
+; not be so large.
+;
is_linux_kernel:
cmp dx,80h ; 8 megs
ja kernel_corrupt
and dx,dx
- jz kernel_corrupt
+ jnz kernel_sane
+ cmp ax,1024 ; Bootsect + 1 setup sect
+ jb near kernel_corrupt
kernel_sane: push ax
push dx
push si
@@ -1775,6 +1781,10 @@ kernel_sane: push ax
call abort_check ; Check for abort key
mov cx,[ClustPerMoby]
shr cx,1 ; Half a moby
+ cmp cx,[KernelClust]
+ jna .normalkernel
+ mov cx,[KernelClust]
+.normalkernel:
sub [KernelClust],cx
xor bx,bx
pop si ; Cluster pointer on stack
@@ -2016,6 +2026,8 @@ high_load_loop:
call cwritestr
call abort_check
mov cx,[KernelClust]
+ and cx,cx
+ jz high_load_done ; Zero left (tiny kernel?)
cmp cx,[ClustPerMoby]
jna high_last_moby
mov cx,[ClustPerMoby]
diff --git a/ldlinux.asm b/ldlinux.asm
index 6b5a9ba9..eabc3122 100644
--- a/ldlinux.asm
+++ b/ldlinux.asm
@@ -1774,14 +1774,20 @@ kernel_good:
; stuff means 512 bytes *no matter what*, so here I am using that piece
; of knowledge.
;
-; First check that our kernel is at least 64K and less than 8M (if it is
+; First check that our kernel is at least 1K and less than 8M (if it is
; more than 8M, we need to change the logic for loading it anyway...)
;
+; We used to require the kernel to be 64K or larger, but it has gotten
+; popular to use the Linux kernel format for other things, which may
+; not be so large.
+;
is_linux_kernel:
cmp dx,80h ; 8 megs
ja kernel_corrupt
and dx,dx
- jz kernel_corrupt
+ jnz kernel_sane
+ cmp ax,1024 ; Bootsect + 1 setup sect
+ jb kernel_corrupt
kernel_sane: push ax
push dx
push si
@@ -1823,6 +1829,10 @@ kernel_sane: push ax
call abort_check ; Check for abort key
mov cx,[ClustPerMoby]
shr cx,1 ; Half a moby
+ cmp cx,[KernelClust]
+ jna .normalkernel
+ mov cx,[KernelClust]
+.normalkernel:
sub [KernelClust],cx
xor bx,bx
pop si ; Cluster pointer on stack
@@ -2121,6 +2131,8 @@ high_load_loop:
call cwritestr
call abort_check
mov cx,[KernelClust]
+ and cx,cx
+ jz high_load_done ; Zero left (tiny kernel?)
cmp cx,[ClustPerMoby]
jna high_last_moby
mov cx,[ClustPerMoby]
diff --git a/pxelinux.asm b/pxelinux.asm
index 1bf8060e..3dfdfa4c 100644
--- a/pxelinux.asm
+++ b/pxelinux.asm
@@ -1523,14 +1523,20 @@ kernel_good:
; kernel code. The boot sector is never executed when using an external
; booting utility, but it contains some status bytes that are necessary.
;
-; First check that our kernel is at least 64K and less than 8M (if it is
+; First check that our kernel is at least 1K and less than 8M (if it is
; more than 8M, we need to change the logic for loading it anyway...)
;
+; We used to require the kernel to be 64K or larger, but it has gotten
+; popular to use the Linux kernel format for other things, which may
+; not be so large.
+;
is_linux_kernel:
cmp dx,80h ; 8 megs
ja kernel_corrupt
and dx,dx
- jz kernel_corrupt
+ jnz kernel_sane
+ cmp ax,1024 ; Bootsect + 1 setup sect
+ jb kernel_corrupt
kernel_sane: push ax
push dx
push si
@@ -1572,6 +1578,10 @@ kernel_sane: push ax
call abort_check ; Check for abort key
mov cx,[ClustPerMoby]
shr cx,1 ; Half a moby
+ cmp cx,[KernelClust]
+ jna .normalkernel
+ mov cx,[KernelClust]
+.normalkernel:
sub [KernelClust],cx
xor bx,bx
pop si ; Cluster pointer on stack
@@ -1821,6 +1831,8 @@ high_load_loop:
call cwritestr
call abort_check
mov cx,[KernelClust]
+ and cx,cx
+ jz high_load_done ; Zero left (tiny kernel?)
cmp cx,[ClustPerMoby]
jna high_last_moby
mov cx,[ClustPerMoby]