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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? kernel.inc

?? MMURTL(tm) Computer Operating System Ver x0.8, source code.
?? INC
?? 第 1 頁 / 共 4 頁
字號:
;   MMURTL Operating System Source Code
;   Copyright 1991,1992,1993, Richard A. Burgess
;   ALL RIGHTS RESERVED
;   Version x0.8

;This file contains all the internal kernel functions plus
;the PUBLIC kernel functions SendMsg, ISendMsg, WaitMsg, CheckMsg,
;Request, Respond, MoveMsg, NewTask and SpawnTask.
;Exchange management functions such as AllocExch and DeAllocExch are
;also included here.
;
; NOTE on interrupts and the kernel primitives:
; Because certain kernel functions may be called from ISRs,
; and because portions of other kernel functions may be
; interrupted by a task change that happens because of an action
; that an ISR takes, we must ensure that interrupts are
; DISABLED prior to the allocation or deallocation
; of most kernel resources. This especially applies when
; a message is "in transit."  For example: taken from an exchange
; but not yet linked to a TSS and placed on the ready queue.
;
; NOTE on Exchanges, Messages, and Tasks (TSSs)
; In MMURTL, an exchange is a place where either Messages or
; Tasks wait.  There can never be tasks AND messages at an
; exchange at the same time (unless the kernel is BROKEN!).
; For this reason we share the HEAD and TAIL link pointers
; for tasks and messages in an exchange.
;
;=============================================================================

enQueueMsg:
;
; INPUT : ESI,EAX
; OUTPUT : NONE
; REGISTERS : EAX,EDX,ESI,FLAGS
; MODIFIES : EDX
;
; This routine will place the link block pointed to by EAX onto the exchange
; pointed to by the ESI register. If EAX is NIL then the routine returns.
;
		CMP EAX,NIL             ; if pLBin = NIL THEN Return;
		JE eqMsgDone            ;
		MOV [EAX.NextLB],NIL    ; pLBin^.Next <= NIL;
		XCHG ESI,EAX            ; pExch => EAX, pLBin => ESI
		CMP [EAX.EHead],NIL     ; if ..MsgHead = NIL
		JNE eqMNotNIL           ; then
		MOV [EAX.EHead],ESI     ;  ..MsgHead <= pLBin;
		MOV [EAX.ETail],ESI     ;  ..MsgTail <= pLBin;
		MOV [EAX.fEMsg], 1		; Flag it as a Msg (vice a task)
		XCHG EAX,ESI            ; Put pExch Back in ESI
		RETN                    ; else
eqMNotNIL:
	    MOV EDX,[EAX.ETail]     ;  ..MsgTail^.NextLB <= pLBin;
		MOV [EDX.NextLB],ESI    ;
		MOV [EAX.ETail],ESI     ;  ..MsgTail <= pLBin;
		MOV [EAX.fEMsg], 1		; Flag it as a Msg (vice a task)
		XCHG EAX,ESI            ; Put pExch Back in ESI
eqMsgDone:
	    RETN                    ;

;=============================================================================

deQueueMsg:
;
; INPUT : ESI
; OUTPUT : EAX
; REGISTERS : EAX,EBX,ESI,FLAGS
; MODIFIES : *prgExch[ESI].msg.head and EBX
;
; This routine will dequeue a link block on the exchange pointed to by the
; ESI register and place the pointer to the link block dequeued into EAX.
;
		MOV EAX,[ESI.fEMsg]     ; Get Msg Flag
		OR EAX, EAX				; Is it a Msg?
		JZ deMsgDone			; No! (return 0)
		MOV EAX,[ESI.EHead]     ; pLBout <= ..MsgHead;
		OR EAX, EAX             ; if pLBout = NIL then Return;
		JZ deMsgDone            ;
		MOV EBX,[EAX.NextLB]    ; ..MsgHead <= ..MsgHead^.Next;
		MOV [ESI.EHead],EBX     ;
deMsgDone:
	    RETN                    ;

;=============================================================================

