Problem booting 2.5 kernel with HZ != 1000
Hi Fabrice,
Setting HZ to any value other than 1000 causes vl to hang for
me (no response to C-x a). The RT timer is still going off inside vl, but it doesn't seem to be getting through as a timer interrupt.
BTW, vl compiled with gcc 3.3 gives a Floating Exception, so I compiled it with 2.95 and it works.
Tried 0.4.1 and CVS.
Here's the output, kernel patch I'm using below.
rusty@bach:~/devel/cvs/qemu$ ./vl -initrd ~/devel/qemu/vl-test/initrd-2.4.20.img ~/devel/kernel/working-2.5.73-bk7-qemu-page-offset/arch/i386/boot/bzImage Connected to host network interface: tun0 /etc/vl-ifup: could not launch network script for 'tun0' Uncompressing Linux... Ok, booting the kernel. Linux version 2.5.73-bk7 (rusty@bach) (gcc version 3.2.3 (Debian)) #13 Tue Jul 1 15:03:18 EST 2003 Video mode to be used for restore is 0 BIOS-provided physical RAM map: BIOS-88: 0000000000000000 - 000000000009f000 (usable) BIOS-88: 0000000000100000 - 0000000002000000 (usable) 32MB LOWMEM available. On node 0 totalpages: 8192 DMA zone: 4096 pages, LIFO batch:1 Normal zone: 4096 pages, LIFO batch:1 HighMem zone: 0 pages, LIFO batch:1 Building zonelist for node : 0 Kernel command line: Initializing CPU#0 PID hash table entries: 256 (order 8: 2048 bytes) Detected 697.116 MHz processor. [ hang ]
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
Name: QEMU CONFIG Patch
Author: Rusty Russell
Status: Trivial
D: Convenient patch based on Fabrice Bellard's documentation on how to
D: boot an x86 kernel under qemu 0.4. Adjusts PAGE_OFFSET and HZ value.
arch/i386/Kconfig +8 -0
@@ -307,6 +307,14 @@ config X86_GENERIC when it has moderate overhead. This is intended for generic distributions kernels. +config QEMU + bool "Kernel to run under QEMU" + depends on EXPERIMENTAL + help + Select this if you want to boot the kernel inside qemu, the + x86 emulator. See http://fabrice.bellard.free.fr/qemu/. + Say N. + # # Define implied options from the CPU selection here #
arch/i386/vmlinux.lds.S +3 -2
@@ -3,14 +3,15 @@ */ #include <asm-generic/vmlinux.lds.h> - +#include <asm/page.h> + OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") OUTPUT_ARCH(i386) ENTRY(startup_32) jiffies = jiffies_64; SECTIONS { - . = 0xC0000000 + 0x100000; + . = __PAGE_OFFSET + 0x100000; /* read-only */ _text = .; /* Text and read-only data */ .text : {
include/asm-i386/page.h +10 -3
@@ -10,10 +10,10 @@#define LARGE_PAGE_SIZE (1UL << PMD_SHIFT)#ifdef __KERNEL__ -#ifndef __ASSEMBLY__ -#include <linux/config.h> +#ifndef __ASSEMBLY__ +#ifdef CONFIG_X86_USE_3DNOW #include <asm/mmx.h>
@@ -115,12 +115,19 @@ static __inline__ int get_order(unsigned#endif /* __ASSEMBLY__ */ #ifdef __ASSEMBLY__ +#ifdef CONFIG_QEMU +#define __PAGE_OFFSET (0x90000000) +#else #define __PAGE_OFFSET (0xC0000000) +#endif /* QEMU */ +#else +#ifdef CONFIG_QEMU +#define __PAGE_OFFSET (0x90000000UL)#else #define __PAGE_OFFSET (0xC0000000UL) +#endif /* QEMU */ #endif -#define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET)#define VMALLOC_RESERVE ((unsigned long)__VMALLOC_RESERVE)#define MAXMEM (-__PAGE_OFFSET-__VMALLOC_RESERVE)
include/asm-i386/param.h +5 -1
@@ -2,7 +2,11 @@#define _ASMi386_PARAM_H#ifdef __KERNEL__ -# define HZ 1000/* Internal kernel timer frequency */ +# ifdef CONFIG_QEMU +# define HZ 100 +# else +# define HZ 1000/* Internal kernel timer frequency */ +# endif # define USER_HZ 100/* .. some user interfaces are in "ticks" */ # define CLOCKS_PER_SEC (USER_HZ)/* like times() */ #endif