🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

BIOS

Started by
13 comments, last by Calin 4 years, 3 months ago

I`m trying to understand BIOS better. The question I have is who loads stuff to memory (RAM)? BIOS is not always active. the motherboard has a battery so that keeps something always alive which is not BIOS, bios loads (gets loaded) as well. Like, if I have an ASM program it will be `booted` if it`s placed on the right place on the hard drive, but from the moment my program has prime time who will it talk to? something that resides in RAM (BIOS)? Basicly you have two entities residing in memory that take turns at using the CPU.

My project`s facebook page is “DreamLand Page”

Advertisement

BIOS remains in its own chip, which is partly reprogrammable (it stores the current date, for example). When you boot your computer this chip becomes active before everything else and runs a tiny program that does some basic peripheral checks and then tries to load the first sector of the primary disk. If that doesn't work, it will try other peripherals and eventually display an error message and hang.

So if you want to run anything without an OS you'll need a bootable disk to initialize the system. You can even put a complete game inside the boot sector, however the space is limited. Note that you don't want to try this on your harddisk.

Check out some of these answers: https://superuser.com/questions/462314/what-are-the-functions-of-the-bios-while-the-operating-system-is-running

Prototype said:
BIOS remains in its own chip

why do then they say that in real mode you can only use 1MB of memory of which 300 KB is occupied by the BIOS

My project`s facebook page is “DreamLand Page”

Pretty sure that just dates back to some of the original hardware. A 20bit (1MB) address bus, 640KB for RAM, and the rest for some system purposes (I think the BIOS ROM was mapped here, video cards, etc.). Newer CPUs had a wider address bus, but DOS/other software wasn't designed for it (and the original maths for the segment/offset registers to access the 20bits didn't allow for a final address over 1MB), so real mode remained compatible.

EFI (and later UEFI) replacing BIOS still didn't need for this feature to be changed, they just switch themselves into 32/64bit mode then work from there, while the BIOS stays in real mode to boot.

Calin said:

why do then they say that in real mode you can only use 1MB of memory of which 300 KB is occupied by the BIOS

Who is they? Different BIOS versions may do all kinds of tricks, but that's irrelevant to the fact that RAM is empty at startup and the only code available is in the BIOS. It's kind of elementary to how a PC works.

Of the 1MB addressable in real mode, only the first 640KB are actual system RAM. The rest is used for mapped memory, i.e. memory that is not part of system RAM, but accessed as if it were. The F-block in particular is used for the BIOS ROM. This allows the BIOS to run directly from ROM, without being loaded into RAM.

a light breeze said:
actual system RAM

got it

My project`s facebook page is “DreamLand Page”

Prototype said:
Who is they?

I`m not going to disclose all the stuff I`m reading. I should have mentioned, in this thread I`m not looking for input from senior members. It`s a revalidation of stuff I already now, each validation conducts to deeper implications.

So when a game runs is the computer stiff ? like if I don`t call the Windows update procedures ( PeekMessage()) while my game runs is the computer dead?

My project`s facebook page is “DreamLand Page”

This topic is closed to new replies.

Advertisement