Chameleon

Sign in or create your account | Project List | Help

Chameleon Commit Details

Date:2010-02-17 23:11:47 (5 months 13 days ago)
Author:Tamás Kosárszky
Commit:86
Message:Added a variant of boot0 (boot0hfs) which prefers a bootable HFS partition in the first MBR partition scan.
Files: trunk/i386/boot0/boot0.s (3 diffs)
trunk/i386/boot0/Makefile (1 diff)

Change Details

trunk/i386/boot0/boot0.s
313313    jne .Pass2
314314
315315.Pass1:
316%ifdef HFSFIRST
317    cmp BYTE [si + part.type], kPartTypeHFS ; In pass 1 we're going to find a HFS+ partition
318                                                  ; equipped with boot1h in its boot record
319                                                  ; regardless if it's active or not.
320    jne .continue
321      mov dh, 1 ; Argument for loadBootSector to check HFS+ partition signature.
322%else
316323    cmp BYTE [si + part.bootid], kPartActive ; In pass 1 we are walking on the standard path
317    jne .continue ; by trying to hop on the active partition.
318    xor dh, dh ; Argument for loadBootSector to skip HFS+ partition
319                                                    ; signature check.
324                                                  ; by trying to hop on the active partition.
325    jne .continue
326    xor dh, dh ; Argument for loadBootSector to skip HFS+ partition
327                                                                            ; signature check.
328%endif
329
320330    jmp .tryToBoot
321331
322332.Pass2:
323; cmp BYTE [si + part.type], kPartTypeHFS ; In pass 2 we're going to find a HFS+ partition
324; jne .continue ; equipped with boot1h in its boot record
325; ; regardless if it's active or not.
326    mov dh, 1 ; Argument for loadBootSector to check HFS+ partition signature.
333%ifdef HFSFIRST
334    cmp BYTE [si + part.bootid], kPartActive ; In pass 2 we are walking on the standard path
335                                                  ; by trying to hop on the active partition.
336    jne .continue
337    xor dh, dh ; Argument for loadBootSector to skip HFS+ partition
338                                                                            ; signature check.
339%else
340    cmp BYTE [si + part.type], kPartTypeHFS ; In pass 2 we're going to find a HFS+ partition
341                                                  ; equipped with boot1h in its boot record
342                                                  ; regardless if it's active or not.
343    jne .continue
344      mov dh, 1 ; Argument for loadBootSector to check HFS+ partition signature.
345%endif
327346
328347    DebugChar('*')
329348
...... 
755774
756775%if VERBOSE
757776gpt_str db 'GPT', 0
758test_str db 'testing', 0
777test_str db 'test', 0
759778done_str db 'done', 0
760779%endif
761780
...... 
773792pad_boot:
774793    times 440-($-$$) db 0
775794
776%ifdef FLOPPY
777;--------------------------------------------------------------------------
778; Put fake partition entries for the bootable floppy image
779;
780part1bootid db 0x80 ; first partition active
781part1head db 0x00 ; head #
782part1sect db 0x02 ; sector # (low 6 bits)
783part1cyl db 0x00 ; cylinder # (+ high 2 bits of above)
784part1systid db 0xab ; Apple boot partition
785times 3 db 0x00 ; ignore head/cyl/sect #'s
786part1relsect dd 0x00000001 ; start at sector 1
787part1numsect dd 0x00000080 ; 64K for booter
788part2bootid db 0x00 ; not active
789times 3 db 0x00 ; ignore head/cyl/sect #'s
790part2systid db 0xa8 ; Apple UFS partition
791times 3 db 0x00 ; ignore head/cyl/sect #'s
792part2relsect dd 0x00000082 ; start after booter
793; part2numsect dd 0x00000abe ; 1.44MB - 65K
794part2numsect dd 0x000015fe ; 2.88MB - 65K
795%endif
796
797795pad_table_and_sig:
798796    times 510-($-$$) db 0
799797    dw kBootSignature
trunk/i386/boot0/Makefile
66INSTALLDIR = $(DSTROOT)/usr/standalone/i386
77DIRS_NEEDED = $(SYMROOT)
88
9all embedtheme: $(DIRS_NEEDED) boot0 chain0
9all embedtheme: $(DIRS_NEEDED) boot0 boot0hfs chain0
1010
1111boot0: boot0.s Makefile $(NASM)
1212    $(NASM) boot0.s -o $(SYMROOT)/$@
1313
14boot0hfs: boot0.s Makefile $(NASM)
15    $(NASM) boot0.s -DHFSFIRST -o $(SYMROOT)/$@
16
1417chain0: chain0.s Makefile $(NASM)
1518    $(NASM) chain0.s -o $(SYMROOT)/$@
1619
1720

Archive Download the corresponding diff file

Revision: 86