; -*- Mode:LISP; Readtable:T; Base:8; Lowercase:T; Package: (fcold :size 1000.) -*-
;	** (c) Copyright 1980 Massachusetts Institute of Technology **
;	   (c) Copyright 1988 GigaMOS Systems Inc,

;This package is the program
(defpackage fcold (:use "GLOBAL") (:size 1000.))

;This package is used to contain symbols which stand for symbols in the cold-load
;being built; this includes all the system data structure definition symbols.
;These shadow the ones in GLOBAL, so that you can make incompatible changes.
(defpackage fcold-symbols
  (:use)
  (:size 20.)
  (:nicknames "FSYM")
  (:relative-names ("GLOBAL" "GLOBAL"))
  ;; Borrow symbols needed to load QCOM and QDEFS
  ;; But don't actually get under global, want to shadow all the system parameter symbols
  ;; Code here and there relies on the fact that NIL is the same.
  (:import-from global
		defun defvar defconst defconstant setq cond and or ibase defprop putprop + - > = < 1+ 1-
		t nil error length special dpb %p-ldb-offset *read-base*
		assign-values assign-alternate assign-values-init-delta
	        * byte ash)
  (:import-from si get-alternate assign-values-alist assign-alternate-eval)
  (:import-from fcold))

(if (not (fboundp 'fsym:get-alternate))
    (fset 'fsym:get-alternate 'si:get-alternate))

;(if (not (fboundp 'fsym:defmic))
;    (fset 'fsym:defmic 'cold:defmic))

;;This package is really under NIL, not GLOBAL, but there is a bug in the package system.
;;This package is used to contain symbols which stand for symbols in the cold-load
;;being built; this includes all the system data structure definition symbols.
;;These shadow the ones in GLOBAL, so that you can make incompatible changes.
;(package-declare cold-symbols none 10000.
;   ()
;   (refname global global)
;   (myrefname global cold-symbols)
;   (myrefname global sym)
;   ;; Borrow symbols needed to load QCOM and QDEFS
;   ;; But don't actually get under global, want to shadow all the system parameter symbols
;   ;; Code here and there relies on the fact that NIL is the same.
;   (borrow global defun defvar defconst setq cond and or ibase defprop putprop + - > = < 1+ 1-
;	   	  t nil error length special dpb %p-ldb-offset
;		  assign-values assign-alternate get-alternate assign-values-init-delta)
;   (borrow cold defmic))

(fset 'fcold-symbols:logdpb #'dpb)

;Before we can compile anything in the cold-load package, we need to load the parameters
(si:define-simple-transformation fcold:load-cold-parameters fcold:load-parameters
	fcold:parameters-not-loaded () ()
	("Load cold parameters" "Loading cold parameters" "cold parameters loaded"))

(defun fcold:parameters-not-loaded ()
  (not (boundp (progn t 'fcold:big-fixnum))))

(defsystem fcold
  (:package fcold)
  (:pathname-default "K-SYS: NCOLD;")
  (:module util ("FCOLDUT"))
  (:module server "MINI-SERVER" :package fi)	;flush for now.
  (:module file-lists "FSYSDCL" :package fi)
  (:skip :fasload util)
  (:skip fcold:load-cold-parameters nil (:fasload util))
  (:compile-load (util "FCOLDLD") (fcold:load-cold-parameters))
  ;(:compile-load server)
  (:fasload file-lists))


