OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 11:21 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: "No boot partition" for BOOTBOOT on a FAT32 image
PostPosted: Thu Dec 12, 2019 7:28 am 
Offline

Joined: Thu Dec 12, 2019 7:07 am
Posts: 8
Hi,

I am trying to get my FAT32 image to run using BOOTBOOT and I am running into a "No boot partition" error (image attached). Looking at the docs, it says if you are using FAT32, this means that the partition may be "inconsistent". Not knowing exactly what that meant, I looked through bootboot.asm and found the possible place of failure (image attached). It looks like it's looking for 0xAA55 and then the string 'INITRD' 8 bytes later. Looking at a hexdump, I do not see that pattern anywhere in my FAT32 image file. I do have my INITRD file in /BOOTBOOT/INITRD in the image. 2 questions:

1) What do I have to do to get the pattern (0x55 0xAA ?? ?? 'INITRD') it is looking for?
2) I'd like to know where in the image it's searching and it looks like it starts at address 0xC8000, but I don't know what this maps to. What is the significance of this address? It's not referenced anywhere else.

Thanks!
Attachment:
File comment: no partition found
error_bootboot.png
error_bootboot.png [ 55.19 KiB | Viewed 1496 times ]

Attachment:
File comment: possible place of failure
asm.png
asm.png [ 93.48 KiB | Viewed 1496 times ]


Top
 Profile  
 
 Post subject: Re: "No boot partition" for BOOTBOOT on a FAT32 image
PostPosted: Thu Dec 12, 2019 3:02 pm 
Offline
Member
Member

Joined: Thu Aug 13, 2015 4:57 pm
Posts: 384
I don't know BOOTBOOT, quick search found this:
https://gitlab.com/bztsrc/bootboot

Where did you find BOOTBOOT? Did you read the instructions? The above link talks about ELF64 or PE32+ executable inside an initrd (initial ram disk). So maybe read that and follow the instructions.

Seems to bzt's handiwork.

There was also this:
https://gitlab.com/bztsrc/bootboot/blob/master/bootboot_spec_1st_ed.pdf

Though didn't read that, disagreed with first few paragraphs, so stopped reading..

Out of curiosity, you could use the common tools (grub for instance) which have good instructions in the osdev wiki, or you can venture out on your own, but that usually means you need to figure stuff out on your own. So how did you decide to use BOOTBOOT, and not find the instructions for it?


Top
 Profile  
 
 Post subject: Re: "No boot partition" for BOOTBOOT on a FAT32 image
PostPosted: Fri Dec 13, 2019 3:58 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5102
DanB91 wrote:
I am trying to get my FAT32 image to run using BOOTBOOT and I am running into a "No boot partition" error (image attached).

Is your image partitioned with GPT?

DanB91 wrote:
1) What do I have to do to get the pattern (0x55 0xAA ?? ?? 'INITRD') it is looking for?

Put your initrd in an option ROM.
DanB91 wrote:
2) I'd like to know where in the image it's searching and it looks like it starts at address 0xC8000, but I don't know what this maps to. What is the significance of this address? It's not referenced anywhere else.

That's where option ROMs are located.

I think you're looking at the code for loading from an option ROM and not the code for loading from disk.


Top
 Profile  
 
 Post subject: Re: "No boot partition" for BOOTBOOT on a FAT32 image
PostPosted: Fri Dec 13, 2019 5:03 am 
Offline
Member
Member
User avatar

Joined: Thu Oct 13, 2016 4:55 pm
Posts: 1584
Hi,

Thanks for checking out my boot loader!

About your issue, @Octocontrabass is perfectly right in everything. You are looking at the code which locates the initrd in a ROM image. The disk storage code starts at line 1030.

The error message you're getting means one of these:
1. you probably have a valid GPT, otherwise the message would be "no gpt found", line 1041
2. in the GPT there's no partition with bootable flag set (EFI_PART_USED_BY_OS, attrib bit 2). This is optional to let you choose a partition explicitly, line 1063
3. if there's no partition flagged, then there's no partition with ESP UUID either (most likely this is your problem), line 1072
4. if partition found, it does not contain a FAT file system (the code explicitly checks for "FAT16" and "FAT32" magic bytes in the BPB), line 1108
5. the FAT partition does not contain a directory named "BOOTBOOT" in it's root directory, line 1203

Please note that due to licensing issues, the loader only uses 8+3 MSDOS file names, so if you have only LFN entry for the BOOTBOOT directory, it won't be able to find it (some fs creators are only saving the LFN entry to avoid these licensing issues).

