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

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

?? ext2.asm

?? 這是一個開放源代碼的與WINNT/WIN2K/WIN2003兼容的操作系統
?? ASM
?? 第 1 頁 / 共 2 頁
字號:
Done:
		mov al,0dh
		call PutCharsCallBios
		mov al,0ah
		call PutCharsCallBios
        retn



msgDiskError		db 'Disk error',0
; Sorry, need the space...
;msgAnyKey			db 'Press any key to restart',0
msgAnyKey			db 'Press any key',0

        times 509-($-$$) db 0   ; Pad to 509 bytes

BootPartition			db 0

        dw 0aa55h       ; BootSector signature
        

; End of bootsector
;
; Now starts the extra boot code that we will store
; at sector 1 on a EXT2 volume



LoadRootDirectory:

		mov  eax,EXT2_ROOT_INO			; Put the root directory inode number in EAX
		call Ext2ReadInode				; Read in the inode

		; Point ES:DI to the inode structure at 6000:8000
		push WORD 6000h
		pop  es
		mov  di,8000h
		push di
		push es							; Save these for later

		; Get root directory size from inode structure
		mov  eax,DWORD [es:di+4]
		push eax

		; Now that the inode has been read in load
		; the root directory file data to 0000:8000
		call Ext2ReadEntireFile

		; Since the root directory was loaded to 0000:8000
		; then add 8000h to the root directory's size
		pop  eax
		mov  edx,8000h					; Set EDX to the current offset in the root directory
		add  eax,edx					; Initially add 8000h to the size of the root directory

SearchRootDirectory:
		push edx						; Save current offset in root directory
		push eax						; Save the size of the root directory

		; Now we have to convert the current offset
		; in the root directory to a SEGMENT:OFFSET pair
		mov  eax,edx
		xor  edx,edx
		mov  ecx,16
		div  ecx						; Now AX:DX has segment & offset
		mov  es,ax
		mov  di,dx
		push di							; Save the start of the directory entry
		add  di,byte 8					; Add the offset to the filename
		mov  si,filename
		mov  cl,11
		rep  cmpsb						; Compare the file names
		pop  di
		pop  eax
		pop  edx
		jz   FoundFile

		; Nope, didn't find it in this entry, keep looking
		movzx ecx,WORD [es:di+4]
		add   edx,ecx

		; Check to see if we have reached the
		; end of the root directory
		cmp  edx,eax
		jb   SearchRootDirectory
		jmp  PrintFileNotFound

FoundFile:
		mov  eax,[es:di]				; Get inode number from directory entry
		call Ext2ReadInode				; Read in the inode

		; Point ES:DI to the inode structure at 6000:8000
		pop  es
		pop  di							; These were saved earlier

		mov  cx,[es:di]					; Get the file mode so we can make sure it's a regular file
		and  ch,EXT2_S_IFMT				; Mask off everything but the file type
		cmp  ch,EXT2_S_IFREG			; Make sure it's a regular file
		je   LoadFreeLoader
		jmp  PrintRegFileError

LoadFreeLoader:
        mov  si,msgLoading				; "Loading FreeLoader..." message
        call PutChars					; Display it

		call Ext2ReadEntireFile			; Read freeldr.sys to 0000:8000

        mov  dl,[BYTE bp+BootDrive]
		mov  dh,[BYTE bp+BootPartition]
        push byte 0						; We loaded at 0000:8000
        push WORD 8000h					; We will do a far return to 0000:8000h
        retf							; Transfer control to FreeLoader





; Reads ext2 file data into [0000:8000]
; This function assumes that the file's
; inode has been read in to 6000:8000 *and*
; ES:DI points to 6000:8000
; This will load all the blocks up to
; and including the double-indirect pointers.
; This should be sufficient because it
; allows for ~64MB which is much bigger
; than we need for a boot loader.
Ext2ReadEntireFile:

		; Reset the load segment
		mov  WORD [BYTE bp+Ext2ReadEntireFileLoadSegment],800h

		; Now we must calculate how
		; many blocks to read in
		; We will do this by rounding the
		; file size up to the next block
		; size and then dividing by the block size
		mov  eax,DWORD [BYTE bp+Ext2BlockSizeInBytes]		; Get the block size in bytes
		push eax
		dec  eax											; Ext2BlockSizeInBytes -= 1
		add  eax,DWORD [es:di+4]							; Add the file size
		xor  edx,edx
		pop  ecx											; Divide by the block size in bytes
		div  ecx											; EAX now contains the number of blocks to load
		push eax

		; Make sure the file size isn't zero
		cmp  eax,byte 0
		jnz  Ext2ReadEntireFile2
		jmp  PrintFileSizeError

