From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 28464 invoked from network); 18 Aug 1999 23:49:40 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 18 Aug 1999 23:49:40 -0000 Received: from piglet.twiddle.net (root@piglet.twiddle.net [207.104.6.26]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id TAA16080 for ; Wed, 18 Aug 1999 19:49:34 -0400 Received: (from rth@localhost) by piglet.twiddle.net (8.8.7/8.8.7) id QAA17061 for axp-list@redhat.com; Wed, 18 Aug 1999 16:49:32 -0700 Date: Wed, 18 Aug 1999 16:49:32 -0700 From: Richard Henderson To: axp-list@redhat.com Subject: Re: tbia() on DEC 3000 question Message-ID: <19990818164932.C15520@twiddle.net> References: <19990816171655.A26946@twiddle.net> <199908180936.FAA15756@neptune.phys.ufl.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.5i In-Reply-To: <199908180936.FAA15756@neptune.phys.ufl.edu>; from Craig P Prescott on Wed, Aug 18, 1999 at 05:36:45AM -0400 On Wed, Aug 18, 1999 at 05:36:45AM -0400, Craig P Prescott wrote: > The empty pages being what we flushed in free_area_init()... No, free_area_init merely initializes the kernel's data structures for managing physical memory. > This enabling of the KSEG superpage - I am not sure how this happens, > but it sounds like something I could check. It's something that the PALcode is supposed to do. It's not straightforward to check -- the kernel doesn't have direct access to the register involved. On EV4 it's SPE_2 (bit 5) in ABOX_CTL. >From the Avanti MILO PALcode I see that the value is saved in the machine check logout -- it's quite possible that the value is dumped for the 3000 as well. You'll have to find a description of the mcheck logout area for the machine to find out what offset the value might live at. Also, the CSERVE_K_RD_ABOX (0x03) function of PAL_cserve returns the value (in $0 of course) on Avanti, which also has a chance of working on the 3000. > Is that the significance of paging_init()'s > > clear_bit(PG_reserved, &mem_map[pfn++].flags); No. That marks as reserved all the memory that the console told us not to touch, which includes the PALcode for the system. > Ok. removed the mapping - again, because we've flushed everything in > free_area_init()? No. It all happens in paging_init. We create a new, empty set of page tables: /* Initialize the kernel's page tables. Linux puts the vptb in the last slot of the L1 page table. */ memset(swapper_pg_dir, 0, PAGE_SIZE); pgd_val(swapper_pg_dir[1023]) = (newptbr << 32) | pgprot_val(PAGE_KERNEL); Then we take this new page table root and install it in the not-yet-running idle task: newptbr = ((unsigned long) swapper_pg_dir - PAGE_OFFSET) >> PAGE_SHIFT; init_task.tss.ptbr = newptbr; Then we switch contexts from whatever random thing the PALcode started us off with into the new idle task: original_pcb_ptr = load_PCB(&init_task.tss); Now we have a new empty set of page tables, but the tlb has yet to be flushed of its stale data, so we do that next: tbia(); > I had sprinkled some srm_printk (is this ok to do??) calls around (I am > working from a serial console), and just prior to paging_init() Yes. You can't call srm_printk after that tbia above. In theory we should be able to relocate the srm callbacks and continue making such calls, but I never got srm_fixup working. I thought I was following all the rules outlined in the ARM, but ... > memory_start is 0xfffffc00004657e8 > memory_end is 0xfffffc0008000000 (the 3000/500 has 128 Megs of RAM) > > and inside paging_init(), just after free_area_init(), > > start_mem becomes 0xfffffc00005a67e8 > > Are these starting values sensible? Yep. > I'm sure I'm doing something silly... I don't think you are. This _should_ just all work. Since it doesn't, it seems clear that there's something different about the environment provided by the console code on the 3000, but I have no idea what it is. How much documentation are you working with here? Or are you just winging it? I know NetBSD works on the 3000; you might compare our vm startup code with theirs. r~