這是我從Bootloader的內存位置
`[ORG 0x00]
[BITS 16]
SECTION .text
jmp 0x07c0:START ; set CS(segment register) to 0x07C0 and jump to START label.
TOTALSECTORCOUNT:
dw 0x02
KERNEL32SECTORCOUNT:
dw 0x02
START:
mov ax, 0x07c0
mov ds, ax ; set DS(segment register) to the address of the bootloader.
mov ax, 0xb800
mov es, ax ; set ES(segment register) to the address of the video memory starting address.
; stack initialization
mov ax, 0x0000
mov ss, ax
mov sp, 0xfffe
mov bp, 0xfffe
; clear the screen
mov si, 0
CLEARSCREEN:
mov byte[es:si], 0
mov byte[es:si + 1], 0x0a
add si, 2
cmp si, 80 * 25 * 2
jl CLEARSCREEN
; print welcome message`
我學習不明白一開始就引導程序的一部分:jmp 0x07C0:START
它是如何設置的CS註冊? ,什麼是兩個變量TOTALSECTORCOUNT
和KERNEL32SECTORCOUNT
呢?他們不啓動扇區文件的任何地方出現,如果刪除它們,引導加載程序加載失敗的歡迎信息。
刪除部件會導致操作系統無法加載。那麼jmp聲明和兩個變量的意義是什麼?
``[ORG 0x00]
[BITS 16]
jmp START
START:
mov ax, 0x07c0
mov ds, ax ; set DS(segment register) to the address of the bootloader.
mov ax, 0xb800
mov es, ax ; set ES(segment register) to the address of the video memory starting address.
; stack initialization
mov ax, 0x0000
mov ss, ax
mov sp, 0xfffe
mov bp, 0xfffe
`
我不知道這兩個變量的想法沒有看到完整的代碼。 – Breavyn