From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: implementation of Bounded_String
Date: Fri, 19 Jan 2018 20:26:47 +0200
Date: 2018-01-19T20:26:47+02:00 [thread overview]
Message-ID: <fcerj5Fj7rhU1@mid.individual.net> (raw)
In-Reply-To: <p3spv5$i3m$1@gioia.aioe.org>
On 18-01-19 14:57 , Dmitry A. Kazakov wrote:
> On 19/01/2018 12:54, Mehdi Saada wrote:
>
> [Trying to make sense from kind of meaningless questions]
>
>> I just wonder what's the lowest level (besides assembly) at which in
>> Ada, one can implement characters input-output.
>
> You cannot do I/O in assembly in any way different to a higher level
> language. With an OS in place all I/O is queuing a request to some
> device driver.
>
>> But since Text_io is language-defined, I suppose there's nothing
>> closer to the hardware ?
>
> Among Ada standard means stream and direct I/O are the closest to the
> hardware in the sense that they add least to the data being read and
> written. [However that can depend on the OS which can translate streams
> and blocks into something else below]
>
> Calls to the native OS I/O facilities follow. There is nothing closer
> unless you are in the system kernel.
Or running "bare machine", without an OS, and with direct access to the
I/O HW -- which means that you are, in some sense, part of the "system
kernel", such as it is.
In a bare machine environment, Text_IO.Put (Item : in Character) is
often implemented like this (in Ada, usually):
while UART_Tx_Register.Busy loop null; end loop;
UART_Tx_Register.Data := Item;
where UART_Tx_Register is mapped to the transmission register of the
UART peripheral.
--
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
. @ .
prev parent reply other threads:[~2018-01-19 18:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-18 14:10 implementation of Bounded_String Mehdi Saada
2018-01-18 14:42 ` Dmitry A. Kazakov
2018-01-18 22:24 ` Simon Wright
2018-01-19 1:25 ` Randy Brukardt
2018-01-19 11:54 ` Mehdi Saada
2018-01-19 12:57 ` Dmitry A. Kazakov
2018-01-19 18:26 ` Niklas Holsti [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox