Does UEFI run on top of BIOS?

The article you link to https://wiki.osdev.org/UEFI uses strange terminology that nobody else uses like that. So that article is saying BIOS runs first then UEFI, but that's not really the case.

There is a 'colloquial' definition or usage of the term BIOS, and a technical definition.

(That article's terminology is neither of those, that article's terminology is way off)

So for now let's put aside that article's bizarre definitions of UEFI and BIOS and look at the definitions of UEFI And BIOS and how they are used.

The colloquial definition or usage of the term BIOS, is not just to refer to the BIOS as a BIOS, but to refer to the UEFI as a BIOS. That may be because they are using the term BIOS generally, or it may be they just call the UEFI, the BIOS, because they think the term is more familiar to people as BIOS was around for a long time and to the end user or even to most computer technicians, it looks the same. And they may even say UEFI BIOS, to mean UEFI. That may be because are using BIOS generally and see UEFI as a type of BIOS. Or they may be saying it because some may have no idea what a UEFI is and by sticking the word BIOS after it, they think it makes it clearer for people, as from the perspective of end users and most computer technicians they look the same. e.g. they have a configuration page, you can choose boot order.

https://www.howtogeek.com/56958/htg-explains-how-uefi-will-replace-the-bios/ "Even if your PC uses the term 'BIOS', modern PCs you buy today almost certainly ship with UEFI firmware instead of a BIOS. "

So, computers sometimes use the colloquial definition , for example it says push F2/Escape/F10/whatever to go to the BIOS. Or says Press whatever to go to setup, and then it says "BIOS version ..". Actually it's technically not a BIOS it's a UEFI.

There are things that take place when a computer powers on, before the processor executes anything. i.e. before it runs the firmware in the 'reset vector' , that's before any BIOS or UEFI. Here is some description of what happens then, http://www.drdobbs.com/parallel/booting-an-intel-architecture-system-par/232300699?pgno=1 . (and the article continues for afterwards too). There's a CPLD that is programmable, it runs software, that is firmware. That is very obscure. People almost never mean this when they say motherboard firmware. That firmware regulates the power supply and clocks and then lets the CPU reset and start.

I don't think the word BIOS would ever apply to anything as early as that! And UEFI wouldn't either. So when a source like wikipedia in its article on BIOS, says BIOS is "the first software to run when powered on", it's not technically correct, for two reasons. A)'cos even if a system was running a BIOS and not a UEFI, the BIOS still wouldn't be the first thing to run. B)And if a system is running a UEFI there wouldn't be any BIOS running!

When the CPU begins its fetch decode execute cycle, it begins with a part of memory known as the reset vector - which has or points to the BIOS or UEFI.

Some perhaps older sources, may have spoken of UEFI BIOS, to mean UEFI. For example this source written in 2013 https://www.alphr.com/features/381565/uefi-bios-explained speaks of a UEFI BIOS but rightly says it's not that meaningful and falls to the term UEFI , which is what it meant by UEFI BIOS. The Dr Dobbs link I mentioned from 2011 also uses the phrase "UEFI BIOS", to mean UEFI. Your source uses terms more strangely.

The colloquial definition for BIOS (as a general term), is probably rather old and outdated.

If one wants a general term for UEFI and BIOS then "motherboard firmware run by the CPU" would be spot on.

The technical definition / usage, and really current one, is UEFI replaces BIOS.

Looking at that article and its unique strange wrong terminology

The osdev article you link to uses stranger terminology that only it uses! It seems to refer to the initial part of the BIOS or UEFI, which they have in common, as BIOS. So if you have a UEFI, one might think it runs on top of a BIOS! I don't think anybody other than that article defines BIOS in this manner or uses the term BIOS in that way!

Here is a very misleading strange paragraph from the article you linked to

A common misconception is that UEFI is a replacement for BIOS. In reality, both legacy motherboards and UEFI-based motherboards come with BIOS ROMs, which contain firmware that performs the initial power-on configuration of the system before loading some third-party code into memory and jumping to it. The differences between legacy BIOS firmware and UEFI BIOS firmware are where they find that code, how they prepare the system before jumping to it, and what convenience functions they provide for the code to call while running.

So it seems to be referring to the initial part of the BIOS or UEFI, that they share, as BIOS, as mentioned. This is very unconventional terminology no other source does that.

Sometimes when people look at what actual functions they are referring to with this/that word, they can be a bit sloppy with terms, though this article is quite dogmatic in its strange usage.

It's not a "misconception" that UEFI replaces BIOS, it's the truth.

And the term UEFI BIOS is really unclear and best avoided.

