From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: implementation of Bounded_String Date: Fri, 19 Jan 2018 20:26:47 +0200 Organization: Tidorum Ltd Message-ID: References: <2eaf6de3-ce95-4c69-b22b-441a7ed6d5c9@googlegroups.com> <90369010-6a4c-4000-b305-ed54e4d377ce@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net 1i/wMyvUkFwE0Phh9ywAcwiA57cn6UHsUZWAapWf5vqJC/RKmJ Cancel-Lock: sha1:kgqOlccdfK8JWXQr34EIBYPIUTg= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: Xref: reader02.eternal-september.org comp.lang.ada:50006 Date: 2018-01-19T20:26:47+02:00 List-Id: 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 . @ .