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

⟦5528d3710⟧ TextFile

    Length: 5236 (0x1474)
    Types: TextFile
    Names: »INIT.S«

Derivation

└─⟦b8af24a88⟧ Bits:30005796 CR80 Disc Pack ( MINICAMPS )
    └─ ⟦this⟧ »GENS.D!SYSGEN.D!FMS.D!MINI_CAMPS.D!INIT.S« 

TextFile

"--------------------------------------------------------------------
"
"  PROJECT:               AMOS
"
"  MODULE NAME:           CR File System, adaption and initialize module
"  MODULE ID NMB:         CSS/920
"  MODULE VERSION:        0301
"  MODULE TYPE:           MAIN MODULE
"  MODULE FILES:          S
"                         IO.I
"                         CONFIG.S
"  MERGE FILES:           @**GENS.D*SWELLPREFIX.D*GENERALPARAMS.S
"                         @**GENS.D*SWELLPREFIX.D*X2GENPARAMS.S
"                         @**GENS.D*SWELLPREFIX.D*MONITORNAMES.S
"                         @**GENS.D*SWELLPREFIX.D*COMONPARAMS.S
"
"  SPECIFICATIONS:        Informal
"  AUTHOR/DATE:           NMJ/800919
"
"  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.
"    0102     GMC/810119      No change to this submodule.
"    0103     GMC/810223      Check of sectors available introduced.
"    0201     GMC/810318      No change to this submodule.
"    0202     GMC/810401      Minor changes to source text layout.
"    0203     GMC/810427      No change to this submodule.
"    0301     GMC/810603      Minor change to init-dcm parameters.
"
"--------------------------------------------------------------------
"«ff»


                  MAINMODULE FMS_INIT;
                 "-------------------



%NOLIST
%SOURCE @**GENS.D*SWELLPREFIX.D*GENERALPARAMS.S
%SOURCE @**GENS.D*SWELLPREFIX.D*X2GENPARAMS.S
%SOURCE @**GENS.D*SWELLPREFIX.D*MONITORNAMES.S
%SOURCE @**GENS.D*SWELLPREFIX.D*COMONPARAMS.S

%LIST
%PRINT
%SOURCE @**GENS.D*SYSGEN.D*FMS.D*IO.I


import var
  sectors_available : integer;

var
  init_corout: coroutine_descriptor;
  init_sem: semaphore;


procedure init_sys(r6);  "registers destroyed"

" Activates all modules in the system by calling their initialize procedures.
" Each module should initialize its own data structures, including coroutines
" and semaphores.
" Workarea may be allocated from a common workarea pool.
" Conventions for initialize procedure calls:
"
"               r0    top of free workarea pool
"               r4    call:
"                       first free of workarea when called
"                     return:
"                        first free of workarea;
"                        on return, >> r0 implies workarea is too small

%LIST
"page«ff»
%SOURCE CONFIG.S



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

import procedure init_ctrl(nbr_local_ports, cache_size, nbr_dmas : integer; r0; r4; r6);

import procedure init_dcm(cache_size, nbr_dcbs, nbr_caps, nbr_dbcbs, nbr_ths : integer;
                          r0; r4; r6);

import procedure init_fm(nbr_fhs, nbr_fd_drvs, nbr_cdc_drvs, nbr_dcbs,
                         nbr_ucbs, nbr_fcbs, nbr_caps : integer;
                         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 workarea_small;

var
  link:integer;

begin "init sys
  r6=> link;

  -size(process_head)=> r5;
  r5@process_head.bound=> r0 + 1;
  r5@process_head.gen_head.word_size=> r4 + r5;
  r0=> r6;
  while r6-1 >>= r4 do clr(r6@integer); "clear workarea"

  init_dcm(cache_size, nbr_dcbs, nbr_fhs, nbr_dbcbs, nbr_ths, r0, r4, r6);
  if r0 << r4 then goto workarea_small;

  init_ctrl(nbr_local_ports, cache_size, nbr_dmas, r0, r4, r6);
  if r0 << r4 then goto workarea_small;

  init_fm(nbr_fhs, nbr_fd_drvs, nbr_cdc_drvs, nbr_dcbs, nbr_ucbs,
          nbr_fcbs, nbr_caps, r0, r4, r6);
  if r0 << r4 then goto workarea_small;

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

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

  if sectors_available => r6 < 0 then
    begin
    out_text(address('INSUFFICIENT CACHE SIZE(:10:)(:0:)')=> r2, r6);
    mon(terminate, 2 => r0, 2 => r1, r7)
    end;

  if r4 << r0 then
  begin
    out_text(address('EXCESSIVE PROCESS SPACE (:0:)')=>r2, r6);
    out_hexa(r0-r4=>r2, r6);
    out_text(address('(:10:)(:0:)')=>r2, r6);
  end;

  exit(link);

workarea_small:
  out_text(address('INSUFFICIENT PROCESS SPACE(:10:)(:0:)')=>r2, r6);
  mon(terminate, 1=>r0, 1=>r1, r7);

end "init_sys";


export var
  comon_data: comon_var;


begin "main program"
  init_oc(r1, r6);
  out_text(address('FILE SYSTEM ACTIVE(:10:)(:0:)')=>r2, r6);
  mon(cor, address(comon_data), cm_init, address(init_corout)=>r0, r7);
  init_sys(r6);
  mon(cor, address(comon_data), sem_init, address(init_sem)=>r5, r7);
  mon(cor, address(comon_data), cm_wait, r5, r7);  "wait forever"
end;


ENDMODULE «a5»