?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE Deadstart : Save System Information' ??
MODULE dsm$save_system_information;

{ PURPOSE:
{   This module saves information vital to system operation across deadstarts.  Information is stored on a
{   device file residing on the system device created during an installation deadstart.

?? NEWTITLE := 'Global Declarations Referenced by This Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc dsc$system_log_file_size
?? POP ??
*copyc dmp$create_device_file
*copyc dmp$detach_device_file
?? EJECT ??
*copy dmv$system_device_information
?? TITLE := 'dsp$create_system_file', EJECT ??

  PROCEDURE [XDCL] dsp$create_system_files
    (VAR status: ost$status);

    VAR
      file_attributes: ARRAY [1 .. 1] OF dmt$new_device_file_attribute,
      file_modified: boolean,
      fmd_modified: boolean,
      recorded_vsn: rmt$recorded_vsn,
      system_file_id: gft$system_file_identifier,
      user_supplied_name: ost$name;

    status.normal := TRUE;

    user_supplied_name := 'DSF$SYSTEM_INFORMATION';
    recorded_vsn := dmv$system_device_recorded_vsn;

    file_attributes [1].keyword := dmc$file_limit;
    file_attributes [1].limit := UPPERVALUE (amt$file_limit);

    dmp$create_device_file (user_supplied_name, recorded_vsn, ^file_attributes, 0, system_file_id, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    dmp$detach_device_file (system_file_id, file_modified, fmd_modified, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    user_supplied_name := 'LGF$SYSTEM_LOG';

    dmp$create_device_file (user_supplied_name, recorded_vsn, ^file_attributes, dsc$system_log_file_size,
        system_file_id, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    dmp$detach_device_file (system_file_id, file_modified, fmd_modified, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

  PROCEND dsp$create_system_files;
MODEND dsm$save_system_information;
