2016-10-11 52 views
1

我曾經遇到過在0X55AA 2種情況:關於0x55AA有什麼特別之處?

  • 最後2個字節的引導扇區中的遺留引導過程包含0x55AA
  • 第2個字節Option ROM必須是0x55AA

那麼,有什麼特別之處0x55AA

0x55AA的二進制版本是0101010110101010。是因爲它是均勻交錯的0和1嗎?但我不認爲這是一個強有力的標準。

+1

可能的重複[爲什麼55 AA用作IBM PC上的引導簽名?](http://stackoverflow.com/questions/11075003/why-55-aa-is-used-as-the-boot- sign-on-ibm-pcs) – Downvoter

+0

實際上它是0xAA55作爲16位字,它在一個小端系統上被存儲爲字節0x55 0xAA。 –

+0

它也被用作在CPAN上找到的很多perl模塊的返回值,它們是返回一個真實值所需的。請參閱http://returnvalues.userperl.at/values.html – Aaron

回答

0

對於這種組合,沒有什麼神奇或神祕的東西。實施者需要一種方法來確定設備的第一個扇區是否可引導(引導簽名),並且發生在扇區的最後兩個字節中的組合是如此不可能,這就是爲什麼它被選中。

同樣,可以找到SMBIOS入口點掃描BIOS的_SM_簽名,必須在這樣的片段邊界上;

Find_SMBIOS: 
    push ds 
    push bx      ; Preserve essential 
    push si 

; Establish DS:BX to point to base of BIOS code 

    mov  ax, 0xf000 
    mov  ds, ax     ; Segment where table lives 
    xor  bx, bx     ; Initial pointer 
    mov  eax, '_SM_'    ; Scan buffer for this signature 

; Loop has maximum of 4096 interations. As table is probably at top of buffer, cycling 
; though it backwards saves time. In my test bed, BOCH's 2.6.5 BIOS-bochs-latest it was 
; 1,451 interations. 

.L0: sub  bx, 16     ; Bump pointer to previous segment 
    jnz  .J0 

; Return NULL in AX and set CF. Either AX or flag can be tested on return. 

    mov  ax, bx 
    stc 
    jmp  .Done 

; Did we find signature at this page 

.J0: cmp  [bx], eax 
    jnz  .L0      ; NZ, keep looking 

; Calculate checksum to verify position 

    mov  cx, 15 
    mov  ax, cx 
    mov  si, bx     ; DS:SI = Table entry point 

; Compute checksum on next 15 bytes 

.L1: lodsb 
    add  ah, al 
    loop .L1 

    or  ah, ah 
    jnz  .L0      ; Invalid, try to find another occurence 

; As entry point is page aligned, we can do this to determine segment. 

    shr  bx, 4 
    mov  ax, ds 
    add  ax, bx 
    clc        ; NC, found signature 

.Done: 
    pop  si 
    pop  bx      ; Restore essential 
    pop  ds 

    ret  

該簽名很容易在十六進制轉儲中識別,它適合一個16位寄存器。在這兩個標準促成因素的情況下,我不知道,但是再一次,在甚至16字節的邊界上出現0x5f4d535f的概率是不太可能的。

相關問題