		**  Xenix BB to MSDOS BB Conversion Log  **


Section header fields are defined as follows -
	Conv	= C source file converted (conditional code added).
	Xenix	= Checked out on Xenix system.
	MSDOS	= Checked out on MSDOS system.

Functions preceeded by a '%' are not system functions. They are P machine
	functions, which call lower level (system) functions.


Conventions used -
	MS		= MSDOS specific. Usually used  as 'MS function' to mean a
				function which is specifically implemented for MSDOS.
	XS		= Xenix specific. Used like MS.



	** Notes **

All MS functions return error codes which are Xenix compatable.
	Thus, no special translation is necessary when MS fn's are used.



Following are descriptions of the changes made to some of the source modules-

locks.c -
	This is where lock & unlock system requests are made.
	Lock/Unlock requests are ignored in BB/PC.

rename.c -
	MS rename() fn used for renameing files.

stma9.c -
	Acct number returned by STMA 9,0 statement is defined as constant
	'AAAAAA' in BB/PC.

bsystem.c -
	The 'SYSTEM' statement is disabled for BB/PC.
	Execution of the SYSTEM stmt in BB/PC causes a BEOPT error.

break.c -
	The 'BREAK' statement is not implemented in BB/PC. (e.g. the
	Debugger is not supported).
	Execution of the BREAK stmt in BB/PC causes a BEOPT error.

stma9.c, bpopen.c -
	The MS 'getdir()' function is used by BB/PC to get the current directory
	for the STMA 9,1 statment. BB/X86 uses the Shell, via a pipe created
	by XS bpopen() fn, to get the current directory.
	Stma9.c was changed to use the getdir() function in BB/PC.
	Bpopen.c was changed so as not to compile the bpopen() function in BB/PC.

stmc1.c -
	The MS function 'mkdir()' is used to create a directory, instead of
	the XS system() function call.




Fn			Conv	Xenix	MSDOS		Ref'ed / Def'ed
--			----	-----	-----		---------------

access	n/a						bopen		- spool file creation
										chkpath	- resolve bb/syslib & BBPATH


			Fn fully implemented.




Fn			Conv	Xenix	MSDOS		Ref'ed / Def'ed
--			----	-----	-----		---------------

alarm									onalarm	-
										pmach		-
										pmach2	-
										setsig	-


			Fn  not implemented.

			Fn used for timed statements (TINPUT,LOCK,DELAY).



Fn			Conv	Xenix	MSDOS		Ref'ed / Def'ed
--			----	-----	-----		---------------

chdir		n/a						stmc9		-


			Fn fully implemented.




Fn			Conv	Xenix	MSDOS		Ref'ed / Def'ed
--			----	-----	-----		---------------

creat		n/a						bopen
										link
										openpush
										phist
										pmdump
										stmc0
										stmc7


			Fn implemented. Mode differences.

			** Note **
			MSDOS has 'text files' which do strange things with CR & LF.
			MSDOS files must be opened in the 'raw data' mode. (???)

			The MSDOS specific 'creat()' fn creates file with mode/attribute
			set to '0'.




Fn			Conv	Xenix	MSDOS		Ref'ed / Def'ed
--			----	-----	-----		---------------

execl		7/25						break		- BREAK stmt (execute Debugger).

execv		7/25						bpopen	- open pipe to shell.

fork		7/25						bpopen	- open pipe to shell.
			7/25						break		- BREAK stmt (execute Debugger).


			Fn not implemented.

			The break module is called to implement the Debugger.
			The bpopen module is used to open a pipe to the shell. The pipe
			is used by STMA 9,1 to get the current directory.

			
			The Debugger is not supported in BB/PC,
			Execution of the BREAK statement is trapped as a
			BEOPT error in BB/PC.

			The STMA 9,1 stmt is implemented with the MS fn getdir(),
			so bpopen() is not needed in BB/PC.




Fn			Conv	Xenix	MSDOS		Ref'ed / Def'ed
--			----	-----	-----		---------------

kill(getpid())
										inputln	- 2nd ikey during input
										pmach3	- force core dump on .BREAK


			Fn's not implemented.






Fn			Conv	Xenix	MSDOS		Ref'ed / Def'ed
--			----	-----	-----		---------------

signal								break
										onalarm
										onikey
										pexit
										pmach3
										setsig


			Fn not implemented.

			Used to adjust interupts for alarms, ikeys, & quits.





Fn			Conv	Xenix	MSDOS		Ref'ed / Def'ed
--			----	-----	-----		---------------

