Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 May 2005 03:51:48 +0200
From:      Pawel Worach <pawel.worach@gmail.com>
To:        freebsd-current@freebsd.org
Cc:        David Gurvich <david.freebsd@verizon.net>
Subject:   Re: Newest loader from CVS not working
Message-ID:  <42992034.3080403@gmail.com>
In-Reply-To: <42914446.4000203@gmail.com>
References:  <20050518051111.GA33262@Athena.infor.org>	<20050520164349.GD6982@dragon.NUXI.org>	<428E1815.8080500@samsco.org> <200505221453.44007.peter@wemm.org>	<429105D8.6000106@samsco.org> <20050523021527.GA62693@dragon.NUXI.org> <42914446.4000203@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Pawel Worach wrote:
  > I'm seeing the same thing if CPUTYPE is set to "pentium-m" while
> "pentium2" works fine. Loader crashes on start, is there a way to make 
> it freeze instead of reset to capture the register dump? Kernel/world 
> works fine with the pentium-m CPUTYPE if booted with loader.old. This in 
> on a IBM T41 with a cpu as detected below.
> 
> CPU: Intel(R) Pentium(R) M processor 1700MHz (1698.56-MHz 686-class CPU)
>   Origin = "GenuineIntel"  Id = 0x695  Stepping = 5
> Features=0xa7e9f9bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,TM,PBE> 
> 
> Features2=0x180<EST,TM2>
> 

I did some more investigation into this and found that MMX registers are used in 
the FICL code in the pentium-m case. Here is a full diff of sys/boot built with 
CPUTYPE?=pentium2 and pentium-m.

diff -ur boot.pentium2/ficl/softcore.c boot.pentium-m/ficl/softcore.c
--- boot.pentium2/ficl/softcore.c	Sun May 29 03:43:23 2005
+++ boot.pentium-m/ficl/softcore.c	Sun May 29 03:42:00 2005
@@ -4,7 +4,7 @@
  ** Words from CORE set written in FICL
  ** Author: John Sadler (john_sadler@alum.mit.edu)
  ** Created: 27 December 1997
