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

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

?? boot.s

?? 簡單的操作系統(tǒng)源代碼
?? S
字號:
/* chapter2/2/boot.S   Author: Wenbo Yang <solrex@gmail.com> <http://solrex.cn>   This file is part of the source code of book "Write Your Own OS with Free   and Open Source Software". Homepage @ <http://share.solrex.cn/WriteOS/>.   This file is licensed under the GNU General Public License; either   version 3 of the License, or (at your option) any later version. */.code16.set    BaseOfStack,     0x7c00    /* Stack base address, inner */.set    BaseOfLoader,    0x9000    /* Section loading address of LOADER.BIN */.set    OffsetOfLoader,  0x0100    /* Loading offset of LOADER.BIN */.set    RootDirSectors,  14        /* Root directory sector count */.set    SecNoOfRootDir,  19        /* 1st sector of root directory */.set    SecNoOfFAT1,     1         /* 1st sector of FAT1 */.set    DeltaSecNo,      17        /* BPB_(RsvdSecCnt+NumFATs*FATSz) -2 *//* Start sector of file space =*/.text/* Floppy header of FAT12 */    jmp     LABEL_START /* Start to boot. */    nop                 /* nop required */BS_OEMName:         .ascii  "WB. YANG"    /* OEM String, 8 bytes required */BPB_BytsPerSec:     .2byte  512           /* Bytes per sector */BPB_SecPerCluster:  .byte   1             /* Sector per cluster */BPB_ResvdSecCnt:    .2byte  1             /* Reserved sector count */BPB_NumFATs:        .byte   2             /* Number of FATs */BPB_RootEntCnt:     .2byte  224           /* Root entries count */BPB_TotSec16:       .2byte  2880          /* Total sector number */BPB_Media:          .byte   0xf0          /* Media descriptor */BPB_FATSz16:        .2byte  9             /* FAT size(sectors) */BPB_SecPerTrk:      .2byte  18            /* Sector per track */BPB_NumHeads:       .2byte  2             /* Number of magnetic heads */BPB_HiddSec:        .4byte  0             /* Number of hidden sectors */BPB_TotSec32:       .4byte  0             /* If TotSec16 equal 0, this works */BS_DrvNum:          .byte   0             /* Driver number of interrupt 13 */BS_Reserved1:       .byte   0             /* Reserved */BS_BootSig:         .byte   0x29          /* Boot signal */BS_VolID:           .4byte  0             /* Volume ID */BS_VolLab:          .ascii  "Solrex 0.01" /* Volume label, 11 bytes required */BS_FileSysType:     .ascii  "FAT12   "    /* File system type, 8 bytes required *//* Initial registers. */LABEL_START:    mov     %cs,%ax    mov     %ax,%ds    mov     %ax,%es    mov     %ax,%ss    mov     $BaseOfStack, %sp    /* Clear screen */    mov     $0x0600,%ax   /* %ah=6, %al=0 */    mov     $0x0700,%bx   /* Black white */    mov     $0,%cx        /* Top left: (0,0) */    mov     $0x184f,%dx   /* Bottom right: (80,50) */    int     $0x10         /* BIOS int 10h, ah=6: Initialize screen */        /* Display "Booting**" */    mov     $0,%dh    call    DispStr       /* Display string(index 0)*/    /* Reset floppy */    xor     %ah,%ah    xor     %dl,%dl       /* %dl=0: floppy driver 0 */    int     $0x13         /* BIOS int 13h, ah=0: Reset driver 0 */    /* Find LOADER.BIN in root directory of driver 0 */    movw    $SecNoOfRootDir, (wSectorNo)/* Read root dir sector to memory */LABEL_SEARCH_IN_ROOT_DIR_BEGIN:    cmpw    $0,(wRootDirSizeForLoop)    /* If searching in root dir */    jz      LABEL_NO_LOADERBIN          /* can find  LOADER.BIN ?   */    decw    (wRootDirSizeForLoop)    mov     $BaseOfLoader,%ax    mov     %ax,%es                     /* %es <- BaseOfLoader*/    mov     $OffsetOfLoader,%bx         /* %bx <- OffsetOfLoader */    mov     (wSectorNo),%ax             /* %ax <- sector number in root */    mov     $1,%cl    call    ReadSector    mov     $LoaderFileName,%si         /* %ds:%si -> LOADER  BIN */    mov     $OffsetOfLoader,%di         /* BaseOfLoader<<4+100*/    cld    mov     $0x10,%dx/* Search for "LOADER  BIN", FAT12 save file name in 12 bytes, 8 bytes for    file name, 3 bytes for suffix, last 1 bytes for '\20'. If file name is   less than 8 bytes, filled with '\20'. So "LOADER.BIN" is saved as:   "LOADER  BIN"(4f4c 4441 5245 2020 4942 204e). */LABEL_SEARCH_FOR_LOADERBIN:    cmp     $0,%dx                      /* Read control */    jz      LABEL_GOTO_NEXT_SECTOR_IN_ROOT_DIR    dec     %dx    mov     $11,%cxLABEL_CMP_FILENAME:    cmp     $0,%cx    jz      LABEL_FILENAME_FOUND    /* If 11 chars are all identical? */    dec     %cx    lodsb                           /* %ds:(%si) -> %al*/    cmp     %es:(%di),%al    jz      LABEL_GO_ON    jmp     LABEL_DIFFERENT         /* Different */LABEL_GO_ON:    inc     %di    jmp     LABEL_CMP_FILENAME      /* Go on loop */LABEL_DIFFERENT:    and     $0xffe0,%di             /* Go to head of this entry */    add     $0x20,%di    mov     $LoaderFileName,%si     /* Next entry */    jmp     LABEL_SEARCH_FOR_LOADERBINLABEL_GOTO_NEXT_SECTOR_IN_ROOT_DIR:    addw    $1,(wSectorNo)    jmp     LABEL_SEARCH_IN_ROOT_DIR_BEGIN/* Not found LOADER.BIN in root dir. */LABEL_NO_LOADERBIN:    mov     $2,%dh    call    DispStr         /* Display string(index 2) */    jmp        .            /* Infinite loop *//* Found. */LABEL_FILENAME_FOUND:    mov     $RootDirSectors,%ax    and     $0xffe0,%di             /* Start of current entry, 32 bytes per entry */    add     $0x1a,%di               /* First sector of this file */    mov     %es:(%di),%cx    push    %cx                     /* Save index of this sector in FAT */    add     %ax,%cx    add     $DeltaSecNo,%cx         /* LOADER.BIN's start sector saved in %cl */    mov     $BaseOfLoader,%ax    mov     %ax,%es                 /* %es <- BaseOfLoader */    mov     $OffsetOfLoader,%bx     /* %bx <- OffsetOfLoader */    mov     %cx,%ax                 /* %ax <- Sector number *//* Load LOADER.BIN's sector's to memory. */LABEL_GOON_LOADING_FILE:    push    %ax    push    %bx    mov     $0x0e,%ah    mov     $'.',%al    /* Char to print */    mov     $0x0f,%bl   /* Front color: white */    int     $0x10       /* BIOS int 10h, ah=0xe: Print char */    pop     %bx    pop     %ax    mov     $1,%cl    call    ReadSector    pop     %ax             /* Got index of this sector in FAT */    call    GetFATEntry    cmp     $0x0fff,%ax    jz      LABEL_FILE_LOADED    push    %ax             /* Save index of this sector in FAT */    mov     $RootDirSectors,%dx    add     %dx,%ax    add     $DeltaSecNo,%ax    add     (BPB_BytsPerSec),%bx    jmp     LABEL_GOON_LOADING_FILELABEL_FILE_LOADED:    mov     $1,%dh            call    DispStr        /* Display string(index 1) *//*******************************************************************   Jump to LOADER.BIN's start address in memory.*/    jmp     $BaseOfLoader,$OffsetOfLoader/*******************************************************************//* ==================================================================   Variable table*/wRootDirSizeForLoop:    .2byte  RootDirSectorswSectorNo:              .2byte  0       /* Sector number to read */bOdd:                   .byte   0       /* odd or even? *//* ==================================================================   String table*/LoaderFileName:     .asciz  "LOADER  BIN"        /* File name */.set    MessageLength,9BootMessage:        .ascii    "Booting**"        /* index 0 */Message1:           .ascii    "Loaded in"        /* index 1 */Message2:           .ascii    "No LOADER"        /* index 2 *//* ==================================================================   Routine: DispStr   Action: Display a string, string index stored in %dh*/DispStr:     mov     $MessageLength, %ax    mul     %dh    add     $BootMessage,%ax    mov     %ax,%bp               /* String address */    mov     %ds,%ax    mov     %ax,%es    mov     $MessageLength,%cx    /* String length */    mov     $0x1301,%ax           /* ah = 0x13, al = 0x01(W) */    mov     $0x07,%bx             /* PageNum 0(bh = 0), bw(bl= 0x07)*/    mov     $0,%dl                /* Start row and column */    int     $0x10                 /* BIOS INT 10h, display string */    ret/* ==================================================================   Routine: ReadSector   Action: Read %cl Sectors from %ax sector(floppy) to %es:%bx(memory)      Assume sector number is 'x', then:       x/(BPB_SecPerTrk) = y,       x%(BPB_SecPerTrk) = z.     The remainder 'z' PLUS 1 is the start sector number;     The quotient 'y' divide by BPB_NumHeads(RIGHT SHIFT 1 bit)is cylinder       number;     AND 'y' by 1 can got magnetic header.*/ReadSector:    push    %ebp    mov     %esp,%ebp    sub     $2,%esp        /* Reserve space for saving %cl */    mov     %cl,-2(%ebp)    push    %bx            /* Save bx */    mov     (BPB_SecPerTrk), %bl    /* %bl: the divider */    div     %bl            /* 'y' in %al, 'z' in %ah */    inc     %ah            /* z++, got start sector */    mov     %ah,%cl        /* %cl <- start sector number */    mov     %al,%dh        /* %dh <- 'y' */    shr     $1,%al         /* 'y'/BPB_NumHeads */    mov     %al,%ch        /* %ch <- Cylinder number(y>>1) */    and     $1,%dh         /* %dh <- Magnetic header(y&1) */    pop     %bx            /* Restore %bx */    /* Now, we got cylinder number in %ch, start sector number in %cl, magnetic       header in %dh. */    mov     (BS_DrvNum), %dlGoOnReading:    mov     $2,%ah    mov     -2(%ebp),%al    /* Read %al sectors */    int     $0x13    jc      GoOnReading     /* If CF set 1, mean read error, reread. */    add     $2,%esp    pop     %ebp    ret/* ==================================================================   Routine: GetFATEntry   Action: Find %ax sector's index in FAT, save result in %ax */GetFATEntry:    push    %es    push    %bx    push    %ax    mov     $BaseOfLoader,%ax    sub     $0x0100,%ax    mov     %ax,%es           /* Left 4K bytes for FAT */    pop     %ax    mov     $3,%bx    mul     %bx               /* %dx:%ax = %ax*3 */    mov     $2,%bx    div     %bx               /* %dx:%ax/2 */    movb    %dl, (bOdd)       /* store remainder %dx in label bOdd. */LABEL_EVEN:    xor     %dx,%dx           /* Now %ax is the offset of FATEntry in FAT */    mov     (BPB_BytsPerSec),%bx    div     %bx               /* %dx:%ax/BPB_BytsPerSec */    push    %dx    mov     $0,%bx    add     $SecNoOfFAT1,%ax  /* %ax <- FATEntry's sector */    mov     $2,%cl            /* Read 2 sectors in 1 time, because FATEntry */    call    ReadSector        /* may be in 2 sectors. */    pop     %dx    add     %dx,%bx    mov     %es:(%bx),%ax     /* read FAT entry by word(2 bytes) */    cmpb    $0,(bOdd)         /* remainder %dx(see above) == 0 ?*/    jz      LABEL_EVEN_2      /* NOTE: %ah: high address byte, %al: low byte */    shr     $4,%axLABEL_EVEN_2:    and     $0x0fff,%axLABEL_GET_FAT_ENTRY_OK:    pop     %bx    pop     %es    ret.org 510        /* Skip to address 0x510. */.2byte 0xaa55   /* Write boot flag to 1st sector(512 bytes) end */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美aaaaaa午夜精品| 亚洲国产精品成人综合 | 欧美一卡二卡三卡| 亚洲福利一区二区三区| 欧美巨大另类极品videosbest| 婷婷综合久久一区二区三区| 欧美精品在线视频| 久久99国产乱子伦精品免费| 国产日韩av一区二区| 色综合久久99| 免费人成精品欧美精品| 久久免费视频一区| youjizz久久| 亚洲一区免费视频| 日韩精品专区在线影院重磅| 色婷婷久久久亚洲一区二区三区| 亚洲黄网站在线观看| 91精品视频网| 国产成人免费在线观看| 一区二区三区在线不卡| 777a∨成人精品桃花网| 大尺度一区二区| 亚洲一区视频在线观看视频| 日韩精品中文字幕一区二区三区 | 欧美一区二区三区在线观看| 国产中文字幕一区| 亚洲乱码国产乱码精品精可以看| 欧美一区二区三区小说| 成人国产在线观看| 亚洲va天堂va国产va久| 国产日韩精品一区二区浪潮av| 欧美中文字幕不卡| 国产福利一区在线观看| 亚洲一卡二卡三卡四卡无卡久久| 精品奇米国产一区二区三区| 色噜噜狠狠成人网p站| 久久99精品国产91久久来源| 亚洲麻豆国产自偷在线| www国产成人| 欧美日韩三级一区二区| 国产成人精品在线看| 免费观看在线色综合| 一区二区三区影院| 欧美国产综合色视频| 91麻豆精品国产91久久久久| 91社区在线播放| 国产美女视频91| 日本三级亚洲精品| 一区二区欧美精品| 国产精品精品国产色婷婷| 精品免费日韩av| 欧美日韩大陆一区二区| 色综合久久中文综合久久牛| 国产成人三级在线观看| 久久99在线观看| 爽好多水快深点欧美视频| 亚洲黄色片在线观看| 欧美国产视频在线| 久久毛片高清国产| 26uuu精品一区二区| 欧美一级欧美三级| 欧美日韩不卡一区| 欧美午夜免费电影| 91啪亚洲精品| 一本到不卡精品视频在线观看| 成人a免费在线看| 国产aⅴ综合色| 国产综合色视频| 紧缚奴在线一区二区三区| 免费成人小视频| 麻豆精品在线视频| 毛片不卡一区二区| 久久av老司机精品网站导航| 美女尤物国产一区| 另类欧美日韩国产在线| 久久精品国产99久久6| 看电视剧不卡顿的网站| 精品亚洲成a人| 狠狠色丁香婷婷综合久久片| 国产在线播放一区三区四| 极品美女销魂一区二区三区| 国模冰冰炮一区二区| 国产精品一区二区91| 懂色av一区二区夜夜嗨| 不卡一区二区三区四区| 91免费观看视频在线| 日本大香伊一区二区三区| 欧美三级电影网站| 56国语精品自产拍在线观看| 日韩一区和二区| 国产日韩欧美一区二区三区乱码 | 精品三级在线观看| 久久久久久久久一| 国产精品毛片大码女人| 一区二区三区日韩精品视频| 午夜久久久久久| 免费成人av资源网| 懂色av一区二区夜夜嗨| 91久久人澡人人添人人爽欧美| 欧美性三三影院| 日韩欧美国产综合一区| 国产精品网友自拍| 一区二区三区免费网站| 免费人成网站在线观看欧美高清| 国产一区 二区| 97se亚洲国产综合自在线| 欧美日韩激情一区二区| 久久精品视频一区二区三区| 中文字幕色av一区二区三区| 性做久久久久久久免费看| 九九国产精品视频| 成人黄色小视频| 欧美猛男男办公室激情| 久久精品亚洲精品国产欧美kt∨ | 美女一区二区视频| 成人福利视频网站| 欧美高清激情brazzers| 国产日韩欧美激情| 天天色综合成人网| 国产91综合一区在线观看| 欧美日韩久久不卡| 精品国产人成亚洲区| 一区av在线播放| 国产麻豆精品在线观看| 欧美美女bb生活片| 国产精品久久免费看| 麻豆精品视频在线| 欧美在线啊v一区| 国产女主播一区| 日韩中文欧美在线| 色av综合在线| 国产日韩欧美高清在线| 久久不见久久见免费视频7| 在线观看日韩av先锋影音电影院| 久久精品一级爱片| 日本亚洲最大的色成网站www| 91玉足脚交白嫩脚丫在线播放| 日韩一区二区影院| 一级做a爱片久久| 成人av在线影院| 久久久久国产精品麻豆ai换脸| 日本成人在线一区| 欧美日韩视频在线观看一区二区三区 | 日韩精品一区二区三区中文不卡| 亚洲一区二区三区中文字幕| 不卡在线视频中文字幕| 欧美激情综合网| 国产乱国产乱300精品| 日韩一级精品视频在线观看| 亚洲第一精品在线| 91福利社在线观看| 亚洲免费看黄网站| 成年人午夜久久久| 国产精品嫩草99a| 国产成人免费高清| 国产天堂亚洲国产碰碰| 激情图片小说一区| 精品久久久久一区| 精品午夜久久福利影院 | 国产白丝精品91爽爽久久| 日韩欧美精品在线| 免费在线欧美视频| 欧美一区二区免费| 男人的天堂久久精品| 欧美一区二区视频网站| 日韩av成人高清| 欧美一区二区成人| 麻豆精品精品国产自在97香蕉| 欧美一区二区免费视频| 美女高潮久久久| 亚洲精品在线观看网站| 国产成人亚洲综合a∨猫咪| 国产视频一区在线播放| 成人app网站| 亚洲精品欧美二区三区中文字幕| 在线视频一区二区免费| 午夜精品aaa| 日韩精品一区二区三区视频| 韩国av一区二区| 国产女人水真多18毛片18精品视频| 成人激情av网| 亚洲狼人国产精品| 欧美日韩大陆一区二区| 久久国产精品第一页| 国产日韩欧美激情| 色哟哟一区二区三区| 婷婷夜色潮精品综合在线| 精品电影一区二区| 成人动漫中文字幕| 亚洲一区二区偷拍精品| 日韩欧美中文一区二区| 高清不卡在线观看av| 亚洲欧美区自拍先锋| 欧美一区二区三区在| 懂色av一区二区在线播放| 亚洲一区二区不卡免费| 2017欧美狠狠色| 色婷婷综合五月| 精品一区二区三区欧美| 亚洲品质自拍视频网站|