linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* A newbie's question
@ 2002-09-26 14:52 immortal1015
  2002-09-26 15:22 ` jbradford
  2002-09-26 16:14 ` DervishD
  0 siblings, 2 replies; 3+ messages in thread
From: immortal1015 @ 2002-09-26 14:52 UTC (permalink / raw)
  To: linux-kernel

Hi, all. I am a newbie to Linuxe Kernel. I am reading the kernel source about bootstrap in Linux.
I was confused by the boot.s:
/////////////////////////////
   	mov	ax,#BOOTSEG
	mov	ds,ax
	mov	ax,#INITSEG
	mov	es,ax
	mov	cx,#256
	sub	si,si
	sub	di,di
	rep
	movw
	jmpi	go,INITSEG
/////////////////////////////
1. What assembly language used in boot.s? Intel Asm or AT&T?
2. Where is the definition of operand movw and jmpi? I cant find it in the Intel Manual.

Please give me some adivices.

Best regards.



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

* Re: A newbie's question
  2002-09-26 14:52 A newbie's question immortal1015
@ 2002-09-26 15:22 ` jbradford
  2002-09-26 16:14 ` DervishD
  1 sibling, 0 replies; 3+ messages in thread
From: jbradford @ 2002-09-26 15:22 UTC (permalink / raw)
  To: immortal1015; +Cc: linux-kernel

> Hi, all. I am a newbie to Linuxe Kernel. I am reading the kernel source about bootstrap in Linux.
> I was confused by the boot.s:
> /////////////////////////////
>    	mov	ax,#BOOTSEG
> 	mov	ds,ax
> 	mov	ax,#INITSEG
> 	mov	es,ax
> 	mov	cx,#256
> 	sub	si,si
> 	sub	di,di
> 	rep
> 	movw
> 	jmpi	go,INITSEG
> /////////////////////////////
> 1. What assembly language used in boot.s? Intel Asm or AT&T?
> 2. Where is the definition of operand movw and jmpi? I cant find it in the Intel Manual.
> 
> Please give me some adivices.

I could be totally wrong here, but my understanding of the situtation is that the bootstrap was originally compiled with as86, not gas, and therefore was in the Intel format, (the standard for gas being AT&T, although Gas can also compile Intel format using the .intel_syntax pseudo-op).  I assume that the bootloader has stayed in Intel format for historical reasons.

However, I could be totally wrong.  The last assembler coding I did was on a Z80 :-).

John.

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

* Re: A newbie's question
  2002-09-26 14:52 A newbie's question immortal1015
  2002-09-26 15:22 ` jbradford
@ 2002-09-26 16:14 ` DervishD
  1 sibling, 0 replies; 3+ messages in thread
From: DervishD @ 2002-09-26 16:14 UTC (permalink / raw)
  To: immortal1015; +Cc: linux-kernel

    Hi unknown :)

> 	rep
> 	movw

    In my bootsector.S, it's movsw: repeat move (string) by words.
'movw' is 'mov word size operands'.

> 	jmpi	go,INITSEG

    AFAIK, the correct is 'ljmp': long jump. What kernel sources are
you seeing?. Old kernels (2.0 and I think that 2.2 too) used as86 to
do the assembling, and the syntax was like the Intel one, but with
some differences. Not quite standard, I think.

> /////////////////////////////
> 1. What assembly language used in boot.s? Intel Asm or AT&T?

    AT&T in new kernels, fully 'assembleable' with GNU as. IMHO is a
better syntax, but I don't want to feed a troll here ;)

> 2. Where is the definition of operand movw and jmpi?
> I cant find it in the Intel Manual.

    Of course, there aren't Intel syntax anyway :) I recommend you to
see the 2.4 sources for reading the assembler part. Moreover, the
info section for 'GNU as' comments the differences between Intel
assembly syntax and the AT&T one. This will be of great help.

    In addition to this, I have a document about using GNU as for
real mode assembly that comments some of these points. But it is
written in spanish only :((

    Last, the Assembly-HOWTO will cast some light to the issue, too.

    Raúl

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

end of thread, other threads:[~2002-09-26 16:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-26 14:52 A newbie's question immortal1015
2002-09-26 15:22 ` jbradford
2002-09-26 16:14 ` DervishD

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 NNTP newsgroup(s).