x86 boot enhancements, cleanups 4/11

x86 boot enhancements, cleanups 4/11

Post by Eric W. Biederm » Fri, 19 Apr 2002 02:10:09



Linus please apply,

  All changes are syntactic the generated code is not affected.

- e820.h Add define E820ENTRY_SIZE

- boot.h Add defines for address space divisions.

- Add define KERNEL_START in setup.S so if I need this
  value more than once it is easy to get at.

Eric

diff -uNr linux-2.5.8.boot.spring-cleaning/arch/i386/boot/setup.S linux-2.5.8.boot.syntax/arch/i386/boot/setup.S
--- linux-2.5.8.boot.spring-cleaning/arch/i386/boot/setup.S     Tue Apr 16 20:13:05 2002

 #define SIG1   0xAA55
 #define SIG2   0x5A5A

+#ifndef __BIG_KERNEL__
+#define KERNEL_START LOW_BASE          /* zImage */
+#else
+#define KERNEL_START HIGH_BASE                 /* bzImage */
+#endif
+
 INITSEG  = DEF_INITSEG         # 0x9000, we move boot here, out of the way
 SYSSEG   = DEF_SYSSEG          # 0x1000, system loaded at 0x10000 (65536).

                                        # loader knows how much data behind
                                        # us also needs to be loaded.

-code32_start:                          # here loaders can put a different
+code32_start:  .long   KERNEL_START    # here loaders can put a different
                                        # start address for 32-bit code.
-#ifndef __BIG_KERNEL__
-               .long   0x1000          #   0x1000 = default for zImage
-#else
-               .long   0x100000        # 0x100000 = default for big kernel
-#endif

 ramdisk_image: .long   0               # address of loaded ramdisk image

        incb    (E820NR)
        movw    %di, %ax
-       addw    $20, %ax
+       addw    $E820ENTRY_SIZE, %ax
        movw    %ax, %di
 again820:
        cmpl    $0, %ebx                        # check to see if
diff -uNr linux-2.5.8.boot.spring-cleaning/include/asm-i386/boot.h linux-2.5.8.boot.syntax/include/asm-i386/boot.h
--- linux-2.5.8.boot.spring-cleaning/include/asm-i386/boot.h    Wed Apr 16 15:15:00 1997

 #ifndef _LINUX_BOOT_H
 #define _LINUX_BOOT_H

+/* Address space division during load */
+       /* Memory below 640 we can use for loading */
+#define LOW_BASE   0x001000
+#define LOW_MAX    0x0a0000  /* Maximum low memory address to use */
+       /* Memory above 640 we can use for loading */
+#define HIGH_BASE  0x100000
+#define HIGH_MAX   __MAXMEM
+       /* Subset of the low segment that is generally safe to
+        * use for loading.
+        */
+#define REAL_BASE  0x010000
+#define REAL_MAX   0x090000
+
 /* Don't touch these, unless you really know what you're doing. */
 #define DEF_INITSEG    0x9000
 #define DEF_SYSSEG     0x1000
diff -uNr linux-2.5.8.boot.spring-cleaning/include/asm-i386/e820.h linux-2.5.8.boot.syntax/include/asm-i386/e820.h
--- linux-2.5.8.boot.spring-cleaning/include/asm-i386/e820.h    Fri Aug 18 10:30:51 2000

 #define E820MAP        0x2d0           /* our map */
 #define E820MAX        32              /* number of entries in E820MAP */
 #define E820NR 0x1e8           /* # entries in E820MAP */
+#define E820ENTRY_SIZE 20      /* size of an E820MAP entry */

 #define E820_RAM       1
 #define E820_RESERVED  2
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. x86 boot enhancements, link enhancements 2/11

#2  2.5.8.boot.vmlinuxlds
============================================================
- i386/Makefile remove bogus linker command line of -e stext
- Fix vmlinux.lds so vmlinux knows it loads at 0x100000 (1MB)
- Fix vmlinux.lds so we correctly use startup_32 for our entry point
- Make startup_32 global

diff -uNr linux-2.5.8.boot.boot_params/arch/i386/Makefile linux-2.5.8.boot.vmlinuxlds/arch/i386/Makefile
--- linux-2.5.8.boot.boot_params/arch/i386/Makefile     Thu Apr 12 13:20:31 2001

 LD=$(CROSS_COMPILE)ld -m elf_i386
 OBJCOPY=$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S
-LDFLAGS=-e stext
+LDFLAGS=
 LINKFLAGS =-T $(TOPDIR)/arch/i386/vmlinux.lds $(LDFLAGS)

 CFLAGS += -pipe
diff -uNr linux-2.5.8.boot.boot_params/arch/i386/kernel/head.S linux-2.5.8.boot.vmlinuxlds/arch/i386/kernel/head.S
--- linux-2.5.8.boot.boot_params/arch/i386/kernel/head.S        Wed Mar 20 07:18:31 2002

  *
  * On entry, %esi points to the real-mode code as a 32-bit pointer.
  */
-startup_32:
+ENTRY(startup_32)
 /*
  * Set segments to known values
  */
diff -uNr linux-2.5.8.boot.boot_params/arch/i386/vmlinux.lds linux-2.5.8.boot.vmlinuxlds/arch/i386/vmlinux.lds
--- linux-2.5.8.boot.boot_params/arch/i386/vmlinux.lds  Sun Mar 10 20:09:08 2002

  */
 OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
 OUTPUT_ARCH(i386)
-ENTRY(_start)
+physical_startup_32 = startup_32 - 0xC0000000;
+ENTRY(physical_startup_32)
+PHDRS
+{
+       text PT_LOAD AT(0x100000);
+
+}
 SECTIONS
 {

        *(.text)
        *(.fixup)
        *(.gnu.warning)
-       } = 0x9090
+       } :text = 0x9090

   _etext = .;                  /* End of text section */

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. Solaris 9 x86 and Mylex AcceleRAID 250 LUN problems.

3. x86 boot enhancements, x86 boot protocol 2.04 9/11

4. blaster banshee, tdfx, 4.1.0 anyone??

5. x86 boot enhancements, bzELF support 11/11

6. pppd on serial line

7. x86 Boot enhancements, boot parameters 1/11

8. Knoppix w/o Hard Drive

9. x86 boot enhancements, boot time heap 5/11

10. x86 Boot enhancements, boot params 1/11

11. x86 boot enhancements, boot bean counting 8/11

12. x86 Boot enhancements, boot memory cleanup 5/9

13. x86 boot enhancements, Clean up the 32bit entry points 6/11