Ext2ReadEntireFile2:
		; Save the indirect & double indirect pointers
		mov  edx,DWORD [es:di+0x58]							; Get indirect pointer
		mov  [BYTE bp+Ext2InodeIndirectPointer],edx			; Save indirect pointer
		mov  edx,DWORD [es:di+0x5c]							; Get double indirect pointer
		mov  [BYTE bp+Ext2InodeDoubleIndirectPointer],edx	; Save double indirect pointer

		; Now copy the direct pointers to 7000:0000
		; so that we can call Ext2ReadDirectBlocks
		push ds												; Save DS
		push es
		push WORD 7000h
		pop  es
		pop  ds
		mov  si,8028h
		xor  di,di											; DS:SI = 6000:8028 ES:DI = 7000:0000
		mov  cx,24											; Moving 24 words of data
		rep  movsw
		pop  ds												; Restore DS

		; Now we have all the block pointers in the
		; right location so read them in
		pop  eax											; Restore the total number of blocks in this file
		xor  ecx,ecx										; Set the max count of blocks to read to 12
		mov  cl,12											; which is the number of direct block pointers in the inode
		call Ext2ReadDirectBlockList

		; Check to see if we actually have
		; blocks left to read
		cmp  eax,byte 0
		jz   Ext2ReadEntireFileDone

		; Now we have read all the direct blocks in
		; the inode. So now we have to read the indirect
		; block and read all it's direct blocks
		push eax											; Save the total block count
		mov  eax,DWORD [BYTE bp+Ext2InodeIndirectPointer]	; Get the indirect block pointer
		push WORD 7000h
		pop  es
		xor  bx,bx											; Set the load address to 7000:0000
		call Ext2ReadBlock									; Read the block

		; Now we have all the block pointers from the
		; indirect block in the right location so read them in
		pop  eax											; Restore the total block count
		mov  ecx,DWORD [BYTE bp+Ext2PointersPerBlock]		; Get the number of block pointers that one block contains
		call Ext2ReadDirectBlockList

		; Check to see if we actually have
		; blocks left to read
		cmp  eax,byte 0
		jz   Ext2ReadEntireFileDone

		; Now we have read all the direct blocks from
		; the inode's indirect block pointer. So now
		; we have to read the double indirect block
		; and read all it's indirect blocks
		; (whew, it's a good thing I don't support triple indirect blocks)
		mov  [BYTE bp+Ext2BlocksLeftToRead],eax				; Save the total block count
		mov  eax,DWORD [BYTE bp+Ext2InodeDoubleIndirectPointer]	; Get the double indirect block pointer
		push WORD 7800h
		pop  es
		push es												; Save an extra copy of this value on the stack
		xor  bx,bx											; Set the load address to 7000:8000
		call Ext2ReadBlock									; Read the block

		pop  es												; Put 7800h into ES (saved on the stack already)
		xor  di,di

Ext2ReadIndirectBlock:
		mov  eax,DWORD [es:di]								; Get indirect block pointer
		add  di,BYTE 4										; Update DI for next array index
		push es
		push di

		push WORD 7000h
		pop  es
		xor  bx,bx											; Set the load address to 7000:0000
		call Ext2ReadBlock									; Read the indirect block

		; Now we have all the block pointers from the
		; indirect block in the right location so read them in
		mov  eax,DWORD [BYTE bp+Ext2BlocksLeftToRead]		; Restore the total block count
		mov  ecx,DWORD [BYTE bp+Ext2PointersPerBlock]		; Get the number of block pointers that one block contains
		call Ext2ReadDirectBlockList
		mov  [BYTE bp+Ext2BlocksLeftToRead],eax				; Save the total block count
		pop  di
		pop  es

		; Check to see if we actually have
		; blocks left to read
		cmp  eax,byte 0
		jnz  Ext2ReadIndirectBlock

Ext2ReadEntireFileDone:
		ret

; Reads a maximum number of blocks
; from an array at 7000:0000
; and updates the total count
; ECX contains the max number of blocks to read
; EAX contains the number of blocks left to read
; On return:
;  EAX contians the new number of blocks left to read
Ext2ReadDirectBlockList:
		cmp  eax,ecx										; Compare it to the maximum number of blocks to read
		ja   CallExt2ReadDirectBlocks						; If it will take more blocks then just read all of the blocks
		mov  cx,ax											; Otherwise adjust the block count accordingly

