From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19adGa-0004RB-Dq for qemu-devel@nongnu.org; Thu, 10 Jul 2003 11:23:28 -0400 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19adBc-0002li-7m for qemu-devel@nongnu.org; Thu, 10 Jul 2003 11:18:24 -0400 Received: from www.13thfloor.at ([212.16.59.250]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19ad8O-00014j-8a for qemu-devel@nongnu.org; Thu, 10 Jul 2003 11:15:00 -0400 Date: Thu, 10 Jul 2003 17:15:01 +0200 From: Herbert =?iso-8859-1?Q?P=F6tzl?= Message-ID: <20030710151501.GA6381@www.13thfloor.at> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Subject: [Qemu-devel] CONFIG_QEMU patch for 2.4.21 Reply-To: herbert@13thfloor.at, qemu-devel@nongnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fabrice Bellard Cc: qemu-devel@nongnu.org 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 ------ diff -NurbP --minimal linux-2.4.21/Documentation/Configure.help linux-2.4.21-qemu/Documentation/Configure.help --- linux-2.4.21/Documentation/Configure.help Fri Jun 13 16:51:29 2003 +++ linux-2.4.21-qemu/Documentation/Configure.help Thu Jul 10 16:51:38 2003 @@ -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 diff -NurbP --minimal linux-2.4.21/arch/i386/Makefile linux-2.4.21-qemu/arch/i386/Makefile --- linux-2.4.21/arch/i386/Makefile Fri Jun 13 16:51:29 2003 +++ linux-2.4.21-qemu/arch/i386/Makefile Thu Jul 10 16:51:38 2003 @@ -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 diff -NurbP --minimal linux-2.4.21/arch/i386/config.in linux-2.4.21-qemu/arch/i386/config.in --- linux-2.4.21/arch/i386/config.in Fri Jun 13 16:51:29 2003 +++ linux-2.4.21-qemu/arch/i386/config.in Thu Jul 10 16:51:38 2003 @@ -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 diff -NurbP --minimal linux-2.4.21/arch/i386/vmlinux.lds linux-2.4.21-qemu/arch/i386/vmlinux.lds --- linux-2.4.21/arch/i386/vmlinux.lds Mon Feb 25 20:37:53 2002 +++ linux-2.4.21-qemu/arch/i386/vmlinux.lds Thu Jul 10 16:51:38 2003 @@ -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 -NurbP --minimal linux-2.4.21/include/asm-i386/fixmap.h linux-2.4.21-qemu/include/asm-i386/fixmap.h --- linux-2.4.21/include/asm-i386/fixmap.h Mon Jul 7 18:20:58 2003 +++ linux-2.4.21-qemu/include/asm-i386/fixmap.h Thu Jul 10 16:51:38 2003 @@ -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) diff -NurbP --minimal linux-2.4.21/include/asm-i386/page.h linux-2.4.21-qemu/include/asm-i386/page.h --- linux-2.4.21/include/asm-i386/page.h Wed Jul 9 23:08:36 2003 +++ linux-2.4.21-qemu/include/asm-i386/page.h Thu Jul 10 16:51:38 2003 @@ -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()