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

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

?? ext2.asm

?? 一個類似windows
?? ASM
?? 第 1 頁 / 共 2 頁
字號:
; EXT2.ASM
; EXT2 Boot Sector
; Copyright (c) 2002, 2003 Brian Palmer

; [bp-0x04] Here we will store the number of sectors per track
; [bp-0x08] Here we will store the number of heads
; [bp-0x0c] Here we will store the size of the disk as the BIOS reports in CHS form
; [bp-0x10] Here we will store the number of LBA sectors read

SECTORS_PER_TRACK		equ	0x04
NUMBER_OF_HEADS			equ	0x08
BIOS_CHS_DRIVE_SIZE		equ	0x0C
LBA_SECTORS_READ		equ	0x10


EXT2_ROOT_INO			equ 2
EXT2_S_IFMT				equ	0f0h
EXT2_S_IFREG			equ 080h


org 7c00h

segment .text

bits 16

start:
        jmp short main
        nop

BootDrive				db 0x80
;BootPartition			db 0					; Moved to end of boot sector to have a standard format across all boot sectors
;SectorsPerTrack		db 63					; Moved to [bp-SECTORS_PER_TRACK]
;NumberOfHeads			dw 16					; Moved to [bp-NUMBER_OF_HEADS]
;BiosCHSDriveSize		dd (1024 * 1024 * 63)	; Moved to [bp-BIOS_CHS_DRIVE_SIZE]
;LBASectorsRead			dd 0					; Moved to [bp-LBA_SECTORS_READ]

Ext2VolumeStartSector	dd 263088				; Start sector of the ext2 volume
Ext2BlockSize			dd 2					; Block size in sectors
Ext2BlockSizeInBytes	dd 1024					; Block size in bytes
Ext2PointersPerBlock	dd 256					; Number of block pointers that can be contained in one block
Ext2GroupDescPerBlock	dd 32					; Number of group descriptors per block
Ext2FirstDataBlock		dd 1					; First data block (1 for 1024-byte blocks, 0 for bigger sizes)
Ext2InodesPerGroup		dd 2048					; Number of inodes per group
Ext2InodesPerBlock		dd 8					; Number of inodes per block

Ext2ReadEntireFileLoadSegment:
	dw	0
Ext2InodeIndirectPointer:
	dd	0
Ext2InodeDoubleIndirectPointer:
	dd	0
Ext2BlocksLeftToRead:
	dd	0

main:
        xor ax,ax               ; Setup segment registers
        mov ds,ax               ; Make DS correct
        mov es,ax               ; Make ES correct
        mov ss,ax				; Make SS correct
		mov bp,7c00h
        mov sp,7b00h            ; Setup a stack


		cmp BYTE [BYTE bp+BootDrive],BYTE 0xff	; If they have specified a boot drive then use it
		jne GetDriveParameters

        mov [BYTE bp+BootDrive],dl				; Save the boot drive


GetDriveParameters:
		mov  ah,08h
		mov  dl,[BYTE bp+BootDrive]					; Get boot drive in dl
		int  13h									; Request drive parameters from the bios
		jnc  CalcDriveSize							; If the call succeeded then calculate the drive size

		; If we get here then the call to the BIOS failed
		; so just set CHS equal to the maximum addressable
		; size
		mov  cx,0ffffh
		mov  dh,cl