CallExt2ReadDirectBlocks:
		sub  eax,ecx										; Subtract the number of blocks being read from the total count
		push eax											; Save the new total count
		call Ext2ReadDirectBlocks
		pop  eax											; Restore the total count
		ret


; Reads a specified number of blocks
; from an array at 7000:0000
; CX contains the number of blocks to read
Ext2ReadDirectBlocks:

		push WORD 7000h
		pop  es
		xor  di,di											; Set ES:DI = 7000:0000

Ext2ReadDirectBlocksLoop:
		mov  eax,[es:di]									; Get direct block pointer from array
		add  di,BYTE 4										; Update DI for next array index

		push cx												; Save number of direct blocks left
		push es												; Save array segment
		push di												; Save array offset
		mov  es,[BYTE bp+Ext2ReadEntireFileLoadSegment]
		xor  bx,bx											; Setup load address for next read

		call Ext2ReadBlock									; Read the block (this updates ES for the next read)

		mov  [BYTE bp+Ext2ReadEntireFileLoadSegment],es		; Save updated ES

		pop  di												; Restore the array offset
		pop  es												; Restore the array segment
		pop  cx												; Restore the number of blocks left

		loop Ext2ReadDirectBlocksLoop

		; At this point all the direct blocks should
		; be loaded and ES (Ext2ReadEntireFileLoadSegment)
		; should be ready for the next read.
		ret



; Displays a file not found error message
; And reboots
PrintFileNotFound:
        mov  si,msgFreeLdr      ; FreeLdr not found message
		jmp short DisplayItAndReboot

; Displays a file size is 0 error
; And reboots
PrintFileSizeError:
        mov  si,msgFileSize     ; Error message
		jmp short DisplayItAndReboot

; Displays a file is not a regular file error
; And reboots
PrintRegFileError:
        mov  si,msgRegFile      ; Error message
DisplayItAndReboot:
        call PutChars           ; Display it
		jmp  Reboot

