Is it possible to call Windows libraries that will live on the hard disk from a program that lives in the BIOS?
Asked Answered
L

5

8

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.

Lithuanian answered 16/2, 2010 at 9:35 Comment(0)
D
9

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.

Deca answered 16/2, 2010 at 9:54 Comment(7)
Like this answer :D, however how do you fit that in 60k ? :DGehlenite
I've got a killer awesome code compression algorithm to do it. But I haven't quite worked out the decompressor. :-)Deca
@user274217: not pictures, not in that kind of memory footprint. Graphics were limited to line drawing character squares and what could be done with various colored text cells.Deca
So the memory issue is the constraint not the technology? So if I could up the memory usage would it be possible to create dialog resources in windows and embed the windows libraries into the final executable? Maybe use the includelib directives in MASM32?Lithuanian
Certainly the memory constraint presents a serious challenge; the more memory available the more that is possible. However, even doing this in—say—512 KiB is many man years of effort. As the memory limit decreases, the development effort climbs exponentially.Deca
Thanks, I'm abandoning his thread as it doesn't look like it is possible in the time we have permitted. Opened a different post at https://mcmap.net/q/1325817/-displaying-graphics-in-bios for an alternative optionLithuanian
To sum up, if you reimplement half of Windows operating system, you can do that;)Shirtwaist
C
5

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.

Crumble answered 16/2, 2010 at 9:45 Comment(0)
P
0

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 :)

Perforated answered 16/2, 2010 at 9:48 Comment(1)
I'm not trying to create an OS, I'm trying to write a module that will run in the BIOS. I can guarantee that windows 7 will on the computer however this code needs to run in BIOS before the OS loads.Lithuanian
K
0

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

Kimmie answered 16/2, 2010 at 10:0 Comment(0)
M
0

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?

Motch answered 25/2, 2010 at 6:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.