public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* egcs-1.0.2, linux kernel 2.0.33 SMP on i686
@ 1998-05-05  8:20 Christian Iseli
  1998-05-05 16:32 ` H.J. Lu
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Iseli @ 1998-05-05  8:20 UTC (permalink / raw)
  To: egcs

Hi folks,

I just compiled linux kernel 2.0.33 SMP on a 4-way PPro box.  I had a few problems
with the assembler things.  I use binutils 2.9.0.3.  The main problem came from two
instructions in entry.S and irq.h: btl %al,... and btrl %al,...  I changed
the %al to %eax, and now it seems to work.

I know next to zip about x86 assembler stuff, so the question is: was this the
Right Thing to do?

BTW, I also tried to compile kernel 2.1.99 on the same machine.  No problem compiling,
but when the kernel boots, it fails to detect the ncr53c8xx SCSI driver and panics.
Any clue why this happens.  I think it's a kernel related problem, cause gcc-2.[78].x
do no better.

					Christian

P.S. Now that I reread this message, it notice that it has probably little to do with egcs...
Oh well...

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: egcs-1.0.2, linux kernel 2.0.33 SMP on i686
  1998-05-05  8:20 egcs-1.0.2, linux kernel 2.0.33 SMP on i686 Christian Iseli
@ 1998-05-05 16:32 ` H.J. Lu
  0 siblings, 0 replies; 3+ messages in thread
From: H.J. Lu @ 1998-05-05 16:32 UTC (permalink / raw)
  To: Christian Iseli; +Cc: egcs

> 
> Hi folks,
> 
> I just compiled linux kernel 2.0.33 SMP on a 4-way PPro box.  I had a few problems
> with the assembler things.  I use binutils 2.9.0.3.  The main problem came from two
> instructions in entry.S and irq.h: btl %al,... and btrl %al,...  I changed
> the %al to %eax, and now it seems to work.
> 
> I know next to zip about x86 assembler stuff, so the question is: was this the
> Right Thing to do?
> 

I am enclosing a patch for linux 2.0.33.

> BTW, I also tried to compile kernel 2.1.99 on the same machine.  No problem compiling,

kernel 2.1.99 is fixed.

> but when the kernel boots, it fails to detect the ncr53c8xx SCSI driver and panics.
> Any clue why this happens.  I think it's a kernel related problem, cause gcc-2.[78].x
> do no better.
> 

I will give it a try when I find time. I have a NCR 810 card.



H.J.
---
diff -ur linux-2.0.33/arch/i386/kernel/entry.S linux-2.0.33.fixed/arch/i386/kernel/entry.S
--- linux-2.0.33/arch/i386/kernel/entry.S	Tue May  5 10:54:33 1998
+++ linux-2.0.33.fixed/arch/i386/kernel/entry.S	Sun Apr 26 10:49:57 1998
@@ -182,10 +182,10 @@
 	cmpb SYMBOL_NAME(active_kernel_processor), %al; \
 	je 4f; \
 2:	SMP_PROF_B \
-	btl %al, SYMBOL_NAME(smp_invalidate_needed); \
+	btl %eax, SYMBOL_NAME(smp_invalidate_needed); \
 	jnc 5f; \
 	lock; \
-	btrl %al, SYMBOL_NAME(smp_invalidate_needed); \
+	btrl %eax, SYMBOL_NAME(smp_invalidate_needed); \
 	jnc 5f; \
 	movl %cr3,%edx; \
 	movl %edx,%cr3; \
@@ -326,7 +326,7 @@
 	ALIGN
 1:	call SYMBOL_NAME(syscall_trace)
 	movl ORIG_EAX(%esp),%eax
-	call SYMBOL_NAME(sys_call_table)(,%eax,4)
+	call *SYMBOL_NAME(sys_call_table)(,%eax,4)
 	movl %eax,EAX(%esp)		# save the return value
 #ifdef __SMP__
 	GET_PROCESSOR_OFFSET(%eax)
diff -ur linux-2.0.33/include/asm-i386/irq.h linux-2.0.33.fixed/include/asm-i386/irq.h
--- linux-2.0.33/include/asm-i386/irq.h	Tue May  5 10:54:41 1998
+++ linux-2.0.33.fixed/include/asm-i386/irq.h	Sun Apr 26 10:38:03 1998
@@ -165,10 +165,10 @@
 	"movb $1, "SYMBOL_NAME_STR(smp_blocked_interrupt_pending)"\n\t" \
 	"2: " \
         SMP_PROF_INT_SPINS \
-	"btl %al, "SYMBOL_NAME_STR(smp_invalidate_needed)"\n\t" \
+	"btl %eax, "SYMBOL_NAME_STR(smp_invalidate_needed)"\n\t" \
 	"jnc 5f\n\t" \
 	"lock\n\t" \
-	"btrl %al, "SYMBOL_NAME_STR(smp_invalidate_needed)"\n\t" \
+	"btrl %eax, "SYMBOL_NAME_STR(smp_invalidate_needed)"\n\t" \
 	"jnc 5f\n\t" \
 	"movl %cr3,%edx\n\t" \
 	"movl %edx,%cr3\n" \

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: egcs-1.0.2, linux kernel 2.0.33 SMP on i686
@ 1998-05-05 19:14 Benjamin Redelings I
  0 siblings, 0 replies; 3+ messages in thread
From: Benjamin Redelings I @ 1998-05-05 19:14 UTC (permalink / raw)
  To: chris, egcs

Yes this is a bit offtopic ;) I think that egcs 1.0.2 should be OK, but
I know that 2.0.33 has some know bugs.  Some are regarding bad asm which
was caught only by recently released versions of the 'binutils'
package.  These asm bugs are fixed in 2.1.9x, so you may have a problem
compiling 2.0.33 with newer assemblers that now complain about bad asm.

	Another problem is that 2.0.33 forgets to declare some things
volatile.  Since egcs is better at optimizing than gcc 2.7.2.3, it can
FIND existing kernel bugs... again, these are fixed in 2.1.99.  These
bugs might be fixed in 2.0.34, and perhaps even in 2.0.34-pre11b which
is already out.  (pre11 dies badly, pre11b is good..with gcc2.7.2.3 at
least :).  Also, read the egcs FAQ.

	As for the problems with 2.1.99, they might not be present in 2.1.98. 
Look at the kernel change summaries on linuxhq.com for detail.s  2.1.99
probably has some interrupt bugs as regards SMP.  Look for the
linux-kernel mailing list archives at linuxhq...you really have to read
them if you want to know anything about kernel problems; look in the
archives for WHICH kernel work with your SCSI drive ;)
	Linus and others have been messing around with the structure of
interrupt handlers...2.1.100-pre2 might be better (I'm just about to
boot into it from 2.1.100-pre1 and see if it works...egcs snapshot 0502
-mpentiumpro UniProcessor :) It probably is.

good luck
-BenRI

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1998-05-05 19:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-05-05  8:20 egcs-1.0.2, linux kernel 2.0.33 SMP on i686 Christian Iseli
1998-05-05 16:32 ` H.J. Lu
1998-05-05 19:14 Benjamin Redelings I

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).