DataMuseum.dk

Presents historical artifacts from the history of:

CR80 Hard and Floppy Disks

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about CR80 Hard and Floppy Disks

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦4da0f3475⟧ TextFile

    Length: 9526 (0x2536)
    Types: TextFile
    Names: »INIT.S«

Derivation

└─⟦8c095a7f3⟧ Bits:30005798 CR80 Disc Pack ( Vol ILS systemdisk XAMOS TOS 10:01 hard boot #43c 19-7-87/JFJ )
    └─ ⟦this⟧ »SYSTEMS.D!XAMOS.D!GEN850501.D!FILE.D!FMS.D!MY_SYSTEM.D!INIT.S« 
    └─ ⟦this⟧ »SYSTEMS.D!XAMOS.D!GEN850501.D!FILE.D!FMS.D!SINGLE.D!INIT.S« 
    └─ ⟦this⟧ »SYSTEMS.D!XAMOS.D!GEN850501.D!FMS.D!MY_SYSTEM.D!INIT.S« 
    └─ ⟦this⟧ »SYSTEMS.D!XAMOS.D!GEN850501.D!FMS.D!SINGLE.D!INIT.S« 
└─⟦c2e810e96⟧ Bits:30005799 CR80 Disc Pack ( XAMOS 841129 ILS TOS 10-01 System Disk Tilhører ILS/MSG hard boot boot entry #43c )
    └─ ⟦this⟧ »SYSTEMS.D!XAMOS.D!GEN850501.D!FILE.D!FMS.D!MY_SYSTEM.D!INIT.S« 
    └─ ⟦this⟧ »SYSTEMS.D!XAMOS.D!GEN850501.D!FILE.D!FMS.D!SINGLE.D!INIT.S« 
    └─ ⟦this⟧ »SYSTEMS.D!XAMOS.D!GEN850501.D!FMS.D!MY_SYSTEM.D!INIT.S« 
    └─ ⟦this⟧ »SYSTEMS.D!XAMOS.D!GEN850501.D!FMS.D!SINGLE.D!INIT.S« 
└─⟦e0c43619c⟧ Bits:30005797 CR80 Disc pack ( Vol:FNJ1 861029/EC CR80 S/W Package II+III+IV+V+VII )
    └─ ⟦this⟧ »CSP005_V0501.D!CSS920.D!LINK.D!ERP_SINGLE.D!INIT.S« 
    └─ ⟦this⟧ »CSP005_V0501.D!CSS920.D!LINK.D!MX.D!INIT.S« 
    └─ ⟦this⟧ »CSP005_V0501.D!CSS920.D!LINK.D!MX_CRAM.D!INIT.S« 
    └─ ⟦this⟧ »CSP005_V0501.D!CSS920.D!LINK.D!MX_DMA.D!INIT.S« 
    └─ ⟦this⟧ »CSP005_V0501.D!CSS920.D!LINK.D!MY_SYSTEM.D!INIT.S« 
    └─ ⟦this⟧ »CSP005_V0501.D!CSS920.D!LINK.D!SINGLE.D!INIT.S« 

TextFile

"--------------------------------------------------------------------
"
"  PROJECT:               AMOS
"
"  MODULE NAME:           CR File System, adaption and initialize module
"  MODULE ID NMB:         CSS/920
"  MODULE VERSION:        0601
"  MODULE TYPE:           MAIN MODULE
"  MODULE FILES:          S
"                         IO.I
"                         CONFIG.S
"                         GENS.D*COMON_IF.I
"  MERGE FILES:           @**GENS.D*SWELLPREFIX.D*GENERALPARAMS.S
"                         @**GENS.D*SWELLPREFIX.D*X2GENPARAMS.S
"                         @**GENS.D*SWELLPREFIX.D*MONITORNAMES.S
"
"  SPECIFICATIONS:        CR80 AMOS, File Management System, SPS,
"                         CSS/920/SPS/0001.
"  AUTHOR/DATE:           GMC/810410
"
"  DELIVERABLE:           YES
"  SOURCE LANGUAGE:       SWELL
"  COMPILE COMPUTER:      CR80
"  TARGET COMPUTER:       CR80
"  OPERATING SYSTEM:      AMOS
"
"--------------------------------------------------------------------
"
"  CHANGE RECORD
"
"  VERSION    AUTHOR/DATE   DESCRIPTION OF CHANGE
"  -------    -----------   ---------------------
"
"    0001     NMJ/800919      Pre-release
"    0101     GMC/801231      First official release.
"    0103     GMC/810223      Check of sectors available introduced.
"    0202     GMC/810401      Minor changes to source text layout.
"    0301     GMC/810706      Minor change to init-dcm parameters.
"    0402     GMC/820210      A new configuration parameter, OC_output,
"                             is introduced, which defines whether or
"                             not INIT should write on the OC.
"    0403     EKH/820501      Process size is fetched from iodata-ref
"                             rather than from bound, for XAMOS
"    0501     GMC/820709      The FMS no longer prints its version number.
"    0601     JAS/830927      The coroutine monitor is accessed via the
"                             coroutine-monitor-interface.
"                             Parameters are given in a record rather
"                             than constant parameters.
"
"--------------------------------------------------------------------
"«ff»


                  MAINMODULE FMS_INIT_0601;
                 "-------------------------"



%XREF  %XREF  %XREF
%SOURCE @**GENS.D*SWELLPREFIX.D*GENERALPARAMS.S
%SOURCE @**GENS.D*SWELLPREFIX.D*MONITORNAMES.S
%SOURCE @**GENS.D*SWELLPREFIX.D*X2GENPARAMS.S
%SOURCE GENS.D*COMON_IF.I

%PRINT
%LIST
%SOURCE GENS.D*INIT_DEFNS.S

import var
  sectors_available : integer;

var
  init_corout     : coroutine_descriptor;
  init_sem        : semaphore;
  init_fms_params : init_fms;


procedure init_sys(r6);  "registers destroyed"

" First the process size of the FMS is checked by calling a procedure in
" all modules giving the accumulated size of the required workspace
" and comparing this to the free workspace.
" Conventions for size_procedure calls
"
"               r5    ptr to a record of type init_fms (kept)
"               r3    updated with the size of the module
"               r6    link
"                     other registers, except r4, may be destroyed
"
" Then all modules in the system are activated by calling their initialize procedures.
" Each module should initialize its own data structures, including coroutines
" and semaphores.
" Workarea may be allocated from the common workarea pool.
" Conventions for initialize procedure calls:
"
"               r5    ptr to a record of type init_fms (kept)
"               r0    top of free workarea pool (kept)
"               r4    call:
"                       first free of workarea when called
"                     return:
"                        first free of workarea;
"                        on return, >> r0 implies workarea is too small
"               r6    link
"                     other registers may be destroyed
"page«ff»
%SOURCE CONFIG.S

%SOURCE IO.I

init
  init_fms_params.nbr_fhs                 = nbr_fhs;
  init_fms_params.nbr_chs                 = nbr_chs;
  init_fms_params.nbr_ths                 = nbr_ths;
  init_fms_params.nbr_local_ports         = nbr_local_ports;
  init_fms_params.dma_port_spec_table_ptr = address (dma_port_spec_table);
  init_fms_params.nbr_dmas                = nbr_dmas;
  init_fms_params.nbr_fd_drvs             = nbr_fd_drvs;
  init_fms_params.fd_name_ptr             = address(fd_names);
  init_fms_params.nbr_cdc_drvs            = nbr_cdc_drvs;
  init_fms_params.cdc_name_ptr            = address(cdc_names);
  init_fms_params.nbr_ucbs                = nbr_ucbs;
  init_fms_params.nbr_dcbs                = nbr_dcbs;
  init_fms_params.nbr_fcbs                = nbr_fcbs;
  init_fms_params.nbr_caps                = nbr_caps;
  init_fms_params.time_update             = time_update;
  init_fms_params.access_time_update      = access_time_update and time_update;
  init_fms_params.nbr_dbcbs               = nbr_dbcbs;
  init_fms_params.cramteststacksize       = cramteststacksize;
  init_fms_params.cram_init_table_ptr     = address(cram_init_table);
  init_fms_params.cache_size              = cache_size;


"Submodule initialisation procedures
"-----------------------------------

import procedure size_ctrl(r5; r3; r6);
import procedure init_ctrl(r5; r0; r4; r6);

import procedure size_dcm (r5; r3; r6);
import procedure init_dcm (r5; r0; r4; r6);

import procedure size_fm  (r5; r3; r6);
import procedure init_fm  (r5; r0; r4; r6);

%WHEN nbr_ths = 0 SKIP
  import procedure init_tqm(nbr_ths : integer;
                            r0; r4; r6);
%COMPILE

%WHEN nbr_chs = 0 SKIP
  import procedure init_cram(cramteststacksize : integer;
                             cram_init_table_ptr : pointer;
                             r0; r4; r6);
%COMPILE



label
  term_small,
  ctrl_small,
  dcm_small,
  fm_small,
  tqm_small,
  cram_small;

%WHEN OC_init = false SKIP
const
  ws_txt = ' workarea size (:0:)';
  es_txt = 'Excessive process space (:0:)';
  ms_txt = ' Missing : (:0:)';
  nl_txt = '(:10:)(:0:)(:0:)';
  is_txt = 'Insufficient space for (:0:)';
%COMPILE

var
  link:integer;

begin "init sys
  r6=> link;

%WHEN OC_init = false SKIP
  init_oc(r1, r6);
  out_text(address('FMS active(:10:)(:0:)')=>r2, r6);
%COMPILE

  address (init_fms_params) => r5;
  0 => r3;
  size_dcm (r5, r3, r6);
%WHEN oc_init = false SKIP
  out_text(address('DCM (:0:)')=>r2, r6);
  out_text(address(ws_txt)=>r2, r6);
  out_hexa(r3=>r2, r6);
  r3 => r4;
%COMPILE
  size_ctrl(r5, r3, r6);
%WHEN oc_init = false SKIP
  r3 => r1 - r4;
  out_text(address('(:10:)CTRL(:0:)')=>r2, r6);
  out_text(address(ws_txt)=>r2, r6);
  out_hexa(r1=>r2, r6);
  r3 => r4;
%COMPILE
  size_fm  (r5, r3, r6);
%WHEN oc_init = false SKIP
  r3 => r1 - r4;
  out_text(address('(:10:)FM  (:0:)')=>r2, r6);
  out_text(address(ws_txt)=>r2, r6);
  out_hexa(r1=>r2, r6);
  out_text(address(nl_txt)=>r2, r6);
%COMPILE

  -size(process_head)=> r6;
  r6@process_head.iodata_ref=> r0;  "XAMOS, uses iodata_ref rather than bound"
  r6@process_head.gen_head.word_size=> r4 + r6;

  r0 => r6 - r4;
  if r6 << r3 then
  begin
    r3 - r6;
%WHEN OC_init = false SKIP
    out_text (address('FMS workarea too small.(:0:)')=>r2, r6);
    out_text (address(ms_txt)=>r2, r6);
    out_hexa (r3=>r2, r6);
    out_text (address(nl_txt)=>r2, r6);
%COMPILE
    terminate_me (#333=>r0, r3=>r1, r6);
%WHEN OC_init = false SKIP
  end
  else
  begin
    r3 - r6;  -r3;
    out_text (address(es_txt)=>r2, r6);
    out_text (address('(before CRAM) (:0:)')=>r2, r6);
    out_hexa (r3=>r2, r6);
    out_text (address('(:10:)(:0:)')=>r2, r6);
%COMPILE
  end;

  r0=> r6;
  while r6-1 >>= r4 do clr(r6@integer); "clear workarea"

  init_dcm (r5, r0, r4, r6);
  if r0 << r4 then goto dcm_small;

  init_ctrl(r5, r0, r4, r6);
  if r0 << r4 then goto ctrl_small;

  init_fm  (r5, r0, r4, r6);
  if r0 << r4 then goto fm_small;

%WHEN nbr_ths = 0 SKIP
  init_tqm(nbr_ths, r0, r4, r6);
  if r0 << r4 then goto tqm_small;
%COMPILE

%WHEN nbr_chs = 0 SKIP
  init_cram(cramteststacksize, address(cram_init_table), r0, r4, r6);
  if r0 << r4 then goto cram_small;
%COMPILE

  if sectors_available => r1 < 0 then
    begin
    -r1;
%WHEN OC_init = false SKIP
    out_text(address('Insufficient cache size.(:0:)')=> r2, r6);
    out_text(address(ms_txt)=>r2, r6);
    out_hexa (r1=>r2, r6);
    out_text (address(nl_txt)=>r2, r6);
%COMPILE
    terminate_me (#332 => r0, r1, r6)
    end;

%WHEN OC_output = false SKIP
  if r4 << r0 then
  begin
    out_text (address(es_txt)=>r2, r6);
    out_text (address('(final)       (:0:)')=>r2, r6);
    out_hexa(r0-r4=>r2, r6);
    out_text(address(nl_txt)=>r2, r6);
  end;
%COMPILE

  exit(link);

dcm_small:
%WHEN OC_init = false SKIP
  address('DCM(:10:)(:0:)') => r3;
%COMPILE
  1 => r1;
  goto term_small;
ctrl_small:
%WHEN OC_init = false SKIP
  address('CTRL(:10:)(:0:)') => r3;
%COMPILE
  2 => r1;
  goto term_small;
fm_small:
%WHEN OC_init = false SKIP
  address('FM(:10:)(:0:)') => r3;
%COMPILE
  3 => r1;
  goto term_small;
tqm_small:
%WHEN OC_init = false SKIP
  address('TQM(:10:)(:0:)') => r3;
%COMPILE
  4 => r1;
  goto term_small;
cram_small:
%WHEN OC_init = false SKIP
  address('CRAM(:10:)(:0:)') => r3;
%COMPILE
  5 => r1;
term_small:
%WHEN OC_init = false SKIP
  out_text(address(is_txt)=>r2, r6);
  out_text(r3=>r2, r6);
%COMPILE
  terminate_me (#331=>r0, r1, r6);

end "init_sys";



begin "main program"
  cm_init (address(init_corout)=>r0, r7, r6);
  init_sys(r6);
  sem_init (address(init_sem)=>r5, r7, r6);
  cm_wait (r5, r7, r6);  "wait forever"
end;


ENDMODULE