Chameleon

Chameleon Commit Details

Date:2010-03-09 21:08:46 (14 years 1 month ago)
Author:JrCs
Commit:121
Parents: 120
Message:Added a variant of boot0 (boot0hfs) which prefers a bootable HFS partition in the first MBR partition scan.
Changes:
M/branches/JrCs/i386/boot0/boot0.s
M/branches/JrCs/i386/boot0/Makefile

File differences

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

Archive Download the corresponding diff file

Revision: 121