diff -NurpP --minimal linux-2.4.21-15.0.4.EL/Documentation/Configure.help linux-2.4.21-15.0.4.EL-x/Documentation/Configure.help --- linux-2.4.21-15.0.4.EL/Documentation/Configure.help 2004-08-16 14:25:21.000000000 +0200 +++ linux-2.4.21-15.0.4.EL-x/Documentation/Configure.help 2004-08-16 18:20:21.000000000 +0200 @@ -343,6 +343,17 @@ CONFIG_X86_4G of RAM will rarely see a benefit from this option - but it's not out of question, the exact circumstances have to be considered. +QEMU Enabled Kernel +CONFIG_QEMU + This enables the Kernel to be used with QEMU, a CPU emulator, + without the requirement for an expensive soft MMU. Although a + kernel modified in this way (limmited address range), will run + on a real system, you should not select this option without a + good reason to do so. + + Say Y if you want to build a kernel for QEMU. + Say N otherwise. + Kernel math emulation CONFIG_MATH_EMULATION Linux can emulate a math coprocessor (used for floating point diff -NurpP --minimal linux-2.4.21-15.0.4.EL/arch/i386/Makefile linux-2.4.21-15.0.4.EL-x/arch/i386/Makefile --- linux-2.4.21-15.0.4.EL/arch/i386/Makefile 2004-08-16 14:25:20.000000000 +0200 +++ linux-2.4.21-15.0.4.EL-x/arch/i386/Makefile 2004-08-16 18:20:21.000000000 +0200 @@ -19,7 +19,14 @@ LD=$(CROSS_COMPILE)ld -m elf_i386 OBJCOPY=$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S LDFLAGS=-e stext -LINKFLAGS =-T $(TOPDIR)/arch/i386/vmlinux.lds $(LDFLAGS) + +ifdef CONFIG_QEMU +LINKFLAGS = --defsym __PAGE_OFFSET=0x90000000 +else +LINKFLAGS = --defsym __PAGE_OFFSET=0xC0000000 +endif + +LINKFLAGS += -T $(TOPDIR)/arch/i386/vmlinux.lds $(LDFLAGS) CFLAGS += -pipe CFLAGS+=-freorder-blocks @@ -107,6 +114,7 @@ SUBDIRS += arch/i386/math-emu DRIVERS += arch/i386/math-emu/math.o endif + # FIXME: is drivers- right ? ifdef CONFIG_OPROFILE SUBDIRS += arch/i386/oprofile diff -NurpP --minimal linux-2.4.21-15.0.4.EL/arch/i386/config.in linux-2.4.21-15.0.4.EL-x/arch/i386/config.in --- linux-2.4.21-15.0.4.EL/arch/i386/config.in 2004-08-16 14:25:20.000000000 +0200 +++ linux-2.4.21-15.0.4.EL-x/arch/i386/config.in 2004-08-16 18:20:21.000000000 +0200 @@ -309,6 +309,8 @@ fi if [ "$CONFIG_SMP" = "y" -a "$CONFIG_X86_CMPXCHG" = "y" ]; then define_bool CONFIG_HAVE_DEC_LOCK y fi + +dep_bool 'QEMU Enabled Kernel' CONFIG_QEMU $CONFIG_EXPERIMENTAL endmenu mainmenu_option next_comment diff -NurpP --minimal linux-2.4.21-15.0.4.EL/arch/i386/vmlinux.lds linux-2.4.21-15.0.4.EL-x/arch/i386/vmlinux.lds --- linux-2.4.21-15.0.4.EL/arch/i386/vmlinux.lds 2004-08-16 14:25:20.000000000 +0200 +++ linux-2.4.21-15.0.4.EL-x/arch/i386/vmlinux.lds 2004-08-16 18:20:21.000000000 +0200 @@ -1,12 +1,13 @@ /* ld script to make i386 Linux kernel * Written by Martin Mares ; */ + OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") OUTPUT_ARCH(i386) ENTRY(_start) SECTIONS { - . = 0xC0000000 + 0x100000; + . = __PAGE_OFFSET + 0x100000; _text = .; /* Text and read-only data */ .text : { *(.text) diff -NurpP --minimal linux-2.4.21-15.0.4.EL/include/asm-i386/fixmap.h linux-2.4.21-15.0.4.EL-x/include/asm-i386/fixmap.h --- linux-2.4.21-15.0.4.EL/include/asm-i386/fixmap.h 2004-08-16 14:27:19.000000000 +0200 +++ linux-2.4.21-15.0.4.EL-x/include/asm-i386/fixmap.h 2004-08-16 18:20:21.000000000 +0200 @@ -101,7 +101,11 @@ extern void __set_fixmap (enum fixed_add * IMPORTANT: dont change FIXADDR_TOP without adjusting KM_VSTACK0 * and KM_VSTACK1 so that the virtual stack is 8K aligned. */ +#ifdef CONFIG_QEMU +#define FIXADDR_TOP (0xa7ffe000UL) +#else #define FIXADDR_TOP (0xffffe000UL) +#endif #define __FIXADDR_SIZE (__end_of_permanent_fixed_addresses << PAGE_SHIFT) #define FIXADDR_START (FIXADDR_TOP - __FIXADDR_SIZE) diff -NurpP --minimal linux-2.4.21-15.0.4.EL/include/asm-i386/page.h linux-2.4.21-15.0.4.EL-x/include/asm-i386/page.h --- linux-2.4.21-15.0.4.EL/include/asm-i386/page.h 2004-08-16 14:27:19.000000000 +0200 +++ linux-2.4.21-15.0.4.EL-x/include/asm-i386/page.h 2004-08-16 18:20:56.000000000 +0200 @@ -95,8 +95,8 @@ typedef struct { unsigned long pgprot; } # define __PAGE_OFFSET_USER (0xff000000) #else # if defined(CONFIG_3GB) -# define __PAGE_OFFSET (0xc0000000) -# define __PAGE_OFFSET_USER (0xc0000000) +# define __PAGE_OFFSET (0x90000000) +# define __PAGE_OFFSET_USER (0x90000000) # elif defined(CONFIG_2GB) # define __PAGE_OFFSET (0x80000000) # define __PAGE_OFFSET_USER (0x80000000)