Jump to content

Boot a legacy system in UEFI mode


miqlas
 Share

24 posts in this topic

Recommended Posts

Hi Guys,

 
i got an UEFI based computer, and i'm using it happily 2 years ago. It works very well, my primary OS (Yosemite) installed in EUFI mode too with Clover.
 
My secondary system, Haiku have no UEFI bootloader yet (hopefully soon). I can install Haiku in Legacy mode into a GPT partition, but i don't want to go into BIOS everytime to change the boot type from UEFI to Legacy everytime, when i want to boot into Haiku.
So i thinkig about to let Clover boot Haiku, but my Haiku partition isn't listed in Clover (maybe user error).
 
Is it possible to boot a legacy system from Clover in UEFI mode? If yes, how can i do that? Or is there any other way to do that?
 
Thank you!
 
Best regards,
miqlas
Link to comment
Share on other sites

Yes, Clover has so called "Legacy Boot". It's a pity it doesn't work on some hardwares.

 

"Haiku partition is not listed" - is a separate issue. We should know signature of the partition to be included in next Clover release.

 

I think I should move this topic to Clover subforum?

  • Like 1
Link to comment
Share on other sites

I cannot create new topic in Clover subforum, thats why i made it here. And actually it is a general question, because i wasn't was sure about the ability of Clover to boot legacy systems, so i'm open to any other ideas too. But i'm using Clover, so the best wolud be to solve this problem with Clover.

 

@Slice, i read at the Intel forum, that we need disable Secure boot to enable the CSM support in UEFI mode. Is it right? I have Secure Boot enabled, but i have no OS that using that, so i will try to disable it. Maybe helps...

 

@Slice: Haiku have support for MBR and GPT partitioning systems too, in legacy boot the Haiku bootloader can boot Haiku from GPT disk too. DriveSetup (partitioning tool for Haiku) can create all of them.

Haiku can install a bootmenu into the MBR or a boot-code into the Haiku partition for chainloading. 

And i've found BFS (the Haiku FS) EFI driver here: http://efi.akeo.ie/downloads/efifs-0.7/x64/  (search for bfs). Maybe it can help too.

 

I can help to get the Haiku partition signature, if you need any help, just let me know.

 

I found this in the Haiku BFS source:

#define SUPER_BLOCK_FS_LENDIAN		'BIGE'		/* BIGE */
#define SUPER_BLOCK_MAGIC1			'BFS1'		/* BFS1 */
#define SUPER_BLOCK_MAGIC2			0xdd121031
#define SUPER_BLOCK_MAGIC3			0x15b6830e
#define INODE_MAGIC1			0x3bbe0ad9
#define INODE_TIME_MASK			0xfff0

Partition Type is 0xeb .

 

Best regards,

miqlas

Link to comment
Share on other sites

I cannot create new topic in Clover subforum, thats why i made it here. And actually it is a general question, because i wasn't was sure about the ability of Clover to boot legacy systems, so i'm open to any other ideas too. But i'm using Clover, so the best wolud be to solve this problem with Clover.

 

@Slice, i read at the Intel forum, that we need disable Secure boot to enable the CSM support in UEFI mode. Is it right? I have Secure Boot enabled, but i have no OS that using that, so i will try to disable it. Maybe helps...

 

@Slice: Haiku have support for MBR and GPT partitioning systems too, in legacy boot the Haiku bootloader can boot Haiku from GPT disk too. DriveSetup (partitioning tool for Haiku) can create all of them.

Haiku can install a bootmenu into the MBR or a boot-code into the Haiku partition for chainloading. 

And i've found BFS (the Haiku FS) EFI driver here: http://efi.akeo.ie/downloads/efifs-0.7/x64/  (search for bfs). Maybe it can help too.

 

I can help to get the Haiku partition signature, if you need any help, just let me know.

 

I found this in the Haiku BFS source:

#define SUPER_BLOCK_FS_LENDIAN		'BIGE'		/* BIGE */
#define SUPER_BLOCK_MAGIC1			'BFS1'		/* BFS1 */
#define SUPER_BLOCK_MAGIC2			0xdd121031
#define SUPER_BLOCK_MAGIC3			0x15b6830e
#define INODE_MAGIC1			0x3bbe0ad9
#define INODE_TIME_MASK			0xfff0

Partition Type is 0xeb .

 

Best regards,

miqlas