deQueueTSS:
;
; INPUT : ESI
; OUTPUT : EAX
; REGISTERS : EAX,EBX,ESI,FLAGS
; MODIFIES : EAX,EBX
;
; This routine will dequeue a TSS on the exchange pointed to by the ESI
; register and place the pointer to the TSS dequeued into EAX.
; EAX return NIL if no TSS is waiting at Exch ESI
;
		XOR EAX,EAX				; Set up to return nothing
		MOV EBX,[ESI.fEMsg]		; Msg flag (is it a Msg)
		OR EBX, EBX
		JNZ deTSSDone			; It's a Msg (return leaving EAX 0)
		MOV EAX,[ESI.EHead] 	; pTSSout <= ..TSSHead;
		OR EAX, EAX           	; if pTSSout = NIL then Return;
		JZ deTSSDone           	;
		MOV EBX,[EAX.NextTSS]  	; ..TSSHead <= ..TSSHead^.Next;
		MOV [ESI.EHead],EBX  	;
deTSSDone:
	    RETN                    	;

;=============================================================================

enQueueRdy:
;
; INPUT : EAX
; OUTPUT : NONE
; REGISTERS : EAX,EBX,EDX,FLAGS
; MODIFIES : EAX,EBX,EDX
;
; This routine will place a TSS pointed to by EAX onto the ReadyQueue. This
; algorithm chooses the proper priority queue based on the TSS priority.
; The Rdy Queue is an array of QUEUES (2 pointers, head & tail per QUEUE).
; This links the TSS to rgQueue[nPRI].
;
		CMP EAX,NIL             ; if pTSS = NIL then return;
		JE eqRdyDone            ;
		MOV [EAX.NextTSS],NIL   ; pTSSin^.Next <= NIL;
		XOR EBX,EBX             ; get the priority
		MOV BL,[EAX.Priority]   ; in EBX
		XCHG EAX,EBX            ; Priority => EAX, pTSSin => EBX
		SHL EAX, 3              ; Times 8 (size of QUEUE)
		LEA EDX,RdyQ            ; Add offset of RdyQ => EAX
		ADD EAX,EDX             ; EAX pts to proper Rdy Queue
		CMP [EAX.Head],NIL      ; if Head = NIL
		JNE eqRNotNIL           ; then
		MOV [EAX.Head],EBX      ;  ..Head <= pTSSin;
		MOV [EAX.Tail],EBX      ;  ..Tail <= pTSSin;
		RETN                    ; else
eqRNotNIL:
	    MOV EDX,[EAX.Tail]      ;  ..Tail^.NextTSS <= pTSSin;
		MOV [EDX.NextTSS],EBX   ;
		MOV [EAX.Tail],EBX      ;  ..Tail <= pTSSin;
eqRdyDone:
	    RETN                    ;

;=============================================================================

deQueueRdy:
;
; INPUT : NONE
; OUTPUT : EAX
; REGISTERS : EAX,EBX,ECX,FLAGS
; MODIFIES : RdyQ
;
; This routine will return a pointer in EAX to the highest priority task
; queued on the RdyQ. Then the routine will "pop" the TSS from the RdyQ.
; If there was no high priority process, EAX is returned as NIL.
;
		MOV ECX,nPRI            ; Set up the number of times to loop
		LEA EBX,RdyQ            ; Get base address of RdyQ in EBX
deRdyLoop:
	    MOV EAX,[EBX.Head]      ; Get pTSSout in EAX
		CMP EAX,NIL             ; IF pTSSout is NIL Then go and
		JNE deRdyFound          ; check the next priority
		ADD EBX,sQUEUE          ; Point to the next Priority Queue
		LOOP deRdyLoop          ; DEC ECX and LOOP IF NOT ZERO
deRdyFound:
		CMP EAX,NIL             ; IF pTSSout is NIL Then there are
		JE deRdyDone            ; No TSSs on the RdyQ; RETURN
		MOV ECX,[EAX.NextTSS]   ; Otherwise, deQueue the process
		MOV [EBX.Head],ECX      ; And return with the pointer in EAX
