Re: Loadlin 1.6 & 2.1.22

Hans Lermen (lermen@elserv.ffm.fgan.de)
Fri, 24 Jan 1997 02:19:17 +0100 (MET)


On Thu, 23 Jan 1997 reneb@VNET.IBM.COM wrote:

>
> Loadlin is not booting my kernel 2.1.22 anymore.
> it gives: Less than 4MB of memory
>
> -- System halted
>

Yep, I was prepared though.

> Found this message in arch/i386/boot/compressed/misc.c
>

Yes, but it never reached that piece of code.

( The page-reordering routine of Loadlin, which is called
just before jumping to the kernel ALSO checked the mem and
unfortunately gave the same error message )

There are 2 ways to make it load again:

1. A workround by defining STANDARD_MEMORY_BIOS_CALL
( this will restore the old behave )
This solution needs no further fix. ( see PATCH-1 )

2. You apply PATCH-2 (below) and download a quick-fixed new loadlin-1.6a:

ftp://elserv.ffm.fgan.de/pub/linux/loadlin-1.6/update-1.6a/*

This loadlin version just fixes the loading error, but doesn't yet
support memory detection for more then 64Meg.
The new memory detection stuff in the kernel isn't yet ready, when it
is, Loadlin will be adapted to support that.

NOTE: Either use PATCH-1 or PATCH-2, don't apply both.

Hans
<lermen@fgan.de>

--------------------PATCH-1 (the workaround)--------------------------
--- linux-2.1.22-clean/arch/i386/boot/setup.S Thu Jan 23 20:22:51 1997
+++ linux-2.1.22/arch/i386/boot/setup.S Fri Jan 24 01:13:26 1997
@@ -33,6 +33,7 @@
#include <asm/segment.h>
#include <linux/version.h>
#include <linux/compile.h>
+#define STANDARD_MEMORY_BIOS_CALL

! Signature words to ensure LILO loaded us right
#define SIG1 0xAA55
--- linux-2.1.22-clean/arch/i386/kernel/setup.c Thu Jan 23 20:22:51 1997
+++ linux-2.1.22/arch/i386/kernel/setup.c Fri Jan 24 01:14:09 1997
@@ -7,6 +7,7 @@
/*
* This file handles the architecture-dependent parts of initialization
*/
+#define STANDARD_MEMORY_BIOS_CALL

#include <linux/errno.h>
#include <linux/sched.h>
--- linux-2.1.22-clean/arch/i386/boot/compressed/misc.c Thu Jan 23 20:22:51 1997
+++ linux-2.1.22/arch/i386/boot/compressed/misc.c Fri Jan 24 01:25:17 1997
@@ -8,6 +8,7 @@
* puts by Nick Holloway 1993, better puts by Martin Mares 1995
* High loaded stuff by Hans Lermen & Werner Almesberger, Feb. 1996
*/
+#define STANDARD_MEMORY_BIOS_CALL

#include <string.h>
--------------------------------------------------------------------------

-------- PATCH2 (the right one, but needing Loadlin-1.6a) ----------------
--- linux-2.1.22-clean/arch/i386/boot/setup.S Thu Jan 23 20:22:51 1997
+++ linux-2.1.22/arch/i386/boot/setup.S Fri Jan 24 01:13:26 1997
@@ -240,6 +241,16 @@
push ax
push cx
push dx
+ ! which bootloader ?
+ seg cs
+ mov al,byte ptr type_of_loader
+ and al,#0xf0
+ cmp al,#0x10
+ jne try_xe801 ! not Loadlin
+ seg cs
+ cmp byte ptr type_of_loader,#0x16
+ jbe oldstylemem ! Loadlin <= 1.6 don't like that
+try_xe801:
mov ax,#0xe801
int 0x15
jc oldstylemem
@@ -257,6 +268,9 @@
oldstylemem:
mov ah,#0x88
int 0x15
+ or ax,ax ! some BIOSes report ZERO for 64meg
+ mov word ptr [2],#0x400
+ jz gotmem
mov cx,#64 ! got memory size in kbytes, so we need to
xor dx,dx ! adjust to 64k chunks for the system.
div cx
--- linux-2.1.22-clean/arch/i386/boot/compressed/misc.c Thu Jan 23 20:22:51 1997
+++ linux-2.1.22/arch/i386/boot/compressed/misc.c Fri Jan 24 01:25:17 1997
@@ -356,7 +357,11 @@
void setup_output_buffer_if_we_run_high(struct moveparams *mv)
{
high_buffer_start = (uch *)(((ulg)&end) + HEAP_SIZE);
+#ifdef STANDARD_MEMORY_BIOS_CALL
if (EXT_MEM_K < (3*1024)) error("Less than 4MB of memory.\n");
+#else
+ if (EXT_MEM_K*64 < (3*1024)) error("Less than 4MB of memory.\n");
+#endif
mv->low_buffer_start = output_data = (char *)LOW_BUFFER_START;
high_loaded = 1;
free_mem_end_ptr = (long)high_buffer_start;
--------------------------------------------------------------------------