Clover somehow knows Haiku, just need to understand what is wrong

      } else if (FindMem(SectorBuffer, 512, "\x04" "beos\x06" "system\x05" "zbeos", 18) >= 0 ||
                 FindMem(SectorBuffer, 512, "\x06" "system\x0c" "haiku_loader", 20) >= 0) {
        Volume->HasBootCode = TRUE;
        Volume->LegacyOS->IconName = L"haiku";
        Volume->LegacyOS->Name = L"Haiku";
        Volume->LegacyOS->Type = OSTYPE_VAR;
        Volume->BootType = BOOTING_BY_PBR;
      }

Link to comment
Share on other sites

 

Clover somehow knows Haiku, just need to understand what is wrong

      } else if (FindMem(SectorBuffer, 512, "\x04" "beos\x06" "system\x05" "zbeos", 18) >= 0 ||
                 FindMem(SectorBuffer, 512, "\x06" "system\x0c" "haiku_loader", 20) >= 0) {
        Volume->HasBootCode = TRUE;
        Volume->LegacyOS->IconName = L"haiku";
        Volume->LegacyOS->Name = L"Haiku";
        Volume->LegacyOS->Type = OSTYPE_VAR;
        Volume->BootType = BOOTING_BY_PBR;
      }

 

With the release of the PackageManagement lot of things changed.

"The stage one boot loader has changed. The old one cannot load a PM Haiku and vice versa. So if you copy the files manually onto a previously bootable target partition, you still have to use the new makebootable to make it boot PM Haiku."

 

Let me look into this later. If i can, i'll provide a required info to update the partition sniffing rules.

 

EDIT: This is the actual bootcode: https://github.com/haiku/haiku/blob/master/src/bin/writembr/mbr.S

 

However can you tell me anything or point a documentation about the "Legacy boot", because everything, what i found was just Clover in native BIOS/MBR mode. This is not, what i need.

 

Thanks for your help, Slice.

 

Best regards,

miqlas

Link to comment
Share on other sites

In my sytem (not UEFI) i have two disks and the first one is booting  ok (osx and legacy windows 8) but the second disk is not booting at all and clover does not detec PBR and MBR of  the disk which is grub4dos it just detects filesystem(ntfs).Have to say that chameleon and other bootloaders are booting and detecting ok.

Link to comment
Share on other sites

In my sytem (not UEFI) i have two disks and the first one is booting  ok (osx and legacy windows 8) but the second disk is not booting at all and clover does not detec PBR and MBR of  the disk which is grub4dos it just detects filesystem(ntfs).Have to say that chameleon and other bootloaders are booting and detecting ok.

 

Hi alexanderq!

 

I have also 2 disk:

- the firs one with the EFI and OSX partitions

- and a second one with the USER  and the Haiku partitions.

 

Both of them have GPT partition table, and GPT-only partitions (NO GPT-MBR hybrid).

So i boot from the first one, but the Haiku located on the second one. I'll try to resize the main OSX partition to make place for a small Haiku partition, and we'll see, what happens.

 

Thanks for the tip,alexanderq!

 

Best regards,

miqlas

Link to comment
Share on other sites

@miqlas

Make full DarwinDumper report to see what about we speak.

You can exclude BIOS ROM from the folder to reduce size and upload the rest to this thread.

Link to comment
Share on other sites

Is it the partition you want to boot?

disk1s2  Microsoft Basic Data                                           49 GB                 Unknown (If you know, please report).

0:845  0:000    PciRoot(0x0)\Pci(0x1F,0x2)\Sata(0x0,0x0,0x0)\HD(2,GPT,73721609-985D-443A-B3AB-E90CB3409BED,0x6EA87000,0x5C7F800)
0:845  0:000    Result of bootcode detection: bootable unknown (legacy)

Make a command like this

sudo dd if=/dev/rdisk1s2 of=pbr_haiku.bin bs=512 count=1

See

disk0s1 - EFI - 209 MB
PBR: First 1024 bytes    Code Detected: FAT16 Non System
0000000: eb3c 9042 5344 2020 342e 3400 0208 0100  .<.BSD  4.4.....
0000010: 0200 0200 00f8 c800 2000 2000 2800 0000  ........ . .(...
0000020: 0040 0600 8000 29e3 17e7 f945 4649 2020  .@....)....EFI  
0000030: 2020 2020 2020 4641 5431 3620 2020 fa31        FAT16   .1
0000040: c08e d0bc 007c fb8e d8e8 0000 5e83 c619  .....|......^...
0000050: bb07 00fc ac84 c074 06b4 0ecd 10eb f530  .......t.......0
0000060: e4cd 16cd 190d 0a4e 6f6e 2d73 7973 7465  .......Non-syste
0000070: 6d20 6469 736b 0d0a 5072 6573 7320 616e  m disk..Press an
0000080: 7920 6b65 7920 746f 2072 6562 6f6f 740d  y key to reboot.