CalcDriveSize:
		; Now that we have the drive geometry
		; lets calculate the drive size
		mov  bl,ch								; Put the low 8-bits of the cylinder count into BL
		mov  bh,cl								; Put the high 2-bits in BH
		shr  bh,6								; Shift them into position, now BX contains the cylinder count
		and  cl,3fh								; Mask off cylinder bits from sector count
		; CL now contains sectors per track and DH contains head count
		movzx eax,dh							; Move the heads into EAX
		movzx ebx,bx							; Move the cylinders into EBX
		movzx ecx,cl							; Move the sectors per track into ECX
		inc   eax								; Make it one based because the bios returns it zero based
		mov   [BYTE bp-NUMBER_OF_HEADS],eax		; Save number of heads
		mov   [BYTE bp-SECTORS_PER_TRACK],ecx	; Save number of sectors per track
		inc   ebx								; Make the cylinder count one based also
		mul   ecx								; Multiply heads with the sectors per track, result in edx:eax
		mul   ebx								; Multiply the cylinders with (heads * sectors) [stored in edx:eax already]

		; We now have the total number of sectors as reported
		; by the bios in eax, so store it in our variable
		mov   [BYTE bp-BIOS_CHS_DRIVE_SIZE],eax


LoadExtraBootCode:
		; First we have to load our extra boot code at
		; sector 1 into memory at [0000:7e00h]
		;mov  eax,01h
		xor  eax,eax
		inc  eax								; Read logical sector 1, EAX now = 1
		mov  cx,1								; Read one sector
		mov  bx,7e00h							; Read sector to [0000:7e00h]
		call ReadSectors

		jmp  LoadRootDirectory



; Reads ext2 group descriptor into [7000:8000]
; We read it to this arbitrary location so
; it will not cross a 64k boundary
; EAX has group descriptor number to read
Ext2ReadGroupDesc:
		shl   eax,5										; Group = (Group * sizeof(GROUP_DESCRIPTOR) /* 32 */)
		xor   edx,edx
		div   DWORD [BYTE bp+Ext2GroupDescPerBlock]		; Group = (Group / Ext2GroupDescPerBlock)
		add   eax,DWORD [BYTE bp+Ext2FirstDataBlock]	; Group = Group + Ext2FirstDataBlock + 1
		inc   eax										; EAX now has the group descriptor block number
														; EDX now has the group descriptor offset in the block

		; Adjust the read offset so that the
		; group descriptor is read to 7000:8000
		mov   ebx,78000h
		sub   ebx,edx
		shr   ebx,4
		mov   es,bx
		xor   bx,bx


		; Everything is now setup to call Ext2ReadBlock
		; Instead of using the call instruction we will
		; just put Ext2ReadBlock right after this routine

; Reads ext2 block into [ES:BX]
; EAX has logical block number to read
Ext2ReadBlock:
		mov   ecx,DWORD [BYTE bp+Ext2BlockSize]
		mul   ecx
		jmp   ReadSectors

; Reads ext2 inode into [6000:8000]
; We read it to this arbitrary location so
; it will not cross a 64k boundary
; EAX has inode number to read
Ext2ReadInode:
		dec   eax										; Inode = Inode - 1
		xor   edx,edx
		div   DWORD [BYTE bp+Ext2InodesPerGroup]		; Inode = (Inode / Ext2InodesPerGroup)
		mov   ebx,eax									; EBX now has the inode group number
		mov   eax,edx
		xor   edx,edx
		div   DWORD [BYTE bp+Ext2InodesPerBlock]		; Inode = (Inode / Ext2InodesPerBlock)
		shl   edx,7										; FIXME: InodeOffset *= 128 (make the array index a byte offset)
														; EAX now has the inode offset block number from inode table
														; EDX now has the inode offset in the block

		; Save the inode values and put the group
		; descriptor number in EAX and read it in
		push  edx
		push  eax
		mov   eax,ebx
		call  Ext2ReadGroupDesc

		; Group descriptor has been read, now
		; grab the inode table block number from it
		push  WORD 7000h
		pop   es
		mov   di,8008h
		pop   eax										; Restore inode offset block number from stack
		add   eax,DWORD [es:di]							; Add the inode table start block

		; Adjust the read offset so that the
		; inode we want is read to 6000:8000
		pop   edx										; Restore inode offset in the block from stack
		mov   ebx,68000h
		sub   ebx,edx
		shr   ebx,4
		mov   es,bx
		xor   bx,bx

		call  Ext2ReadBlock
		ret


