OSDev.org

The Place to Start for Operating System Developers
It is currently Mon Mar 18, 2024 11:53 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Legacy OS in class 3 UEFI machines
PostPosted: Thu Jan 26, 2023 1:00 pm 
Offline

Joined: Thu Jan 26, 2023 10:37 am
Posts: 1
Is it theoretically possible to boot the following (ordered by how difficult I imagine it is) in a UEFI class 3 machine:

  1. 64-bit Linux kernel (with EFI stub)?
    Quote:
    I hope so!

  2. 32-bit Linux kernel?
    Quote:
    I imagine it is possible and that a UEFI application could:
    • Possibly use the UEFI framework to gather information later needed for the linux x86 boot protocol.
    • Read the kernel and copy to its desired load address.
    • Drop from long mode to protected mode and jump to the kernel's protected mode entry point.
  3. 16-bit helloworld bootloader that only uses the BIOS functions to print to screen and halts?
    Quote:
    • Use UEFI framework to find out which graphics mode the hardware supports.
    • Copy 16-bit code that implements the BIOS print character routine somewhere in low memory and point the IVT 0x10 entry to it.
    • Maybe other BIOS interrupts also need to be implemented?
    • Copy the helloworld bootloader to 0000:7c00.
    • Drop to real mode and jump to the bootloader.
  4. A 32-bit OS that goes to protected mode as fast as possible and never goes back to real mode?
    Quote:
    • Same as before, but also implement other BIOS services, like disk access?
  5. Real mode code that writes to memory hardware mapped stuff like, idk, VGA screen memory?

To sum up: how much of CSM is based on software (that could be theoretically re-implemented by a UEFI app) and how much of it is hardware?


Top
 Profile  
 
 Post subject: Re: Legacy OS in class 3 UEFI machines
PostPosted: Thu Jan 26, 2023 4:24 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5069
pensebem wrote:
64-bit Linux kernel (with EFI stub)?

Yes, and it can also be done without the stub (e.g. using GRUB).

pensebem wrote:
32-bit Linux kernel?

Works fine on 32-bit UEFI. GRUB seems to be able to boot a 32-bit Linux kernel on 64-bit UEFI, but I've never tried it.

pensebem wrote:
16-bit helloworld bootloader that only uses the BIOS functions to print to screen and halts?

If there's RAM at the appropriate addresses, yes, you could drop your code into it and make it work, though you'll have to use a bitmap framebuffer instead of VGA text mode. If there's no RAM where you need it, you could use virtual 8086 mode with paging to fix things, but that's starting to get into hypervisor territory.

pensebem wrote:
A 32-bit OS that goes to protected mode as fast as possible and never goes back to real mode?

How many assumptions about legacy hardware does this OS make? If your class 3 UEFI hardware can't meet those assumptions, you'll need a hypervisor.

pensebem wrote:
Real mode code that writes to memory hardware mapped stuff like, idk, VGA screen memory?

If you've already got a hypervisor for that 32-bit OS from earlier, you might as well use it here too, although virtual 8086 mode might also be an option depending on exactly how this code expects to interact with the hardware.


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Majestic-12 [Bot] and 16 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