comp.lang.ada
 help / color / mirror / Atom feed
* Bare metal text I/O in Ada
@ 2005-03-20 18:01 John McCormick
  2005-03-20 18:54 ` tmoran
  2005-04-26 13:47 ` Fredrik
  0 siblings, 2 replies; 6+ messages in thread
From: John McCormick @ 2005-03-20 18:01 UTC (permalink / raw)


For the embedded systems class that I teach, I need to implement
keyboard input and text output to EGA / VGA on a bare metal (no
operating system) AMD (Intel clone) platform.  Is anyone aware of any
efforts in this area that I might build on?

I am using IBM Rational Apex Embedded.  The Text_IO supplied in
TDM/Rational Exec uses the serial port to communicate with a host
system to do the I/O.  I need to do basic text I/O on the target not
the host.

Thanks for any pointers

John



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

* Re: Bare metal text I/O in Ada
  2005-03-20 18:01 Bare metal text I/O in Ada John McCormick
@ 2005-03-20 18:54 ` tmoran
  2005-03-21 21:40   ` Randy Brukardt
  2005-04-26 13:47 ` Fredrik
  1 sibling, 1 reply; 6+ messages in thread
From: tmoran @ 2005-03-20 18:54 UTC (permalink / raw)


>keyboard input and text output to EGA / VGA on a bare metal (no
>operating system) AMD (Intel clone) platform.
  No PC-style BIOS ROM either?
  It's trivial to write text to video RAM given the set of bits to
draw letters, eg
  type Bytes is mod 256;
  type Rows is array (0 .. 7) of Bytes;
  Letter : constant array(Character) of Rows
    :=((16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#,16#00#),
  etc.
"Programmer's Problem Solver for the IBM PC, XT, and AT", Robert Jourdain,
has a section on programming the keyboard interrupt for those machines,
but it's probably not applicable to truly different bare hardware.



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

* Re: Bare metal text I/O in Ada
  2005-03-20 18:54 ` tmoran
@ 2005-03-21 21:40   ` Randy Brukardt
  2005-03-22  1:16     ` John McCormick
  0 siblings, 1 reply; 6+ messages in thread
From: Randy Brukardt @ 2005-03-21 21:40 UTC (permalink / raw)


<tmoran@acm.org> wrote in message news:M5Kdna9J29x7W6DfRVn-3g@comcast.com...
> >keyboard input and text output to EGA / VGA on a bare metal (no
> >operating system) AMD (Intel clone) platform.
>   No PC-style BIOS ROM either?

If you have access to the BIOS ROM, it's pretty easy. But the BIOS doesn't
function in protected mode, and most compilers these days are 32-bit
protected.

One possibility would be write some code to call the BIOS, switching modes
as needed. That's how DOS-Extenders worked, and they're not that
complicated. Debugging the code might be fun, though. It certainly would be
better to access to the BIOS than to write new drivers for the keyboard and
video screen (which would essentially be a copy of the BIOS).

I can help you with the BIOS calls needed (our text windowing package did
this for all of its I/O), but we always assumed the existence of a DOS
Extender.

                           Randy Brukardt






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

* Re: Bare metal text I/O in Ada
  2005-03-21 21:40   ` Randy Brukardt
@ 2005-03-22  1:16     ` John McCormick
  2005-03-22  9:01       ` Gautier
  0 siblings, 1 reply; 6+ messages in thread
From: John McCormick @ 2005-03-22  1:16 UTC (permalink / raw)


I do have access to the BIOS.  But my application runs in protected
mode.  I am starting to gather up some documentation on VGA and will
try to see if I can access the video memory directly.  I know that I
can access the I/O ports in protected mode.

A silver lining to the whole thing is that the keyboard problem might
make a good exercise to introduce my students to Ada interrupt
handling.

John

Randy Brukardt wrote:
> <tmoran@acm.org> wrote in message
news:M5Kdna9J29x7W6DfRVn-3g@comcast.com...
> > >keyboard input and text output to EGA / VGA on a bare metal (no
> > >operating system) AMD (Intel clone) platform.
> >   No PC-style BIOS ROM either?
>
> If you have access to the BIOS ROM, it's pretty easy. But the BIOS
doesn't
> function in protected mode, and most compilers these days are 32-bit
> protected.
>
> One possibility would be write some code to call the BIOS, switching
modes
> as needed. That's how DOS-Extenders worked, and they're not that
> complicated. Debugging the code might be fun, though. It certainly
would be
> better to access to the BIOS than to write new drivers for the
keyboard and
> video screen (which would essentially be a copy of the BIOS).
>
> I can help you with the BIOS calls needed (our text windowing package
did
> this for all of its I/O), but we always assumed the existence of a
DOS
> Extender.
> 
>                            Randy Brukardt




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

* Re: Bare metal text I/O in Ada
  2005-03-22  1:16     ` John McCormick
@ 2005-03-22  9:01       ` Gautier
  0 siblings, 0 replies; 6+ messages in thread
From: Gautier @ 2005-03-22  9:01 UTC (permalink / raw)


John McCormick:

# I do have access to the BIOS.  But my application runs in protected
# mode.  I am starting to gather up some documentation on VGA and will
# try to see if I can access the video memory directly.  I know that I
# can access the I/O ports in protected mode.
# 
# A silver lining to the whole thing is that the keyboard problem might
# make a good exercise to introduce my students to Ada interrupt
# handling.

If it can help:
http://homepage.sunrise.ch/mysunrise/gdm/gsoft.htm#dos_paqs
It is GNAT & DOS-centered, but some pieces access the BIOS;
there are example of interrupt programming from protected mode.
______________________________________________________________
Gautier     --     http://www.mysunrise.ch/users/gdm/index.htm
Ada programming -- http://www.mysunrise.ch/users/gdm/gsoft.htm

NB: For a direct answer, e-mail address on the Web site!



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

* Re: Bare metal text I/O in Ada
  2005-03-20 18:01 Bare metal text I/O in Ada John McCormick
  2005-03-20 18:54 ` tmoran
@ 2005-04-26 13:47 ` Fredrik
  1 sibling, 0 replies; 6+ messages in thread
From: Fredrik @ 2005-04-26 13:47 UTC (permalink / raw)


Depending on which version of Rational Apex your using, you can 
implement an alternative communication method for text_io.
I think this is possible from Apex 4.0 and later.
There is a subsystem - lower_predefined.ss- which implements the 
"transportation" of your I/O. Check the 
apex_predefined_io_implementation.os_dependent_io package in there for 
details.

--Fredrik

On 2005-03-20 19:01, John McCormick wrote:
> For the embedded systems class that I teach, I need to implement
> keyboard input and text output to EGA / VGA on a bare metal (no
> operating system) AMD (Intel clone) platform.  Is anyone aware of any
> efforts in this area that I might build on?
> 
> I am using IBM Rational Apex Embedded.  The Text_IO supplied in
> TDM/Rational Exec uses the serial port to communicate with a host
> system to do the I/O.  I need to do basic text I/O on the target not
> the host.
> 
> Thanks for any pointers
> 
> John



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

end of thread, other threads:[~2005-04-26 13:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-20 18:01 Bare metal text I/O in Ada John McCormick
2005-03-20 18:54 ` tmoran
2005-03-21 21:40   ` Randy Brukardt
2005-03-22  1:16     ` John McCormick
2005-03-22  9:01       ` Gautier
2005-04-26 13:47 ` Fredrik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox