⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 boot.asm

📁 一个朋友写的操作系统源码
💻 ASM
字号:
cseg segment 'code'

     assume cs:cseg

start:
      ;read MBR into 87C00 don't ruin the dos 

      mov ax,8000h
      mov es,ax
      mov ds,ax         ;partition table segment
      mov bx,7c00h
      mov ax,201h
      mov dl,80h
      mov dh,0
      mov ch,0
      mov cl,1
      int 13h

      ;load our entry

      mov si,7dbeh      ;point to the partition table
      xor cx,cx
      mov cx,4

searchloop:

      cmp byte ptr [si+4],23h
      je continue       ;got it!
      dec cx
die:  je die            ;can't find
      add si,16         ;address next entry
      jmp searchloop

continue:

      ;we should load the int 13 register parameters reading from Partition table

      mov dh,[si+1]
      mov cl,[si+2]
      mov ch,[si+3]

      xor ax,ax
      mov es,ax
      mov bx,7c00h
      mov dl,80h
      mov ax,201h
      int 13h

      db 0eah
      dw 7c00h
      dw 0

cseg  ends

end start

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -