OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Feb 25, 2021 7:33 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: uefi real pc bios doesn't recognize test boot drive
PostPosted: Tue Nov 10, 2020 10:57 am 
Offline
Member
Member
User avatar

Joined: Sun Oct 11, 2020 9:46 pm
Posts: 336
Location: North Florida, USA
I've been working on a bootloader from my OS because I really, really badly want my OS to work on real hardware.

I've gotten it to a mature point. I can load my kernel, in long mode, using operable graphics, on a UEFI-based QEMU virtual machine (without CSM support). I have a colorful screen in my bootloader so I wanted to boot it on real hardware to test my beautiful creation.

I plugged in my 64GB USB 3.0 drive, dd'ed the ISO to my USB stick. Rebooted, went into boot menu, and the only available UEFI option was my daily driver OS. I attempted to boot by manually booting the drive, however it still didn't work. I looked over and over and still didn't find anything.

Anyone know why?

source: https://github.com/microNET-OS/microCOR ... rizet/UEFI

_--computer--_

brand: HP
year: 2012
bios: American Megatrends K01 v3.03 (HP version)

Also I don't have Secure Boot or Fast Boot on.

_________________
microCORE: https://github.com/microNET-OS/microCORE
microBOOT: https://github.com/microNET-OS/microBOOT

I make stupid mistakes and my vision is terrible. Not a good combination.

NOTE: Never respond to my posts with "it's too hard".


Top
 Profile  
 
 Post subject: Re: uefi real pc bios doesn't recognize test boot drive
PostPosted: Tue Nov 10, 2020 12:07 pm 
Online
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 2792
It doesn't work because you're writing an image that is not partitioned and is not formatted as FAT32.

Partition your USB drive and format a partition as FAT32, then copy your files to it.


Top
 Profile  
 
 Post subject: Re: uefi real pc bios doesn't recognize test boot drive
PostPosted: Tue Nov 10, 2020 12:19 pm 
Offline
Member
Member
User avatar

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 639
Burn it to a CDROM and put it in your machine. It should work then.

_________________
Currently working on the Nexware project, an attempt to make a less bloated version of GNU. All repos for it can be found at https://github.com/Nexware-Project.


Top
 Profile  
 
 Post subject: Re: uefi real pc bios doesn't recognize test boot drive
PostPosted: Tue Nov 10, 2020 12:22 pm 
Offline
Member
Member
User avatar

Joined: Sun Oct 11, 2020 9:46 pm
Posts: 336
Location: North Florida, USA
nexos wrote:
Burn it to a CDROM and put it in your machine. It should work then.

Yea I don't have any CDs. I have an optical drive, not any CDs.

_________________
microCORE: https://github.com/microNET-OS/microCORE
microBOOT: https://github.com/microNET-OS/microBOOT

I make stupid mistakes and my vision is terrible. Not a good combination.

NOTE: Never respond to my posts with "it's too hard".


Top
 Profile  
 
 Post subject: Re: uefi real pc bios doesn't recognize test boot drive
PostPosted: Tue Nov 10, 2020 12:36 pm 
Offline
Member
Member
User avatar

Joined: Sun Oct 11, 2020 9:46 pm
Posts: 336
Location: North Florida, USA
Octocontrabass wrote:
It doesn't work because you're writing an image that is not partitioned and is not formatted as FAT32.

Partition your USB drive and format a partition as FAT32, then copy your files to it.


I tried extracting the ISO and flashing that FAT32 image to the USB drive, didn't work.
I tried leaving the FAT32 image on the USB drive, didn't work.
I tried dd'ing the FAT32 image to the USB drive, didn't work.
I also tried forgoing the FAT32 image, didn't work.
I also tried manually running the UEFI application in my BIOS's "Run UEFI Application..." menu. (drive didn't show up)

I've dd'ed my ISO images before, many, in fact, including my own OS and Linux installers, and they've all gone off without a hitch. I don't understand what the difference is here.

_________________
microCORE: https://github.com/microNET-OS/microCORE
microBOOT: https://github.com/microNET-OS/microBOOT

I make stupid mistakes and my vision is terrible. Not a good combination.

NOTE: Never respond to my posts with "it's too hard".


Last edited by rizxt on Tue Nov 10, 2020 1:27 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: uefi real pc bios doesn't recognize test boot drive
PostPosted: Tue Nov 10, 2020 1:23 pm 
Online
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 2792
The UEFI-compatible Linux installers include a partition table and a partition formatted as FAT32.

You're using mformat to create a FAT12 volume, but UEFI requires FAT32.


