Chameleon

Chameleon Commit Details

Date:2011-03-23 23:28:33 (8 years 3 months ago)
Author:Tamás Kosárszky
Commit:750
Parents: 749
Message:Added KillerJK's switchPass2 modifications.
Changes:
M/trunk/i386/boot0/boot0.s

File differences

trunk/i386/boot0/boot0.s
4646
4747
4848
49
50
4951
5052
5153
......
354356
355357
356358
357
359
358360
359361
360
362
361363
362364
363365
......
366368
367369
368370
369
371
372
370373
374
371375
372376
373377
......
378382
379383
380384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
381401
382402
383403
......
385405
386406
387407
388
408
409
389410
390411
391412
......
473494
474495
475496
497
476498
499
477500
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492501
493502
494503
......
507516
508517
509518
510
519
511520
512521
513522
......
609618
610619
611620
612
621
622
613623
614624
615625
;
; Turbo added EFI System Partition boot support
;
; Added KillerJK's switchPass2 modifications
;
;
; Set to 1 to enable obscure debug messages.
call loadBootSector
jne .continue
jmp initBootLoader
jmp SHORT initBootLoader
.continue:
add si, part_size ; advance SI to next partition entry
add si, BYTE part_size; advance SI to next partition entry
loop .loop ; loop through all partition entries
;
; for a possible GPT Header at LBA 1
;
dec bl
jz checkGPT; found Protective MBR before
jnz .switchPass2; didn't find Protective MBR before
call checkGPT
.switchPass2
;
; Switching to Pass 2
; try to find a boot1h aware HFS+ MBR partition
.exit:
ret; Giving up.
;
; Jump to partition booter. The drive number is already in register DL.
; SI is pointing to the modified partition entry.
;
initBootLoader:
DebugChar('J')
%if VERBOSE
LogString(done_str)
%endif
jmp kBoot0LoadAddr
;
; Found Protective MBR Partition Type: 0xEE
; of LBA1 for possible GPT Table Header
;
checkGPT:
push bx
mov di, kLBA1Buffer; address of GUID Partition Table Header
cmp DWORD [di], kGPTSignatureLow; looking for 'EFI '
jne .exit; not found. Giving up.
loop .gpt_loop; loop through all partition entries
.exit:
pop bx
ret; no more GUID partitions. Giving up.
DebugChar('J')
;
; Jump to partition booter. The drive number is already in register DL.
; SI is pointing to the modified partition entry.
;
initBootLoader:
%if VERBOSE
LogString(done_str)
%endif
jmp kBoot0LoadAddr
;--------------------------------------------------------------------------
; loadBootSector - Load boot sector
;
mov al, 3
mov bx, kBoot0LoadAddr
call load ; will not return on success
call load
jc error
ordh, dh
xor ah, ah ; offset 3, must be 0
push ax ; offset 2, number of sectors
push WORD 16 ; offset 0-1, packet size
; It pushes 2 bytes with a smaller opcode than if WORD was used
push BYTE 16 ; offset 0-1, packet size
DebugChar('<')
%if DEBUG

Archive Download the corresponding diff file

Revision: 750