ia64/xen-unstable

changeset 2129:e2ca4e318afa

bitkeeper revision 1.1159.1.16 (41174ff5ujN698k09JTEc1zTtLVakg)

Fix initrd for 2.6.
author kaf24@scramble.cl.cam.ac.uk
date Mon Aug 09 10:20:37 2004 +0000 (2004-08-09)
parents cea3cbf1c374
children c61b505b6a52 cbd4d6c22abe 629e24e00cff
files linux-2.6.7-xen-sparse/arch/xen/i386/kernel/head.S linux-2.6.7-xen-sparse/arch/xen/i386/kernel/setup.c linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/setup.h
line diff
     1.1 --- a/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/head.S	Mon Aug 09 09:47:56 2004 +0000
     1.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/head.S	Mon Aug 09 10:20:37 2004 +0000
     1.3 @@ -24,38 +24,12 @@
     1.4  #define X86_CAPABILITY	new_cpu_data+CPUINFO_x86_capability
     1.5  #define X86_VENDOR_ID	new_cpu_data+CPUINFO_x86_vendor_id
     1.6  
     1.7 -/* Offsets in start_info structure */
     1.8 -#define MOD_START	24
     1.9 -#define MOD_LEN		28
    1.10 -                
    1.11  ENTRY(startup_32)
    1.12  	cld
    1.13  
    1.14  	/* Set up the stack pointer */
    1.15  	lss stack_start,%esp
    1.16  
    1.17 -	/* Copy initrd somewhere safe before it's clobbered by BSS. */
    1.18 -	mov  MOD_LEN(%esi),%ecx
    1.19 -	shr  $2,%ecx
    1.20 -	jz   2f			/* bail from copy loop if no initrd */
    1.21 -	mov  $_end,%edi
    1.22 -	add  MOD_LEN(%esi),%edi
    1.23 -	mov  MOD_START(%esi),%eax
    1.24 -	add  MOD_LEN(%esi),%eax
    1.25 -1:	sub  $4,%eax
    1.26 -	sub  $4,%edi
    1.27 -	mov  (%eax),%ebx
    1.28 -	mov  %ebx,(%edi)
    1.29 -	loop 1b
    1.30 -	mov  %edi,MOD_START(%esi)
    1.31 -
    1.32 -	/* Clear BSS first so that there are no surprises... */
    1.33 -2:	xorl %eax,%eax
    1.34 -	movl $__bss_start,%edi
    1.35 -	movl $__bss_stop,%ecx
    1.36 -	subl %edi,%ecx
    1.37 -	rep stosb
    1.38 -
    1.39  	/* Copy the necessary stuff from start_info structure. */
    1.40  	mov  $start_info_union,%edi
    1.41  	mov  $128,%ecx
     2.1 --- a/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/setup.c	Mon Aug 09 09:47:56 2004 +0000
     2.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/setup.c	Mon Aug 09 10:20:37 2004 +0000
     2.3 @@ -894,12 +894,12 @@ static unsigned long __init setup_memory
     2.4  #endif
     2.5  
     2.6  #ifdef CONFIG_BLK_DEV_INITRD
     2.7 -	if (LOADER_TYPE && INITRD_START) {
     2.8 +	if (start_info.mod_start) {
     2.9  		if (INITRD_START + INITRD_SIZE <= (max_low_pfn << PAGE_SHIFT)) {
    2.10 -			reserve_bootmem(INITRD_START, INITRD_SIZE);
    2.11 -			initrd_start =
    2.12 -				INITRD_START ? INITRD_START + PAGE_OFFSET : 0;
    2.13 +			/*reserve_bootmem(INITRD_START, INITRD_SIZE);*/
    2.14 +			initrd_start = INITRD_START + PAGE_OFFSET;
    2.15  			initrd_end = initrd_start+INITRD_SIZE;
    2.16 +			initrd_below_start_ok = 1;
    2.17  		}
    2.18  		else {
    2.19  			printk(KERN_ERR "initrd extends beyond end of memory "
     3.1 --- a/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/setup.h	Mon Aug 09 09:47:56 2004 +0000
     3.2 +++ b/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/setup.h	Mon Aug 09 10:20:37 2004 +0000
     3.3 @@ -53,7 +53,7 @@ extern unsigned char boot_params[PARAM_S
     3.4  #define AUX_DEVICE_INFO (*(unsigned char *) (PARAM+0x1FF))
     3.5  #define LOADER_TYPE (*(unsigned char *) (PARAM+0x210))
     3.6  #define KERNEL_START (*(unsigned long *) (PARAM+0x214))
     3.7 -#define INITRD_START (start_info.mod_start)
     3.8 +#define INITRD_START (__pa(start_info.mod_start))
     3.9  #define INITRD_SIZE (start_info.mod_len)
    3.10  #define EDID_INFO   (*(struct edid_info *) (PARAM+0x440))
    3.11  #define DISK80_SIGNATURE (*(unsigned int*) (PARAM+DISK80_SIG_BUFFER))