亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? jobc.c

?? MMURTL(tm) Computer Operating System Ver x0.8, source code.
?? C
?? 第 1 頁 / 共 2 頁
字號:
		  	xprintf("PhyAdd : %08x\r\n", PhyAdd);
			ReadKbd(&KeyCodeE, 1);
			*/

			/* Now we can allocate User Job Memory */
			/* Allocate user memory for Stack Code and Data */
			/* This is done in the OS PD */

			nPages = sStack/4096;
			if (sStack%4096) nPages++;
			erc = AllocPage(nPages, &pStack);
			sStack = nPages * 4096;				/* set to whole pages */

			nPages = sCode/4096;
			if (sCode%4096) nPages++;
			if (!erc)
				erc = AllocPage(nPages, &pCode);

			nPages = sData/4096;
			if (sData%4096) nPages++;
			if (!erc)
				erc = AllocPage(nPages, &pData);

			/* Right now, the OS PD looks exacly like we want
			the User PD to look.  We will now copy the entire
			OS PD into the User's New PD.
			*/

			CopyData(pOSPD,	pPD, 4096);		/* Copy OS PD to User PD */

			/* All Job memory is now allocated, so let's LOAD IT! */

			if (!erc)
				erc = SetFileLFA(fh, oCode);
			if (!erc)
				erc = ReadBytes (fh, pCode, sCode, &dret);

			if (!erc)
				erc = SetFileLFA(fh, oData);
			if (!erc)
				erc = ReadBytes (fh, pData, sData, &dret);

			/* Now that we have read in the code and data we
			apply fixups to these segments from the runfile
			*/

			if (!erc) {

				if (nCDFIX) {
					erc = SetFileLFA(fh, oCDFIX);	/* back to fixups */
					while ((nCDFIX--) && (!erc)) {
						erc = ReadBytes (fh, &i, 4, &dret);
						pFix = pCode + i;		/* Where in CSeg */
						*pFix = *pFix - offData + pData;
					}
				}

				if (nCCFIX) {
					erc = SetFileLFA(fh, oCCFIX);	/* back to fixups */
					while ((nCCFIX--) && (!erc)) {
						erc = ReadBytes (fh, &i, 4, &dret);
						pFix = pCode + i;		/* Where in CSeg */
						*pFix = *pFix - offCode + pCode;
					}
				}

				if (nDCFIX) {
					erc = SetFileLFA(fh, oDCFIX);	/* back to fixups */
					while ((nDCFIX--) && (!erc)) {
						erc = ReadBytes (fh, &i, 4, &dret);
						pFix = pData + i;		/* Where in DSeg */
						*pFix = *pFix - offCode + pCode;
					}
				}

				if (nDDFIX) {
					erc = SetFileLFA(fh, oDDFIX);	/* back to fixups */
					while ((nDDFIX--) && (!erc)) {
						erc = ReadBytes (fh, &i, 4, &dret);
						pFix = pData + i;		/* Where in DSeg */
						*pFix = *pFix - offData + pData;
					}
				}

			}

			/* Clean the OS PD of User memory */

			FillData(&pOSPD[256], 1024, 0);	/* Clean OS PD of User PDEs */
			FillData(&pOSPD[768], 1024, 0);	/* Clean OS PD of User Shadow */

			/* Now we fill in the rest of the User's JCB */

			pNewJCB->pJcbPD = pPD;			/* Lin Add of PD */
			pNewJCB->pJcbStack = pStack;	/* Add of Stack */
			pNewJCB->sJcbStack = sStack;	/* Size of Code */
			pNewJCB->pJcbCode  = pCode;		/* Add of Code */
			pNewJCB->sJcbCode  = sCode; 	/* Size of Code */
			pNewJCB->pJcbData  = pData;		/* Add of Code */
			pNewJCB->sJcbData  = sData; 	/* Size of Code */

			pNewJCB->sbUserName[0] = 0; 	/* Zero UserName */
			pNewJCB->sbPath[0] = 0;		 	/* No Default path */
			pNewJCB->JcbExitRF[0] = 0;	 	/* No Exit Run File */
			pNewJCB->JcbCmdLine[0] = 0;	 	/* No Cmd Line */

			CopyData("KBD", &pNewJCB->JcbSysIn[1], 3);
			pNewJCB->JcbSysIn[0] = 3;	 	/* Size */

			CopyData("VID", &pNewJCB->JcbSysOut[1], 3);
			pNewJCB->JcbSysOut[0] = 3;	 	/* Size */

			pNewJCB->pVidMem = pVid;	 	/* Default to Virt Vid */
			pNewJCB->pVirtVid = pVid;	 	/* Virtual Video memory */
			pNewJCB->CrntX = 0;			 	/* Vid X Position */
			pNewJCB->CrntY = 0;			 	/* Vid Y Position */
			pNewJCB->nCols = 80;		 	/* Columns */
			pNewJCB->nLines = 25;		 	/* Lines */

			pNewJCB->VidMode = 0;		 	/* 80x25 VGA Color Text */
			pNewJCB->fCursOn = 1;		 	/* Cursor On */
			pNewJCB->fCursType = 0;		 	/* UnderLine */


			/* Finally, we crank up the new task and schedule it for
			execution!
			*/
			if (!erc)
				erc = AllocExch(&i);

			if (!erc)
				erc = NewTask(JobNum, 0x18, 25, 0, i,
							  pStack+sStack-4,
							  pStart+pCode-offCode);
			if (!erc)
				SetExchOwner(i, pNewJCB);	/* Exch now belongs to new JCB */
		}

		CloseFile(fh);
	}	/* read run file OK */

	if (!erc)
		*pJobNumRet = JobNum;

	return(erc);
}

