Drivers based on UEFI?

Here you can discuss ReactOS related topics.

Moderator: Moderator Team

Post Reply
alexei2
Posts: 20
Joined: Fri Oct 29, 2021 2:07 pm

Drivers based on UEFI?

Post by alexei2 »

I believe it's possible to write drivers that interact with hardware via calling UEFI.
That would assure ROS boot and run on modern hardware with no existing XP drivers and no ROS drivers written yet.
Would it be a lot of work?
BTW, that would also allow running XP/2003 on modern hardware.
User avatar
EmuandCo
Developer
Posts: 4722
Joined: Sun Nov 28, 2004 7:52 pm
Location: Germany, Bavaria, Steinfeld
Contact:

Re: Drivers based on UEFI?

Post by EmuandCo »

UFEI is running BEFORE OS and the drivers are not available there. So it's not working that way. Either you have drivers for the corresponding OS and kernel or you do not.
ReactOS is still in alpha stage, meaning it is not feature-complete and is recommended only for evaluation and testing purposes.

If my post/reply offends or insults you, be sure that you know what sarcasm is...
User avatar
binarymaster
Posts: 481
Joined: Sun Nov 16, 2014 7:05 pm
Location: Russia, Moscow
Contact:

Re: Drivers based on UEFI?

Post by binarymaster »

EmuandCo wrote: Mon Jan 10, 2022 2:06 pm UFEI is running BEFORE OS and the drivers are not available there.
I think he means interaction between the OS and UEFI Boot Services.
alexei2 wrote: Mon Jan 10, 2022 11:46 am I believe it's possible to write drivers that interact with hardware via calling UEFI.
That would assure ROS boot and run on modern hardware with no existing XP drivers and no ROS drivers written yet.
While it's possible in theory, NT kernel is not suited to work with the boot services. The loader does call UEFI function ExitBootServices() before jumping to the kernel.

UEFI does also expose Runtime Services - this is what can be used in the OS, but it's limited to some critical hardware functions like power management.
Last edited by binarymaster on Mon Jan 10, 2022 6:17 pm, edited 2 times in total.
PeterLinuxer
Posts: 122
Joined: Fri Oct 26, 2018 6:19 pm

Re: Drivers based on UEFI?

Post by PeterLinuxer »

You can write (and use existing) UEFI drivers for booting an OS. But once the boot process is done and the kernel becomes active, then the UEFI drivers become useless. The whole computer is in a different state when the kernel is working than when the UEFI is active. So you need OS specific drivers.

UEFI runtime services are very limited.
ReactOS is in early development phase! And ReactOS is not Linux.
User avatar
irony
Posts: 42
Joined: Tue Dec 04, 2018 4:17 pm

Re: Drivers based on UEFI?

Post by irony »

I think he means interaction between the OS and UEFI Boot Services.
Using UEFI Boot Services in the kernel is not possible nor the former are meant for that purpose.
While it's possible in theory, NT kernel is not suited to work with the boot services. The loader does call UEFI function ExitBootServices() before jumping to the kernel.
None OS, that uses modern virtual memory approach (running in a process(or) address space, that is mapped to the system (physical) space) would be able to use Boot Services. even more, such the kernel could not own the system memory map at all, and could not have direct access to peripherals. basically, it's only possible if the kernel would be just a UEFI application, which is basically a DLL of the UEFI Boot Manager (or, another way to say, - of the Boot Device Selection phase of the firmware), running in a single processor, single threaded, single address space, identity mapped to the system one, with the only timer interrupt handled (still, by the firmware core, not the DLL) - everything else is handled by polling. Would such a thing be elligible to be called an OS yet? rhetorical question. UEFI provides a simplistic access to hardware just enough for loading files and making some output, it's made for this - loading the OS. it's an environment for running OS loaders, way friendlier, than BIOS, and that's it. there is no such thing like "UEFI based drivers" possible.

Original poster just needs to familiarize himself more with what UEFI is and what it is for.
alexei2
Posts: 20
Joined: Fri Oct 29, 2021 2:07 pm

Re: Drivers based on UEFI?

Post by alexei2 »

Original poster just needs to familiarize himself more with what UEFI is and what it is for.
Have you noticed "?" in the title?

Actually, it's not as simple, as "UEFI is for boot only" :) UEFI Runtime Services do exist, for ex. see https://wiki.osdev.org/Using_UEFI_Runti ... our_Kernel and other info on the subject.
However, it looks like making UEFI to work alongside the OS would be extremely hard to implement and it would likely be very slow anyways.
Finally, it would depend on particular (possibly buggy) OEM implementation of UEFI :(
PeterLinuxer
Posts: 122
Joined: Fri Oct 26, 2018 6:19 pm

Re: Drivers based on UEFI?

Post by PeterLinuxer »

As I said UEFI runtime services are very limited. UEFI drivers for an OS aren't possible with them.
ReactOS is in early development phase! And ReactOS is not Linux.
User avatar
irony
Posts: 42
Joined: Tue Dec 04, 2018 4:17 pm

Re: Drivers based on UEFI?

Post by irony »

alexey2, have you looked at what Runtime Services are and what they are for? if you had, you'd have known, that there couldn't be even a question about some "drivers", based on them. anyone, interested, should read the UEFI specification and not some questionable articles.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], DotBot [Crawler] and 19 guests