HI Is there oberon as UEFI executable? It could be bare-metal executable running on modern PC without OS (no need for windows/linux) Here's example of tetris-uefi https://github.com/a1ive/uefi-tetris I tried binery, it works, there's source and makefile for gcc.
Hello, Am 06.11.2022 um 19:54 schrieb D EMARD:
Is there oberon as UEFI executable? It could be bare-metal executable running on modern PC without OS (no need for windows/linux)
I am not aware of one that is running directly in the UEFI boot services environment. I considered porting the Oberon RISC Emulator to UEFI boot services some years ago, but I ditched that plan as mouse support in boot services envrironment was (depending on hardware) either very rudimentary or non-existant. (On my laptop, the touchpad does not work at all, and an attached USB mouse works with two buttons but cannot detect both buttons simultaneously, so no interclicks). As most existing bootloaders do not have mouse support, I doubt that the situation changed meanwhile. And with Windows 10/11 having switched to run the boot option selector outside boot services in the "full" Windows environment, I doubt that there will be any more incentives for improving mouse support in UEFI boot services environment. In case your UEFI has working 3-button mouse support in boot services environment, feel free to port one of the Oberon distributions or emulators to that environment :) Regards, Michael
HM, obviously something we consider 'trivial' like 3-button mouse can be issue for bare-metal. I can try to search some simple uefi source example that supports USB mouse. I have read some blogs that for uefi PS/2 mouse/kbd is easier than USB and laptops internally hjave PS/2 kbd and touchpad. Example for this is UEFI-NES games emulator https://github.com/shadlyd15/NesUEFI Of course there should be be some way to get working USB mouse. I tried free memtest86 binary, it works with USB mouse support On Sun, Nov 6, 2022 at 9:16 PM Michael Schierl <schierlm@gmx.de> wrote:
Hello,
Am 06.11.2022 um 19:54 schrieb D EMARD:
Is there oberon as UEFI executable? It could be bare-metal executable running on modern PC without OS (no need for windows/linux)
I am not aware of one that is running directly in the UEFI boot services environment.
I considered porting the Oberon RISC Emulator to UEFI boot services some years ago, but I ditched that plan as mouse support in boot services envrironment was (depending on hardware) either very rudimentary or non-existant. (On my laptop, the touchpad does not work at all, and an attached USB mouse works with two buttons but cannot detect both buttons simultaneously, so no interclicks).
As most existing bootloaders do not have mouse support, I doubt that the situation changed meanwhile. And with Windows 10/11 having switched to run the boot option selector outside boot services in the "full" Windows environment, I doubt that there will be any more incentives for improving mouse support in UEFI boot services environment.
In case your UEFI has working 3-button mouse support in boot services environment, feel free to port one of the Oberon distributions or emulators to that environment :)
Regards,
Michael
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
EDK2 has something that looks like usb mouse driver support I think EFI Clover bootloader is compiled with EDK2 and it has mouse support. For gnu-efi there seems to exist some low-level USB support, I think there is USB class protocol and user should decode mouse protocol. I did some low-level USB 3-btn and wheel mouse support on FPGA using lowlevel class support. Most mouses have same data structure like logitech, it reports few bytes for each event move or click. so most logitech mouses work, and approx 50% other models have data structure same as logitech. https://edk2-docs.gitbook.io/edk-ii-uefi-driver-writer-s-guide/19_usb_driver... On Sun, Nov 6, 2022 at 9:31 PM D EMARD <vordah@gmail.com> wrote:
HM, obviously something we consider 'trivial' like 3-button mouse can be issue for bare-metal.
I can try to search some simple uefi source example that supports USB mouse. I have read some blogs that for uefi PS/2 mouse/kbd is easier than USB and laptops internally hjave PS/2 kbd and touchpad. Example for this is UEFI-NES games emulator https://github.com/shadlyd15/NesUEFI Of course there should be be some way to get working USB mouse.
I tried free memtest86 binary, it works with USB mouse support
On Sun, Nov 6, 2022 at 9:16 PM Michael Schierl <schierlm@gmx.de> wrote:
Hello,
Am 06.11.2022 um 19:54 schrieb D EMARD:
Is there oberon as UEFI executable? It could be bare-metal executable running on modern PC without OS (no need for windows/linux)
I am not aware of one that is running directly in the UEFI boot services environment.
I considered porting the Oberon RISC Emulator to UEFI boot services some years ago, but I ditched that plan as mouse support in boot services envrironment was (depending on hardware) either very rudimentary or non-existant. (On my laptop, the touchpad does not work at all, and an attached USB mouse works with two buttons but cannot detect both buttons simultaneously, so no interclicks).
As most existing bootloaders do not have mouse support, I doubt that the situation changed meanwhile. And with Windows 10/11 having switched to run the boot option selector outside boot services in the "full" Windows environment, I doubt that there will be any more incentives for improving mouse support in UEFI boot services environment.
In case your UEFI has working 3-button mouse support in boot services environment, feel free to port one of the Oberon distributions or emulators to that environment :)
Regards,
Michael
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Hello, Am 06.11.2022 schrieb D EMARD:
I can try to search some simple uefi source example that supports USB mouse.
Ther is EFI_SIMPLE_POINTER_PROTOCOL which is available in gnu-efi as well as in EDK2. <https://github.com/rhboot/gnu-efi/blob/master/inc/efipoint.h> And yes, the protocol is really simple. Which does not guarantee that it works on your machine :) I have read some blogs that for
uefi PS/2 mouse/kbd is easier than USB and laptops internally hjave PS/2 kbd and touchpad.
It all depends on what drivers are included in your motherboard firmware. And while the embedded controller of my notebook emulates a PS/2 keyboard, the touchpad is not emulated at all (neither as a PS/2 mouse nor an USB HID device). So for OSes that do not have native support for Elantech touchpads, no mouse for me... And also not in UEFI.
I tried free memtest86 binary, it works with USB mouse support
Good for you :) Maybe I should buy a new notebook at some point (it is almost 10 years old).
EDK2 has something that looks like usb mouse driver support
The USB mouse drivers in Tianocore EDK2 only support two mouse buttons. See https://bsdio.com/edk2/docs/master/_usb_mouse_8c_source.html line 828ff. But on the bright side, they should support interclicks just fine.
I think EFI Clover bootloader is compiled with EDK2 and it has mouse support.
Clover, that was that bootloader for Macs/Haskintoshes? To be honest, the variety of different hardware on Macs (even on Hackintoshes) is a fraction of that you find on a PC.
For gnu-efi there seems to exist some low-level USB support, I think there is USB class protocol and user should decode mouse protocol.
While it is possible for boot service applications to take over the USB host controller, I am not sure whether that is a good idea. You'd at least have to make sure that the device the user booted from was not connected to that same host controller, or you'd have to implement all the USB Mass Storage and filesystem stuff on your own. And while the alternative would be to load a custom Dxe for your USB device and leave the host controller under the control of UEFI boot services, I don't know if you can load a custom Dxe for USB mice (supporting more buttons) if your system firmware already includes one (that supports only two of them).
I did some low-level USB 3-btn and wheel mouse support on FPGA using lowlevel class support. Most mouses have same data structure like logitech, it reports few bytes for each event move or click. so most logitech mouses work, and approx 50% other models have data structure same as logitech.
To be honest, when you start to reimplement drivers at that level, why not just use the drivers (USB keyboard/mouse/storage) of e.g. Linux or A2 and let it run on EFI framebuffer? I believe there is a Linux hosted version for every Oberon variant in existence. UEFI boot services makes sense to be independent of hardware (so you can play GRUB invaders on any device that has a keyboard, screen and UEFI). Once you need to write hardware specific drivers, I'd prefer to piggyback on some existing OS that has implemented everything for it. Unless you consider it a challenge to run it without any Linux/Windows/A2 in between. Regards, Michael
Your points seem reasonable I hope DXE driver is only protocol decoder with some interrupt/threads support and it should not occupy entire USB bus only for mouse, so storage and kbd should keep working. Linux USB driver supports everything but its too big (needs complex class parser) and tightly integrated with many things in kernel so pulling just "mouse driver" out doesn't look simple I think it's ok to have minimalistic driver assuming a known mouse protocol and no complex class parsing even if it doesn't support every mouse but most of them. Clover is user "friendly" bootloader with GUI and mouse, mainly intended to appear nice for apple users, comes with free source (so we can see how USB is done) and can boot normal linux or windows, no apples required. True one could first boot linux and have every USB mouse supported, then run oberon exe. One drawback is linux shutdown is always recommeded before powering off or there could be filesystem issues on next boot. oberon is more poweroff-resistant than linux so I'd find acceptable buying supported mouse to run oberong on average uefi PC On Sun, Nov 6, 2022 at 10:44 PM Michael Schierl <schierlm@gmx.de> wrote:
Hello,
Am 06.11.2022 schrieb D EMARD:
I can try to search some simple uefi source example that supports USB mouse.
Ther is EFI_SIMPLE_POINTER_PROTOCOL which is available in gnu-efi as well as in EDK2.
<https://github.com/rhboot/gnu-efi/blob/master/inc/efipoint.h>
And yes, the protocol is really simple. Which does not guarantee that it works on your machine :)
I have read some blogs that for
uefi PS/2 mouse/kbd is easier than USB and laptops internally hjave PS/2 kbd and touchpad.
It all depends on what drivers are included in your motherboard firmware. And while the embedded controller of my notebook emulates a PS/2 keyboard, the touchpad is not emulated at all (neither as a PS/2 mouse nor an USB HID device). So for OSes that do not have native support for Elantech touchpads, no mouse for me... And also not in UEFI.
I tried free memtest86 binary, it works with USB mouse support
Good for you :)
Maybe I should buy a new notebook at some point (it is almost 10 years old).
EDK2 has something that looks like usb mouse driver support
The USB mouse drivers in Tianocore EDK2 only support two mouse buttons. See https://bsdio.com/edk2/docs/master/_usb_mouse_8c_source.html line 828ff. But on the bright side, they should support interclicks just fine.
I think EFI Clover bootloader is compiled with EDK2 and it has mouse support.
Clover, that was that bootloader for Macs/Haskintoshes? To be honest, the variety of different hardware on Macs (even on Hackintoshes) is a fraction of that you find on a PC.
For gnu-efi there seems to exist some low-level USB support, I think there is USB class protocol and user should decode mouse protocol.
While it is possible for boot service applications to take over the USB host controller, I am not sure whether that is a good idea. You'd at least have to make sure that the device the user booted from was not connected to that same host controller, or you'd have to implement all the USB Mass Storage and filesystem stuff on your own. And while the alternative would be to load a custom Dxe for your USB device and leave the host controller under the control of UEFI boot services, I don't know if you can load a custom Dxe for USB mice (supporting more buttons) if your system firmware already includes one (that supports only two of them).
I did some low-level USB 3-btn and wheel mouse support on FPGA using lowlevel class support. Most mouses have same data structure like logitech, it reports few bytes for each event move or click. so most logitech mouses work, and approx 50% other models have data structure same as logitech.
To be honest, when you start to reimplement drivers at that level, why not just use the drivers (USB keyboard/mouse/storage) of e.g. Linux or A2 and let it run on EFI framebuffer?
I believe there is a Linux hosted version for every Oberon variant in existence.
UEFI boot services makes sense to be independent of hardware (so you can play GRUB invaders on any device that has a keyboard, screen and UEFI). Once you need to write hardware specific drivers, I'd prefer to piggyback on some existing OS that has implemented everything for it. Unless you consider it a challenge to run it without any Linux/Windows/A2 in between.
Regards,
Michael -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Hello, Am 06.11.2022 um 23:29 schrieb D EMARD:
True one could first boot linux and have every USB mouse supported, then run oberon exe. One drawback is linux shutdown is always recommeded before powering off or there could be filesystem issues on next boot.
Boot from an initramfs and have the Oberon user data on a separate filesystem. That way, your boot filesystem cannot get corrupted. And your user data drive can be checked and fixed from the initramfs.
oberon is more poweroff-resistant than linux so I'd find acceptable buying supported mouse to run oberong on average uefi PC
What filesystem are you using in Oberon? And what mount options are you using on Linux? I would assume an ext4 or vfat filesystem mounted with "-o flush" to be at least as resilient as any filesystem supported by Oberon. And ext4 without "-o flush" may lose some recently written files if they did not make it from the cache to the journal, but still should not get inconsistent quickly. Using vfat without "-o flush" is a recipe for desaster if you do not unmount or sync the drive before poweroff. So just don't do that. And I would assume that Oberon's vfat driver will just flush all metadata on every file close, so basically does the same as "-o flush". Also, when using the UEFI boot services, you will probably use their VFAT driver instead of coming with your own. So you depend on the stability of your firmware's vfat driver. At least the UEFI vfat driver should also flush all metadata once you close the last file which you opened for writing, so probably stability is comparable to "-o flush" on Linux. (Yes, I sometimes have a bad habit of just running "sync" and then hard-resetting the machine when having booted some rescue Linux distribution, without shutting the distribution down cleanly. Never had any filesystem corruption due to that, even with NTFS and VFAT filesystems where Linux does not write a journal. On a full desktop distribution I would not do that, though, as there are too many background jobs that may interfere between the sync and the loss of power, or that may leave lockfiles behind.). Regards, Michael
Hi! Something like this seems as good idea for best linux+oberon filesystem stability, to load oberon executable from read-only media or initramfs then mount vfat, and use emulator access oberon disk image as a file in vfat. Although vfat itself "knows" it was poweroffed unclean and has some fsck tool, in practice seems not needed. Maybe emulator can go more low-level to use raw linux block device partiton (/dev/sda1 or similar) then oberon will directly write its blocks all would be very lowlevel and only drawback extra boot time (bios, linux, mount) I expect 30 seconds from power to cursor On 11/6/22, Michael Schierl <schierlm@gmx.de> wrote:
Hello,
Am 06.11.2022 um 23:29 schrieb D EMARD:
True one could first boot linux and have every USB mouse supported, then run oberon exe. One drawback is linux shutdown is always recommeded before powering off or there could be filesystem issues on next boot.
Boot from an initramfs and have the Oberon user data on a separate filesystem. That way, your boot filesystem cannot get corrupted. And your user data drive can be checked and fixed from the initramfs.
oberon is more poweroff-resistant than linux so I'd find acceptable buying supported mouse to run oberong on average uefi PC
What filesystem are you using in Oberon? And what mount options are you using on Linux?
I would assume an ext4 or vfat filesystem mounted with "-o flush" to be at least as resilient as any filesystem supported by Oberon. And ext4 without "-o flush" may lose some recently written files if they did not make it from the cache to the journal, but still should not get inconsistent quickly. Using vfat without "-o flush" is a recipe for desaster if you do not unmount or sync the drive before poweroff. So just don't do that.
And I would assume that Oberon's vfat driver will just flush all metadata on every file close, so basically does the same as "-o flush".
Also, when using the UEFI boot services, you will probably use their VFAT driver instead of coming with your own. So you depend on the stability of your firmware's vfat driver. At least the UEFI vfat driver should also flush all metadata once you close the last file which you opened for writing, so probably stability is comparable to "-o flush" on Linux.
(Yes, I sometimes have a bad habit of just running "sync" and then hard-resetting the machine when having booted some rescue Linux distribution, without shutting the distribution down cleanly. Never had any filesystem corruption due to that, even with NTFS and VFAT filesystems where Linux does not write a journal. On a full desktop distribution I would not do that, though, as there are too many background jobs that may interfere between the sync and the loss of power, or that may leave lockfiles behind.).
Regards,
Michael -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
participants (2)
-
D EMARD -
Michael Schierl