Top
 Profile  
 
 Post subject: Re: uefi real pc bios doesn't recognize test boot drive
PostPosted: Tue Nov 10, 2020 1:48 pm 
Offline
Member
Member
User avatar

Joined: Sun Oct 11, 2020 9:46 pm
Posts: 336
Location: North Florida, USA
Thank you Octacontrabass. My problem was solved by formatting as FAT32 and replacing the files back in (which I thought I had already did, lol)

_________________
microCORE: https://github.com/microNET-OS/microCORE
microBOOT: https://github.com/microNET-OS/microBOOT

I make stupid mistakes and my vision is terrible. Not a good combination.

NOTE: Never respond to my posts with "it's too hard".


Top
 Profile  
 
 Post subject: Re: uefi real pc bios doesn't recognize test boot drive
PostPosted: Tue Nov 10, 2020 4:13 pm 
Offline
Member
Member
User avatar

Joined: Thu Oct 13, 2016 4:55 pm
Posts: 1266
In case someone reads this topic later:

ISO - typically images containing ISO9660 file system, specifically designed for CDROMs (or UDF in case of DVDs). See Bootable CD.
USB stick - does not work with ISO images, for an UEFI compatible, dd'able image see wiki page Bootable Disk.

Special images that comply with both standards are called "hybrid images".

Octocontrabass wrote:
You're using mformat to create a FAT12 volume, but UEFI requires FAT32.
No, the UEFI spec allows FAT12, however very few real-life firmware implementation supports that. So FAT32 is not required, but recommended.

Cheers,
bzt


Top
 Profile  
 
 Post subject: Re: uefi real pc bios doesn't recognize test boot drive
PostPosted: Tue Nov 10, 2020 4:30 pm 
Offline
Member
Member
User avatar

Joined: Fri Feb 17, 2017 4:01 pm
Posts: 547
Location: Ukraine, Bachmut
UEFI specification mandates using FAT32 for ESP and also UEFI spec says ESP can reside on every medium, supported by Boot Services protocols - meaning, on removable devices as well. So, if it's marked as ESP, it must be FAT32, no matter where it resides. It may be of other type otherwise. the relevant quotes:
Quote:
EFI encompasses the use of FAT32 for a system partition, and FAT12 or FAT16 for removable media.

Quote:
A System Partition can reside on any media that is supported by EFI Boot Services.


Also, dd'ing a GPT image would be a very bad idea. you screw up GUID uniqueness. post processing is needed. But personally, in the case of pure UEFI, I'd go with just a folder on a FAT formatted (any type) USB stick, where I'd put my whole installation set, with an OSL incl. and just pointed to it manually during FW BDS (boot device selection) phase. and then, it would start a "live" session for the OS for letting users have a look or just run a setup/install process immediately. no need to prepare any "images", just throw your install set at your USB stick and you are ready to conquer the world. :)

_________________
future big goal: ANT - NT-like OS for mips, arm and x86.
current smaller goal: efify - UEFI for a couple of boards (mips and arm).


Last edited by zaval on Tue Nov 10, 2020 6:28 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: uefi real pc bios doesn't recognize test boot drive
PostPosted: Tue Nov 10, 2020 5:49 pm 
Offline
Member
Member
User avatar

Joined: Thu Oct 13, 2016 4:55 pm
Posts: 1266
.....aaaaand our beloved troll who knows always better but actually wasn't able to produce anything yet is here! Yay! :-)

zaval wrote:
UEFI specification mandates using FAT32 for ESP
Absolutely not. From the UEFI spec:
Quote:
The file system supported by the Extensible Firmware Interface is based on the FAT file system. EFI defines a specific version of FAT that is explicitly documented and testable. Conformance to the EFI specification and its associate reference documents is the only definition of FAT that needs to be implemented to support EFI.
Meaning it doesn't matter what's in the M$ FAT specification, EFI specifies it's own file system format.

zaval wrote:
Also, dd'ing a GPT image would be a very bad idea.
How would you write an image file to a disk otherwise? Who said that you can't generate the image dynamically before dd'ing it?

zaval wrote:
But personally, in the case of pure UEFI, I'd go with just a folder on a FAT formatted (any type) USB stick, where I'd put my whole installation set, with an OSL incl. and just pointed to it manually during FW BDS (boot device selection) phase.
Could we please see your installer (app, script whatever) that does all of this in your build environment? Do you even have an automated workflow for creating a bootable image from your source code?

Cheers,
bzt


Top
 Profile  
 
 Post subject: Re: uefi real pc bios doesn't recognize test boot drive