deRdyDone:
	    RETN                    ;

;=============================================================================
;================= BEGIN NEAR KERNEL HELPER ROUTINES =========================
;=============================================================================

; RemoveRdyJob  (NEAR)
;
; This routine searchs all ready queue priorities for tasks belonging
; to pJCB. When one is found it is removed from the queue
; and the TSS is freed up.
;
; Procedureal Interface :
;
;		RemoveRdyJob(char *pJCB):ercType
;
;	pJCB is a pointer to the JCB that the tasks to kill belong to.
;
; pJCB		 	EQU DWORD PTR [EBP+8]
;
; INPUT :  (pJCB on stack)
; OUTPUT : NONE
; REGISTERS : All general registers are trashed
; MODIFIES : RdyQ
;
;
_RemoveRdyJob PROC NEAR
;
		PUSH EBP                ;
		MOV EBP,ESP             ;
		MOV ECX,nPRI            ; Set up the number of times to loop
		LEA EBX,RdyQ            ; Get base address of RdyQ in EBX

		;EBX points to begining of next Priority Queue
RemRdyLoop:
	    MOV EAX,[EBX.Head]      ; Get pTSS in EAX
		MOV EDI, EAX			; EDI points to last TSS by default (or NIL)
		CMP EAX,NIL             ; Is pTSS 0 (none left queued here)
		JNE RemRdy0		        ; Valid pTSS!
RemRdyLoop1:
		MOV [EBX.Tail], EDI		; EDI always points to last TSS or NIL
		ADD EBX,sQUEUE          ; Point to the next Priority Queue
		LOOP RemRdyLoop         ; DEC ECX and LOOP IF NOT ZERO

		XOR EAX, EAX			; No error
		POP EBP
		RETN 4					; All done (clean stack)

		;Go here to dequeue a TSS at head of list
RemRdy0:
		CMP EDX, [EAX.TSS_pJCB]	; Is this from the JCB we want?
		JNE RemRdy2				; No

		MOV EDI, [EAX.NextTSS]  ; Yes, deQueue the TSS
		MOV [EBX.Head], EDI     ; Fix link in Queue list

		PUSH EBX				; Save ptr to RdyQue (crnt priority)

		;Free up the TSS (add it to the free list)
		MOV EBX,pFreeTSS        ; pTSSin^.Next <= pFreeTSS;
		MOV [EAX.NextTSS],EBX   ;
		MOV [EAX.TSS_pJCB], 0	; Make TSS invalid
		MOV pFreeTSS,EAX        ; pFreeTSS <= pTSSin;
		INC _nTSSLeft			;

		POP EBX
		MOV EAX, EDI 		    ; Make EAX point to new head TSS
		OR EAX, EAX				; Is it Zero?
		JZ RemRdyLoop1			; Next Queue please
		JMP RemRdy0				; back to check next at head of list

		;Go here to dequeue a TSS in middle or end of list
RemRdy2:
		MOV EAX, [EDI.NextTSS]	; Get next link in list
		OR EAX, EAX				; Valid pTSS?
		JZ RemRdyLoop1			; No. Next Queue please
		CMP EDX, [EAX.TSS_pJCB]	; Is this from JCB we want?
		JE RemRdy3				; Yes. Trash it.
		MOV	EDI, EAX			; No. Next TSS
		JMP RemRdy2
RemRdy3:
		;EDI points to prev TSS
		;EAX points to crnt TSS
		;Make ESI point to NextTSS

		MOV ESI, [EAX.NextTSS]  ; Yes, deQueue the TSS

		;Now we fix the list (Make Prev point to Next)
		;This extracts EAX from the list

		MOV [EDI.NextTSS], ESI	;Jump the removed link
		PUSH EBX				;Save ptr to RdyQue (crnt priority)

		;Free up the TSS (add it to the free list)
		MOV EBX,pFreeTSS        ; pTSSin^.Next <= pFreeTSS;
		MOV [EAX.NextTSS],EBX   ;
		MOV [EAX.TSS_pJCB], 0	; Make TSS invalid
		MOV pFreeTSS,EAX        ; pFreeTSS <= pTSSin;
		INC _nTSSLeft			;

		POP EBX
		;
		OR  ESI, ESI			;Is EDI the new Tail? (ESI = 0)
		JZ  RemRdyLoop1			;Yes. Next Queue please
		JMP RemRdy2				;back to check next TSS

