Subversion Repositories Kolibri OS

Rev

Rev 7270 | Rev 7727 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7270 Rev 7546
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2011-2015. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2011-2015. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
$Revision: 7270 $
8
$Revision: 7546 $
9
 
9
 
10
; =============================================================================
10
; =============================================================================
11
; ================================= Constants =================================
11
; ================================= Constants =================================
Line 1010... Line 1010...
1010
 
1010
 
1011
; ecx = pointer to partition records array (MBR + 446)
1011
; ecx = pointer to partition records array (MBR + 446)
1012
is_protective_mbr:
1012
is_protective_mbr:
1013
        push    ecx edi
1013
        push    ecx edi
1014
        xor     eax, eax
-
 
1015
;        cmp     [ecx-6], eax
-
 
1016
;        jnz     .exit
1014
        xor     eax, eax
1017
        cmp     [ecx-2], ax
1015
        cmp     [ecx-2], ax
1018
        jnz     .exit
1016
        jnz     .exit
1019
; Partition record 0 has specific fields
1017
; Partition record 0 has specific fields
1020
        cmp     [ecx+0], al
1018
        cmp     [ecx+0], al
1021
        jnz     .exit
1019
        jnz     .exit
1022
        cmp     byte[ecx+4], 0xEE
1020
        cmp     byte[ecx+4], 0xEE
1023
        jnz     .exit
1021
        jnz     .exit
1024
        cmp     dword[ecx+8], 1
1022
        cmp     dword[ecx+8], 1
1025
        jnz     .exit
1023
        jnz     .exit
1026
        cmp     dword[esi+DISK.MediaInfo.Capacity+4], eax
1024
        mov     edi, -1
1027
        mov     edi, 0xFFFFFFFF
1025
        cmp     [ecx+12], edi
1028
        jnz     @f
1026
        jz      @f
1029
        mov     edi, dword[esi+DISK.MediaInfo.Capacity+0]
-
 
1030
        dec     edi
-
 
1031
@@:
1027
        add     edi, dword[esi+DISK.MediaInfo.Capacity+0]
1032
        cmp     dword[ecx+12], edi
1028
        cmp     [ecx+12], edi
1033
        jnz     .exit
1029
        jnz     .exit
1034
 
1030
@@:
1035
; Check that partition records 1-3 are filled with zero
1031
; Check that partition records 1-3 are filled with zero
1036
        lea     edi, [ecx+16]
1032
        lea     edi, [ecx+16]
1037
        mov     ecx, 16*3/2     ; 3 partitions
1033
        mov     ecx, 16*3/2     ; 3 partitions
1038
        repz scasw
1034
        repz scasw