From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 9 15:20:30 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 34FEF16A4CE for ; Wed, 9 Feb 2005 15:20:30 +0000 (GMT) Received: from natco3.natcotech.com (natco3.natcotech.com [205.167.142.103]) by mx1.FreeBSD.org (Postfix) with ESMTP id B79AD43D53 for ; Wed, 9 Feb 2005 15:20:29 +0000 (GMT) (envelope-from smartweb@leadhill.net) Received: from ibm.nlcc.us (lhr4-dial-12-28-49-177.natcotech.com [12.28.49.177]) by natco3.natcotech.com (Postfix) with ESMTP id 894C263046 for ; Wed, 9 Feb 2005 09:20:28 -0600 (CST) Received: (qmail 14649 invoked by uid 89); 9 Feb 2005 15:20:27 -0000 Received: from unknown (HELO ?192.168.0.2?) (billy@192.168.0.2) by ibm.nlcc.us with SMTP; 9 Feb 2005 15:20:27 -0000 Message-ID: <420A2A3B.2060507@leadhill.net> Date: Wed, 09 Feb 2005 09:20:27 -0600 From: Billy Newsom User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040616 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Cold Reboot (or cold restart) FreeBSD? locore.s hack attempt X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Feb 2005 15:20:30 -0000 I want to do a cold reboot of FreeBSD due to (what seens to be) a problem with the FreeBSD 5.3 system on my particular machine. To make a long story short, I have determined that FreeBSD 5.3 sputters and coughs when it tries to reboot this system. (The problem wasn't on 4.7, for example, and DOS can reboot the machine fine.) I believe the solution (barring a change of the kernel I'm not sure how to do) is to merely rewrite the code which send the command to reboot the system. I want to be able to do a shutdown -r now, or merely a "reboot" from single user mode, etc. and the system restart, do its full POST, count memory, and run properly. So here's my unified diff, which did not seem to work: -----------------Code --- locore.s Thu Jul 8 17:35:34 2004 +++ /usr/src/sys/i386/i386/locore.s Wed Feb 2 01:50:36 2005 @@ -214,7 +214,8 @@ movsb #else /* IBM-PC */ /* Tell the bios to warmboot next time */ - movw $0x1234,0x472 +/* movw $0x1234,0x472 */ + movw $0x0000,0x472 /* Billy: Perform Cold Reboot! */ #endif /* PC98 */ /* Set up a real frame in case the double return in newboot is executed. */ -----------------Code Recompiling my kernel and using that diff did not work. The system would still lock up and freeze when I attempted to do a shutdown -r now. The 0x472h address is supposed to point to a region of memory that the BIOS looks at when deciding to do a cold or warm restart. Perhaps doing this in locore.s is not working somehow, or that region of memory gets corrupted. So to see the full discussion of my problem in detail, see the archives of the freebsd-questions list: http://lists.freebsd.org/pipermail/freebsd-questions/2005-January/074567.html (my original post) Here's what I came up with: http://lists.freebsd.org/pipermail/freebsd-questions/2005-February/074728.html Well, so far I tried this hack: http://lists.freebsd.org/pipermail/freebsd-questions/2005-February/074867.html This problem is very weird, because only FreeBSD 5.3 seems to break the rebooting ability of this machine. The underlying problem might have to do with some sort of aggressive use of the BIOS memroy region or some reserved memory which causes a warm (or perhaps even the cold) reboot to fail. IF that's the case, is there a hack to reserve memory from FreeBSD's kernel so that these secret regions get left in tact? Other than that, would someone like to see if my hack of locore.s Works For Them? I'm curious to see if someone else's computer will perform the cold restart (count memory). This code region is apparently about 10 years old or more (pre-3.0.5), so it would be interesting to hack it now. As a side note, I believe that linux and others allow you to decide on which reboot flavor you prefer. Thanks, Billy