Re: 2.3.99-3 axp combo patch

From: Andrea Arcangeli (andrea@suse.de)
Date: Wed Mar 29 2000 - 11:41:38 EST


This is an incremental patch that allows me to boot:

--- 2.3.99-pre3aa1-alpha/arch/alpha/kernel/head.S.~1~ Wed Mar 29 18:02:32 2000
+++ 2.3.99-pre3aa1-alpha/arch/alpha/kernel/head.S Wed Mar 29 18:14:12 2000
@@ -10,8 +10,11 @@
 #include <linux/config.h>
 #include <asm/pal.h>
 
+.globl swapper_pg_dir
+.globl _stext
+swapper_pg_dir=SWAPPER_PGD
+
         .set noreorder
- .globl _stext
         .globl __start
         .ent __start
 _stext:
--- 2.3.99-pre3aa1-alpha/arch/alpha/kernel/process.c.~1~ Wed Mar 29 18:01:58 2000
+++ 2.3.99-pre3aa1-alpha/arch/alpha/kernel/process.c Wed Mar 29 18:07:03 2000
@@ -59,7 +59,6 @@
         = { task: INIT_TASK(init_task_union.task) };
 
 pgd_t swapper_pg_dir[1024] __attribute__((aligned(PAGE_SIZE)));
-char ___zero_page[PAGE_SIZE] __attribute__((aligned(PAGE_SIZE)));
 
 /*
  * No need to acquire the kernel lock, we're entirely local..
--- 2.3.99-pre3aa1-alpha/arch/alpha/kernel/setup.c.~1~ Wed Mar 29 18:01:58 2000
+++ 2.3.99-pre3aa1-alpha/arch/alpha/kernel/setup.c Wed Mar 29 18:34:06 2000
@@ -72,7 +72,7 @@
  * initialized, we need to copy things out into a more permanent
  * place.
  */
-#define PARAM (IDENT_ADDR + 0x30A000)
+#define PARAM ZERO_PGE
 #define COMMAND_LINE ((char*)(PARAM + 0x0000))
 #define COMMAND_LINE_SIZE 256
 #define INITRD_START (*(unsigned long *) (PARAM+0x100))
@@ -235,7 +235,11 @@
         }
 
         /* Find the bounds of kernel memory. */
- start_kernel_pfn = PFN_UP(virt_to_phys(_stext));
+#if 0
+ start_kernel_pfn = PFN_DOWN(virt_to_phys(_stext));
+#else
+ start_kernel_pfn = 0;
+#endif
         end_kernel_pfn = PFN_UP(virt_to_phys(_end));
         bootmap_start = -1;
 
--- 2.3.99-pre3aa1-alpha/arch/alpha/mm/init.c.~1~ Wed Mar 29 18:01:58 2000
+++ 2.3.99-pre3aa1-alpha/arch/alpha/mm/init.c Wed Mar 29 18:25:31 2000
@@ -57,7 +57,7 @@
 inline pmd_t *
 __bad_pagetable(void)
 {
- return (pmd_t *) ___zero_page;
+ return (pmd_t *) EMPTY_PGT;
 }
 
 inline pte_t
@@ -216,7 +216,7 @@
 
         /* Initialize the kernel's page tables. Linux puts the vptb in
            the last slot of the L1 page table. */
- clear_page(___zero_page);
+ clear_page((void *)ZERO_PGE);
         clear_page(swapper_pg_dir);
         newptbr = ((unsigned long) swapper_pg_dir - PAGE_OFFSET) >> PAGE_SHIFT;
         pgd_val(swapper_pg_dir[1023]) =
--- 2.3.99-pre3aa1-alpha/include/asm-alpha/pgtable.h.~1~ Wed Mar 29 18:01:58 2000
+++ 2.3.99-pre3aa1-alpha/include/asm-alpha/pgtable.h Wed Mar 29 18:16:18 2000
@@ -136,12 +136,11 @@
 extern pte_t __bad_page(void);
 extern pmd_t * __bad_pagetable(void);
 
-extern char ___zero_page[];
 extern unsigned long __zero_page(void);
 
 #define BAD_PAGETABLE __bad_pagetable()
 #define BAD_PAGE __bad_page()
-#define ZERO_PAGE(vaddr) (mem_map + MAP_NR(___zero_page))
+#define ZERO_PAGE(vaddr) (mem_map + MAP_NR(ZERO_PGE))
 
 /* number of bits that fit into a memory pointer */
 #define BITS_PER_PTR (8*sizeof(unsigned long))
--- 2.3.99-pre3aa1-alpha/include/asm-alpha/system.h.~1~ Wed Mar 29 18:01:58 2000
+++ 2.3.99-pre3aa1-alpha/include/asm-alpha/system.h Wed Mar 29 18:16:18 2000
@@ -10,6 +10,27 @@
  * files, so it does only defines, not any C code.
  */
 
+/*
+ * We leave one page for the initial stack page, and one page for
+ * the initial process structure. Also, the console eats 3 MB for
+ * the initial bootloader (one of which we can reclaim later).
+ * With a few other pages for various reasons, we'll use an initial
+ * load address of PAGE_OFFSET+0x310000UL
+ */
+#define BOOT_PCB 0x20000000
+#define BOOT_ADDR 0x20000000
+/* Remove when official MILO sources have ELF support: */
+#define BOOT_SIZE (16*1024)
+
+#define KERNEL_START (PAGE_OFFSET+0x300000)
+#define SWAPPER_PGD (PAGE_OFFSET+0x300000)
+#define INIT_STACK (PAGE_OFFSET+0x302000)
+#define EMPTY_PGT (PAGE_OFFSET+0x304000)
+#define EMPTY_PGE (PAGE_OFFSET+0x308000)
+#define ZERO_PGE (PAGE_OFFSET+0x30A000)
+
+#define START_ADDR (PAGE_OFFSET+0x310000)
+
 #ifndef __ASSEMBLY__
 
 /*

And yes if I change the #if 0 below to #if 1 the kernel crashes in the
early boot stage. I still don't know what's going wrong...

+#if 0
+ start_kernel_pfn = PFN_DOWN(virt_to_phys(_stext));
+#else
+ start_kernel_pfn = 0;
+#endif

Andrea



This archive was generated by hypermail 2b29 : Fri Mar 31 2000 - 21:00:32 EST