; Reads logical sectors into [ES:BX]
; EAX has logical sector number to read
; CX has number of sectors to read
ReadSectors:
        add  eax,DWORD [BYTE bp+Ext2VolumeStartSector]	; Add the start of the volume
		cmp  eax,DWORD [BYTE bp-BIOS_CHS_DRIVE_SIZE]	; Check if they are reading a sector outside CHS range
		jae  ReadSectorsLBA						; Yes - go to the LBA routine
												; If at all possible we want to use LBA routines because
												; They are optimized to read more than 1 sector per read

		pushad									; Save logical sector number & sector count

CheckInt13hExtensions:							; Now check if this computer supports extended reads
		mov  ah,0x41							; AH = 41h
		mov  bx,0x55aa							; BX = 55AAh
		mov  dl,[BYTE bp+BootDrive]				; DL = drive (80h-FFh)
		int  13h								; IBM/MS INT 13 Extensions - INSTALLATION CHECK
		jc   ReadSectorsCHS						; CF set on error (extensions not supported)
		cmp  bx,0xaa55							; BX = AA55h if installed
		jne  ReadSectorsCHS
		test cl,1								; CX = API subset support bitmap
		jz   ReadSectorsCHS						; Bit 0, extended disk access functions (AH=42h-44h,47h,48h) supported

		popad									; Restore sector count & logical sector number

ReadSectorsLBA:
		pushad									; Save logical sector number & sector count

		cmp  cx,byte 64							; Since the LBA calls only support 0x7F sectors at a time we will limit ourselves to 64
		jbe  ReadSectorsSetupDiskAddressPacket	; If we are reading less than 65 sectors then just do the read
		mov  cx,64								; Otherwise read only 64 sectors on this loop iteration

ReadSectorsSetupDiskAddressPacket:
		mov  [BYTE bp-LBA_SECTORS_READ],cx
		mov  WORD [BYTE bp-LBA_SECTORS_READ+2],0
		o32 push byte 0
		push eax								; Put 64-bit logical block address on stack
		push es									; Put transfer segment on stack
		push bx									; Put transfer offset on stack
		push cx									; Set transfer count
		push byte 0x10							; Set size of packet to 10h
		mov  si,sp								; Setup disk address packet on stack


        mov  dl,[BYTE bp+BootDrive]				; Drive number
		mov  ah,42h								; Int 13h, AH = 42h - Extended Read
		int  13h								; Call BIOS
		jc   PrintDiskError						; If the read failed then abort

		add  sp,byte 0x10						; Remove disk address packet from stack

		popad									; Restore sector count & logical sector number

		push bx
		mov  ebx,DWORD [BYTE bp-LBA_SECTORS_READ]
        add  eax,ebx							; Increment sector to read
		shl  ebx,5
        mov  dx,es
        add  dx,bx								; Setup read buffer for next sector
        mov  es,dx
		pop  bx

		sub  cx,[BYTE bp-LBA_SECTORS_READ]
        jnz  ReadSectorsLBA						; Read next sector

        ret


; Reads logical sectors into [ES:BX]
; EAX has logical sector number to read
; CX has number of sectors to read
ReadSectorsCHS:
		popad										; Get logical sector number & sector count off stack

ReadSectorsCHSLoop:
        pushad
        xor   edx,edx
		mov   ecx,DWORD [BYTE bp-SECTORS_PER_TRACK]
		div   ecx									; Divide logical by SectorsPerTrack
        inc   dl									; Sectors numbering starts at 1 not 0
		mov   cl,dl									; Sector in CL
		mov   edx,eax
		shr   edx,16
        div   WORD [BYTE bp-NUMBER_OF_HEADS]		; Divide logical by number of heads
        mov   dh,dl									; Head in DH
        mov   dl,[BYTE bp+BootDrive]				; Drive number in DL
        mov   ch,al									; Cylinder in CX
        ror   ah,2									; Low 8 bits of cylinder in CH, high 2 bits
                									;  in CL shifted to bits 6 & 7
        or    cl,ah									; Or with sector number
        mov   ax,0201h
        int   13h    ; DISK - READ SECTORS INTO MEMORY
                     ; AL = number of sectors to read, CH = track, CL = sector
                     ; DH = head, DL    = drive, ES:BX -> buffer to fill
                     ; Return: CF set on error, AH =    status (see AH=01h), AL    = number of sectors read

        jc    PrintDiskError						; If the read failed then abort

        popad

        inc   eax									; Increment Sector to Read

        mov   dx,es
        add   dx,byte 20h							; Increment read buffer for next sector
        mov   es,dx

        loop  ReadSectorsCHSLoop					; Read next sector

        ret   




