* linux setup
@ 2013-07-22 13:28 zhaobin xv
2013-07-23 10:25 ` Catalin Marinas
0 siblings, 1 reply; 4+ messages in thread
From: zhaobin xv @ 2013-07-22 13:28 UTC (permalink / raw)
To: linux-arm-kernel
Hi
I recently read lernel source .
I have a question:In
folder:linux/arch/arm/boot/compressed/head.S(linux2.6.22.6):
start:
.type start,#function
.rept 8
mov r0, r0
.endr
b 1f
.word 0x016f2818 @ Magic numbers to help the loader
.word start @ absolute load/run zImage address
.word _edata @ zImage end address
1: mov r7, r1 @ save architecture ID
mov r8, r2 @ save atags pointer
I don't kown why the ?mov r0 r0 ? repeated emergence 8 times.
^ permalink raw reply [flat|nested] 4+ messages in thread
* linux setup
2013-07-22 13:28 linux setup zhaobin xv
@ 2013-07-23 10:25 ` Catalin Marinas
2013-07-23 19:34 ` Nicolas Pitre
0 siblings, 1 reply; 4+ messages in thread
From: Catalin Marinas @ 2013-07-23 10:25 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Jul 22, 2013 at 02:28:50PM +0100, zhaobin xv wrote:
> I recently read lernel source .
> I have a question:In
> folder:linux/arch/arm/boot/compressed/head.S(linux2.6.22.6):
>
>
> start:
> .type start,#function
> .rept 8
> mov r0, r0
> .endr
>
> b 1f
> .word 0x016f2818 @ Magic numbers to help the loader
> .word start @ absolute load/run zImage address
> .word _edata @ zImage end address
> 1: mov r7, r1 @ save architecture ID
> mov r8, r2 @ save atags pointer
>
>
> I don't kown why the ?mov r0 r0 ? repeated emergence 8 times.
I think some people used that in the past to be able to modify the
zImage binary directly and work around wrong register values passed by
the boot loader. I've never used it myself but I saw it mentioned once.
--
Catalin
^ permalink raw reply [flat|nested] 4+ messages in thread
* linux setup
2013-07-23 10:25 ` Catalin Marinas
@ 2013-07-23 19:34 ` Nicolas Pitre
2013-07-24 1:12 ` zhaobin xv
0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Pitre @ 2013-07-23 19:34 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, 23 Jul 2013, Catalin Marinas wrote:
> On Mon, Jul 22, 2013 at 02:28:50PM +0100, zhaobin xv wrote:
> > I recently read lernel source .
> > I have a question:In
> > folder:linux/arch/arm/boot/compressed/head.S(linux2.6.22.6):
> >
> >
> > start:
> > .type start,#function
> > .rept 8
> > mov r0, r0
> > .endr
> >
> > b 1f
> > .word 0x016f2818 @ Magic numbers to help the loader
> > .word start @ absolute load/run zImage address
> > .word _edata @ zImage end address
> > 1: mov r7, r1 @ save architecture ID
> > mov r8, r2 @ save atags pointer
> >
> >
> > I don't kown why the ?mov r0 r0 ? repeated emergence 8 times.
>
> I think some people used that in the past to be able to modify the
> zImage binary directly and work around wrong register values passed by
> the boot loader. I've never used it myself but I saw it mentioned once.
The whole reason for this is because in a distant past the kernel image
was an a.out binary containing a 32-bytes header. Those nops are simply
padding so to be compatible with those bootloaders expecting the kernel
code to start at an offset of 32.
Nicolas
^ permalink raw reply [flat|nested] 4+ messages in thread
* linux setup
2013-07-23 19:34 ` Nicolas Pitre
@ 2013-07-24 1:12 ` zhaobin xv
0 siblings, 0 replies; 4+ messages in thread
From: zhaobin xv @ 2013-07-24 1:12 UTC (permalink / raw)
To: linux-arm-kernel
thank you for your answer,
2013/7/24 Nicolas Pitre <nico@fluxnic.net>:
> On Tue, 23 Jul 2013, Catalin Marinas wrote:
>
>> On Mon, Jul 22, 2013 at 02:28:50PM +0100, zhaobin xv wrote:
>> > I recently read lernel source .
>> > I have a question:In
>> > folder:linux/arch/arm/boot/compressed/head.S(linux2.6.22.6):
>> >
>> >
>> > start:
>> > .type start,#function
>> > .rept 8
>> > mov r0, r0
>> > .endr
>> >
>> > b 1f
>> > .word 0x016f2818 @ Magic numbers to help the loader
>> > .word start @ absolute load/run zImage address
>> > .word _edata @ zImage end address
>> > 1: mov r7, r1 @ save architecture ID
>> > mov r8, r2 @ save atags pointer
>> >
>> >
>> > I don't kown why the ?mov r0 r0 ? repeated emergence 8 times.
>>
>> I think some people used that in the past to be able to modify the
>> zImage binary directly and work around wrong register values passed by
>> the boot loader. I've never used it myself but I saw it mentioned once.
>
> The whole reason for this is because in a distant past the kernel image
> was an a.out binary containing a 32-bytes header. Those nops are simply
> padding so to be compatible with those bootloaders expecting the kernel
> code to start at an offset of 32.
>
>
> Nicolas
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-07-24 1:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-22 13:28 linux setup zhaobin xv
2013-07-23 10:25 ` Catalin Marinas
2013-07-23 19:34 ` Nicolas Pitre
2013-07-24 1:12 ` zhaobin xv
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).