/*********************************************************
  This loads a job into an existing PD and JCB.  This is
  called by Chain() and may also be called by ExitJob()
  if an ExitJob was specified in the current JCB.
  The PD, pVid & first PT still exist in OS memory.
  (CleanPD left the first PT for us). ExitJob and Chain
  are responsible for opening and validating the runfile
  and setting up the run file variables.
*********************************************************/

long LoadJob(char *pJCB, long fh)
{
long erc, i, dret, nPages;
long *pFix;

	pNewJCB = pJCB;

	/* Allocate user memory for Stack, Code and Data */
	/* This is done in the USER PD */

	nPages = sStack/4096;
	if (sStack%4096) nPages++;
	erc = AllocPage(nPages, &pStack);
	sStack = nPages * 4096;				/* set to whole pages */

	nPages = sCode/4096;
	if (sCode%4096) nPages++;
	if (!erc)
		erc = AllocPage(nPages, &pCode);

	nPages = sData/4096;
	if (sData%4096) nPages++;

	erc = AllocPage(nPages, &pData);

	/* All Job memory is now allocated, so let's LOAD IT! */

	if (!erc)
		erc = SetFileLFA(fh, oCode);
	if (!erc)
		erc = ReadBytes (fh, pCode, sCode, &dret);

	if (!erc)
		erc = SetFileLFA(fh, oData);
	if (!erc)
		erc = ReadBytes (fh, pData, sData, &dret);

	/* Now that we have read in the code and data we
	apply fixups to these segments from the runfile
	*/

	if (!erc) {
		if (nCDFIX) {
			erc = SetFileLFA(fh, oCDFIX);	/* back to fixups */
			while ((nCDFIX--) && (!erc)) {
				erc = ReadBytes (fh, &i, 4, &dret);
				pFix = pCode + i;		/* Where in CSeg */
				*pFix = *pFix - offData + pData;
			}
		}

		if (nCCFIX) {
			erc = SetFileLFA(fh, oCCFIX);	/* back to fixups */
			while ((nCCFIX--) && (!erc)) {
				erc = ReadBytes (fh, &i, 4, &dret);
				pFix = pCode + i;		/* Where in CSeg */
				*pFix = *pFix - offCode + pCode;
			}
		}

		if (nDCFIX) {
			erc = SetFileLFA(fh, oDCFIX);	/* back to fixups */
			while ((nDCFIX--) && (!erc)) {
				erc = ReadBytes (fh, &i, 4, &dret);
				pFix = pData + i;		/* Where in DSeg */
				*pFix = *pFix - offCode + pCode;
			}
		}

		if (nDDFIX) {
			erc = SetFileLFA(fh, oDDFIX);	/* back to fixups */
			while ((nDDFIX--) && (!erc)) {
				erc = ReadBytes (fh, &i, 4, &dret);
				pFix = pData + i;		/* Where in DSeg */
				*pFix = *pFix - offData + pData;
			}
		}

		/* Now we fill in the rest of the User's JCB */
		pNewJCB->pJcbStack = pStack;	/* Add of Stack */
		pNewJCB->sJcbStack = sStack;	/* Size of Code */
		pNewJCB->pJcbCode  = pCode;		/* Add of Code */
		pNewJCB->sJcbCode  = sCode; 	/* Size of Code */
		pNewJCB->pJcbData  = pData;		/* Add of Code */
		pNewJCB->sJcbData  = sData; 	/* Size of Code */

	}
	CloseFile(fh);

	return(erc);

}

