From owner-freebsd-arm@FreeBSD.ORG Tue Jul 21 16:48:03 2009 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7314F1065678 for ; Tue, 21 Jul 2009 16:48:03 +0000 (UTC) (envelope-from tinguely@casselton.net) Received: from casselton.net (casselton.net [63.165.140.2]) by mx1.freebsd.org (Postfix) with ESMTP id 16AEF8FC0C for ; Tue, 21 Jul 2009 16:48:02 +0000 (UTC) (envelope-from tinguely@casselton.net) Received: from casselton.net (localhost [127.0.0.1]) by casselton.net (8.14.3/8.14.3) with ESMTP id n6LGm2Jp076062; Tue, 21 Jul 2009 11:48:02 -0500 (CDT) (envelope-from tinguely@casselton.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=casselton.net; s=ccnMail; t=1248194882; bh=BsX3OIH3RLvR01H1LrhBlSLlqFYrQlQQRlHqnwWiXzY=; h=Date:From:Message-Id:To:Subject:In-Reply-To; b=MvmlSewMW0TMK3SP8wW9Mo0RNnlO4oKWvBPgMLEVnFIAOWph6AzVFn/LOwadqAadJ ZtnshIxos1kEUuj2ixRrtcFJdFCf1pof8gtOpGg3KP1mdfJo4VVW9tNleH21RFNWal 1Mm0u88YNwzA651BSsFSUZkCQYw0FWZf+r0yYpxs= Received: (from tinguely@localhost) by casselton.net (8.14.3/8.14.2/Submit) id n6LGm2KW076061; Tue, 21 Jul 2009 11:48:02 -0500 (CDT) (envelope-from tinguely) Date: Tue, 21 Jul 2009 11:48:02 -0500 (CDT) From: Mark Tinguely Message-Id: <200907211648.n6LGm2KW076061@casselton.net> To: freebsd-arm@freebsd.org, xiechao.mail@gmail.com In-Reply-To: X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.2 (casselton.net [127.0.0.1]); Tue, 21 Jul 2009 11:48:02 -0500 (CDT) Cc: Subject: Re: start_init data abort X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 16:48:03 -0000 > > hi > I am trying to port Freebsd to pxa310. After I have compiled, and get > kernel.bin, i will directly download it to SDRAM, and begin to run it. The > SYSINITs are all right, and i get the final init - start_init. At this time, > a exception of data abort happens. > After i debug it, i find it is caused by subyte at the following code. > /* > * Move out the boot flag argument. > */ > options = 0; > ucp = (char *)p->p_sysent->sv_usrstack; > (void)subyte(--ucp, 0); /* trailing zero */ > if (boothowto & RB_SINGLE) { > (void)subyte(--ucp, 's'); > options = 1; > } > > It seems that subyte will store a byte to user stack of initproc. The user > stack of initproc is started at 0xC0000000. i have checked the page mapping, > and find the veirtual address 0xC0000000 - PAGESIZE to 0xC0000000 is not > mapped. So i get the data abort. > I am confuesed. Where should i map the user stack of initproc? I appreciate > that someone can help me.Thanks. In the begining of that routine, the user stack is put into the map backed by a default (NULL) object. A page for the stack should fault a page into that location when accessed. For testing, you can speed it along a bit by setting the MAP_PREFAULT bit: addr = p->p_sysent->sv_usrstack - PAGE_SIZE; if (vm_map_find(&p->p_vmspace->vm_map, NULL, 0, &addr, PAGE_SIZE, - FALSE, VM_PROT_ALL, VM_PROT_ALL, 0) != 0) + FALSE, VM_PROT_ALL, VM_PROT_ALL, MAP_PREFAULT) != 0) panic("init: couldn't allocate argument space"); If there is still no page at that location and you have a console, you can print out the vm_map.