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

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

?? initcode.inc

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

;=============================================================================
;The following code	initializes structures and hardware just after bootup
;THIS CODE MUST BE LAST IN OS CODE SEG. THE MEMORY IT OCCUPIES WILL BE
;DEALLOCATED AFTER INITIALIZATION IF IT IS CONTAINED IN A SEPARATE PAGE.
;=============================================================================
InitFreeLB:
;
; INPUT : ECX,EDX
; OUTPUT : NONE
; REGISTERS : EAX,EBX,ECX,FLAGS
; MODIFIES : pFreeLB,rgLBs
;
; This routine will initialize a free pool of link blocks.
; The data used in this algorithm are an array of ECX link blocks (rgLBs),
; each EDX bytes long and pointer to a list of free link blocks (pFreeLB).
;
; The pFreeLB pointer is set to address the first element in rgLBs. Each
; element of rgLBs is set to point to the next element of rgLBs. The
; last element of rgLBs is set to point to nothing (NIL).
;
		LEA EAX,rgLBs           ; pFreeLB <= ^rgLBs;
		MOV pFreeLB,EAX         ;
LB_Loop:
		MOV EBX,EAX             ; for I = 0 TO ECX
		ADD EAX,EDX             ;   rgLBs[I].Next <=
		MOV [EBX.NextLB],EAX    ;     ^rgLBs[I+1];
		LOOP LB_Loop            ;
		MOV [EBX.NextLB],NIL    ; rgFree[1023].Next <= NIL;
		RETN                    ;
;=============================================================================
; AddTSSDesc
; Builds a descriptor for a task and places it in the GDT.  If you
; check the intel documentation the bits of data that hold this
; information are scattered through the descriptor entry, so
; we have to do some shifting, moving, anding and oring to get
; the descriptor the way the processor expects it.  See the Intel
; docs for a complete description of the placement of the bits.
;
; Note: The granularity bit represents the TSS itself, not the code
; that will run under it!
;
;
; IN:
;	EAX - Size of TSS
;	EBX - Decriptor type (default for OS TSS is 0089h)
;		(0089h - G(0),AV(0),LIM(0000),P(1),DPL(00),(010),B(0),(1))
;	EDX - Address of TSS
;	EDI - Address of Desc in GDT
; OUT:
;	GDT is updated with descriptor
; USED:
;	EFlags  (all other registers are saved)

AddTSSDesc:
		;The following code section builds a descriptor entry for
		;the TSS and places it into the GDT
		PUSH EAX
		PUSH EBX
		PUSH EDX
		PUSH EDI
		DEC EAX                 ; (Limit is size of TSS-1)
	    SHL EBX,16              ; Chinese puzzle rotate
		ROL EDX,16              ; Exchange hi & lo words of Base Addr
		MOV BL,DH               ; Base 31 .. 24
		MOV BH,DL               ; Base 23 .. 16
		ROR EBX,8               ; Rotate to Final Alignment
		MOV DX,AX               ; Limit 15 .. 0 with Base 15 .. 0
		AND EAX,000F0000h       ; Mask Limit 19 .. 16
		OR EBX,EAX              ; OR into high order word
		MOV [EDI],EDX           ; Store lo double word
		MOV [EDI+4],EBX         ; Store hi double word
		POP EDI
		POP EDX
		POP EBX
		POP EAX
		RETN

;=============================================================================
; InitFreeTSS
; INPUT :  EAX, ECX
; OUTPUT : NONE
; USED :   ALL General registers, FLAGS
; MODIFIES : pFreeTSS (and the dynamic array of TSSs)
;
; This routine initializes the free pool of Task State Segments.
; On entry:
;	EAX points to the TSSs to initialize (allocated memory).
;   ECX has the count of TSSs to initialize.
;   The size of the TSS is taken from the constant sTSS.
;
; The pFreeTSS pointer is set to address the first TSS. The NextTSS
; field in each TSS is set to point to the next free TSS. The
; last TSS is set to point to nothing (NIL). The IOBitBase field is
; also set to FFFFh for NULL I/O permissions in each TSS.
; NOTE: The allocated memory area for the TSS MUST BE ZEROED before
; calling this routine.  By deafult, we add the TSS descriptors at OS
; protection level. If we spawn or add a User level TSS we must
; OR the DPL bits with 3!

