public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] i386 loading from flash
@ 2006-09-13 14:53 Tim michals
  2006-10-01 18:38 ` Bart Veer
  0 siblings, 1 reply; 3+ messages in thread
From: Tim michals @ 2006-09-13 14:53 UTC (permalink / raw)
  To: ecos-discuss

I'm looking at loading ecos from ROM for a SC520, the
romboot.S assumes a BIOS?  because it is call video
memory and loading the descriptor from ROM to RAM
without setting RAM?

Can the GDT descriptor be in ROM, instead of creating
the header in RAM use the header stored in ROM?

	
	movw    %0xFFa0,%di  //assuming the header starts at
0xffA0
	# load GDTR
	lgdt	%cs:di
.........rest of startup......

	.align	4, 0xCC
 desc:
         .word 0x0032
         .word 0xFFA0  //address in ROM
         .word 0x000f
         .word 0
         .word 0
         .word 0


gdtStart:
	/* Selector 0x00 == invalid. */
	.word	0x0000
	.word	0x0000
	.byte	0x00
	.byte	0x00
	.byte	0x00
	.byte	0x00

	/* Selector 0x08 == code. */
	.word	0xFFFF
	.word	0x0000
	.byte	0x00
	.byte	0x9B
	.byte	0xCF
	.byte	0x00


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] i386 loading from flash
  2006-09-13 14:53 [ECOS] i386 loading from flash Tim michals
@ 2006-10-01 18:38 ` Bart Veer
  2006-10-02  1:28   ` Tim michals
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Veer @ 2006-10-01 18:38 UTC (permalink / raw)
  To: tcmichals; +Cc: ecos-discuss

>>>>> "Tim" == Tim michals <tcmichals@yahoo.com> writes:

    Tim> I'm looking at loading ecos from ROM for a SC520, the
    Tim> romboot.S assumes a BIOS? because it is call video memory and
    Tim> loading the descriptor from ROM to RAM without setting RAM?

    Tim> Can the GDT descriptor be in ROM, instead of creating the
    Tim> header in RAM use the header stored in ROM?

I assume you are referring to the romboot.S in the PC platform HAL. I
believe that file was for use in a PC option ROM so it could assume
both the presence of a full BIOS and that the hardware had already
been fully initialized. Having eCos itself boot from ROM on an
embedded x86 platform, i.e. all the way from the processor's reset
vector, is possible. However it can prove tricky and the details will
depend on exactly which x86-mostly-compatible processor you are using.

To date I have only done one such port (not to an SC520) and it was
somewhat of a challenge - especially since the main debug facility
available was a 7-segment LED display. That port was to
customer-specific hardware so I am not at liberty to share any of the
code.

It should certainly be possible to store the global descriptor table
in ROM. However one issue that you need to be aware of is that there
are two versions of the lgdt instruction:

    lgdt	 %cs:_gdt
    data32 lgdt	 %cs:_gdt

  _gdt:
    <global descriptor table data comes here>

Which one is appropriate will depend on exactly what your memory map
looks like at the time the instruction is executed. Unfortunately
objdump -d will not distinguish between the two instructions so you
may end up having to decode the binary. The ndisasm utility may also
prove useful.

Bart

-- 
Bart Veer                       eCos Configuration Architect
http://www.ecoscentric.com/     The eCos and RedBoot experts

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] i386 loading from flash
  2006-10-01 18:38 ` Bart Veer
@ 2006-10-02  1:28   ` Tim michals
  0 siblings, 0 replies; 3+ messages in thread
From: Tim michals @ 2006-10-02  1:28 UTC (permalink / raw)
  To: Bart Veer; +Cc: ecos-discuss

Yes, this is what the problem was...

----- Original Message ----
From: Bart Veer <bartv@ecoscentric.com>
To: tcmichals@yahoo.com
Cc: ecos-discuss@sourceware.org
Sent: Sunday, October 1, 2006 1:38:04 PM
Subject: Re: [ECOS] i386 loading from flash


>>>>> "Tim" == Tim michals <tcmichals@yahoo.com> writes:

    Tim> I'm looking at loading ecos from ROM for a SC520, the
    Tim> romboot.S assumes a BIOS? because it is call video memory and
    Tim> loading the descriptor from ROM to RAM without setting RAM?

    Tim> Can the GDT descriptor be in ROM, instead of creating the
    Tim> header in RAM use the header stored in ROM?

I assume you are referring to the romboot.S in the PC platform HAL. I
believe that file was for use in a PC option ROM so it could assume
both the presence of a full BIOS and that the hardware had already
been fully initialized. Having eCos itself boot from ROM on an
embedded x86 platform, i.e. all the way from the processor's reset
vector, is possible. However it can prove tricky and the details will
depend on exactly which x86-mostly-compatible processor you are using.

To date I have only done one such port (not to an SC520) and it was
somewhat of a challenge - especially since the main debug facility
available was a 7-segment LED display. That port was to
customer-specific hardware so I am not at liberty to share any of the
code.

It should certainly be possible to store the global descriptor table
in ROM. However one issue that you need to be aware of is that there
are two versions of the lgdt instruction:

    lgdt     %cs:_gdt
    data32 lgdt     %cs:_gdt

  _gdt:
    <global descriptor table data comes here>

Which one is appropriate will depend on exactly what your memory map
looks like at the time the instruction is executed. Unfortunately
objdump -d will not distinguish between the two instructions so you
may end up having to decode the binary. The ndisasm utility may also
prove useful.

Bart

-- 
Bart Veer                       eCos Configuration Architect
http://www.ecoscentric.com/     The eCos and RedBoot experts

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

end of thread, other threads:[~2006-10-02  1:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-13 14:53 [ECOS] i386 loading from flash Tim michals
2006-10-01 18:38 ` Bart Veer
2006-10-02  1:28   ` Tim michals

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).