stat									link		- check for file exists.
										lopen		- get (???) on open.
										stmc0		- chk for file exists.
										stmc7		- chk for file exists.

fstat									bopenf
										stmc39
										stmc40
										stmc41
										stmc42


			Will be implemented later.								(???)

			fstat() is used to get inode number. (?)



Fn			Conv	Xenix	MSDOS		Ref'ed / Def'ed
--			----	-----	-----		---------------

sync									stmc36	- flush buffers on .UPDATE


			Might be implemented										(???)




Fn			Conv	Xenix	MSDOS		Ref'ed / Def'ed
--			----	-----	-----		---------------

time									random	- randomize
										stmc29	- set date/time
										sys		- return real time
										ustinit	- save login time

%times								sys		- SYS(5) (cpu time used).

gettime								stmc29	- get date/time

%localtime							stmc29	- get date/time
										sys		- return time


			Use generic fn's for get & set time & date.




Fn			Conv	Xenix	MSDOS		Ref'ed / Def'ed
--			----	-----	-----		---------------

ioctl									terminit	- set terminal characteristics.
ioctl									setikey	- sets ikey characteristics.


			Implemented differently - Bits have different meaning.




Fn			Conv	Xenix	MSDOS		Ref'ed / Def'ed
--			----	-----	-----		---------------
ttyslot								sys		- used by SYS(4)


			Fn not implemented.


			BB/PC returns a constant '0' from SYS(4).




Fn			Conv	Xenix	MSDOS		Ref'ed / Def'ed
--			----	-----	-----		---------------

link		7/22	7/22				rename	- .RENAME & RENAME statement

unlink	n/a	n/a				delete	- DELETE statement
			n/a	n/a				link		- remove pseudo-link
			n/a	n/a				openpush	- delete push file
			n/a	n/a				rename	- delete original file


			link() fn not implemented.
			unlink() fn fully implemented.

			Xenix uses link() to rename a file, and unlink() to delete a
			file, remove a 'link file', or delete the original file after
			a file rename.

			MSDOS uses the system specific function rename() to rename a
			file, and the MS function unlink() to delete files.

			Note that the P machine 'rename()' function was changed to
			'brename()', to avoid conflict with the new MS 'rename()' fn.




Fn			Conv	Xenix	MSDOS		Ref'ed / Def'ed
--			----	-----	-----		---------------

%locking	7/21						locks - < Defined >
										bopen
										stmc39
										stmc40
										sys
										ustinit


			Locking ignored.

			%locking() is the generic function for lock/unlock requests.
			Locking fn's do nothing on the PC.

			lockf(),lockd(),locks(), and unlks() are the low-level fn's used by
			the P machine to implement locking. In BB/PC, these functions become 
			NOP's, returning a k'good' flag in the error return var when it is
			present.




Fn			Conv	Xenix	MSDOS		Ref'ed / Def'ed
--			----	-----	-----		---------------

pause									inputln	- force 2nd ikey
										pmach2	- DELAY statement
										pmach3	- wait for core dump completion


			Fn not implemented.




Fn			Conv	Xenix	MSDOS		Ref'ed / Def'ed
--			----	-----	-----		---------------

pipe		7/25						bpopen - create pipe to Shell.

dup		7/25						bpopen - create pipe to Shell.


			Functions not implemented.


			The bpopen function is not called by BB/PC.
			Compilation of the bpopen.c module is disabled in BB/PC.




Fn			Conv	Xenix	MSDOS		Ref'ed / Def'ed
--			----	-----	-----		---------------

wait									break		- wait for debugger


			Not implemented.

			Used after invoking debugger to wait for return.



Fn			Conv	Xenix	MSDOS		Ref'ed / Def'ed
--			----	-----	-----		---------------

getlogin	7/22	7/22				stma9		- STMA 9,0


			Fn not implemented.

			Used by STMA 9,0,ACT$ to return login name.


			BB/PC returns a constant 'AAAAAA' for the login name.




Fn			Conv	Xenix	MSDOS		Ref'ed / Def'ed
--			----	-----	-----		---------------

system	7/22						bsystem	- SYSTEM statement
			7/25						stmc1		- create directory (.CDIR)
										stmc29	- set time & date


			Fn not implemented.


		stmc1 - Used to create a directory.
			MS function mkdir() used instead.

		bsystem - used for the SYSTEM statement.
			SYSTEM statement not implemented in BB/PC.

		stmc29 - used to get/set time/date.
			MS functions gday(),gtod(),sdayf(),stod() used in BB/PC.


		** Terminal I/O **


Module	Written	Tested	Desc
------	-------	------	----