InitFreeTSS:
		MOV pFreeTSS,EAX        	; First one free to use
		MOV EDI, OFFSET rgTSSDesc	; ptr to TSS descriptors
		ADD EDI, 16					; First two TSSs are Static (Mon & Dbgr)
		MOV EDX, sTSS				; Size of TSS (in bytes) into EDX
		MOV EBX, 3					; Number of first dynamic TSS
TSS_Loop:
		MOV ESI,EAX           		  	; for I = 0 TO ECX
		ADD EAX,EDX             		;   EAX <= rgTSSs[I].Next
		MOV [ESI.NextTSS],EAX   		;     ^rgTSSs[I+1];
		MOV [ESI.TSS_IOBitBase], 0FFFFh	; IOBitBase
		MOV [ESI.TSSNum], BX			; TSS Number
		MOV [ESI.TSS_DS], DataSel		;Set up for Data Selectors
		MOV [ESI.TSS_ES], DataSel
		MOV [ESI.TSS_FS], DataSel
		MOV [ESI.TSS_GS], DataSel
		MOV [ESI.TSS_SS], DataSel
		MOV [ESI.TSS_SS0], DataSel
		PUSH EAX					;Save pTSS
		MOV EAX,EDI            		; Get offset of Curr TssDesc in EAX
		SUB EAX, OFFSET GDT    		; Sub offset of GDT Base to get Sel of TSS
		MOV [ESI.Tid],AX    	    ; Store TSS Selector in TSS (later use)
		PUSH EBX
		PUSH EDX

		MOV EAX,EDX             ; Size of TSS (TSS + SOFTSTATE)
		MOV EDX,ESI             ; Address of TSS
		MOV EBX,0089h           ; G(0),AV(0),LIM(0),P(1),DPL(0),B(0)

		CALL AddTSSDesc

		ADD EDI,8               ; Point to Next GDT Slot (for next one)
		POP EDX
		POP EBX
		POP EAX
		INC EBX					; TSS Number
		LOOP TSS_Loop           ;
		MOV [ESI.NextTSS],NIL   ; rgFree[LastOne].Next <= NIL;
		RETN                    ;

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

InitFreeJCB:
; INPUT : 	EAX - Address of JCBs to be initialized
;			ECX - Count of JCBs
;			EDX - Size of JCBs
; OUTPUT :	NONE
; USED:		EAX,EBX,ECX,EDX,ESI EFLAGS
; MODIFIES: pFreeJCB, pJCBs
;
; This routine will initialize the free pool of Job Control Blocks (JCBs).
; EAX points to the first JCB,
; ECX is count of JCBs,
; EDX is size of each JCB.
;
; The pFreeJCB pointer is set to address the first element in rgJCBs.
; Each element of rgJCBs is set to point to the next element of rgJCBs.
; The last element of rgJCBs is set to point to nothing (NIL).
; The JCBs are also sequentially numbered. We can't use it's position
; in the array because some JCBs are static (Mon and Debugger), while
; others (the ones we are initializing now) are dynamicly allocated.
;
		MOV pFreeJCB,EAX        ;Set up OS pointer to list
		MOV pJCBs, EAX			;Set up global ptr to first JCB
		MOV EBX, 3				;1st number for Dynamic JCBs
JCB_Loop:
	    MOV ESI,EAX             ;EBX has pointer to current one
		ADD EAX,EDX             ;EAX points to next one
		MOV [ESI.NextJCB],EAX   ;Make current point to next
		MOV [ESI.JobNum], EBX	;Number it
		INC EBX
		LOOP JCB_Loop           ;Go back till done
		MOV [ESI.NextJCB],NIL   ;Make last one nil
		RETN                    ;

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

