home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 May / Chip_2000-05_cd2.bin / dosutils / loadlin / update-1.6a / 2.1.22.patch next >
Text File  |  1997-01-23  |  4KB  |  130 lines

  1.  
  2. From lermen@elserv.ffm.fgan.de Fri Jan 24 04:14:58 1997
  3. Date: Fri, 24 Jan 1997 02:19:17 +0100 (MET)
  4. From: Hans Lermen <lermen@elserv.ffm.fgan.de>
  5. To: reneb@VNET.IBM.COM
  6. Cc: linux-kernel@vger.rutgers.edu
  7. Subject: Re: Loadlin 1.6 & 2.1.22
  8.  
  9. On Thu, 23 Jan 1997 reneb@VNET.IBM.COM wrote:
  10.  
  11. > Loadlin is not booting my kernel 2.1.22 anymore.
  12. > it gives: Less than 4MB of memory
  13. > -- System halted
  14.  
  15. Yep, I was prepared though.
  16.  
  17. > Found this message in arch/i386/boot/compressed/misc.c
  18.  
  19. Yes, but it never reached that piece of code.
  20.  
  21. ( The page-reordering routine of Loadlin, which is called
  22.   just before jumping to the kernel ALSO checked the mem and
  23.   unfortunately gave the same error message )
  24.  
  25.  
  26. There are 2 ways to make it load again:
  27.  
  28. 1. A workround by defining STANDARD_MEMORY_BIOS_CALL
  29.    ( this will restore the old behave )
  30.    This solution needs no further fix. ( see PATCH-1 )
  31.  
  32. 2. You apply PATCH-2 (below) and download a quick-fixed new loadlin-1.6a:
  33.  
  34.    ftp://elserv.ffm.fgan.de/pub/linux/loadlin-1.6/update-1.6a/*
  35.  
  36.    This loadlin version just fixes the loading error, but doesn't yet
  37.    support memory detection for more then 64Meg.
  38.    The new memory detection stuff in the kernel isn't yet ready, when it
  39.    is, Loadlin will be adapted to support that.
  40.  
  41.  
  42. NOTE: Either use PATCH-1 or PATCH-2, don't apply both.
  43.  
  44. Hans
  45. <lermen@fgan.de>
  46.  
  47.  
  48. --------------------PATCH-1 (the workaround)--------------------------
  49. --- linux-2.1.22-clean/arch/i386/boot/setup.S    Thu Jan 23 20:22:51 1997
  50. +++ linux-2.1.22/arch/i386/boot/setup.S    Fri Jan 24 01:13:26 1997
  51. @@ -33,6 +33,7 @@
  52.  #include <asm/segment.h>
  53.  #include <linux/version.h>
  54.  #include <linux/compile.h>
  55. +#define STANDARD_MEMORY_BIOS_CALL
  56.  
  57.  ! Signature words to ensure LILO loaded us right
  58.  #define SIG1    0xAA55
  59. --- linux-2.1.22-clean/arch/i386/kernel/setup.c    Thu Jan 23 20:22:51 1997
  60. +++ linux-2.1.22/arch/i386/kernel/setup.c    Fri Jan 24 01:14:09 1997
  61. @@ -7,6 +7,7 @@
  62.  /*
  63.   * This file handles the architecture-dependent parts of initialization
  64.   */
  65. +#define STANDARD_MEMORY_BIOS_CALL
  66.  
  67.  #include <linux/errno.h>
  68.  #include <linux/sched.h>
  69. --- linux-2.1.22-clean/arch/i386/boot/compressed/misc.c    Thu Jan 23 20:22:51 1997
  70. +++ linux-2.1.22/arch/i386/boot/compressed/misc.c    Fri Jan 24 01:25:17 1997
  71. @@ -8,6 +8,7 @@
  72.   * puts by Nick Holloway 1993, better puts by Martin Mares 1995
  73.   * High loaded stuff by Hans Lermen & Werner Almesberger, Feb. 1996
  74.   */
  75. +#define STANDARD_MEMORY_BIOS_CALL
  76.  
  77.  #include <string.h>
  78. --------------------------------------------------------------------------
  79.  
  80.  
  81. -------- PATCH2 (the right one, but needing Loadlin-1.6a) ----------------
  82. --- linux-2.1.22-clean/arch/i386/boot/setup.S    Thu Jan 23 20:22:51 1997
  83. +++ linux-2.1.22/arch/i386/boot/setup.S    Fri Jan 24 01:13:26 1997
  84. @@ -240,6 +241,16 @@
  85.      push    ax
  86.      push    cx
  87.      push    dx
  88. +                ! which bootloader ?
  89. +    seg cs
  90. +    mov    al,byte ptr type_of_loader
  91. +    and    al,#0xf0
  92. +    cmp    al,#0x10
  93. +    jne    try_xe801    ! not Loadlin
  94. +    seg cs
  95. +    cmp    byte ptr type_of_loader,#0x16
  96. +    jbe    oldstylemem    ! Loadlin <= 1.6 don't like that
  97. +try_xe801:
  98.      mov    ax,#0xe801
  99.      int    0x15
  100.      jc    oldstylemem
  101. @@ -257,6 +268,9 @@
  102.  oldstylemem:
  103.      mov    ah,#0x88
  104.      int    0x15
  105. +    or    ax,ax        ! some BIOSes report ZERO for 64meg
  106. +    mov    word ptr [2],#0x400
  107. +    jz    gotmem
  108.      mov    cx,#64        ! got memory size in kbytes, so we need to
  109.      xor    dx,dx        ! adjust to 64k chunks for the system.
  110.      div    cx
  111. --- linux-2.1.22-clean/arch/i386/boot/compressed/misc.c    Thu Jan 23 20:22:51 1997
  112. +++ linux-2.1.22/arch/i386/boot/compressed/misc.c    Fri Jan 24 01:25:17 1997
  113. @@ -356,7 +357,11 @@
  114.  void setup_output_buffer_if_we_run_high(struct moveparams *mv)
  115.  {
  116.      high_buffer_start = (uch *)(((ulg)&end) + HEAP_SIZE);
  117. +#ifdef STANDARD_MEMORY_BIOS_CALL
  118.      if (EXT_MEM_K < (3*1024)) error("Less than 4MB of memory.\n");
  119. +#else
  120. +    if (EXT_MEM_K*64 < (3*1024)) error("Less than 4MB of memory.\n");
  121. +#endif
  122.      mv->low_buffer_start = output_data = (char *)LOW_BUFFER_START;
  123.      high_loaded = 1;
  124.      free_mem_end_ptr = (long)high_buffer_start;
  125. --------------------------------------------------------------------------
  126.