?? zimage.patch
字號:
+ * the part of the image where the zImage is. -- Tom+ */+ zimage_start = (char *)(unsigned long)(&__image_begin);+ zimage_size = (unsigned long)(&__image_end) -+ (unsigned long)(&__image_begin);++ /*+ * The zImage and initrd will be between start and _end, so they've+ * already been moved once. We're good to go now. -- Tom+ */+ puts("zimage at: "); puthex((unsigned long)zimage_start);+ puts(" "); puthex((unsigned long)(zimage_size+zimage_start));+ puts("\n");++ if ( initrd_size ) {+ puts("initrd at: ");+ puthex((unsigned long)(&__ramdisk_begin));+ puts(" "); puthex((unsigned long)(&__ramdisk_end));puts("\n");+ }++ /* assume the chunk below 8M is free */+ avail_ram = (char *)AVAIL_RAM_START;+ end_avail = (char *)AVAIL_RAM_END;++ /* Display standard Linux/MIPS boot prompt for kernel args */+ puts("Uncompressing Linux at load address ");+ puthex(LOADADDR);+ puts("\n");+ /* I don't like this hard coded gunzip size (fixme) */+ gunzip((void *)LOADADDR, 0x400000, zimage_start, &zimage_size);+ puts("Now booting the kernel\n");+}diff -Naur --exclude=CVS linux-2.6-orig/arch/mips/boot/compressed/common/no_initrd.c linux-2.6-dev/arch/mips/boot/compressed/common/no_initrd.c--- linux-2.6-orig/arch/mips/boot/compressed/common/no_initrd.c 1969-12-31 16:00:00.000000000 -0800+++ linux-2.6-dev/arch/mips/boot/compressed/common/no_initrd.c 2004-12-12 22:42:29.000000000 -0800@@ -0,0 +1,2 @@+char initrd_data[1];+int initrd_len = 0;diff -Naur --exclude=CVS linux-2.6-orig/arch/mips/boot/compressed/images/Makefile linux-2.6-dev/arch/mips/boot/compressed/images/Makefile--- linux-2.6-orig/arch/mips/boot/compressed/images/Makefile 1969-12-31 16:00:00.000000000 -0800+++ linux-2.6-dev/arch/mips/boot/compressed/images/Makefile 2004-12-12 22:42:29.000000000 -0800@@ -0,0 +1,17 @@++#+# This dir holds all of the images for MIPS machines.+# Tom Rini January 2001+# Pete Popov 2004++extra-y := vmlinux.bin vmlinux.gz++OBJCOPYFLAGS_vmlinux.bin := -O binary+$(obj)/vmlinux.bin: vmlinux FORCE+ $(call if_changed,objcopy)++$(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE+ $(call if_changed,gzip)++# Files generated that shall be removed upon make clean+clean-files := vmlinux* zImage* diff -Naur --exclude=CVS linux-2.6-orig/arch/mips/boot/compressed/include/nonstdio.h linux-2.6-dev/arch/mips/boot/compressed/include/nonstdio.h--- linux-2.6-orig/arch/mips/boot/compressed/include/nonstdio.h 1969-12-31 16:00:00.000000000 -0800+++ linux-2.6-dev/arch/mips/boot/compressed/include/nonstdio.h 2004-12-12 22:42:29.000000000 -0800@@ -0,0 +1,18 @@+/*+ * Copyright (C) Paul Mackerras 1997.+ *+ * This program is free software; you can redistribute it and/or+ * modify it under the terms of the GNU General Public License+ * as published by the Free Software Foundation; either version+ * 2 of the License, or (at your option) any later version.+ */+typedef int FILE;+extern FILE *stdin, *stdout;+#define NULL ((void *)0)+#define EOF (-1)+#define fopen(n, m) NULL+#define fflush(f) 0+#define fclose(f) 0+extern char *fgets();++#define perror(s) printf("%s: no files!\n", (s))diff -Naur --exclude=CVS linux-2.6-orig/arch/mips/boot/compressed/include/ns16550.h linux-2.6-dev/arch/mips/boot/compressed/include/ns16550.h--- linux-2.6-orig/arch/mips/boot/compressed/include/ns16550.h 1969-12-31 16:00:00.000000000 -0800+++ linux-2.6-dev/arch/mips/boot/compressed/include/ns16550.h 2004-12-12 22:42:29.000000000 -0800@@ -0,0 +1,46 @@+/*+ * NS16550 Serial Port+ */++/*+ * Figure out which file will have the definitons of COMx+ */++/* Some machines have their uart registers 16 bytes apart. Most don't.+ * TODO: Make this work like drivers/char/serial does - Tom */+#if !defined(UART_REG_PAD)+#define UART_REG_PAD(x)+#endif++struct NS16550+ {+ unsigned char rbr; /* 0 */+ UART_REG_PAD(rbr)+ unsigned char ier; /* 1 */+ UART_REG_PAD(ier)+ unsigned char fcr; /* 2 */+ UART_REG_PAD(fcr)+ unsigned char lcr; /* 3 */+ UART_REG_PAD(lcr)+ unsigned char mcr; /* 4 */+ UART_REG_PAD(mcr)+ unsigned char lsr; /* 5 */+ UART_REG_PAD(lsr)+ unsigned char msr; /* 6 */+ UART_REG_PAD(msr)+ unsigned char scr; /* 7 */+ };++#define thr rbr+#define iir fcr+#define dll rbr+#define dlm ier++#define LSR_DR 0x01 /* Data ready */+#define LSR_OE 0x02 /* Overrun */+#define LSR_PE 0x04 /* Parity error */+#define LSR_FE 0x08 /* Framing error */+#define LSR_BI 0x10 /* Break */+#define LSR_THRE 0x20 /* Xmit holding register empty */+#define LSR_TEMT 0x40 /* Xmitter empty */+#define LSR_ERR 0x80 /* Error */diff -Naur --exclude=CVS linux-2.6-orig/arch/mips/boot/compressed/include/pb1000_serial.h linux-2.6-dev/arch/mips/boot/compressed/include/pb1000_serial.h--- linux-2.6-orig/arch/mips/boot/compressed/include/pb1000_serial.h 1969-12-31 16:00:00.000000000 -0800+++ linux-2.6-dev/arch/mips/boot/compressed/include/pb1000_serial.h 2004-12-12 22:42:29.000000000 -0800@@ -0,0 +1,20 @@+/*+ * arch/ppc/boot/include/sandpoint_serial.h+ * + * Location of the COM ports on Motorola SPS Sandpoint machines+ *+ * Author: Mark A. Greer+ * mgreer@mvista.com+ *+ * Copyright 2001 MontaVista Software Inc.+ *+ * This program is free software; you can redistribute it and/or modify it+ * under the terms of the GNU General Public License as published by the+ * Free Software Foundation; either version 2 of the License, or (at your+ * option) any later version.+ */++#define COM1 0xfe0003f8+#define COM2 0xfe0002f8+#define COM3 0x00000000 /* No COM3 */+#define COM4 0x00000000 /* No COM4 */diff -Naur --exclude=CVS linux-2.6-orig/arch/mips/boot/compressed/ld.script linux-2.6-dev/arch/mips/boot/compressed/ld.script--- linux-2.6-orig/arch/mips/boot/compressed/ld.script 1969-12-31 16:00:00.000000000 -0800+++ linux-2.6-dev/arch/mips/boot/compressed/ld.script 2005-01-08 02:28:03.000000000 -0800@@ -0,0 +1,151 @@+OUTPUT_ARCH(mips)+ENTRY(start)+SECTIONS+{+ /* Read-only sections, merged into text segment: */+ /* . = 0x81000000; */+ .init : { *(.init) } =0+ .text :+ {+ _ftext = . ;+ *(.text)+ *(.rodata) *(.rodata.*)+ *(.rodata1)+ /* .gnu.warning sections are handled specially by elf32.em. */+ *(.gnu.warning)+ } =0+ .kstrtab : { *(.kstrtab) }++ . = ALIGN(16); /* Exception table */+ __start___ex_table = .;+ __ex_table : { *(__ex_table) }+ __stop___ex_table = .;++ __start___dbe_table = .; /* Exception table for data bus errors */+ __dbe_table : { *(__dbe_table) }+ __stop___dbe_table = .;++ __start___ksymtab = .; /* Kernel symbol table */+ __ksymtab : { *(__ksymtab) }+ __stop___ksymtab = .;++ _etext = .;++ . = ALIGN(8192);+ .data.init_task : { *(.data.init_task) }++ /* Startup code */+ . = ALIGN(4096);+ __init_begin = .;+ .text.init : { *(.text.init) }+ .data.init : { *(.data.init) }+ . = ALIGN(16);+ __setup_start = .;+ .setup.init : { *(.setup.init) }+ __setup_end = .;+ __initcall_start = .;+ .initcall.init : { *(.initcall.init) }+ __initcall_end = .;+ . = ALIGN(4096); /* Align double page for init_task_union */+ __init_end = .;++ . = ALIGN(4096);+ .data.page_aligned : { *(.data.idt) }++ . = ALIGN(32);+ .data.cacheline_aligned : { *(.data.cacheline_aligned) }++ .fini : { *(.fini) } =0+ .reginfo : { *(.reginfo) }+ /* Adjust the address for the data segment. We want to adjust up to+ the same address within the page on the next page up. It would+ be more correct to do this:+ . = .;+ The current expression does not correctly handle the case of a+ text segment ending precisely at the end of a page; it causes the+ data segment to skip a page. The above expression does not have+ this problem, but it will currently (2/95) cause BFD to allocate+ a single segment, combining both text and data, for this case.+ This will prevent the text segment from being shared among+ multiple executions of the program; I think that is more+ important than losing a page of the virtual address space (note+ that no actual memory is lost; the page which is skipped can not+ be referenced). */+ . = .;+ .data :+ {+ _fdata = . ;+ *(.data)++ /* Put the compressed image here, so bss is on the end. */+ __image_begin = .;+ *(.image)+ __image_end = .;+ /* Align the initial ramdisk image (INITRD) on page boundaries. */+ . = ALIGN(4096);+ __ramdisk_begin = .;+ *(.initrd)+ __ramdisk_end = .;+ . = ALIGN(4096);++ CONSTRUCTORS+ }+ .data1 : { *(.data1) }+ _gp = . + 0x8000;+ .lit8 : { *(.lit8) }+ .lit4 : { *(.lit4) }+ .ctors : { *(.ctors) }+ .dtors : { *(.dtors) }+ .got : { *(.got.plt) *(.got) }+ .dynamic : { *(.dynamic) }+ /* We want the small data sections together, so single-instruction offsets+ can access them all, and initialized data all before uninitialized, so+ we can shorten the on-disk segment size. */+ .sdata : { *(.sdata) }+ . = ALIGN(4);+ _edata = .;+ PROVIDE (edata = .);++ __bss_start = .;+ _fbss = .;+ .sbss : { *(.sbss) *(.scommon) }+ .bss :+ {+ *(.dynbss)+ *(.bss)+ *(COMMON)+ . = ALIGN(4);+ _end = . ;+ PROVIDE (end = .);+ }++ /* Sections to be discarded */+ /DISCARD/ :+ {+ *(.text.exit)+ *(.data.exit)+ *(.exitcall.exit)+ }++ /* This is the MIPS specific mdebug section. */+ .mdebug : { *(.mdebug) }+ /* These are needed for ELF backends which have not yet been+ converted to the new style linker. */+ .stab 0 : { *(.stab) }+ .stabstr 0 : { *(.stabstr) }+ /* DWARF debug sections.+ Symbols in the .debug DWARF section are relative to the beginning of the+ section so we begin .debug at 0. It's not clear yet what needs to happen+ for the others. */+ .debug 0 : { *(.debug) }+ .debug_srcinfo 0 : { *(.debug_srcinfo) }+ .debug_aranges 0 : { *(.debug_aranges) }+ .debug_pubnames 0 : { *(.debug_pubnames) }+ .debug_sfnames 0 : { *(.debug_sfnames) }+ .line 0 : { *(.line) }+ /* These must appear regardless of . */+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }+ .comment : { *(.comment) }+ .note : { *(.note) }+}diff -Naur --exclude=CVS linux-2.6-orig/arch/mips/boot/compressed/lib/Makefile linux-2.6-dev/arch/mips/boot/compressed/lib/Makefile--- linux-2.6-orig/arch/mips/boot/compressed/lib/Makefile 1969-12-31 16:00:00.000000000 -0800+++ linux-2.6-dev/arch/mips/boot/compressed/lib/Makefile 2004-12-15 00:14:31.000000000 -0800@@ -0,0 +1,11 @@++#+# Makefile for some libs needed by zImage.+#++lib-y := $(addprefix ../../../../../lib/zlib_inflate/, \+ infblock.o infcodes.o inffast.o inflate.o inftrees.o infutil.o) \+ $(addprefix ../../../../../lib/, ctype.o string.o) \+ $(addprefix ../../../../../arch/mips/lib/, memcpy.o) \++diff -Naur --exclude=CVS linux-2.6-orig/arch/mips/boot/compressed/Makefile linux-2.6-dev/arch/mips/boot/compressed/Makefile--- linux-2.6-orig/arch/mips/boot/compressed/Makefile 1969-12-31 16:00:00.000000000 -0800+++ linux-2.6-dev/arch/mips/boot/compressed/Makefile 2004-12-12 22:42:29.000000000 -0800@@ -0,0 +1,32 @@++#+# arch/mips/boot/compressed/Makefile+#+# This file is subject to the terms and conditions of the GNU General Public+# License. See the file "COPYING" in the main directory of this archive+# for more details.+#+# Copyright (C) 1994 by Linus Torvalds+# Adapted for PowerPC by Gary Thomas+# modified by Cort (cort@cs.nmt.edu)+#+# Ported to MIPS by Pete Popov, ppopov@embeddedalley.com+#++boot := arch/mips/boot+compressed := arch/mips/boot/compressed++CFLAGS += -fno-builtin -D__BOOTER__ -I$(compressed)/include++BOOT_TARGETS = zImage ++bootdir-$(CONFIG_SOC_AU1X00) := au1xxx+subdir-y := common lib images++.PHONY: $(BOOT_TARGETS) $(bootdir-y)++$(BOOT_TARGETS): $(bootdir-y)++$(bootdir-y): $(addprefix $(obj)/,$(subdir-y)) \+ $(addprefix $(obj)/,$(hostprogs-y))+ $(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS)diff -Naur --exclude=CVS linux-2.6-orig/arch/mips/boot/compressed/utils/entry linux-2.6-dev/arch/mips/boot/compressed/utils/entry--- linux-2.6-orig/arch/mips/boot/compressed/utils/entry 1969-12-31 16:00:00.000000000 -0800+++ linux-2.6-dev/arch/mips/boot/compressed/utils/entry 2004-12-12 22:42:29.000000000 -0800@@ -0,0 +1,12 @@+#!/bin/sh++# grab the kernel_entry address from the vmlinux elf image+entry=`$1 $2 | grep kernel_entry`++fs=`echo $entry | grep ffffffff` # check toolchain output++if [ -n "$fs" ]; then+ echo "0x"`$1 $2 | grep kernel_entry | cut -c9- | awk '{print $1}'`+else+ echo "0x"`$1 $2 | grep kernel_entry | cut -c1- | awk '{print $1}'`+fidiff -Naur --exclude=CVS linux-2.6-orig/arch/mips/boot/compressed/utils/offset linux-2.6-dev/arch/mips/boot/compressed/utils/offset--- linux-2.6-orig/arch/mips/boot/compressed/utils/offset 1969-12-31 16:00:00.000000000 -0800+++ linux-2.6-dev/arch/mips/boot/compressed/utils/offset 2004-12-12 22:42:29.000000000 -0800@@ -0,0 +1,3 @@+#!/bin/sh++echo "0x"`$1 -h $2 | grep $3 | grep -v zvmlinux| awk '{print $6}'`diff -Naur --exclude=CVS linux-2.6-orig/arch/mips/boot/compressed/utils/size linux-2.6-dev/arch/mips/boot/compressed/utils/size--- linux-2.6-orig/arch/mips/boot/compressed/utils/size 1969-12-31 16:00:00.000000000 -0800+++ linux-2.6-dev/arch/mips/boot/compressed/utils/size 2004-12-12 22:42:29.000000000 -0800@@ -0,0 +1,4 @@+#!/bin/sh++OFFSET=`$1 -h $2 | grep $3 | grep -v zvmlinux | awk '{print $3}'`+echo "0x"$OFFSETdiff -Naur --exclude=CVS linux-2.6-orig/arch/mips/boot/Makefile linux-2.6-dev/arch/mips/boot/Makefile--- linux-2.6-orig/arch/mips/boot/Makefile 2004-10-23 19:11:43.000000000 -0700+++ linux-2.6-dev/arch/mips/boot/Makefile 2004-12-12 22:42:29.000000000 -0800@@ -16,6 +16,7 @@ E2EFLAGS = endif + # # Drop some uninteresting sections in the kernel. # This is only relevant for ELF kernels but doesn't hurt a.out@@ -25,7 +26,10 @@ VMLINUX = vmlinux -all: vmlinux.ecoff vmlinux.srec addinitrd+ZBOOT_TARGETS = zImage+bootdir-y := compressed++all: vmlinux.ecoff vmlinux.srec addinitrd zImage vmlinux.ecoff: $(obj)/elf2ecoff $(VMLINUX) $(obj)/elf2ecoff $(VMLINUX) vmlinux.ecoff $(E2EFLAGS)@@ -47,3 +51,11 @@ elf2ecoff \ vmlinux.ecoff \ vmlinux.srec+ +.PHONY: $(ZBOOT_TARGETS) $(bootdir-y)+ +$(ZBOOT_TARGETS): $(bootdir-y)++$(bootdir-y): $(addprefix $(obj)/,$(subdir-y)) \+ $(addprefix $(obj)/,$(hostprogs-y))+ $(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS)diff -Naur --exclude=CVS linux-2.6-orig/arch/mips/Makefile linux-2.6-dev/arch/mips/Makefile--- linux-2.6-orig/arch/mips/Makefile 2005-01-08 01:45:09.000000000 -0800+++ linux-2.6-dev/arch/mips/Makefile 2004-12-29 00:11:45.000000000 -0800@@ -747,6 +747,9 @@ vmlinux.srec: $(vmlinux-32) +@$(call makeboot,$@) +zImage: vmlinux+ +@$(call makeboot,$@)+ CLEAN_FILES += vmlinux.ecoff \ vmlinux.srec \ vmlinux.rm200.tmp \@@ -755,6 +758,7 @@ archclean: @$(MAKE) $(clean)=arch/mips/boot @$(MAKE) $(clean)=arch/mips/lasat+ @$(MAKE) $(clean)=arch/mips/boot/compressed # Generate <asm/offset.h #
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -