qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] CONFIG_QEMU patch for 2.4.21
@ 2003-07-10 15:15 Herbert Pötzl
  0 siblings, 0 replies; only message in thread
From: Herbert Pötzl @ 2003-07-10 15:15 UTC (permalink / raw)
  To: Fabrice Bellard; +Cc: qemu-devel


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 <mj@atrey.karlin.mff.cuni.cz>;
  */
+ 
 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()

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-07-10 15:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-10 15:15 [Qemu-devel] CONFIG_QEMU patch for 2.4.21 Herbert Pötzl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).