0Day Forums
Is it possible to call Windows libraries that will live on the hard disk from a program that lives in the BIOS? - Printable Version

+- 0Day Forums (https://zeroday.vip)
+-- Forum: Coding (https://zeroday.vip/Forum-Coding)
+--- Forum: Assembly (https://zeroday.vip/Forum-Assembly)
+--- Thread: Is it possible to call Windows libraries that will live on the hard disk from a program that lives in the BIOS? (/Thread-Is-it-possible-to-call-Windows-libraries-that-will-live-on-the-hard-disk-from-a-program-that-lives-in-the-BIOS)



Is it possible to call Windows libraries that will live on the hard disk from a program that lives in the BIOS? - Mrpaly954 - 07-24-2023

I'm trying to write a program that will be a BIOS option (after POST). I'd like the application to have a nice GUI instead of being text based (there are multiple reasons for this, localization being one of them).

My problem is that we are constrained by the size of the application that we can flash to the BIOS.

Is it possible using MASM32 to "Link" to the dll's on the hard disk so that we can use the Windows API's to develop the GUI?

Or is there an API that is availible to us to create the GUI that can be linked into the final executable? (60K size constraint on the final program executable)


Any help you can give would be greatly appreciated, thanks in advance.






RE: Is it possible to call Windows libraries that will live on the hard disk from a program that lives in the BIOS? - uniovulate962202 - 07-24-2023

There are no BIOS implementations which support this. But in theory it's possible, but keep in mind that first you should develop entire OS :)


RE: Is it possible to call Windows libraries that will live on the hard disk from a program that lives in the BIOS? - solve224741 - 07-24-2023

No, it isn't possible. A Windows application requires the Windows operating system to run on top of, so the BIOS must have booted the OS and finished running before a Windows GUI (or console app) can be used. Even to access the DLL files on the disk, you need a filesystem, which won't be available until the OS has booted.

However, In 60K, you should be able to fit quite a reasonable character-based GUI. I would take a look at how some of the linux bootloaders do this.


RE: Is it possible to call Windows libraries that will live on the hard disk from a program that lives in the BIOS? - ernalineetuz - 07-24-2023

It is possible. All you'd have to do is:

* set the processor into protected mode and map memory as expected (flat model)
* develop a filesystem driver and load that
* support all the possible video cards, mice, monitors, keyboards, etc. including potentially legacy hardware
* set up the execution environment so that all external references of the requested DLL are present, including (for Windows) KERNEL32, GDI, etc.

There's a lot to this, and it's not easy. However, an example which comes close is [MenuetOS][1], an impressively compact environment. But it completely is born from a complete rethinking of how to implement a GUI environment.

---

I've written BIOS code which simulates a GUI interface. The video card is kept in text mode, the font is made nicer looking, the text cell separators are turned off, and the mouse is recognized. With simple animation, the whole thing did fit into 60 KiB or so.


[1]:

[To see links please register here]




RE: Is it possible to call Windows libraries that will live on the hard disk from a program that lives in the BIOS? - wey144 - 07-24-2023

You might be interested in looking at the source code of [XOSL][1]- an [old boot manager][2] that had a nice windowed GUI.

[1]:

[To see links please register here]

[2]:

[To see links please register here]




RE: Is it possible to call Windows libraries that will live on the hard disk from a program that lives in the BIOS? - mishmoshesv - 07-24-2023

I'm not sure if the request is actually possible. (Keeping in mind the context of the question)

For this to work, you would have to initialise the entire Microsoft windows environment in order to use the API functions to draw a GUI.

Out of curiosity, what are you doing in this BIOS program?