|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 6144 (0x1800)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Local_Io_Conf, package body Serial_Support, seg_04cdb9
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦cfc2e13cd⟧ »Space Info Vol 2«
└─⟦this⟧
with Io_Exceptions;
use Io_Exceptions;
with Machine_Types;
use Machine_Types;
with System;
with Unchecked_Conversion;
package body Local_Io_Conf is
-- Example implementation of local terminal I/O, stub version.
-- The serial I/O code from the TDM configuration can be used
-- to build an implementation of local_io that communicates with
-- a terminal over an RS-232 connection.
package Serial_Support is
-- Borrowed from TDM configuration code. NOTE -- if TDM is being
-- used, no implementation of local_io may be used that would attempt
-- to do I/O over the same serial port on the target that TDM uses.
procedure Init;
-- Does target hardware specific initializations including
-- programming the serial I/O ports.
procedure Put (B : Byte);
-- Loops until the output port is ready. Then, puts the byte
-- to the serial output device.
procedure Get (B : out Byte; Got_Byte : out Boolean);
-- Gets a byte if one is available from the serial input device.
--
-- NOTE: doesn't loop. Tests if input is available. If available,
-- reads input byte and returns TRUE. Otherwise, returns FALSE
-- immediately. The routine below that uses this procedure just
-- tests 'got_byte' in a tight loop, so a version that waits for
-- a character would work as well. The present procedure
-- specification is used for compatibility with the TDM
-- configuration code.
end Serial_Support;
package body Serial_Support is
procedure Init is
-- Does target hardware specific initializations including programming
-- the serial I/O ports.
begin
null;
end Init;
procedure Put (B : Byte) is
-- Loops until the output port is ready. Then, puts the byte to the
-- serial output device.
begin
null;
end Put;
procedure Get (B : out Byte; Got_Byte : out Boolean) is
-- Gets a byte if one is avaiable from the serial input device.
--
-- NOTE: doesn't loop. Tests if input is available. If available,
-- reads input byte and returns TRUE. Otherwise, returns FALSE
-- immediately.
begin
null;
end Get;
end Serial_Support;
procedure Initialize (Device : Local_Device_Handle) is
begin
if Device = Dev0 then
Serial_Support.Init;
else
raise Use_Error;
end if;
end Initialize;
procedure Shutdown (Device : Local_Device_Handle) is
begin
null;
end Shutdown;
procedure Write_Char (Char : Machine_Types.Byte) is
-- Write a single character, mapping line-feeds
begin
Serial_Support.Put (Char);
if Char = Machine_Types.Byte (Character'Pos (Ascii.Lf)) then
Serial_Support.Put (Character'Pos (Ascii.Cr));
end if;
end Write_Char;
procedure Read (Device : Local_Device_Handle;
Addr : System.Address;
Count : in out Natural) is
-- any special character processing (e.g. backspace)
-- could be done here...this version just reads the next
-- character, changing CR into LF
C, Char : Machine_Types.Byte;
for Char use at Addr;
Got_Char : Boolean := False;
begin
if Device = Dev0 then
if Count > 0 then
while not Got_Char loop
Serial_Support.Get (C, Got_Char);
end loop;
-- change CR into LF
if C = Byte (Character'Pos (Ascii.Cr)) then
C := Byte (Character'Pos (Ascii.Lf));
end if;
-- echo the character
Write_Char (C);
Char := C;
Count := 1;
else
Count := 0;
end if;
else
raise Use_Error;
end if;
end Read;
procedure Write (Device : Local_Device_Handle;
Addr : System.Address;
Count : in out Natural) is
use Machine_Types;
Buf : array (1 .. Count) of Machine_Types.Byte;
for Buf use at Addr;
begin
if Device = Dev0 then
for I in Buf'Range loop
Write_Char (Buf (I));
end loop;
else
raise Use_Error;
end if;
end Write;
end Local_Io_Conf;
nblk1=5
nid=0
hdr6=a
[0x00] rec0=1f rec1=00 rec2=01 rec3=020
[0x01] rec0=18 rec1=00 rec2=02 rec3=018
[0x02] rec0=26 rec1=00 rec2=03 rec3=024
[0x03] rec0=1b rec1=00 rec2=04 rec3=028
[0x04] rec0=21 rec1=00 rec2=05 rec3=000
tail 0x217541b90874f7b452ec0 0x42a00088462060003