PostPosted: Tue Nov 10, 2020 6:08 pm 
Offline
Member
Member
User avatar

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 639
:roll: :roll:
Please don't derail this thread.

_________________
Currently working on the Nexware project, an attempt to make a less bloated version of GNU. All repos for it can be found at https://github.com/Nexware-Project.


Top
 Profile  
 
 Post subject: Re: uefi real pc bios doesn't recognize test boot drive
PostPosted: Tue Nov 10, 2020 6:17 pm 
Offline
Member
Member
User avatar

Joined: Fri Feb 17, 2017 4:01 pm
Posts: 547
Location: Ukraine, Bachmut
well, well. see, how "I" start "bickering". the only thing missing, is that fan girl, following me and telling "he thinks, I am wrong"... but anyway, just a couple of remarks.

bzt wrote:
Meaning it doesn't matter what's in the M$ FAT specification, EFI specifies it's own file system format.

"non" troll, either show me UEFI FAT specification or you are laughingstock. :)

for other people, not as "advanced" in parallel reality observing as bzt, and just for the sake of truth - UEFI doesn't specify one and instead clearly refers to the MS spec. :)
Quote:
The file system supported by the Extensible Firmware Interface is based on the FAT file system. EFI defines a specific version of FAT that is explicitly documented and testable. Conformance to the EFI specification and its associate reference documents is the only definition of FAT that needs to be implemented to support EFI. To differentiate the EFI file system from pure FAT, a new partition file system type has been defined.

the EFI specification doesn't contain FAT specification per se and "associate reference documents" in this respect is this one:
Appendix Q References, Q.1 Related Information wrote:
Microsoft Extensible Firmware Initiative FAT32 File System Specification, Version 1.03,
Microsoft Corporation, December 6, 2000, http://www.microsoft.com/whdc/system/platform/
firmware/fatgen.mspx

the whole "newness" and "difference" of EFI FAT is this one:
Quote:
To differentiate the EFI file system from pure FAT, a new partition file system type has been defined.

summarizing, UEFI FAT is one defined by the MS FAT specification, with the additional requirements regarding its typing and emphasis on using FAT32 for ESP, laid out in the UEFI spec. that's it. there are also notes about using only UCS-2 subset opposed to all UTF-16 and always supporting long names. it's a subset of a thing, specified in A and rules for subsetting, specified in B. where A - is MS FAT spec, B - UEFI spec.

and this one again, I quoted already, but it's you, so, here is yet once:
Quote:
EFI encompasses the use of FAT32 for a system partition, and FAT12 or FAT16 for removable media.

if you cannot grasp this, then sorry.

bzt wrote:
Could we please see your installer (app, script whatever) that does all of this in your build environment? Do you even have an automated workflow for creating a bootable image from your source code?

I don't use "bootable image" for UEFI.

_________________
future big goal: ANT - NT-like OS for mips, arm and x86.
current smaller goal: efify - UEFI for a couple of boards (mips and arm).


Last edited by zaval on Tue Nov 10, 2020 7:22 pm, edited 6 times in total.

Top
 Profile  
 
 Post subject: Re: uefi real pc bios doesn't recognize test boot drive
PostPosted: Tue Nov 10, 2020 6:18 pm 
Offline
Member
Member
User avatar

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 639
Zaval, you aren't the one bickering here. You posted an answer designed to helpful. There is nothing wrong with that. And now you called a troll? I see something wrong with that.

_________________
Currently working on the Nexware project, an attempt to make a less bloated version of GNU. All repos for it can be found at https://github.com/Nexware-Project.


Top
 Profile  
 
 Post subject: Re: uefi real pc bios doesn't recognize test boot drive
PostPosted: Tue Nov 10, 2020 6:20 pm 
Offline
Member
Member
User avatar

Joined: Thu Oct 13, 2016 4:55 pm
Posts: 1266
nexos wrote:
Please don't derail this thread.
Have no worries, I won't respond to zaval.

Have a nice day!
bzt


Top
 Profile  
 
 Post subject: Re: uefi real pc bios doesn't recognize test boot drive
PostPosted: Tue Nov 10, 2020 6:24 pm 
Offline
Member
Member
User avatar

Joined: Fri Feb 17, 2017 4:01 pm
Posts: 547
Location: Ukraine, Bachmut
^ but before vamoosing, - don't forget to show UEFI FAT specification, "genius".

_________________
future big goal: ANT - NT-like OS for mips, arm and x86.
current smaller goal: efify - UEFI for a couple of boards (mips and arm).


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: Majestic-12 [Bot] and 18 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