/******************************************************
 This called from Exit() in C or directly from a user
 job or service. This cleans up ALL resources that the
 job had allocated.
 This also checks for an exit run file to load if
 one is specified. If no exit run file is specified
 we just kill the JCB entirely and if video and
 keyboard are assigned we assign them to the Monitor.
******************************************************/

void far ExitJob(long dError)
{
/* NO LOCAL VARIABLES BECAUSE WE SWITCH STACKS!! */

	GetJobNum(&JobNumE);
	GetpJCB(JobNumE, &pCrntJCB);		/* Get pJCB to current Job */
	pCrntJCB->ExitError = dError;

	/* Remove ALL tasks for this job that are at the ReadyQue.
	   The task we are in won't be removed because its RUNNING!
	*/

	RemoveRdyJob(pCrntJCB);	/* It always returns ErcOk */

	/* Deallocate all exchanges for this job except the one belonging
	   to current TSS!  The Dealloc Exchange call will invalidate
	   all TSSs found at exchanges belonging to this user, and
	   will also free up RQBs and Link Blocks.  The job will not be
	   able to initiate requests or send messages after this unless
	   it is done with the TSSExchange because it will get a kernel
	   error (invalid exchange).
	*/

	 /* Find out what our TSS exchange is so
	 we don't deallocate it to! */

	 GetTSSExch(&ExchE);

	 ercE = 0;
	 iE = 0;
	 while (ercE != ErcOutOfRange) {
	 	ercE = GetExchOwner(iE, &pExchJCBE);
		if ((!ercE) && (iE != ExchE) && (pExchJCBE == pCrntJCB))
			DeAllocExch(iE);
		iE++;
	 }
	 ercE = 0;		/* Clear the error */

	/* Now that the user can't make anymore requests,
	   Send Abort messages to all services.
	   This closes all files that were opened by the Job
       and frees up any other resources held for this
       job by any service.
	*/

/*	SendAbort(JobNumE, ExchE); */

	/* We must now switch to a temporary stack so we can
	clean out the user PD (we are on his stack right now!).
	*/

#asm
	MOV EAX, OFFSET _TmpStack
	ADD EAX, 508
	MOV ESP, EAX
	MOV EBP, EAX
#endasm

	/* Clean the PD of all user memory leaving OS memory for next
	job if there is one.
	*/

	pPDE = pCrntJCB->pJcbPD;
	CleanUserPD(pPDE);

	/* Look for Exit Run file to load if any exists.  If no exit run
	file, we deallocate the PD and JCB then return to JOB 1. */

	GetExitJob(FileE, &cbFileE);     	/* Exit Run File!! */

	if (!cbFileE)
		ercE = ErcNoExitJob;

	if (!ercE)
		ercE =  GetRunFile(FileE, cbFileE, &job_fhE);

	if (!ercE)
		ercE = LoadJob(pCrntJCB, job_fhE);

	if (!ercE) {

			pStart = pStart+pCode-offCode;

			/* Now we RETURN to new job's address after we put him
			on his new stack. */

#asm
			MOV EAX, _pStack
			MOV EBX, _sStack
			ADD EAX, EBX
			SUB EAX, 4
			MOV ESP, EAX
			MOV EBP, EAX
			PUSH 18h
			MOV EAX, _pStart
			PUSH EAX
			RETF				;We are history!
#endasm

	}

	if (ercE) {		/* something failed or we don't have an ExitRF */

		/* In case there is no job to run or a fatal error has happened
		we send a message (ISendMsg) to the monitor status
		task with our TSSExch and the Error. Then he will WIPE US OUT!
		We use ISend (vice send) so he can't run before we get to
		the exchange otherwise we will be placed back on the readyQueue!
	    */

		ISendMsg(KillExch, ExchE, ercE);
		WaitMsg(ExchE, BogusMsg);

		/* We are NO MORE */

	}
}