InitFreeRQB:
; INPUT : 	EAX - Address of RQBs to be initialized
;			ECX - Count of JCBs
;			EDX - Size of JCBs
; OUTPUT :	NONE
; USED:		EAX,ECX,EDX,ESI EFLAGS
; MODIFIES: pFreeRQB, pRQBs
;
; This routine will initialize a free pool of Request Blocks (RQBs).
; ECX is count of RQBs to initialize,
; EDX is the size (in bytes), and EAX points to a list of free JCBs (pFreeJCB).
;
; The pFreeRQB pointer is set to address the first element in rgRQBs.
; Each element of rgRQBs is set to point to the next element of rgRQBs.
; The last element of rgRQBs is set to point to nothing (NIL).
; The RqBlk handle used in many calls is its position in the array.
; This can be done because the array of RQBs is allocated dynamically.
;
		MOV pFreeRQB,EAX        ;Set up OS pointer to list
		MOV pRQBs, EAX			;Set up global ptr to first RQB
RQB_Loop:
	    MOV ESI,EAX             ;EBX has pointer to current one
		ADD EAX,EDX             ;EAX points to next one
		MOV [ESI.pNextRQB],EAX  ;Make current point to next
		LOOP RQB_Loop           ;Go back till done
		MOV [ESI.pNextRQB],NIL  ;Make last one nil
		RETN                    ;

;=============================================================================
; This sets IRQ00-0F vectors in the 8259s
; to be Int20 thru 2F.
;
; When the PICUs are initialized, all the hardware interrupts are MASKED.
; Each driver that uses a hardware interrupt(s) is responsible
; for unmasking that particular IRQ.
;
PICU1          EQU 0020h
PICU2          EQU 00A0h

Set8259 PROC NEAR
		MOV AL,00010001b
		OUT PICU1+0,AL          	;ICW1 - MASTER
		jmp $+2
		jmp $+2
		OUT PICU2+0,AL          	;ICW1 - SLAVE
		jmp $+2
		jmp $+2
		MOV AL,20h
		OUT PICU1+1,AL          	;ICW2 - MASTER
		jmp $+2
		jmp $+2
		MOV AL,28h
		OUT PICU2+1,AL          	;ICW2 - SLAVE
		jmp $+2
		jmp $+2
		MOV AL,00000100b
		OUT PICU1+1,AL          	;ICW3 - MASTER
		jmp $+2
		jmp $+2
		MOV AL,00000010b
		OUT PICU2+1,AL          	;ICW3 - SLAVE
		jmp $+2
		jmp $+2
		MOV AL,00000001b
		OUT PICU1+1,AL          	;ICW4 - MASTER
		jmp $+2
		jmp $+2
		OUT PICU2+1,AL          	;ICW4 - SLAVE
		jmp $+2
		jmp $+2
		MOV AL,11111010b			;Masked all but cascade/timer
;		MOV AL,01000000b			;Floppy masked
		OUT PICU1+1,AL          	;MASK - MASTER (0= Ints ON)
		jmp $+2
		jmp $+2
		MOV AL,11111111b
;		MOV AL,00000000b
		OUT PICU2+1,AL          	;MASK - SLAVE
		jmp $+2
		jmp $+2
		RETN
SET8259	ENDP

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

