public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] i386 pc  target device driver
@ 2000-07-28  0:09 pyxue
  0 siblings, 0 replies; 3+ messages in thread
From: pyxue @ 2000-07-28  0:09 UTC (permalink / raw)
  To: ecos-discuss

Hi, all:
   
        I want to add some device drivers to the i386 pc target, here I
want to make sure about some problems, thanks!
        First, can I use bios interrupt?  In i386 code platform.inc I find
that int13 is used to get the size of ram. While when I use int16 to get
the data of keyboard, I meet the SIGSENV, segmention error. I try this
both in the vectros.S and my application, the same result.
        Second, I find I can set break point in some places, such as
cyg_hal_invoke_constructors. And the a document in hal/i386/pc directory
also indicates some incompleteness of i386 pc code. Can some one tell me
whether this incompleteness will affect the debug of my program?
        Last, when we add a device driver,
do we necessary add a new package,  or just add a single file to any
directoy and let it compile to libextros.o?  I tried the former method in 
vrc4373, and the driver init function  is called during the system init,
while this 
time, I use the  second method, my device init function is not called at
all. 
       Can some one give me any idea about these problems? Many thanks!
         


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

* Re: [ECOS] i386 pc  target device driver
  2000-07-28  0:11 pyxue
@ 2000-07-28  7:46 ` Patrick O'Grady
  0 siblings, 0 replies; 3+ messages in thread
From: Patrick O'Grady @ 2000-07-28  7:46 UTC (permalink / raw)
  To: ecos-discuss

Hi, maybe I can help--

On Fri, 28 Jul 2000, pyxue wrote:

>         First, can I use bios interrupt?  In i386 code platform.inc I find
> that int13 is used to get the size of ram. While when I use int16 to get
> the data of keyboard, I meet the SIGSENV, segmention error. I try this
> both in the vectros.S and my application, the same result.

This isn't possible in the current version of the HAL.  The BIOS expects
to run in real mode (16-bit segments and offsets--backward compatibility
mode), but eCos runs in Protected (32-bit offsets--the simple way which
'C' pointers work) mode.  We called the BIOS to find out the size of RAM
*before* switching to protected mode; once we've switched, the BIOS is off
limits.  The common solution is to provide a 'virtual x86' mode, which is
supported in the '386, but enabling this opens a really huge can of worms.  
You might post the specific routines that you're interested in, as I
imagine that a much better solution than switching memory modes is to
incorporate an already exisiting device driver from Linux instead.

>         Second, I find I can't set break point in some places, such as
> cyg_hal_invoke_constructors.

It's important to check to see if the breakpoint stub (and the interrupt
vectors themselves) are set up at the time the breakpoint is
invoked...  While I haven't looked at it, I'd guess that the constructors
are called before the stub is installed...  and I'm guessing that this
needs to be discussed before any code is changed.

Hope this helps...
-patrick


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

* [ECOS] i386 pc  target device driver
@ 2000-07-28  0:11 pyxue
  2000-07-28  7:46 ` Patrick O'Grady
  0 siblings, 1 reply; 3+ messages in thread
From: pyxue @ 2000-07-28  0:11 UTC (permalink / raw)
  To: ecos-discuss

Hi, all:
   
        I want to add some device drivers to the i386 pc target, here I
want to make sure about some problems, thanks!
        First, can I use bios interrupt?  In i386 code platform.inc I find
that int13 is used to get the size of ram. While when I use int16 to get
the data of keyboard, I meet the SIGSENV, segmention error. I try this
both in the vectros.S and my application, the same result.
        Second, I find I can't  set break point in some places, such as
cyg_hal_invoke_constructors. And the a document in hal/i386/pc directory
also indicates some incompleteness of i386 pc code. Can some one tell me
whether this incompleteness will affect the debug of my program?
        Last, when we add a device driver,
do we necessary add a new package,  or just add a single file to any
directoy and let it compile to libextros.o?  I tried the former method in 
vrc4373, and the driver init function  is called during the system init,
while this 
time, I use the  second method, my device init function is not called at
all. 
       Can some one give me any idea about these problems? Many thanks!
         



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

end of thread, other threads:[~2000-07-28  7:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-28  0:09 [ECOS] i386 pc target device driver pyxue
2000-07-28  0:11 pyxue
2000-07-28  7:46 ` Patrick O'Grady

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