It is not the case here, but be aware that there's an unresolved issue with some compressed initrd in the BIOS implementation, not all images are handled properly (I didn't had the time to debug this yet but I'm on it. With the RPi and EFI versions all compressed images work without a problem, but for the BIOS version there's a 50%-50% chance that it can't be uncompressed. If you want to use the BIOS version, I'd recommend uncompressed initrd images only for the time being).

Cheers,
bzt


Top
 Profile  
 
 Post subject: Re: "No boot partition" for BOOTBOOT on a FAT32 image
PostPosted: Fri Dec 13, 2019 5:17 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5102
bzt wrote:
1. you probably have a valid GPT, otherwise the message would be "no gpt found", line 1041

No such error message exists. If no GPT is found, the error message will be "No boot partition".

bzt wrote:
2. in the GPT there's no partition with bootable flag set (EFI_PART_USED_BY_OS, attrib bit 2). This is optional to let you choose a partition explicitly, line 1063
3. if there's no partition flagged, then there's no partition with ESP UUID either (most likely this is your problem), line 1072
4. if partition found, it does not contain a FAT file system (the code explicitly checks for "FAT16" and "FAT32" magic bytes in the BPB), line 1108
5. the FAT partition does not contain a directory named "BOOTBOOT" in it's root directory, line 1203

If any of these things are the problem, the error message will be "Initrd not found".


Top
 Profile  
 
 Post subject: Re: "No boot partition" for BOOTBOOT on a FAT32 image
PostPosted: Fri Dec 13, 2019 6:30 am 
Offline
Member
Member
User avatar

Joined: Thu Oct 13, 2016 4:55 pm
Posts: 1584
Octocontrabass wrote:
...
No such error message exists. If no GPT is found, the error message will be "No boot partition".

...
If any of these things are the problem, the error message will be "Initrd not found".
Eh, my mistake, you're right. It was long time ago when I wrote this code, it had evolved a lot since, and I haven't touched it for years because it just worked for me :-) Probably I should revise the messages and replace them with more specific texts. Good point!

@DanB91: stay tuned, soon you'll now exactly what's missing in your configuration.

EDIT: fixed. Now if there's no GPT, "no GPT found" is the message. If there's no FAT partition with ESP UUID or EFI_USED_BY_OS bit and a BOOTBOOT directory in the root dir, then the message is "no boot partition". If initrd is not found in that directory, then the message is "Initrd not found".

The "no boot partition" message can't be more specific, because it is perfectly valid to have 3 FAT partitions, all with EFI_USED_BY_OS flag, but only the last having a BOOTBOOT directory. (It would be better if GPT had a unique bootable flag like MBR's 0x80 which can be set on only one partition at a time, but it has not.)

EDIT2: gzip in BIOS version fixed too. All compressed images that were reported broken are now booting successfully.

Cheers,
bzt


Top
 Profile  
 
 Post subject: Re: "No boot partition" for BOOTBOOT on a FAT32 image
PostPosted: Fri Dec 13, 2019 11:14 pm 
Offline

Joined: Thu Dec 12, 2019 7:07 am
Posts: 8
bzt wrote:
Octocontrabass wrote:
...
No such error message exists. If no GPT is found, the error message will be "No boot partition".

...
If any of these things are the problem, the error message will be "Initrd not found".
Eh, my mistake, you're right. It was long time ago when I wrote this code, it had evolved a lot since, and I haven't touched it for years because it just worked for me :-) Probably I should revise the messages and replace them with more specific texts. Good point!

@DanB91: stay tuned, soon you'll now exactly what's missing in your configuration.

EDIT: fixed. Now if there's no GPT, "no GPT found" is the message. If there's no FAT partition with ESP UUID or EFI_USED_BY_OS bit and a BOOTBOOT directory in the root dir, then the message is "no boot partition". If initrd is not found in that directory, then the message is "Initrd not found".

The "no boot partition" message can't be more specific, because it is perfectly valid to have 3 FAT partitions, all with EFI_USED_BY_OS flag, but only the last having a BOOTBOOT directory. (It would be better if GPT had a unique bootable flag like MBR's 0x80 which can be set on only one partition at a time, but it has not.)

EDIT2: gzip in BIOS version fixed too. All compressed images that were reported broken are now booting successfully.

Cheers,
bzt

Ah, I completely missed the part in the docs that says I need a GPT partition. I didn't have that in my image. Thank you very much! I will try it out.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot], kerravon and 73 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group