[fa.info-cpm] USER # in BIOS

info-cpm (12/22/82)

>From Mead@Usc-Eclb  Wed Dec 22 00:33:34 1982
To: info-cpm@BRL
Via:  Usc-Eclb; 21 Dec 82 14:00-EST
Via:  Brl; 21 Dec 82 14:51-EST
Via:  Brl-Bmd; 21 Dec 82 16:06-EST

I ahve seen this mentioned a couple times, and have seen the problem
on all the CP/M system I have used. When working in other that USER 0
if a warm boot is done, you get forced back to USER 0.
Could any of the CP/M wizards please show a good method to have the
bios handle the USER #, in the warmboot or disksel area I assume.
Does it simply entail grabbing the USER # from the page zero location
and saving it, then restoring on warmboot? Examples please...Thanks..
-------

info-cpm (12/22/82)

>From rconn@BRL  Wed Dec 22 01:47:44 1982
To: Dick <Mead@Usc-Eclb>
Cc: info-cpm@BRL
Via:  Brl; 22 Dec 82 1:05-EST
Via:  Brl-Bmd; 22 Dec 82 1:22-EST

Dick,

	The problem you describe lies in the Warm Boot routine within the
BIOS.  Whenever the CCP is entered via either the Warm or Cold Boot routines
in the BIOS, the user/disk flag is carried to it in the C register.

	I do not have the problem you describe.  Warm Boots return me to
the user/disk I was logged into.  My BIOS code in the Warm and Cold Boots
which does this is:

COLD BOOT:
	cbdisk	equ	0	;enter user 0 (high 4 bits), disk A
				; (low 4 bits) on Cold Boot (Startup)
	cdisk	equ	4H	;address of user/disk flag on Page 0
	...
	mvi	a,cbdisk	;select default user/disk
	sta	cdisk		;set user/disk flag
	...
	jmp	gocpm
WARM BOOT:
	...
	jmp	gocpm		;Warm Boot reloads CCP and BDOS
GOCPM:
	...			;Init:
	...			;  JMP at 0, JMP at 5, others
	lda	cdisk		;get current user/disk flag
	mov	c,a		;... in C for CCP entry
	...
	jmp	ccp		;enter CCP with user/disk in C

	In this type of environment, I have the flexibility of setting
cbdisk to anything I want, such as 21H to come up in user 2 on drive B
when I cold boot or 0A0H to come up in user 10 on drive A on cold boot.

	Hope this answers your question.

		Rick

info-cpm (12/23/82)

>From Eldridge.ES@Parc-Maxc  Thu Dec 23 00:28:49 1982
In-Reply-To: Mead's message of 21 Dec 1982 1102-PST
To: Dick <Mead@Usc-Eclb>
Cc: info-cpm@BRL
Via:  Parc-Maxc; 22 Dec 82 11:40-EST
Via:  Brl; 22 Dec 82 12:17-EST
Via:  Brl-Bmd; 22 Dec 82 12:50-EST

The error you describe is common to many CBIOS implementations and is an
annoying bug.  The proper solution is to save the value at location 4 and use it
as the currently logged drive on a warm boot.  Location 4 contains both the
current logged-in drive and the user number.  The warm boot routine should
save location 4, read in the CCP, then put the saved location 4 value into the C
reg and jump to the CCP.

Another idea I have been toying with is to run a checksum on the CCP
whenever a warm boot is requested, and only load the CCP if it has been over-
written.  This would have the advantage that ^C would log-in a new disk even
if the disk did not have CP/M on it (providing, of course, that the CCP was still
intact).

George