/******************************************************
 This is called to execute a program without changing
 the ExitJob. This is so you can run program B from
 program A and return to program A when program B is
 done.  This runs Job B in the "context" of Job A
 which means Job B inherits the JCB and PD of job A
 so it can use things like the command line and
 path that were set up by A.
 Information can be passed to Job B by calling
 SetCmdLine (if Job B reads it), and also by
 setting the ExitError value in the parameter.
 Chain will only return to you if there was an
 error loading the Job.  In other words, if Chain
 fails in a critial section we try to load the
 ExitJob and pass it the error.
******************************************************/

long far Chain(char *pFileName, long cbFileName, long dExitError)
{
/* NO LOCAL VARIABLES BECAUSE WE SWITCH STACKS!! */

	ercE =  GetRunFile(pFileName, cbFileName, &job_fhE);
	if (ercE)
		return(ercE);

	GetJobNum(&JobNumE);
	GetpJCB(JobNumE, &pCrntJCB);		/* Get pJCB to current Job */
	pCrntJCB->ExitError = dExitError;

	/* Remove ALL tasks for this job that are at the ReadyQue.
	   The task we are in won't be removed because its RUNNING!
	*/

	RemoveRdyJob(pCrntJCB);	/* It always returns ErcOk */

	/* Deallocate all exchanges for this job except the one belonging
	   to current TSS!  The Dealloc Exchange call will invalidate
	   all TSSs found at exchanges belonging to this user, and
	   will also free up RQBs and Link Blocks.  The job will not be
	   able to initiate requests or send messages after this unless
	   it is done with the TSSExchange because it will get a kernel
	   error (invalid exchange).
	*/

	 /* Find out what our TSS exchange is so
	 we don't deallocate it to! */

	 GetTSSExch(&ExchE);

	 ercE = 0;
	 iE = 0;
	 while (ercE != ErcOutOfRange) {
	 	ercE = GetExchOwner(iE, &pExchJCBE);
		if ((!ercE) && (iE != ExchE) && (pExchJCBE == pCrntJCB))
			DeAllocExch(iE);
		iE++;
	 }

	/* Now that the user can't make anymore requests,
	   Send Abort messages to all services.
	   This closes all files that were opened by the Job
       and frees up any other resources held for this
       job by any services.
	*/

/*	SendAbort(JobNumE, ExchE); */

	/* We must now switch to a temporary stack so we can
	clean out the user PD (we are on his stack right now!).
	*/

#asm
	MOV EAX, OFFSET _TmpStack
	ADD EAX, 508
	MOV ESP, EAX
	MOV EBP, EAX
#endasm

	/* Clean the PD of all user memory leaving OS memory for next
	job if there is one.
	*/

	pPDE = pCrntJCB->pJcbPD;
	CleanUserPD(pPDE);

	/* Look for Exit Run file to load if any exists.  If no exit run
	file, we deallocate the PD and JCB then return to the JOB 1. */

	ercE = LoadJob(pCrntJCB, job_fhE);

	if (ercE) {
		/* We have errored in a critical part of Chain (LoadJob).  
		The original user's job is destroyed, and we can run the
		chain file (bummer).
		The only thing left to do is Look for Exit Run file to load
		if any exists.  If no exit run file, we kill this guy
		and return to the monitor if he had the screen. */

		GetExitJob(FileE, &cbFileE);     	/* Exit Run File!! */

		if (!cbFileE)
			ercE = ErcNoExitJob;

		if (!ercE)
			ercE =  GetRunFile(FileE, cbFileE, &job_fhE);

		if (!ercE)
			ercE = LoadJob(pCrntJCB, job_fhE);
	}

	if (!ercE) {		/* No error */

		pStart = pStart+pCode-offCode;

		/* Now we RETURN to new job's address after we put him
		on his new stack. */

#asm
		MOV EAX, _pStack
		MOV EBX, _sStack
		ADD EAX, EBX
		SUB EAX, 4
		MOV ESP, EAX
		MOV EBP, EAX
		PUSH 18h
		MOV EAX, _pStart
		PUSH EAX
		RETF				;We are history!
#endasm
	}

	if (ercE) {		/* Something failed loading the job (Chain or Exit) */

		/* In case there is no job to run or a fatal error has happened
		we send a message (ISendMsg) to the monitor status
		task with our TSSExch and the Error. Then he will WIPE US OUT!
		We use ISend (vice send) so he can't run before we get to
		the exchange otherwise we will be placed back on the readyQueue!
	    */

		ISendMsg(KillExch, ExchE, ercE);  /* ISend clears ints! */
#asm
		STI
#endasm
		WaitMsg(ExchE, BogusMsg);

		/* We are NO MORE */

	}
}


