Index: trunk/i386/boot0/boot0.s =================================================================== --- trunk/i386/boot0/boot0.s (revision 749) +++ trunk/i386/boot0/boot0.s (revision 750) @@ -46,6 +46,8 @@ ; ; Turbo added EFI System Partition boot support ; +; Added KillerJK's switchPass2 modifications +; ; ; Set to 1 to enable obscure debug messages. @@ -354,10 +356,10 @@ 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 ; @@ -366,8 +368,10 @@ ; 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 @@ -378,6 +382,22 @@ .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 @@ -385,7 +405,8 @@ ; 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. @@ -473,22 +494,10 @@ 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 ; @@ -507,7 +516,7 @@ mov al, 3 mov bx, kBoot0LoadAddr - call load ; will not return on success + call load jc error or dh, dh @@ -609,7 +618,8 @@ 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