_RemoveRdyJob ENDP

;=============================================================================
; GetExchOwner  (NEAR)
;
; This routine returns the owner of the exchange specified.
; A pointer to the JCB of the owner is returned.
; ErcNotAlloc is returned if the exchange isn't allocated.
; ErcOutofRange is returned is the exchange number is invalid (too high)
;
; Procedureal Interface :
;
;		GetExchOwner(long Exch, char *pJCBRet): dErrror
;
;	Exch is the exchange number.
;	pJCBRet is a pointer to the JCB that the tasks to kill belong to.
;
; Exch	 	EQU DWORD PTR [EBP+12]
; pJCBRet 	EQU DWORD PTR [EBP+8]

_GetExchOwner PROC NEAR         ;
		PUSH EBP                ;
		MOV EBP,ESP             ;

		MOV EAX, [EBP+12]		; Get Resp Exchange in EDX
		CMP EAX,nExch           ; Is the exchange out of range?
		JB GEO01	            ; No, continue
		MOV EAX,ErcOutOfRange   ; Yes, Error in EAX register
		JMP GEOEnd				;
GEO01:
		MOV EDX,sEXCH           ; Compute offset of Exch in rgExch
		MUL EDX                 ; sExch * Exch number
		MOV EDX,prgExch         ; Add offset of rgExch => EAX
		ADD EDX,EAX             ; EDX -> Exch
		MOV EAX, [EDX.Owner]
		OR EAX, EAX				; Valid Exch (Allocated)
		JNZ GEO02
		MOV EAX, ErcNotAlloc	; No, not allocated
		JMP SHORT GEOEnd
GEO02:
		MOV ESI, [EBP+8]		;Where to return pJCB of Exchange
		MOV [ESI], EAX			;
		XOR EAX, EAX
GEOEnd:
		MOV ESP,EBP             ;
		POP EBP                 ;
		RETN 8                  ;
_GetExchOwner  ENDP

;=============================================================================
; SetExchOwner  (NEAR)
;
; This routine sets the owner of the exchange specified to the
; pJCB specified. This is used by the Job code to set the owner of
; a TSS exchange to a new JCB (even though the exchange was allocated
; by the OS).  No error checking is done as the job code does it upfront!
;
; Procedureal Interface :
;
;		SetExchOwner(long Exch, char *pNewJCB): dErrror
;
;	Exch is the exchange number.
;	pNewJCB is a pointer to the JCB of the new owner.
;
; Exch	 	EQU DWORD PTR [EBP+12]
; pNewJCB 	EQU DWORD PTR [EBP+8]

_SetExchOwner PROC NEAR         ;
		PUSH EBP                ;
		MOV EBP,ESP             ;
		MOV EAX, [EBP+12]		; Exchange Number
		MOV EDX,sEXCH           ; Compute offset of Exch in rgExch
		MUL EDX                 ; sExch * Exch number
		MOV EDX,prgExch         ; Add offset of rgExch => EAX
		ADD EAX,EDX             ; EAX -> oExch + prgExch
		MOV EBX, [EBP+8]
		MOV [EAX.Owner], EBX
		XOR EAX, EAX
		POP EBP                 ;
		RETN 8                  ;
_SetExchOwner  ENDP

;=============================================================================
; SendAbort  (NEAR)
;
; This routine sends one abort message to each valid service
; with the jobnum of the aborting job. If we receive a
; kernel error on Request it may be becuase it is a service
; that is aborting itself. We ignore the kernel errors.
;
; Procedureal Interface :
;
;		SendAbort(long JobNum, ValidExch): dErrror
;
;	JobNum is the job that is aborting
;	ValidExch is any valid exchange so the request will go through
;
; JobNum 	EQU DWORD PTR [EBP+12]
; ValidExch	EQU DWORD PTR [EBP+8]