InitMemMgmt:
;IN:   Nothing
;OUT:  Nothing (except that you can use memory management routines now!)
;USED: ALL REGISTERS ARE USED.
;
; This section finds out how much memory we have (in MBs) by writing
; to the highest DWord in each meg until it fails a readback test.
; It sets nPages Free after finding out just how much we have.
; We assume 1MB to start (which means we start at 2Mb (1FFFFC).
; It places the highest addressable offset in GLOBAL oMemMax.
; We also calculate the number of pages of physical memory this
; is and store it in the GLOBAL nPagesFree.

		MOV _nPagesFree, 256	;1 Mb of pages = 256
		MOV EAX,1FFFFCh         ;top of 2 megs (for DWORD)
		XOR EBX,EBX				;
		MOV ECX,06D72746CH      ;'mrtl' test string value for memory
MEMLoop:
		MOV DWORD PTR [EAX],0h	;Set it to zero intially
		MOV DWORD PTR [EAX],ECX	;Move in test string
		MOV EBX,DWORD PTR [EAX]	;Read test string into EBX
		CMP EBX,ECX				;See if we got it back OK
		JNE MemLoopEnd			;NO!
		ADD EAX,3				;Yes, oMemMax must be last byte
		MOV _oMemMax,EAX		;Set oMemMax
		SUB EAX,3				;Make it the last DWord again
		ADD EAX,100000h			;Next Meg
		ADD _nPagesFree, 256	;Another megs worth of pages
		ADD sPAM, 32			;Increase PAM by another meg
		CMP EAX,3FFFFFCh        ;Are we above 64 megs
		JAE MemLoopEnd			;Yes!
		XOR EBX,EBX				;Zero out for next meg test
		JMP MemLoop
MemLoopEnd:

; Page Allocation Map is now sized and ZEROed
; Now we must fill in bits used by OS which was just loaded and
; the Video RAM and Boot ROM (neither of which we consider free).
; This also fills out each of the Page Table Entries (PTEs) for the
; initial OS code and data.  Note that linear address match physical
; address for the initial OS data and code (its the law!)

; This first part MARKS the OS code and data pages as used
; and makes PTEs.
;
		MOV EDX, OFFSET pTbl1		;EDX points to OS Page Table 1
		XOR EAX, EAX				;Point to 1st physical/linear page (0)
IMM001:
		MOV [EDX], EAX				;Make Page Table Entry
		AND DWORD PTR [EDX], 0FFFFF000h 	;Leave upper 20 Bits
		OR	DWORD PTR [EDX], 0001h 			;Supervisor, Present
		MOV EBX, EAX
		CALL MarkPage				;Marks page in PAM
		ADD EDX, 4					;Next table entry
		ADD EAX, 4096
		CMP EAX, 24000h				;Reserve 128K for OS (for now)
		JAE SHORT IMM002
		JMP SHORT IMM001			;Go for more

; Now we fill in PAM and PTEs for Video and ROM slots.
; This covers A0000 thru 0FFFFFh (upper 384K of first Meg).
; Right now we just mark everything from A0000 to FFFFF as used.
; This routine could be expanded to search through the ROM pages of
; ISA memory (C0000 -FFFFF) finding the unaccessable ones and marking
; them as allocated in the PAM. Several chip sets on the market allow
; you to set ROM areas as useable RAM (such as the 82C30 C&T).  But we
; can't be sure everyone can do it, nor can we provide instructions
; to everyone.

IMM002:
		MOV EAX, 0A0000h			;Points to 128K Video & 256K ROM area
		MOV EBX, EAX				;
		SHR EBX, 10					;Make it index (SHR 12, SHL 2)
		MOV EDX, OFFSET pTbl1		;EDX pts to Page Table
		ADD EDX, EBX
IMM003:
		MOV [EDX], EAX					;Make Page Table Entry
		AND DWORD PTR [EDX], 0FFFFF000h ;Leave upper 20 Bits
		OR	DWORD PTR [EDX], 0101b 		;Mark it "User" "ReadOnly" & "Present"
		MOV EBX, EAX				;Setup for MarkPage call
		CALL MarkPage				;Mark it used in the PAM
		ADD EDX, 4					;Next PTE entry
		ADD EAX, 4096				;Next page please
		CMP EAX, 100000h			;1Mb yet?
		JAE IMM004					;Yes
		JMP SHORT IMM003			;No, go back for more

; Initial Page Directory and the Page Table are static.
; Now we can go into PAGED Memory mode.  This is done by loading
; CR3 with the physcial address of the Page Directory, then reading
; CR0, ANDing it with 8000000h and then writing it again.
; After the MOV CR0 we must JMP to clear the prefetch queue of
; any bogus physical addresses.

IMM004:
		MOV EAX, OFFSET PDir1  ;Physical address of OS page directory
		MOV CR3, EAX		;Store in Control Reg 3
		MOV EAX, CR0		;Get Control Reg 0
		OR  EAX, 80000000h	;Set paging bit ON
		MOV CR0, EAX		;Store Control Reg 0
		JMP IM0005			;Clear prefetch queue
IM0005:
;
; Now we allocate an Exchange that the OS uses for a semaphore
; use to prevent reentrant use of the any of the critical
; memory managment functions.
;
		LEA EAX, MemExch		;Alloc Semaphore Exch for Memory calls
		PUSH EAX
		CALL FAR PTR _AllocExch

		PUSH MemExch				;Send a dummy message to pick up
		PUSH 0FFFFFFF1h
		PUSH 0FFFFFFF1h
		CALL FAR PTR _SendMsg

		RETN				;Done initializing memory managment
;
;=============================================================================
; InitCallGates inits the array of call gates with an entry to a generic
; handler that returns ErcNotInstalled when called. This prevents new code
; running on old MMURTLs or systems where special call gates don't exist
; without crashing horribly.
;
; IN: Nothing
; Out : Nothing
; Used : ALL registers and flags
;
InitCallGates:
		MOV ECX, nCallGates		;Number of callgates to init
InitCG01:
		PUSH ECX
		DEC ECX					;make it an index, not the count
		SHL ECX, 3				;
		ADD ECX, 40h			;Now ecx is selector number
		MOV EAX, 0EC00h			;DPL 3, 0 Params
		MOV DX, OSCodeSel
		MOV ESI, OFFSET DummyCall
		CALL FAR PTR _AddCallGate
		POP ECX					;ignore error...
		LOOP InitCG01
		RETN

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品伦理在线| 久久成人av少妇免费| 日韩经典中文字幕一区| 国产成a人亚洲| 51精品国自产在线| 亚洲素人一区二区| 国产一区二区三区四| 欧美色视频在线观看| 国产日韩欧美电影| 麻豆精品一区二区av白丝在线| 91丨九色丨国产丨porny| 久久这里只有精品6| 日本aⅴ亚洲精品中文乱码| 在线一区二区视频| 中文字幕一区三区| 成人一级片在线观看| 欧美tickling网站挠脚心| 午夜亚洲国产au精品一区二区| 成人app下载| 国产日韩欧美在线一区| 国产精品亚洲第一区在线暖暖韩国| 欧美精品高清视频| 日韩一区二区三区电影在线观看| 国产日产欧美一区二区三区| 久久精品av麻豆的观看方式| 欧美视频日韩视频在线观看| 亚洲精品欧美综合四区| 成人免费视频免费观看| 久久精品视频在线看| 国产乱人伦精品一区二区在线观看| 日韩欧美中文字幕精品| 欧美aaaaaa午夜精品| 欧美一区二区在线免费观看| 首页国产欧美久久| 91精品国产一区二区三区蜜臀| 天堂在线一区二区| 欧美一二三区在线| 久久精工是国产品牌吗| 精品美女一区二区| 极品销魂美女一区二区三区| 26uuu欧美日本| 福利一区二区在线| 中文字幕在线一区免费| 色综合久久综合中文综合网| 一区二区三区日本| 欧美一级日韩一级| 国产一区91精品张津瑜| 国产精品毛片高清在线完整版| 99久久免费国产| 亚洲一区视频在线| 日韩精品在线看片z| 国产电影一区二区三区| 日韩美女视频19| 欧美日韩国产bt| 久久99久久精品欧美| 久久久久久久久久久久久久久99| www.欧美.com| 日韩精品免费专区| 欧美经典一区二区| 欧美在线一二三| 久久99精品国产.久久久久| 国产欧美视频一区二区| 91福利国产精品| 麻豆视频观看网址久久| 亚洲天堂av老司机| 日韩美女视频在线| 91欧美激情一区二区三区成人| 视频一区二区国产| 国产午夜三级一区二区三| 在线观看国产日韩| 激情五月激情综合网| 亚洲精选视频免费看| 日韩美女在线视频| 欧美视频中文字幕| 国产高清久久久| 日韩不卡免费视频| 亚洲人亚洲人成电影网站色| 日韩免费一区二区| 欧美色综合网站| 成人涩涩免费视频| 久久草av在线| 亚洲国产综合在线| 国产精品麻豆欧美日韩ww| 日韩一区二区三区在线| 91麻豆精品在线观看| 毛片一区二区三区| 亚洲天堂成人在线观看| 久久老女人爱爱| 欧美日韩国产中文| 一本大道久久a久久精二百| 另类小说视频一区二区| 亚洲一区在线视频观看| 欧美高清在线视频| 久久免费精品国产久精品久久久久| 色吊一区二区三区| 99久久精品免费观看| 国产精品亚洲一区二区三区妖精 | 成人精品在线视频观看| 麻豆精品在线观看| 日韩av不卡在线观看| 一区二区三区中文字幕电影| 国产精品日韩成人| 欧美激情一区二区三区全黄| 久久精品一区二区三区不卡牛牛| 日韩一区二区在线看片| 欧美在线观看18| 日本韩国一区二区| 色综合激情久久| 91免费看片在线观看| 成人av网在线| av成人免费在线观看| 成人性生交大合| 北条麻妃国产九九精品视频| 成人性生交大片| 波多野结衣亚洲| 99久久久免费精品国产一区二区 | 国产欧美日韩精品一区| 欧美精品一区二区三区蜜臀 | 欧美性猛交xxxxxxxx| 欧美午夜精品久久久久久孕妇| 色综合天天综合在线视频| 色婷婷综合激情| 色猫猫国产区一区二在线视频| 一本一道久久a久久精品综合蜜臀| 97精品久久久久中文字幕| av成人老司机| 91久久奴性调教| 欧美性一二三区| 欧美一区二区在线视频| 久久一二三国产| 亚洲国产高清aⅴ视频| 国产精品高潮久久久久无| 成人免费小视频| 亚洲国产欧美在线人成| 日本美女一区二区三区| 精品一二三四区| 成人av网址在线观看| 91福利视频网站| 欧美成人激情免费网| 国产午夜一区二区三区| 日韩理论电影院| 日韩精品免费专区| 国产精品一区二区久激情瑜伽| av亚洲精华国产精华精| 欧美日韩一区二区三区不卡| 精品久久一区二区| 中文字幕一区二区三区视频| 亚洲成人免费视频| 国产乱码精品1区2区3区| 91免费在线看| 日韩欧美二区三区| 一区精品在线播放| 婷婷激情综合网| 不卡的电视剧免费网站有什么| 欧美色精品在线视频| 久久综合九色综合97婷婷女人| 亚洲欧洲av色图| 蜜臀精品久久久久久蜜臀| 成人精品免费看| 91.xcao| 国产精品视频免费| 免费成人在线网站| 色视频欧美一区二区三区| 欧美成va人片在线观看| 一区二区三区久久| 国产精品系列在线观看| 欧美日韩成人激情| 中文字幕日韩精品一区| 美女被吸乳得到大胸91| 欧美视频精品在线| 国产精品久久久久一区| 黄页视频在线91| 91精品国产综合久久精品图片| 国产精品久久久久桃色tv| 蜜桃久久av一区| 欧美在线不卡视频| 国产精品久久久久7777按摩| 久久99精品久久久久久| 91精品国产麻豆国产自产在线| 中文字幕一区二区三区四区| 国产一区二区伦理片| 91精品国产色综合久久不卡电影| 亚洲欧美视频在线观看视频| 国产成人在线免费观看| 日韩精品一区二区三区中文精品| 亚洲中国最大av网站| 91麻豆文化传媒在线观看| 国产偷国产偷亚洲高清人白洁| 日本va欧美va精品| 91精品久久久久久久久99蜜臂| 亚洲一区二区三区小说| 日本高清无吗v一区| 国产精品久久午夜| 国产成人在线色| 中文字幕av资源一区| 成人午夜在线免费| 国产精品欧美一区喷水| 成人综合婷婷国产精品久久蜜臀| 26uuu精品一区二区在线观看| 久久福利视频一区二区|