;;; -*- Mode:LISP; Package:SYSTEM-INTERNALS; Base:8; Readtable:ZL -*- ;;; Version 2 Disk label definitions. (DefConst %DL-Current-Band 16.) (DefConst %DL-Current-Microload 17.) (DefConst %PT-Base 256.) (DefConst %PT-Number-of-Partitions 2.) (DefConst %PT-Size-of-Partition-Entries 3.) (DefConst %PT-Partition-Descriptors 16.) (DefConst %PD-Attributes 3.) (DefConst %%Band-Type-Code 0010) (DefConst %BT-Load-Band 0.) (DefConst %BT-Microload 1.) (DefConst %%CPU-type-code 1020) (DefConst %CPU-chaparral #x+0000) (DefConst %CPU-Generic-Band #x+FFFF) (DefConst %%Default-indicator #o3201) (defun set-default-microload-V2 (rqb band) "Sets the default microload partition. This function will search the partition table for the specified band and if it finds it, will set the default bit. It will then go and reset the default bit in other microcode bands that may be set." ;too much work! (PUT-DISK-STRING RQB BAND %DL-CURRENT-MICROLOAD 4) (multiple-value-bind (ignore ignore label-loc ignore) (find-disk-partition band rqb nil t) (when (and label-loc (= (ldb %%band-type-code (get-disk-fixnum rqb (+ label-loc %PD-Attributes))) %BT-Microload) (= (ldb %%CPU-type-code (get-disk-fixnum rqb (+ label-loc %PD-Attributes))) %CPU-chaparral)) (Put-disk-Fixnum rqb (dpb 1. %%default-indicator (get-disk-fixnum rqb (+ label-loc %PD-Attributes))) (+ label-loc %PD-Attributes)) ;; ;; Now, go through the rest of the partitions looking for microload bands that are of this ;; processor type and reset their (possibly) turned on default bit. ;; (loop for index from (+ %pt-base %pt-partition-descriptors) to (+ %pt-base %pt-partition-descriptors (* (get-disk-fixnum rqb (+ %pt-base %pt-number-of-partitions)) (get-disk-fixnum rqb (+ %pt-base %pt-size-of-partition-entries)))) by (get-disk-fixnum rqb (+ %pt-base %pt-size-of-partition-entries)) do (if (and (not (= index label-loc)) (= (ldb %%Band-type-code (get-disk-fixnum rqb (+ index %PD-attributes))) %BT-microload) (= (ldb %%CPU-type-code (get-disk-fixnum rqb (+ index %PD-attributes))) %CPU-chaparral)) (put-disk-fixnum rqb (dpb 0. %%Default-indicator (get-disk-fixnum rqb (+ index %PD-attributes))) (+ index %PD-attributes)))) band) )) (defun set-default-load-band-V2 (rqb band) "Sets the default loadband. This function will search the partition table for the specified band and if it finds it, will set the default bit. It will then go and reset the default bit in other load bands that may be set." (PUT-DISK-STRING RQB BAND %DL-CURRENT-BAND 4) (multiple-value-bind (ignore ignore label-loc ignore) (find-disk-partition band rqb nil t) (when (and label-loc (= (ldb %%band-type-code (get-disk-fixnum rqb (+ label-loc %PD-Attributes))) %BT-load-band) (= (ldb %%CPU-type-code (get-disk-fixnum rqb (+ label-loc %PD-Attributes))) %CPU-chaparral)) (Put-disk-Fixnum rqb (dpb 1. %%default-indicator (get-disk-fixnum rqb (+ label-loc %PD-Attributes))) (+ label-loc %PD-Attributes)) ;; ;; Now, go through the rest of the partitions looking for load bands that are of this ;; processor type and reset their (possibly) turned on default bit. ;; (loop for index from (+ %pt-base %pt-partition-descriptors) to (+ %pt-base %pt-partition-descriptors (* (get-disk-fixnum rqb (+ %pt-base %pt-number-of-partitions)) (get-disk-fixnum rqb (+ %pt-base %pt-size-of-partition-entries)))) by (get-disk-fixnum rqb (+ %pt-base %pt-size-of-partition-entries)) do (if (and (not (= index label-loc)) (= (ldb %%Band-type-code (get-disk-fixnum rqb (+ index %PD-attributes))) %BT-load-band) (= (ldb %%CPU-type-code (get-disk-fixnum rqb (+ index %PD-attributes))) %CPU-chaparral)) (put-disk-fixnum rqb (dpb 0. %%Default-indicator (get-disk-fixnum rqb (+ index %PD-attributes))) (+ index %PD-attributes)))) band) ;return name as successful completion. ))