_SendAbort PROC NEAR            ;
		PUSH EBP                ;
		MOV EBP,ESP             ;

		MOV ESI,OFFSET rgSVC	; Get the address of rgSVC
		MOV ECX,nSVC			; Get the number of Service Descriptors
SAB01:
		CMP DWORD PTR [ESI], 0	; Valid name?
		JE SAB05				; NO, next service

		PUSH ESI				;Save count and pointer to SVC name
		PUSH ECX

		;Push all the params to make the request
		PUSH ESI				;pName
		PUSH 0					;Abort Service Code
		MOV EAX, [EBP+8]		;Exchange
		PUSH EAX
		PUSH OFFSET dJunk		;pHandleRet
		PUSH 0					;npSend
		PUSH 0					;pData0
		PUSH 0					;cbData0
		PUSH 0					;pData1
		PUSH 0					;cbData1
		MOV EAX, [EBP+12]		;JobNum
		PUSH EAX				;dData0
		PUSH 0					;dData1
		PUSH 0					;dData2
		CALL FAR PTR _Request

		POP ECX
		POP ESI
SAB05:
		ADD ESI, sSVC			;Next Service name
		LOOP SAB01
		XOR EAX, EAX
		MOV ESP,EBP             ;
		POP EBP                 ;
		RETN 8                  ;
_SendAbort  ENDP



