BIOS device drivers help me understand this clearly.

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
Gavin
Posts: 23
Joined: Tue Mar 11, 2008 9:53 pm

BIOS device drivers help me understand this clearly.

Post by Gavin »

Hi I've a fairly straightforward question.

Taken from scott mueller's upgrading & repairing pc's 16th edition.
(Excellent Book btw)


Bios (basic input/output system). This refers to the collection of actual drivers used to act as a basic interface between the operating system and your hardware when the system is booted and running.
When running Dos or windows in safe mode, you are running almost solely on rom bios based drivers because none are loaded from disk
This is my understanding .(let me know where I go wrong)

Concerning safe mode.
When running windows xp in safe mode your running it in 16bit protected mode?
How come i can run firefox in safe mode?

Concerning protected mode(normal)
The bios is discarded once windows xp is fully loaded and device drivers(32bit) take over to interface with the hardware.The bios then on the motherboard cannot be used or isn't used at all untill another reboot .


I hope this question doesn't take up to much time just a simple answer is sufficient.

Thanks a lot .
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Post by thepowersgang »

The explanation given in the book is not quite correct. The bios provides a basic interface to the hardware via interrupt 13h (19) when the machine is in real mode.
When protected mode (32bit) is entered these functions are unavaliable but, the VGA bios functions are still usable via VBE. This is what is meant by windows using the bios while in safe mode.

However, when windows boots into safe mode some drivers are loaded into memory but theses are just the bare minimum to be able to load windows.
Gavin
Posts: 23
Joined: Tue Mar 11, 2008 9:53 pm

Post by Gavin »

Thanks for your explanation .
I'm learning alot everyday hope it's enough sometime to start writting my operating system.
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: BIOS device drivers help me understand this clearly.

Post by jal »

Gavin wrote:
Scott Mueller wrote:When running DOS or Windows in safe mode, you are running almost solely on rom bios based drivers because none are loaded from disk
This sentence is probably in since the first incarnations of this book, and since he is talking about "DOS and Windows", we can safely assume he is talking about Windows 95. Iirc, Win95 indeed used the BIOS in safe mode, as its protected mode drivers (.VXDs) were not loaded in safe mode. We can also safely assume that in modern operating systems, the real mode BIOS is not used at all after the very early stages of booting.
Concerning safe mode.
When running Windows XP in safe mode your running it in 16bit protected mode?
16 bit protected mode is something else entirely from 16 bit real mode. It is more like 32 bit protected mode. 16 bit protected mode was introduced in the 80286 (the successor to the 8086), and made obsolete by 32 bit protected mode when the 80386 came out. It is not possible to run 16 bit real mode code in 16 bit protected mode, although it is possible to run 16 bit protected mode code in 32 bit protected mode.
How come i can run firefox in safe mode?
What an OS calls "safe mode" depends on what the OS makers consider safe. So which functionality is or is not available in safe mode cannot be predicted without knowing the finer details.
The bios is discarded once Windows XP is fully loaded and device drivers (32 bit) take over to interface with the hardware.
The BIOS is probably discarded a lot sooner, but in general you are right.
The BIOS on the motherboard cannot be used or isn't used at all untill another reboot.
If you are talking about normal BIOS then yes, you are right. Note however that there are things like SMM and and ACPI, which also resides in the BIOS, and are used by the OS or the hardware.


JAL
Gavin
Posts: 23
Joined: Tue Mar 11, 2008 9:53 pm

Post by Gavin »

Thanks Jal I understand it a bit better .
User avatar
CmpXchg
Member
Member
Posts: 61
Joined: Mon Apr 28, 2008 12:14 pm
Location: Petrozavodsk, Russia during school months, Vänersborg Sweden in the summertime

Post by CmpXchg »

The bios is discarded once Windows XP is fully loaded and device drivers (32 bit) take over to interface with the hardware.
This brings me to a thought. I've always wondered why BIOS services are only available in real mode, why aren't there protected mode routines we could call?

In fact, there are few BIOS services, like VBE3, which you can access from protected mode. I believe there must be some more. Where can I get the full list? It would be a great advantage to have these services on hand, it would improve compatibility with hardware, wouldn't it?
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Post by jal »

CmpXchg wrote:This brings me to a thought. I've always wondered why BIOS services are only available in real mode, why aren't there protected mode routines we could call?
Because there's no need for them. Windows and Linux, covering 99.99% of the OSes installed on a modern PC, have their own drivers. Also, it's easier updating a software driver than flashing BIOS. As well, there is no standard 'protected mode', there is 16, 32 and 64 bit protected mode, segmented and non-segmented, paged and non-paged, etc.
It would be a great advantage to have these services on hand, it would improve compatibility with hardware, wouldn't it?
I don't see why you would think that. Drivers for hardware are written by the hardware vendors. Doesn't matter whether the driver is in ROM or RAM. On the other hand, there's EFI, which does put many drivers in ROM.


JAL
Gavin
Posts: 23
Joined: Tue Mar 11, 2008 9:53 pm

Post by Gavin »

Concerning EFI , can we still use the normal mbr code we use with the bios or will efi change that?
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Post by neon »

The bios is discarded once Windows XP is fully loaded and device drivers (32 bit) take over to interface with the hardware.
Incorrect. The BIOS is discarded after NTLDR loads the kernel mode drivers and switches back to protected mode to execute the kernel.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
CmpXchg
Member
Member
Posts: 61
Joined: Mon Apr 28, 2008 12:14 pm
Location: Petrozavodsk, Russia during school months, Vänersborg Sweden in the summertime

Post by CmpXchg »

jal wrote:I don't see why you would think that. Drivers for hardware are written by the hardware vendors. Doesn't matter whether the driver is in ROM or RAM. On the other hand, there's EFI, which does put many drivers in ROM.
That's a good point, but let's ask ourselves the following question:

Why aren't there any USB services? We are left to program it for each motherboard. Hardware would create drivers for the mainstream operating systems, like Windows, but what about us hobbists?
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Post by jal »

CmpXchg wrote:Why aren't there any USB services? We are left to program it for each motherboard.
Not at all. There are only three USB controller specifications (two for USB 1, one for USB2), two of which are used on modern motherboards. Visit the Intel site for specifications. Afaik, all chipsets out there conform to these specifications.
Hardware would create drivers for the mainstream operating systems, like Windows, but what about us hobbists?
I think you know the answer to this (rhetorical?) question yourself.


JAL
User avatar
CmpXchg
Member
Member
Posts: 61
Joined: Mon Apr 28, 2008 12:14 pm
Location: Petrozavodsk, Russia during school months, Vänersborg Sweden in the summertime

Post by CmpXchg »

jal wrote:Afaik, all chipsets out there conform to these specifications.
You mean, the lowlevel access code will be exactly same (for respective specification)?
jal wrote:I think you know the answer to this (rhetorical?) question yourself.
:lol: Sure
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Post by jal »

CmpXchg wrote:
jal wrote:Afaik, all chipsets out there conform to these specifications.
You mean, the lowlevel access code will be exactly same (for respective specification)?
Yes, that is what I understand. It's a standard, just like e.g. ATA or PCI.


JAL
Post Reply