-** Last update: Sun May 29 03:43:23 CEST 2005
+** Last update: Sun May 29 03:42:00 CEST 2005
  ***************************************************************/

  /*
diff -ur boot.pentium2/ficl/tools.s boot.pentium-m/ficl/tools.s
--- boot.pentium2/ficl/tools.s	Sun May 29 03:43:30 2005
+++ boot.pentium-m/ficl/tools.s	Sun May 29 03:42:18 2005
@@ -1658,19 +1658,19 @@
  	pushl	%esi
  	xorl	%esi, %esi
  	pushl	%ebx
-	subl	$28, %esp
+	subl	$40, %esp
  	movl	8(%ebp), %edx
  	movl	(%edx), %eax
-	movl	16(%eax), %eax
-	movl	%eax, -16(%ebp)
+	movd	16(%eax), %xmm0
+	movd	%xmm0, %eax
  	movl	8(%eax), %eax
-	movl	%eax, -20(%ebp)
+	movl	%eax, -16(%ebp)
  	movl	8(%eax), %eax
  	cmpl	$0, %eax
  	jbe	.L199
  	.p2align 4,,15
  .L203:
-	movl	-20(%ebp), %edx
+	movl	-16(%ebp), %edx
  	movl	12(%edx,%edi,4), %ebx
  	testl	%ebx, %ebx
  	je	.L201
@@ -1680,21 +1680,23 @@
  	incl	%esi
  	movl	%eax, 8(%esp)
  	movl	8(%ebx), %eax
+	movd	%xmm0, -32(%ebp)
  	movl	%eax, 4(%esp)
  	movl	8(%ebp), %eax
  	movl	%eax, (%esp)
  	call	vmTextOut
+	movd	-32(%ebp), %xmm0
  	movl	(%ebx), %ebx
  	testl	%ebx, %ebx
  	jne	.L196
-	movl	-20(%ebp), %edx
+	movl	-16(%ebp), %edx
  	movl	8(%edx), %eax
  .L201:
  	incl	%edi
  	cmpl	%edi, %eax
  	ja	.L203
  .L199:
-	movl	-16(%ebp), %edx
+	movd	%xmm0, %edx
  	movl	8(%ebp), %ebx
  	movl	84(%edx), %eax
  	subl	$-128, %ebx
@@ -1715,7 +1717,7 @@
  	movl	8(%ebp), %eax
  	movl	%eax, (%esp)
  	call	vmTextOut
-	addl	$28, %esp
+	addl	$40, %esp
  	popl	%ebx
  	popl	%esi
  	popl	%edi
diff -ur boot.pentium2/ficl/vm.s boot.pentium-m/ficl/vm.s
--- boot.pentium2/ficl/vm.s	Sun May 29 03:43:30 2005
+++ boot.pentium-m/ficl/vm.s	Sun May 29 03:42:18 2005
@@ -298,21 +298,24 @@
  	xorl	%edi, %edi
  	pushl	%esi
  	pushl	%ebx
-	subl	$16, %esp
-	movl	8(%ebp), %edx
+	subl	$32, %esp
+	movd	8(%ebp), %xmm0
  	movl	$0, -20(%ebp)
  	movl	$0, -16(%ebp)
+	movd	%xmm0, %edx
  	movl	60(%edx), %ecx
  	movl	52(%edx), %eax
  	movl	56(%edx), %esi
+	movd	%xmm0, -36(%ebp)
  	addl	%ecx, %eax
  	movl	%esi, 4(%esp)
  	movl	%eax, (%esp)
  	call	skipSpace
  	movl	%eax, -16(%ebp)
+	cmpl	%eax, %esi
  	movl	%eax, %ecx
-	cmpl	%ecx, %esi
-	movzbl	(%ecx), %ebx
+	movzbl	(%eax), %ebx
+	movd	-36(%ebp), %xmm0
  	je	.L45
  	.p2align 4,,15
  .L52:
@@ -346,13 +349,13 @@
  	cmpl	$1, %eax
  	sbbl	$-1, %ecx
  .L49:
-	movl	8(%ebp), %eax
+	movd	%xmm0, %eax
  	movl	60(%eax), %edx
  	subl	%edx, %ecx
  	movl	%ecx, 52(%eax)
  	movl	-20(%ebp), %eax
  	movl	-16(%ebp), %edx
-	addl	$16, %esp
+	addl	$32, %esp
  	popl	%ebx
  	popl	%esi
  	popl	%edi
diff -ur boot.pentium2/ficl/words.s boot.pentium-m/ficl/words.s
--- boot.pentium2/ficl/words.s	Sun May 29 03:43:32 2005
+++ boot.pentium-m/ficl/words.s	Sun May 29 03:42:19 2005
@@ -5068,15 +5068,16 @@
  	pushl	%edi
  	pushl	%esi
  	pushl	%ebx
-	subl	$16, %esp
-	movl	8(%ebp), %eax
+	subl	$32, %esp
+	movd	8(%ebp), %xmm0
+	movd	%xmm0, %eax
  	movl	60(%eax), %esi
  	movl	52(%eax), %ebx
  	movl	56(%eax), %edi
  	subl	$-128, %eax
+	movl	%eax, -16(%ebp)
  	addl	%esi, %ebx
  	movl	%eax, %esi
-	movl	%eax, -16(%ebp)
  	jmp	.L363
  	.p2align 4,,7
  .L364:
@@ -5095,8 +5096,10 @@
  	movb	$0, (%esi)
  	cmpl	%ebx, %edi
  	setne	%dl
+	movd	%xmm0, (%esp)
  	xorl	%eax, %eax
  	cmpb	$41, %cl
+	movd	%xmm0, -32(%ebp)
  	sete	%al
  	andl	%edx, %eax
  	cmpl	$1, %eax
@@ -5104,15 +5107,14 @@
  	sbbl	$-1, %ebx
  	xorl	%ecx, %ecx
  	movl	%eax, 4(%esp)
-	movl	8(%ebp), %eax
  	movl	%ecx, 8(%esp)
-	movl	%eax, (%esp)
  	call	vmTextOut
-	movl	8(%ebp), %eax
+	movd	-32(%ebp), %xmm0
+	movd	%xmm0, %eax
  	movl	60(%eax), %edx
  	subl	%edx, %ebx
  	movl	%ebx, 52(%eax)
-	addl	$16, %esp
+	addl	$32, %esp
  	popl	%ebx
  	popl	%esi
  	popl	%edi
diff -ur boot.pentium2/i386/loader/vers.c boot.pentium-m/i386/loader/vers.c
--- boot.pentium2/i386/loader/vers.c	Sun May 29 03:43:25 2005
+++ boot.pentium-m/i386/loader/vers.c	Sun May 29 03:42:02 2005
@@ -1,4 +1,4 @@
  char bootprog_name[] = "FreeBSD/i386 bootstrap loader";
  char bootprog_rev[] = "1.1";
-char bootprog_date[] = "Sun May 29 03:43:25 CEST 2005";
+char bootprog_date[] = "Sun May 29 03:42:02 CEST 2005";
  char bootprog_maker[] = "root@ibm-se82151";
diff -ur boot.pentium2/i386/loader/vers.i boot.pentium-m/i386/loader/vers.i
--- boot.pentium2/i386/loader/vers.i	Sun May 29 03:43:38 2005
+++ boot.pentium-m/i386/loader/vers.i	Sun May 29 03:42:25 2005
@@ -4,5 +4,5 @@
  # 1 "vers.c"
  char bootprog_name[] = "FreeBSD/i386 bootstrap loader";
  char bootprog_rev[] = "1.1";
-char bootprog_date[] = "Sun May 29 03:43:25 CEST 2005";
+char bootprog_date[] = "Sun May 29 03:42:02 CEST 2005";
  char bootprog_maker[] = "root@ibm-se82151";
diff -ur boot.pentium2/i386/loader/vers.s boot.pentium-m/i386/loader/vers.s
--- boot.pentium2/i386/loader/vers.s	Sun May 29 03:43:38 2005
+++ boot.pentium-m/i386/loader/vers.s	Sun May 29 03:42:25 2005
@@ -9,7 +9,7 @@
  	.type	bootprog_date, @object
  	.size	bootprog_date, 30
  bootprog_date:
-	.string	"Sun May 29 03:43:25 CEST 2005"
+	.string	"Sun May 29 03:42:02 CEST 2005"
  .globl bootprog_rev
  	.type	bootprog_rev, @object
  	.size	bootprog_rev, 4

-- 
Pawel



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42992034.3080403>