EFI FAT16 is not good for Clover. You have to reformat this partition to FA32

 

sudo newfs_msdos -F 32 /dev/disk0s1 -v /Volume/EFI

Test this revision. It should see Haiku

 

CLOVERX64.efi-rev3230.zip

Link to comment
Share on other sites

Is it the partition you want to boot?

disk1s2  Microsoft Basic Data                                           49 GB                 Unknown (If you know, please report).
0:845  0:000    PciRoot(0x0)\Pci(0x1F,0x2)\Sata(0x0,0x0,0x0)\HD(2,GPT,73721609-985D-443A-B3AB-E90CB3409BED,0x6EA87000,0x5C7F800)
0:845  0:000    Result of bootcode detection: bootable unknown (legacy)

Make a command like this

sudo dd if=/dev/rdisk1s2 of=pbr_haiku.bin bs=512 count=1

See

disk0s1 - EFI - 209 MB
PBR: First 1024 bytes    Code Detected: FAT16 Non System
0000000: eb3c 9042 5344 2020 342e 3400 0208 0100  .<.BSD  4.4.....
0000010: 0200 0200 00f8 c800 2000 2000 2800 0000  ........ . .(...
0000020: 0040 0600 8000 29e3 17e7 f945 4649 2020  .@....)....EFI  
0000030: 2020 2020 2020 4641 5431 3620 2020 fa31        FAT16   .1
0000040: c08e d0bc 007c fb8e d8e8 0000 5e83 c619  .....|......^...
0000050: bb07 00fc ac84 c074 06b4 0ecd 10eb f530  .......t.......0
0000060: e4cd 16cd 190d 0a4e 6f6e 2d73 7973 7465  .......Non-syste
0000070: 6d20 6469 736b 0d0a 5072 6573 7320 616e  m disk..Press an
0000080: 7920 6b65 7920 746f 2072 6562 6f6f 740d  y key to reboot.

EFI FAT16 is not good for Clover. You have to reformat this partition to FA32

 

sudo newfs_msdos -F 32 /dev/disk0s1 -v /Volume/EFI

Test this revision. It should see Haiku

 

 

Hi Slice,

 

thanks, i'll test it a report as soon as possible.

Yes, this is the partition, what i want to boot.

 

I have no problem with FAT16 EFI Partition, but i'll reformat it to FAT32 as you told.

 

Best Regards,

miqlas

Link to comment
Share on other sites

Hi Slice,

 

this is what i made:

- Backup USB Boot disk (if something goes wrong)

- EFI reformatted to FAT32

- CLOVER installed to EFI with all the old settings

- CLOVERX64.efi replaced from your attachement

- Reboot

 

There is no other bootable disk, just OSX and Recovery, so the partition signature is not correct, or something else wrong.

 

Here is my PBR ( sudo dd if=/dev/rdisk1s2 of=pbr_haiku.bin bs=512 count=1 ) and the bdmesg:

 

boot_log_and_pbr.zip

 

Can you look into this?

 

Thank You!

 

Best Regards,

miqlas

 

Link to comment
Share on other sites

Hi Slice,

 

this is what i made:

- Backup USB Boot disk (if something goes wrong)

- EFI reformatted to FAT32

- CLOVER installed to EFI with all the old settings

- CLOVERX64.efi replaced from your attachement

- Reboot

 

There is no other bootable disk, just OSX and Recovery, so the partition signature is not correct, or something else wrong.

 

Here is my PBR ( sudo dd if=/dev/rdisk1s2 of=pbr_haiku.bin bs=512 count=1 ) and the bdmesg:

 

attachicon.gifboot_log_and_pbr.zip

 

Can you look into this?

 

Thank You!

 

Best Regards,

miqlas

Will check what is wrong

0:583  0:000   6. Volume:
0:583  0:000    PciRoot(0x0)\Pci(0x1F,0x2)\Sata(0x0,0x0,0x0)\HD(2,GPT,73721609-985D-443A-B3AB-E90CB3409BED,0x6EA87000,0x5C7F800)
0:584  0:000    Result of bootcode detection: bootable unknown (legacy)