msgFreeLdr   db 'freeldr.sys not found',0
msgFileSize  db 'File size is 0',0
msgRegFile   db 'freeldr.sys isnt a regular file',0
filename     db 'freeldr.sys'
msgLoading   db 'Loading FreeLoader...',0

        times 1022-($-$$) db 0   ; Pad to 1022 bytes

        dw 0aa55h       ; BootSector signature

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区在线免费观看| 色香色香欲天天天影视综合网| 日韩欧美一级精品久久| 日本在线不卡视频| 精品噜噜噜噜久久久久久久久试看| 久久精品噜噜噜成人88aⅴ| 91精品国产麻豆国产自产在线| 奇米影视在线99精品| 精品国产伦一区二区三区免费| 韩国精品久久久| 国产精品污www在线观看| 91毛片在线观看| 亚洲成人在线免费| 2020国产精品久久精品美国| 国产成人亚洲精品狼色在线| 国产精品传媒在线| 在线观看国产一区二区| 日韩av中文字幕一区二区| 欧美videossexotv100| 高清在线不卡av| 一区二区高清视频在线观看| 欧美老肥妇做.爰bbww| 国内精品久久久久影院色| 国产精品国产自产拍高清av王其| 欧美视频一区二| 激情另类小说区图片区视频区| 中文一区二区在线观看| 欧美精品在线视频| 国产aⅴ综合色| 亚洲成人精品在线观看| 国产性天天综合网| 欧美性感一区二区三区| 国产乱码一区二区三区| 亚洲人成影院在线观看| 日韩欧美二区三区| 91亚洲国产成人精品一区二区三| 日韩二区三区在线观看| 1区2区3区国产精品| 日韩欧美一区二区视频| 91啪亚洲精品| 国产综合久久久久影院| 亚洲伊人伊色伊影伊综合网 | 色综合天天性综合| 蜜桃精品视频在线观看| 中文字幕日本不卡| 久久―日本道色综合久久| 欧美三片在线视频观看| 高清在线观看日韩| 国精品**一区二区三区在线蜜桃| 中文字幕综合网| 国产网站一区二区三区| 91精品婷婷国产综合久久| 91日韩精品一区| 顶级嫩模精品视频在线看| 免费一区二区视频| 亚洲成人动漫在线观看| 亚洲同性gay激情无套| 久久影音资源网| 日韩一区二区免费在线观看| 在线国产电影不卡| 91精品国产91久久综合桃花| 亚洲青青青在线视频| 欧美电视剧在线看免费| 欧美日韩精品专区| 在线亚洲高清视频| 一本久久a久久精品亚洲| 成人永久看片免费视频天堂| 精品一区二区三区在线观看国产| 亚洲丰满少妇videoshd| 亚洲精品国产成人久久av盗摄 | 一本久久综合亚洲鲁鲁五月天 | 日韩福利视频网| 肉肉av福利一精品导航| 亚洲国产成人av| 亚洲一区二区三区四区在线观看 | 国产999精品久久| 精品一区二区久久| 免费看欧美女人艹b| 秋霞成人午夜伦在线观看| 天使萌一区二区三区免费观看| 亚洲五月六月丁香激情| 亚洲午夜影视影院在线观看| 亚洲永久免费视频| 午夜精品一区二区三区电影天堂| 亚洲动漫第一页| 香蕉加勒比综合久久| 亚洲图片自拍偷拍| 亚洲一卡二卡三卡四卡五卡| 亚洲第一成年网| 男女男精品视频网| 久久精品噜噜噜成人av农村| 国产麻豆精品theporn| 国产精品99久久久久久久女警 | 亚洲18影院在线观看| 五月婷婷欧美视频| 日韩国产成人精品| 精品在线一区二区三区| 国产乱人伦偷精品视频免下载| 国产成人在线网站| 91免费国产视频网站| 91黄色在线观看| 欧美精三区欧美精三区| 久久久久久久久久久久久久久99 | 午夜精品久久久久久久| 免费观看日韩av| 国产成人在线色| 在线观看不卡一区| 精品久久久久99| 中文字幕日本乱码精品影院| 五月天久久比比资源色| 精品写真视频在线观看| 91啪在线观看| 欧美成人官网二区| 亚洲欧洲韩国日本视频| 青青草成人在线观看| 国产精品一区在线观看你懂的| 色婷婷久久99综合精品jk白丝| 91精品国产91热久久久做人人| 国产欧美日韩中文久久| 亚洲曰韩产成在线| 国产成人夜色高潮福利影视| 欧美在线三级电影| 久久精品亚洲精品国产欧美kt∨| 亚洲人成亚洲人成在线观看图片| 日本欧美在线观看| 99麻豆久久久国产精品免费优播| 欧美日本免费一区二区三区| 亚洲国产精品99久久久久久久久| 亚洲一区二区四区蜜桃| 国产激情精品久久久第一区二区 | 日韩免费观看高清完整版| 一区视频在线播放| 久久99国产精品久久99果冻传媒| 91黄色免费观看| 国产午夜精品久久| 麻豆精品一区二区av白丝在线| 91丨porny丨首页| 久久影院视频免费| 日韩国产精品91| 欧美在线观看视频一区二区三区| 久久这里只精品最新地址| 日韩制服丝袜av| 色哦色哦哦色天天综合| 国产亚洲一区二区三区| 喷白浆一区二区| 欧美日韩精品一区二区三区四区| 国产精品久久久久久久岛一牛影视| 美女高潮久久久| 欧美麻豆精品久久久久久| 亚洲男人电影天堂| 大尺度一区二区| 久久久久久久电影| 美女在线观看视频一区二区| 欧美在线观看一区| 玉米视频成人免费看| 国产91对白在线观看九色| 精品乱人伦一区二区三区| 日本一不卡视频| 51午夜精品国产| 丝袜a∨在线一区二区三区不卡 | 99久久777色| 中文字幕av不卡| 高清shemale亚洲人妖| 久久久99免费| 国产精品中文字幕欧美| 国产网红主播福利一区二区| 国产精品一区二区在线观看网站| 精品久久久久久久久久久院品网| 精品一区精品二区高清| 欧美电视剧在线观看完整版| 精品一区二区三区免费播放 | 懂色av中文一区二区三区| 国产女主播在线一区二区| 国产成人精品免费视频网站| 久久精品亚洲一区二区三区浴池| 国产精品一区二区久久不卡| 国产亚洲一区字幕| 成人av手机在线观看| 亚洲欧美乱综合| 欧美日韩一级片在线观看| 亚洲二区在线视频| 日韩免费高清电影| 国产成人av影院| 中文字幕一区二区三区在线不卡 | 成人精品视频一区二区三区| 中文字幕在线不卡一区二区三区| 99vv1com这只有精品| 亚洲一二三区在线观看| 5月丁香婷婷综合| 国产精品综合二区| 国产精品国产三级国产有无不卡 | 99久久亚洲一区二区三区青草| 亚洲色欲色欲www在线观看| 在线观看视频欧美| 热久久久久久久| 国产精品污污网站在线观看| 欧亚一区二区三区| 另类小说色综合网站| 亚洲国产精品二十页| 欧美日韩免费一区二区三区视频|