/*********************** End of Module *****************/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久综合色鬼综合色| 美女视频一区二区三区| 天天免费综合色| 成人免费av网站| 欧美一区二区观看视频| 亚洲精品国产精华液| 国产在线精品一区二区| 欧美日韩国产美女| 亚洲欧美日韩人成在线播放| 国产一区二区三区最好精华液| 色噜噜夜夜夜综合网| 国产精品成人免费在线| 国产一区二区视频在线| 日韩视频免费观看高清在线视频| 亚洲精品网站在线观看| 9久草视频在线视频精品| 国产色婷婷亚洲99精品小说| 精品中文字幕一区二区| 欧美一区日韩一区| 三级欧美韩日大片在线看| 91高清视频免费看| 亚洲美腿欧美偷拍| a在线播放不卡| 国产精品美女久久久久aⅴ| 国产在线播放一区| 国产亚洲福利社区一区| 国模娜娜一区二区三区| 久久综合成人精品亚洲另类欧美| 久久91精品久久久久久秒播| 日韩欧美亚洲国产另类| 久久精品国产99| 精品国产青草久久久久福利| 青草国产精品久久久久久| 欧美一卡2卡三卡4卡5免费| 日韩激情视频网站| 日韩区在线观看| 激情偷乱视频一区二区三区| 久久午夜羞羞影院免费观看| 国产suv精品一区二区三区| 国产目拍亚洲精品99久久精品| 粉嫩一区二区三区性色av| 中文字幕一区二区不卡| 色欧美日韩亚洲| 日本一不卡视频| 国产午夜一区二区三区| 波多野洁衣一区| 亚洲精品第1页| 3d动漫精品啪啪一区二区竹菊| 免费成人在线视频观看| 久久久久久免费| a4yy欧美一区二区三区| 午夜伦欧美伦电影理论片| 欧美一二区视频| 国产999精品久久| 一区二区免费在线播放| 日韩精品一区在线| 成人黄动漫网站免费app| 亚洲综合偷拍欧美一区色| 日韩一区二区在线观看视频播放| 国产精品一级片| 玉米视频成人免费看| 91精品午夜视频| 国产.欧美.日韩| 亚洲第一久久影院| 久久久久综合网| 欧美性高清videossexo| 国产精品一级二级三级| 亚洲一区二区三区美女| 久久噜噜亚洲综合| 欧美性极品少妇| 国产a级毛片一区| 亚洲18色成人| 国产精品国产三级国产专播品爱网| 欧美性极品少妇| kk眼镜猥琐国模调教系列一区二区| 亚洲国产wwwccc36天堂| 国产精品女主播av| 欧美一区二区三区免费视频| 91伊人久久大香线蕉| 精品一区二区三区视频| 午夜精品久久久久久久久久| 国产精品人妖ts系列视频| 日韩一区二区精品葵司在线 | 欧洲色大大久久| 国产精品亚洲专一区二区三区| 一区二区三区在线播放| 国产亚洲精久久久久久| 日韩欧美成人激情| 欧美日高清视频| 色综合av在线| 成人一区二区三区| 黄页网站大全一区二区| 日韩国产成人精品| 亚洲一区二区三区四区在线 | 日韩中文字幕不卡| 亚洲欧美日本韩国| 国产精品另类一区| 久久九九99视频| 精品国产123| 日韩免费看的电影| 日韩亚洲欧美一区二区三区| 欧美自拍偷拍午夜视频| 色呦呦网站一区| 97精品视频在线观看自产线路二| 国产盗摄一区二区| 国产乱理伦片在线观看夜一区| 美女视频黄a大片欧美| 日韩影视精彩在线| 日韩中文字幕亚洲一区二区va在线| 亚洲一区av在线| 亚洲电影一区二区| 亚洲精品菠萝久久久久久久| 亚洲同性同志一二三专区| 中文字幕在线不卡| 亚洲视频综合在线| 一区二区三区四区中文字幕| 亚洲美女视频在线观看| 亚洲尤物在线视频观看| 伊人婷婷欧美激情| 午夜精品久久久久久久99水蜜桃| 亚洲第一福利一区| 亚洲成人精品影院| 99天天综合性| 色综合天天性综合| 欧美精品xxxxbbbb| 欧美日韩第一区日日骚| 欧美精品成人一区二区三区四区| 91精品国产一区二区| 精品国产一区二区国模嫣然| 国产欧美日韩在线观看| 国产精品久久毛片av大全日韩| 亚洲色图视频网站| 五月婷婷激情综合| 国模冰冰炮一区二区| 成人爱爱电影网址| 欧美日韩在线直播| 精品少妇一区二区三区在线视频| 久久一区二区视频| 亚洲欧洲综合另类| 蜜臀av一区二区在线免费观看| 国产精品一区二区黑丝| 色天天综合色天天久久| 欧美久久婷婷综合色| 久久综合九色欧美综合狠狠| 亚洲欧美另类综合偷拍| 蜜臀久久99精品久久久久宅男| 国产精品一级在线| 欧美日韩一区二区三区免费看| 日韩你懂的在线播放| 国产精品精品国产色婷婷| 日日夜夜免费精品| av一区二区久久| 日韩一区二区在线观看视频播放| 欧美极品另类videosde| 日韩影院在线观看| 99久久久无码国产精品| 欧美一级艳片视频免费观看| 国产精品久久三区| 免费成人在线影院| 欧美一a一片一级一片| 精品乱码亚洲一区二区不卡| 亚洲精品乱码久久久久久黑人| 狠狠色伊人亚洲综合成人| 色激情天天射综合网| 久久久久国产精品人| 亚洲va欧美va天堂v国产综合| 成人免费视频国产在线观看| 91精品国产手机| 国产91综合网| 成人一道本在线| 日韩午夜激情视频| 亚洲成va人在线观看| 北岛玲一区二区三区四区| 日韩你懂的在线播放| 五月天婷婷综合| 在线日韩一区二区| 亚洲欧美另类久久久精品| 国产精品91一区二区| 欧美日韩中文精品| 亚洲日本在线天堂| 不卡欧美aaaaa| 国产精品女主播在线观看| 狠狠色丁香久久婷婷综合丁香| 777a∨成人精品桃花网| 亚洲国产综合91精品麻豆| 99综合电影在线视频| 国产日韩欧美一区二区三区乱码| 麻豆91免费观看| 日韩午夜在线观看| 99久久久久久| 日韩一区有码在线| 成人av在线电影| 国产精品免费视频一区| 高潮精品一区videoshd| 久久久国际精品| 国产91丝袜在线播放| 亚洲国产精品精华液ab| 国产69精品久久99不卡| 国产精品久久久久毛片软件| zzijzzij亚洲日本少妇熟睡|