?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩av成人高清| 日本一区二区成人在线| 亚洲福中文字幕伊人影院| 欧美日韩一区二区在线观看| 亚洲精品成人在线| 欧美日韩综合一区| 久久国产免费看| 久久精品日产第一区二区三区高清版| 国产一区二区0| 亚洲欧美另类小说| 欧美一区欧美二区| 国产·精品毛片| 一区二区三区毛片| 日韩三级伦理片妻子的秘密按摩| 精品一区二区综合| 日韩伦理电影网| 欧美剧在线免费观看网站| 极品瑜伽女神91| 亚洲女人小视频在线观看| 777a∨成人精品桃花网| 国产精华液一区二区三区| 亚洲精品第1页| 精品盗摄一区二区三区| 一本大道久久精品懂色aⅴ| 日韩黄色小视频| 中文字幕一区二区三区在线观看| 欧美天堂一区二区三区| 国产毛片精品视频| 亚洲国产精品尤物yw在线观看| 精品999在线播放| 色噜噜久久综合| 国产一区视频在线看| 亚洲精品一二三| 国产午夜亚洲精品羞羞网站| 欧美视频一区二区三区在线观看| 国产成人综合在线观看| 亚洲成人一区二区| 国产精品久久久久四虎| 91精品国产91综合久久蜜臀| 91视频com| 国产精品一线二线三线精华| 亚洲成人福利片| 亚洲私人黄色宅男| 久久精品一区二区三区不卡牛牛 | 99re亚洲国产精品| 国产一区二区三区在线观看免费视频| 亚洲综合精品久久| 亚洲国产精品av| 精品国产亚洲在线| 欧美日韩国产色站一区二区三区| av在线一区二区三区| 久久66热偷产精品| 五月天视频一区| 亚洲制服丝袜av| 日韩理论电影院| 欧美国产乱子伦 | 日韩二区在线观看| 亚洲午夜久久久久久久久电影院| 国产精品久久久99| 国产欧美日韩三区| 久久久久久久综合| 精品福利一区二区三区免费视频| 欧美一区二区在线观看| 欧美日韩日本视频| 欧美视频一区二区三区四区| 91国偷自产一区二区三区观看| 不卡一区二区三区四区| 成人一级视频在线观看| 国产激情视频一区二区在线观看| 人人狠狠综合久久亚洲| 日产国产欧美视频一区精品 | 日本三级韩国三级欧美三级| 亚洲国产精品久久久久婷婷884| 亚洲精选视频在线| 一区二区三区美女| 午夜影院久久久| 污片在线观看一区二区| 亚洲成人一区二区在线观看| 午夜激情一区二区三区| 天堂在线一区二区| 日韩电影在线观看电影| 日本欧美一区二区三区乱码| 麻豆国产精品777777在线| 久久精品国产精品亚洲综合| 国产主播一区二区三区| 国产成人在线视频播放| 丁香婷婷综合激情五月色| 成人午夜av在线| 色婷婷激情一区二区三区| 在线观看日韩毛片| 欧美一级午夜免费电影| 久久女同性恋中文字幕| 亚洲欧美怡红院| 亚洲一区国产视频| 男男gaygay亚洲| 国产精品456| 一本一道综合狠狠老| 欧美日韩国产综合一区二区三区| 欧美三日本三级三级在线播放| 欧美一区二区在线免费观看| 久久精品一区八戒影视| 综合激情成人伊人| 日韩精品久久久久久| 国产成人精品一区二| 99r国产精品| 日韩一级高清毛片| 国产精品欧美一区喷水| 亚洲成a人在线观看| 精彩视频一区二区三区 | 欧美吻胸吃奶大尺度电影| 欧美电视剧在线看免费| 一区在线中文字幕| 日韩高清欧美激情| 粉嫩嫩av羞羞动漫久久久 | 日韩亚洲欧美高清| 中文字幕国产一区| 亚洲午夜视频在线观看| 精品一区二区三区视频在线观看| 不卡视频在线观看| 日韩一区二区三区免费观看| 亚洲婷婷综合久久一本伊一区 | 国产成人免费在线观看不卡| 欧美午夜精品一区二区三区| 国产喂奶挤奶一区二区三区| 午夜精品久久久| 99久久国产综合色|国产精品| 这里只有精品99re| 国产精品不卡在线| 久久99精品国产| 欧美日高清视频| 国产精品色在线| 精品一二三四区| 欧美日韩一二三区| 国产精品1024久久| 中文乱码免费一区二区| 国产福利精品导航| 综合激情成人伊人| 黄色日韩网站视频| 欧美高清视频www夜色资源网| 中文字幕中文字幕一区二区| 久久精品免费观看| 欧美肥妇毛茸茸| 亚洲综合另类小说| 色综合久久久久| 国产精品国产三级国产a| 国产真实乱子伦精品视频| 678五月天丁香亚洲综合网| 亚洲精品免费在线| 99久久er热在这里只有精品15 | 久久午夜羞羞影院免费观看| 午夜精品影院在线观看| 91久久久免费一区二区| 日本一区二区三区四区在线视频| 激情欧美一区二区三区在线观看| 欧美精品粉嫩高潮一区二区| 亚洲图片欧美色图| 欧美日韩一级片网站| 亚洲一区在线播放| 欧美视频在线播放| 亚洲第一激情av| 88在线观看91蜜桃国自产| 午夜欧美视频在线观看| 欧美日本国产一区| 日产欧产美韩系列久久99| 欧美一区二区三区婷婷月色| 亚洲va中文字幕| 欧美疯狂做受xxxx富婆| 日本一道高清亚洲日美韩| 91精品国产福利| 国产在线精品视频| 国产欧美日韩综合| av不卡在线播放| 一区二区在线观看免费| 91成人在线精品| 三级成人在线视频| 日韩精品一区二区三区三区免费| 精品一区二区三区日韩| 2020国产成人综合网| 成人一区二区三区视频在线观看| 国产精品国产精品国产专区不片| 99视频国产精品| 亚洲一区二区三区四区的| 91精品婷婷国产综合久久竹菊| 另类中文字幕网| 国产精品网站一区| 欧美日韩在线免费视频| 秋霞午夜av一区二区三区| 久久久精品国产免费观看同学| 成人av午夜影院| 亚洲成人精品一区| 精品国产91洋老外米糕| 成人av在线一区二区三区| 亚洲国产日韩精品| wwwwww.欧美系列| 91色porny| 麻豆中文一区二区| 中文字幕中文字幕一区| 欧美一区二区三区影视| 成人精品高清在线| 日韩影院精彩在线|