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.
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, 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.
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.
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 :)
You might be interested in looking at the source code of XOSL- an old boot manager that had a nice windowed GUI.
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?