And by the way, Flash memory, which is where the UEFI is stored, is EEPROM memory which is ROM memory. It's just more easy to write to than the old ROM memory that wasn't EEPROM. (Some sources, to an extent that one, and also even wikipedia's article on BIOS, make it sound like Flash memory is distinct from ROM memory

It's probably not worth thinking too much about the strange usage of BIOS and UEFI used in that osdev.org article. But having spoken to a few OS devs, many look at the UEFI and BIOS more for the API that they provide.. rather than what goes on behind the scenes and no doubt OS devs tend to care more about the development of the OS than the technicalities of BIOS and UEFI.

One attempt at justifying the suggestion in that article that the CPU runs some firmware before the UEFI, was a claim that "CPUs start in 16bit mode. UEFI runs in 32bit or 64bit. So something has to get there first." (and they may the first paragraph of that wikpedia article on the BIOS and say it's that - the BIOS that runs first). But that claim can be proven wrong. One can point to the UEFI starting in 16bit.

The article you link to was trying to suggest that there's a part before the UEFI.. there isn't. Even the 16bit part at the very beginning is part of the UEFI. A technical guy I spoke to that knows a lot, pointed me https://github.com/tianocore/edk2/tree/master/UefiCpuPkg/ResetVector/Vtf0 as evidence, and said that's from the EFI codebase, and is code for that very early still 16bit part of the boot process. I'm sure he's right, as that's consistent with any normal(correct!) use of the terms!

Technically, some of the UEFI specification got put into a specification called the UEFI-PI spec, or PI spec, but any implementation of the UEFI spec, implements the PI Spec. https://www.insyde.com/press_news/blog/uefi-pi-13-review-part-1-i2c-bus-protocol And the PI spec has all the phases of the UEFI https://github.com/tianocore/tianocore.github.io/wiki/PI-Boot-Flow . When people refer to the UEFI they'd tend to be including anything in the UEFI spec and PI spec.

A BIOS or UEFI begins in a part of memory called the 'reset vector'.

UEFI(thus far) supports legacy BIOS mode

UEFI is able to simulate what the firmware used to be like pre EFI i.e. in the days of the "legacy BIOS". For the sake of OSs that don't run on a normal UEFI. This is a mode.. It's called UEFI with CSM(Compatibility Support Module). When UEFI simulates the legacy BIOS with that mode.

This mode may be phased out at some point eg by 2020. https://arstechnica.com/gadgets/2017/11/intel-to-kill-off-the-last-vestiges-of-the-ancient-pc-bios-by-2020/

So now to answer your question quoting you

This page: https://wiki.osdev.org/UEFI and few others which are rather creditable

By 'creditable', you mean 'authoritative', and that page isn't that authoritative, 'cos OS Devs often don't care much about the details of UEFI and BIOS other than the API they provide the OS. Their interest is in OS development.

[that page] mention that UEFI is kind of an application which run on BIOS (legacy BIOS)

Based on the terminology that page uses, yes, though it might not refer to BIOS in that context as legacy.

That page is using the term BIOS generally. Hence its reference to UEFI BIOS.

And it uses the term BIOS (not UEFI), for the aspect of the firmware that runs at the beginning that is the same now as then. (A different terminology would consider that part of the UEFI). I wouldn't take it too seriously.

UEFI is firmware. As is/was legacy BIOS.

and [UEFI is] not a firmware If I got it right.

No.

Legacy BIOS is/was firmware. But hasn't been used in well over a decade.

UEFI is a firmware.

Both are.

Some others claim they just run together (BIOS + UEFI).

No.. There is the terminology that BIOS is the general term(i.e. not specifically legacy BIOS). And UEFI is the specific.

And there is "legacy BIOS Mode" which is within UEFI. (note the word 'mode'. Legacy BIOS is not the same as Legacy BIOS mode). Legacy BIOS (without the word mode), is BIOS not UEFI.

This is not about calling UEFI "UEFI BIOS" mistakenly (its another thing, not my question).

That's the terminology used in that article and has some basis eg the wikipedia article on BIOS uses the term BIOS in the general sense, though it says UEFI is the successor to the BIOS. But the term UEFI doesn't project back in time to what preceded it years before. Whereas the definition of BIOS given in that wikpedia article could project backward or forward in time as it's defined there as the firmware that runs when the computer starts(by which it means when the CPU starts). So by that logic, one could say UEFI BIOS. Even though, as even that same BIOS wikipedia page says, UEFI is the 'successor'.

But, as mentioned, there's no need to use the term 'UEFI BIOS'. And it's not a very clear term. Maybe the term UEFI BIOS was used sometimes to indicate to people the kind of things UEFI did. And because they felt the term BIOS was so entrenched. You can say 'motherboard firmware' for a general term.

And whatever wiring/electronics or even firmware, gets the CPU To go to the reset vector is not BIOS or UEFI. https://stackoverflow.com/questions/22312428/what-memory-is-used-for-storing-the-reset-vector

But as far as I know BIOS and UEFI are firmware interfaces and alternatives to each other. BIOS is legacy and UEFI is more advanced modern alternative to it.

yeah that's the normal terminology

(firmware, not firmware interfaces!).

And they provide an interface / API, to the OS.

So what's the reality?

That.. ^ And research I have done indicates that the linked article in the questoner's post is really wrong. UEFI does replace the BIOS. A computer runs either a UEFI, or if it's very old, then a BIOS. Sometimes colloquially the term BIOS is used for the configuration screen, but it's part of the UEFI and techies will often jump in and correct and say UEFI not BIOS. Some may use the term BIOS for anything run by the CPU before the boot loader, even if it is a UEFI, but it's a colloquialism and a bit iffy and better to say UEFI when it's UEFI. And to say that a computer running a UEFI also runs and starts with a BIOS, as that article does, is completely wrong. The author of that article perhaps doesn't realise that UEFI includes even the 16bit part that runs very near the very beginning of booting.