CONFIG_QEMU patch for 2.4.21
Hi All!
The moment I read that Rusty provided a 2.5 CONFIG_QEMU patch I asked myself: ... and what about 2.4?
so I decided to get my patch in shape (I hope it
was successful ;) and post it too ...
this one is for 2.4.21 but applies up to 2.4.22-pre4.
have fun,
Herbert
------
Documentation/Configure.help +11 -0
@@ -287,6 +287,17 @@ If you have a system with several CPUs, you do not need to say Y here: the local APIC will be used automatically. +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
arch/i386/Makefile +9 -1
@@ -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
@@ -105,6 +112,7 @@ SUBDIRS += arch/i386/math-emu DRIVERS += arch/i386/math-emu/math.o endif + arch/i386/kernel: dummy $(MAKE) linuxsubdirs SUBDIRS=arch/i386/kernel
arch/i386/config.in +2 -0
@@ -256,6 +256,8 @@ 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
arch/i386/vmlinux.lds +2 -1
@@ -1,12 +1,13 @@ /* ld script to make i386 Linux kernel * Written by Martin Mares <[email protected]>; */ + 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)
include/asm-i386/fixmap.h +4 -0
@@ -96,7 +96,11 @@* the start of the fixmap, and leave one page empty * at the top of mem.. */ +#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)
include/asm-i386/page.h +4 -0
@@ -78,7 +78,11 @@* and CONFIG_HIGHMEM64G options in the kernel configuration. */ +#ifdef CONFIG_QEMU +#define __PAGE_OFFSET (0x90000000) +#else #define __PAGE_OFFSET (0xC0000000) +#endif /* * This much address space is reserved for vmalloc() and iomap()