|
|
DataMuseum.dkPresents historical artifacts from the history of: Bogika Butler |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Bogika Butler Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 9088 (0x2380)
Types: TextFile
Names: »KERNEL.PAS«
└─⟦8592db80f⟧ Bits:30009789/_.ft.Ibm2.50007350.imd Mogens Pelles Zilog 80,000 / EOS projekt
└─⟦this⟧ »KERNEL.PAS«
PROGRAM EosKernel;
CONST (* Comdef *)
Trp7stak = 16#100;
(* stack space (in bytes) required by normal
kernel operations i.e. operations called
from normal contexts only *)
KV_StkSiz = 16#800;
(* Initial size of the supervisor stack (in bytes) *)
CONST (* Preface *)
I_Config = -1;
(* address of the first ROM-OS-module to be
booted by the stub. -1 ignals that the
first module is in the boot owner set *)
RAM_TOP = 16#C000;
(* upper available ram address
384K = 16#6 * 64K
512K = 16#8 * 64K
640K = 16#A * 64K
768K = 16#C * 64K *)
Init_SSP = RAM_TOP;
(* use top RAM as initial stack pointer
Mem_ListLength = 1;
(* Only one record in the Mem_List *)
CONST (* MMProcs *)
AllocSiz = Se_Siz + Sp_Siz; (* *** ??? *** *)
NEmb_Siz = Se_Siz + Sp_Siz; (* Size of non.emb.segm.obj. *)
TYPE
ExceptionVectorAreaIndexType = 0.255;
ExceptionVectorAreaType = ARRAY (.ExceptionVectorAreaIndexType.) OF
address;
MemListRecordType = RECORD
Start, (* lower memory address *)
End: address; (* upper memory address *)
Mem_ListType = ARRAY (.1..Mem_ListLength.) OF MemListRecordType;
IMPORTED VAR (* Comdef *) (* Printer device control and data registers *)
PrtContA: byte;
PrtContB: byte;
PrtStatu: byte;
PrtBuf: byte;
IMPORTED VAR (* Preface *)
KV_InVec: ExceptionVectorAreaType;
(* Interrupt vector (normally = 0), contains addresses
of the interrupt procedures. The addresses are
adjusted when the segments holding the procedures
are moved *)
(* KV_InVec(.0.) is assumed to be initialized to
the initial value of the SSP (System stack pointer)
= Init_SSP prior to boot loading.
KV_InVec(.1.) is assumed to be initialized to
the initial value of the PC prior to boot
loading *)
KV_FrMem: address;
(* Initially: points to Mem_List;
Later: Number of free bytes for allocation of objects.
KV_FrMem is assumed to be initialized prior to
boot loading *)
KV_BotLd: address;
(* Lower starting address of bootloaded OS-modules
(RAM-boot) or the value -1 (ROM-boot).
Initially states absolute minimum address
(First_OS) but is upward page aligned.
KV_BotLd is assumed to be initialized prior to
boot loading. *)
KV_Stub: long;
(* Contains the address of a ROM-stub or -1
when the stub is the first module of the
RAM-boot. *)
(* KV_Stub is assumed to be initialized to
the value -1 indicating that the stub is
booted in RAM *)
Mem_List: Mem_ListType;
(* Mem_List(.1.).Start is assumed to be initialized
to TOP_KNEL prior to boot loading.
Mem_List(.1.).End is assumed to be initialized
to RAM_TOP prior to boot loading *)
VAR (* Preface *) (* Variables used by test print procedures *)
TstCount: word;
(* Counts down from 50 the number of output lines *)
TstStatus: word;
(* State of test output *)
(* Test output from alloc/dealloc is generated
when bit zero of this variable equals one *)
VAR (* MMProcs *)
F_Alloc: address; (* Address of the first mem_rec *)
L_Alloc: address; (* Address of the last mem_rec *)
F_Supvs: address; (* Address of the supervisor stack (first byte) *)
Page_Tab: address; (* Address of the page table (addr of entry zero) *)
Supv_Stk: address; (* "Last + 1" address of the supervisor stack *)
MM_Queue: ChainType;
(* chain of processes waiting to create/remove an object *)
MM_Lock: MM_LockType;
(* *** ??? *** *)
(**** Initial pointers *)
KV_IOwnP: PointerType;
(* Owns objects that are never deleted. Stub object
is first in set *)
KV_IManP: PointerType;
(* Manages envelopes that are never demanaged. Stub
envelope is first in set *)
KV_DummyOwn: PointerType;
(* Owns a kernel part while the user part is being
allocated. (Is not initialized) *)
(**** Initial objects *)
AllocObj: AllocatorobjectType;
(* AllocObj holds the kernel part of the kernel
defined alloc object. During MM_initialization
the kernel part is used as the kernel part of
a non-embedded segmnet describing the boot
loaded modules *)
FulSpace: FulSpaceType;
(* FulSpace is a segment object describing the whole
address space of the MC68000. Subsegments of
FulSpace is used by driver objects. The Stub
object gets a reference to FulSpace *)
(* $$$ *)
(* Miscellaneous procedures *)
(* Memory management procedures *)
(* Scheduling procedures *)
(* Kernel Operations procedures *)
EXPORTED PROCEDURE SystemCall;
BEGIN (* SystemCall *)
(* Do this and that and call knelop *)
END; (* SystemCall *)
PROCEDURE InitPreface;
VAR
d0: ExceptionVectorAreaIndexType;
(* working register D0 *)
BEGIN (* InitPreface *)
(*** Round up First_OS in KV_BotLd to align with next page *)
KV_BotLd := ((KV_BotLd + 255) div 256) * 256;
(*** Set up vector table etc. Does this match the initialization
in knelop ??? *)
(*** ??? *** Both tables initialized here are defined in Sc.sa.
Why are they not initialized there ??? They do not appear to
used in any way whatever by the intervening MMPROCS
initialization section. Is the stack space computation
algorithm involved? *)
FOR d0 := 2 TO 255 DO
BEGIN (* entry 0 and 1 initialized prior to boot loading *)
Driv_Tab(.d0.) := 0;
(* channel := free *)
KV_InVec(.d0.) := addr(RteDummy);
(* *** ??? *** *)
(* interrupt address := dummy interrupt *)
Stak_Tab(.d0.) := 0;
(* channel := free *)
END;
Driv_Tab(.32+9.) := -1;
(* channel 32+9 (trap #9) := reserved *)
KV_InVec(.32+9.) := addr(Test_Prt);
(* *** ??? *** *)
(* assign testprint procedure to trap #9 *)
Stack_Tab(.32+9.) := -1;
(* channel 32+9 (trap #9) := reserved *)
(**** Initialize test print *)
TstCount := 0;
TstStatus := 0;
(**** Initialize printer *)
PrtContA := 16#00;
(* select data direction register for a-part *)
PrtBuf := 16#FF;
(* all lines used for output *)
PrtContA := 16#3C;
(* assign control bits to output part *)
PrtContB := 16#00;
(* select data direction register for b-part *)
PrtStatu := 16#08;
(* all lines used for input but bit 3 ??? *)
PrtContB := 16#3C;
(* assign control bits to input part *)
NewLine;
PrtChar('E');
PrtChar('O');
PrtChar('S');
NewLine;
(**** Prepare the stack space computation algorithm *)
Stak_Tab(.0.) := Trp7Stak * 2**16 + 0; (* 0 is interrupt priority *)
Driv_Tab(.0.) := Stak_Tab(.0.); (* := used := dummy value > 0 *)
Stak_Tab(.1.) := -1; (* reserved. Entry 1 cannot be used *)
Driv_Tab(.1.) := -1; (* channel(1) := reseved *)
(* *** ??? *** *)
(*
Prt_Mem('End of preface', KV_InVec, KV_InVec - TstStatus);
*)
END; (* InitPreface *)
PROCEDURE InitMMU;
VAR
BEGIN (* InitMMU *)
END; (* InitMMU *)
BEGIN (* EosKernel *)
InitPreface
InitMMU
InitSc
InitKnelOp
InitEnter
END. (* EosKernel *)«eof»