; Displays a disk error message
; And reboots
PrintDiskError:
        mov  si,msgDiskError			; Bad boot disk message
        call PutChars					; Display it

Reboot:
        mov  si,msgAnyKey				; Press any key message
        call PutChars					; Display it
        xor ax,ax       
        int 16h							; Wait for a keypress
        int 19h							; Reboot

PutChars:
        lodsb
        or al,al
        jz short Done
		call PutCharsCallBios
        jmp short PutChars
PutCharsCallBios:
        mov ah,0eh
        mov bx,07h
        int 10h
		retn

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品国产自产拍高清av| 欧美国产欧美综合| 久久欧美中文字幕| 亚洲视频在线一区| 开心九九激情九九欧美日韩精美视频电影| 国产在线国偷精品产拍免费yy| 91视频91自| 国产视频一区二区三区在线观看| 亚洲高清不卡在线| 成人国产一区二区三区精品| 日韩一级免费一区| 午夜精品一区二区三区免费视频| 91影院在线观看| 国产欧美日韩在线看| 精东粉嫩av免费一区二区三区| 日本电影亚洲天堂一区| 国产精品福利av| 粉嫩欧美一区二区三区高清影视| 日韩亚洲欧美成人一区| 亚洲va韩国va欧美va| 99久精品国产| 国产精品乱码人人做人人爱| 国产成人综合在线| 久久精品在这里| 国产又黄又大久久| 精品国产成人系列| 看电影不卡的网站| 欧美大片在线观看| 蜜桃av一区二区在线观看| 91精品国产色综合久久ai换脸| 亚洲在线中文字幕| 欧美日韩一级视频| 亚洲国产综合视频在线观看| 91官网在线免费观看| 亚洲线精品一区二区三区| 欧洲另类一二三四区| 亚洲与欧洲av电影| 欧美日韩国产精选| 麻豆精品久久久| 日韩美女一区二区三区| 久久99精品国产.久久久久| 日韩精品一区二区三区视频播放| 奇米精品一区二区三区在线观看一| 欧美狂野另类xxxxoooo| 免费高清在线视频一区·| 日韩欧美一二三四区| 国产一区二区三区不卡在线观看| 久久精品一区二区三区av| 风流少妇一区二区| 亚洲人成伊人成综合网小说| 欧美天天综合网| 青青草国产成人99久久| 国产亚洲一本大道中文在线| 99久久精品免费精品国产| 亚洲免费av观看| 日本韩国精品在线| 秋霞电影网一区二区| 精品美女在线播放| 波多野结衣的一区二区三区| 亚洲一级二级在线| 精品国产区一区| proumb性欧美在线观看| 亚洲国产一区二区视频| 精品欧美久久久| 91色.com| 久久97超碰国产精品超碰| 国产欧美精品一区二区色综合 | 亚洲制服丝袜一区| 欧美一区二区精品| av午夜一区麻豆| 午夜国产精品一区| 国产精品理伦片| 777欧美精品| 成人av在线一区二区三区| 亚洲gay无套男同| 色综合久久六月婷婷中文字幕| 91网站在线播放| 狠狠色丁香久久婷婷综| 麻豆精品新av中文字幕| 亚洲欧洲av在线| 欧美一区二区三区免费视频| 成人深夜福利app| 亚洲一区在线播放| 国产午夜精品一区二区| 在线看不卡av| 国产99久久精品| 久久99久久久久久久久久久| 一区二区三区**美女毛片| 久久噜噜亚洲综合| 制服丝袜国产精品| 在线亚洲精品福利网址导航| 福利一区二区在线| 日本不卡高清视频| 亚洲少妇30p| 国产精品色在线| 精品日本一线二线三线不卡| 欧美在线观看视频一区二区三区| 国产女人18毛片水真多成人如厕| 亚洲综合视频网| 日本乱码高清不卡字幕| 成人综合婷婷国产精品久久蜜臀 | 欧美一卡2卡3卡4卡| 91啪亚洲精品| 国产成人精品在线看| 久久99国产精品久久99 | 国产高清精品网站| 精品一区二区免费| 午夜一区二区三区在线观看| 亚洲欧美在线高清| 欧美激情在线看| 亚洲国产精华液网站w| 久久精品欧美日韩精品| 国产欧美日韩一区二区三区在线观看| 日韩精品一区二区三区在线播放| 91麻豆精品国产91久久久| 欧美色图免费看| 91精品久久久久久蜜臀| 精品剧情v国产在线观看在线| 欧美mv和日韩mv的网站| www.亚洲色图| 日本不卡中文字幕| 亚洲素人一区二区| 国产精品国产三级国产aⅴ原创 | 亚洲亚洲精品在线观看| 一区二区三区在线免费| 亚洲欧美电影院| 亚洲激情网站免费观看| 亚洲最色的网站| 亚洲成a人在线观看| 日韩av一级电影| 经典三级视频一区| 成人午夜激情在线| 91香蕉视频mp4| 欧美日韩国产综合草草| 欧美一级艳片视频免费观看| 欧美精品一区二区三区蜜桃视频| 精品成人一区二区三区四区| 欧美国产乱子伦| 自拍偷在线精品自拍偷无码专区| 一区二区三区产品免费精品久久75| 亚洲精品国产精品乱码不99| 亚洲成人综合视频| 精品一区二区三区不卡| 成人午夜激情影院| 欧美日韩精品高清| 精品国免费一区二区三区| 国产精品视频一二三区| 亚洲一区中文日韩| 精品一区二区三区在线观看国产| 国产精品夜夜嗨| 欧美午夜不卡在线观看免费| 欧美一区二区三区思思人| 久久九九影视网| 亚洲一区成人在线| 国产精品一线二线三线| 欧美视频在线不卡| 国产三级一区二区| 亚洲电影在线免费观看| 国产精品亚洲专一区二区三区| 一本大道综合伊人精品热热 | 国产片一区二区三区| 亚洲福利一区二区三区| 国产不卡免费视频| 欧美精品色综合| 国产精品福利av| 精品一区二区三区久久| 欧美视频一区在线| 成人欧美一区二区三区视频网页| 日韩—二三区免费观看av| 91在线观看高清| 久久久噜噜噜久噜久久综合| 亚洲国产另类精品专区| 成人av电影在线| 欧美精品一区二区三区蜜桃视频 | 蜜臀av一区二区在线免费观看| 99久久夜色精品国产网站| 精品99一区二区三区| 首页欧美精品中文字幕| 97成人超碰视| 怡红院av一区二区三区| 在线观看亚洲a| 天天影视涩香欲综合网| 亚洲永久免费视频| 懂色av噜噜一区二区三区av| 樱桃视频在线观看一区| 99riav一区二区三区| 欧美一区二区三区四区久久| 成人亚洲一区二区一| 一区二区国产盗摄色噜噜| 欧美电影免费观看完整版| 色八戒一区二区三区| 五月婷婷激情综合| 精品国产成人在线影院| 99国产精品一区| 麻豆精品一二三| 久久成人羞羞网站| 亚洲美女免费在线| 亚洲色欲色欲www| 精品久久久久久久久久久久久久久| www.亚洲色图.com|