@Slice

Hello Slice can you take a look at grub4dos pbr please and find why Clover is not detecting it but it just detects a ntfs partition.

 

attachicon.gifgrub4dos.zipattachicon.gifbootlog+disk.zip

I don't understand, is it grub or ntldr?

PBR: First 1024 bytes    Code Detected: Windows NTFS NTLDR
0000000: eb52 904e 5446 5320 2020 2000 0208 0000  .R.NTFS    .....
0000010: 0000 0000 00f8 0000 3f00 ff00 0050 0600  ........?....P..
0000020: 0000 0000 8000 8000 ffaf f94e 0000 0000  ...........N....
0000030: 0154 3c01 0000 0000 0c00 0000 0000 0000  .T<.............
0000040: f600 0000 0100 0000 4ecd 0400 e96f 0000  ........N....o..
0000050: 5a4c c5c0 fafc b600 31c0 bd00 7c8e d08d  ZL......1...|...
0000060: 66e0 fb89 56fe 50b4 41bb aa55 cd13 1f72  f...V.P.A..U...r
0000070: 1081 fb55 aa75 0af6 c101 7405 c686 aa01  ...U.u....t.....
0000080: 4216 0766 81be fc07 4752 5542 7413 bb00  B..f....GRUBt...
0000090: 7e66 8b86 1c00 6640 e8e1 00e8 de00 e8db  ~f....f@........
00000a0: 0066 31c0 8b46 0b89 46fc e88c 0088 cb8a  .f1..F..F.......
00000b0: 460d e884 0088 cd00 dd80 ed09 886e fb8a  F............n..
00000c0: 4644 e865 0080 f903 7605 b001 e9fb 0088  FD.e....v.......
00000d0: 4ef9 8a46 40e8 5200 80f9 0175 ed88 4efa  N..F@.R....u..N.
00000e0: 668b 4630 88e9 66d3 e066 0386 1c00 6689  f.F0..f..f....f.

Link to comment
Share on other sites

 

Will check what is wrong

0:583  0:000   6. Volume:
0:583  0:000    PciRoot(0x0)\Pci(0x1F,0x2)\Sata(0x0,0x0,0x0)\HD(2,GPT,73721609-985D-443A-B3AB-E90CB3409BED,0x6EA87000,0x5C7F800)
0:584  0:000    Result of bootcode detection: bootable unknown (legacy)

 

Hi Slice,

 

i just broked the partition system on my HDD. The OS is survived, because it is on my SSD, but my USER and Haiku partition lost (i was silly). Nothing serious, i recreated the partitions and restored everything from TimeMachine.

Instead GPT i made an native MBR style partition system on my HDD, Haiku have better support for that. Theoretically it will work with Clover, right? If not, i can redo everything with GPT style partition system.

 

Let me know if you need any log or info, and thanks for your hard work!

 

Best Regards,

miqlas

Link to comment
Share on other sites

But it is grub and i'm booting from mbr and pbr here are 4 sectors

