Working with BIOS32...

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
smiddy

Working with BIOS32...

Post by smiddy »

Greets,

Has anyone here worked with BIOS32?

I spent the weekend working on PCI32 enumeration and it seemed quite simple; or more like working in real-mode, except for the flat memory usage and the far call to the entry point.

I am curious if anyone has worked with either ACPI or Plug and Play in BIOS32. I haven't found any technical references to either of these but sporatic postings of people working with them. Anyone know of any technical references for BIOS32?
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Working with BIOS32...

Post by Pype.Clicker »

pype/C32> doclocate BIOS
minimum rank: 1, 2 matches ->
/tmp/vbe3.pdf (2)
/tmp/PCI_BIOS_2.1.pdf (2)
/tmp/ia32_rm_addr.pdf (2)
/.../datasheets/xos.freezee.org/doc/kernel/LKI.PS.GZ (1)
/.../datasheets/xos.freezee.org/doc/hard/WOUT_KBD.PDF (1)
/.../moving/SMBIOS.pdf (1)
/.../moving/pcibios.pdf (1)
"System Management BIOS (SMBIOS) Reference Specification (DSP0134 by the Distributed Management Task Froce)
"PCI BIOS SPECIFICATION, Revision 2.1"

Is what i look to have closest to what you request. I heard about all these BIOS things from the FAQ (link to OS faq entry on the BIOS32), but due to lack of complete support (e.g. no PCI bios in bochs by the time i started looking for it, for instance), i preferred to go for a "direct ports probing" approach ...

[edit by candy] URL screwed up page layout[/edit]
smiddy

Re:Working with BIOS32...

Post by smiddy »

Thanks! I hadn't considered SMBIOS either. I am programming with ports too, but am looking at alternatives that may make things a bit more simple. I was bummed about Bochs' BIOS32 support. While it supports it, it doesn't have PCI32 implemented (this sparks another question, see below). Luckily I have several machines to work with so that I can assemble on one and test on another.

Several of the references you mentioned I have looked at over the last few months. There is another one specific to BIOS32 from Phoenix BIOS. I don't have the reference here at work, but will post it for those interested. It is basically the same as what it in PCI 2.1 specification with a little more detail on setting up the selectors for using the interface. I always forget to look at the FAQ too. I better do that in my quest.

Since you use (have used) Bochs: Is it possible to use my BIOS within Bochs. What I mean is, is it as simple as copying f0000 - ffff0 to a file and setting it in the configuration file to load it at f0000? I am considering checking it when I get my next opportunity, which won't be until this coming weekend. I suspect that the BIOS' being used are directly interfaced with Bochs for functionality and that it wouldn't be that simple, but figured I'd check before I tried.

Thanks again for the info!
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re:Working with BIOS32...

Post by Brendan »

Hi,
smiddy wrote:Since you use (have used) Bochs: Is it possible to use my BIOS within Bochs. What I mean is, is it as simple as copying f0000 - ffff0 to a file and setting it in the configuration file to load it at f0000? I am considering checking it when I get my next opportunity, which won't be until this coming weekend. I suspect that the BIOS' being used are directly interfaced with Bochs for functionality and that it wouldn't be that simple, but figured I'd check before I tried.
If you mean copying your real computer's BIOS and using that within Bochs, then it won't work. Real BIOS's map themselves very high in the physical address space (e.g. 0xFFF80000) and then remap 64 KB of this at the top of the first 1 MB. The main reason for this is that most real BIOS's are 512 Kb (or more) while there's only 64 KB of space reserved for the BIOS at 0x000F0000. Bochs doesn't do any of this - it uses a 64 KB BIOS without any of the memory mapping stuff.

Also Bochs' BIOS is designed for the chipset emulated by Bochs, and your computer's BIOS would be designed for the chipset (and CPU/s) your computer uses.


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
smiddy

Re:Working with BIOS32...

Post by smiddy »

Thanks, I would have been trying for a while to make it work. I kind of expected that but wnat to be certain. Again, thanks!
tom1000000

Re:Working with BIOS32...

Post by tom1000000 »

Brendan wrote:
If you mean copying your real computer's BIOS and using that within Bochs, then it won't work. Real BIOS's map themselves very high in the physical address space (e.g. 0xFFF80000) and then remap 64 KB of this at the top of the first 1 MB. The main reason for this is that most real BIOS's are 512 Kb (or more) while there's only 64 KB of space reserved for the BIOS at 0x000F0000. Bochs doesn't do any of this - it uses a 64 KB BIOS without any of the memory mapping stuff.

Also Bochs' BIOS is designed for the chipset emulated by Bochs, and your computer's BIOS would be designed for the chipset (and CPU/s) your computer uses.
Question: If modern BIOSs put themselves at a high address how do they operate in real mode!?!??!?!

Do they use unreal mode? Or some other trick?
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Working with BIOS32...

Post by Pype.Clicker »

i suggest you read chapter 9 about processor initialization in intel manual (vol3). It tells all the BIOS need to do before it can start 'normal' operations. Processor starts in realmode with paging disabled, but all segments' base belong to 0xFFFF0000. So yes, it's a kind of unreal mode. This "unreality" will disappear as soon as you perform a far jump.
Post Reply