.RNTFS    .............?....P......€.€....N.....T<.....................N....o..ZL......1...|Ž.f..‰V.P.A..U...r..U.u....t..†..B..f...GRUBt...~f‹†..f@.........f1.‹F.‰F..Œ.ˆ.ŠF..„.ˆ...€..ˆn.ŠFD.e.€..v......ˆN.ŠF@.R.€..u.ˆN.f‹F0ˆ.f..f.†..f‰F....ŠN...‰... S.y...[?FIul‰..4.‰..€.@.r^..8f1....Š.‰......x.ˆ.....,.ˆ..0...f..s....SW‰.‹G.H‰..f....9.u.‰.‰.._.‹.ƒ...~.ƒ..;.u.‹.‰..._[....Nf`f1.fRfP.Sj.j.f1.f.v.Yf..BYR1.f..†.Y†.........‰.ŠV...afar7f@.^.s.RŒ.€..Ž.Z.0..†....No grldr................... ....}.....<.u.....U..o...…..‚..f|.....u..t.€<0u.ƒ...4....ƒ...E....[..‚”.‹\.€..u.€|..u..t..t.V...t0f1.f‹L(...wmf.....`S........r[f|...@.u.ŠN.f1...f..f1.^YQ....QP..t*VfRfSf‰...P.:.r&?INu .˜.‰.ƒ...4.d.s.f[fZ^f..X..Y..Y...... .ƒ|...…..f‹.‰.....€.r.r.€|..t.‹L......t.....f1.f‹L(f..........‹V.R.........‰..G..t...0.V...ƒ.RŠO..Š'€.Ar.€.Zw.€. 8.u.CC..€<.u.^..^.t......./.r....u..%.s.........P1.‰.‰E.‹E...‰E.X.. u.€...‹]....uf‰.€<.t.€< u.‰u.._.8.u.‰].‰u..ƒ}..r.‹u.€|..u.‰.._..t.."f‹L(f...ƒ...‡.....Pf1..<.Xr.‹t0..‰u.€.....t..\.‰.;].r...._.8.u.P...‰u.‰].f‹D.......u..Š...S.Q.f‹D..J.[?FI.…=........X._.€?.t.8.t.._...‰..P€..;]..ƒ..8.t.._...‰].f‹F.f‰G.f@f‰G.._.;].s#€?€u.f‹W.ŠN.f...F.f...„..f‰G.f‰W...‹].€%.X.W.. ŠN.f..f‰.f.....f..f‰.....‚..?FI.…...k._..u.fRfQS‹u.Š....t.‰.ŠN.f..;].s.8.u.f9W.w.‰.._...‰u..{.[fYfZr.....E..QS.D...„M.ŠD.$...f‰M.ŠN.f‰.f..f‰E.f..f).f‰U 1.f‰U.f‹T..t ...f;U.v.ŠN.f..tGf‹E.f+E.f.E.f..f.E ...t*fPf@f+U.f.U.f..f9.u.Q.‰.Yf‹E.f..f‰.fXf.–..f.†.....uJfSf‰.f+].f..f‰.f[f+M f.E ....f;M.v.f‹M.fQf..u..........fYf)M.v.f‰U..&..b.[Y.f1.„.t.Q.f.....u.Y..€............ˆ.ˆ.€..t.......f..f‰U.f..ˆ....f..f.E.....t.fRS‹u.Š..2.r.€|..t.f.E.....[fZ.t ..U‰.f1.‡F.f...f.F.]...U‰.f.f...n..]..V...fP...^..W...fP..._..WfRf......tCf1.ŠU.€..t8‰.QŠN.€..f...W...f).f.F.....f.f.Yf..f+N.fQ.9.fYf.N.g.*‰.‰.f‰.f1.f‰..–...€f9.v.‰.Q...f...‚.Yf).u.‰.fZ_..V.fP.T.^.f‹V.f..fP.F._..W.Vf1...€f9.v.‰.Q...f...7.Yf).u._.^.f1....€u..........]‰....A..0....w^..u..ˆ......t4‰.HQS..ƒ..r........‰...R.....J!.Zƒ..‰...K&Š..B..[Y...B....9.r....f)V.t....t^...................GRUB
Edited by Allan
Code box added.
Link to comment
Share on other sites

Thank you for looking at it Slice but is this fixable by Clover.

It can be fixable by Clover if someone show me what and how. This is not complex.

Link to comment
Share on other sites

Hi Slice,

 

as i told, i repartitioned my HDD with MBR, made a Haiku partition in Haiku, installed the OS and the boot code to the partition. I tried your Clover build, but it does not list my Haiku partition. Here is a new DarwinDumper report, hopefully it contains some usable data for you.

 

DarwinDumper_2.9.8_INSYDE_Corp._X64_Yos_szilard.zip

 

The active EB partition is the Haiku one.

 

Thanks,

miqlas

Link to comment
Share on other sites

  • 2 weeks later...

Hi Slcie,

 

the latest Clvoer build (r3241) is able to detect my Haiku partition on my second HDD (MBR style). Clover shows a partition icon with a wrench. If i try to boot this partition, the screen goes black, but the partition icon with the wrench stays in the middle of the screen. Sometimes it reboots automatically.

 

What could be wrong?

 

Thank You!

 

--miqlas

Link to comment
Share on other sites

Hi Slcie,

 

the latest Clvoer build (r3241) is able to detect my Haiku partition on my second HDD (MBR style). Clover shows a partition icon with a wrench. If i try to boot this partition, the screen goes black, but the partition icon with the wrench stays in the middle of the screen. Sometimes it reboots automatically.

 

What could be wrong?

 

Thank You!

 

--miqlas

It is old problem still unresolved "Legacy boot works only on few hardwares".

Sorry if we so long discussed unpossible theme.

See again my first answer at post #2

Link to comment
Share on other sites

 Share

×
×
  • Create New...