Page 1 of 1
Real Mode Drivers for hardware
Posted: Thu Dec 29, 2011 10:09 pm
by VolTeK
Is there any drivers id have to write myself that the bios would not have an interrupt already set in for?
Was thinking of including a start up process checking all hardware for any drivers that would need installing but, would the bios interrupts have me covered or is there a chance ill have to write and load one of my own?
Re: Real Mode Drivers for hardware
Posted: Thu Dec 29, 2011 11:15 pm
by Brynet-Inc
Is there a comprehensible question hidden somewhere? because I don't see one.
Re: Real Mode Drivers for hardware
Posted: Thu Dec 29, 2011 11:25 pm
by Brendan
Hi,
GhostXoPCorp wrote:Is there any drivers id have to write myself that the bios would not have an interrupt already set in for?
Was thinking of including a start up process checking all hardware for any drivers that would need installing but, would the bios interrupts have me covered or is there a chance ill have to write and load one of my own?
The BIOS won't have drivers for:
- CD-ROM (unless you boot from CD-ROM, and then it's only one)
- Network cards (unless you boot from network, and then it's only one)
- All USB devices (except for one USB flash stick if you boot from USB flash)
- The second, third, etc video card
- Any monitor (including things like EDID and backlight control)
- Any sound card
- Any touch screen, touchpad, mouse or joystick (there was "pointer device" functions but they weren't standard, weren't used by much and aren't guaranteed to be included in modern BIOSs)
- HPET
- IO APIC and local APICs
The BIOS will have drivers for:
- Keyboard maybe; but possibly only PS/2 keyboards (I've seen enough computers where the BIOS functions won't work properly for USB keyboards), and typically the BIOS only supports "US qwerty" keyboards so if you've got a different keyboard (Turkish, Japanese, Russian, whatever) then you're screwed.
- Floppy disks and floppy disk controllers (excluding USB floppy drives); but without support for disk change notification, "unusual" media formats, sector caches (necessary for decent performance but impossible to add without disk change notification), etc. BIOS will probably also only support 2 floppy drives (but I guess people with more than 2 floppy drives are little rare now).
- Hard disks and hard disk controllers; but not always. For example, if you've got a "PATA only" motherboard with a "SATA controller" PCI card and a "SCSI controller" PCI card, and you want to use PATA, SATA and SCSI then you'll probably only be able to use SATA or SCSI (but not both), because the ROM in one of the cards will "win" and take control of "int 0x13" and everything else will lose.
- VBE; which only works for the first monitor connected to the first video card, and lacks support for everything (2D/3D acceleration, hardware pointers, etc) except video mode switches; but it can't even do the video mode switching properly (ignores monitor's capabilities, often only supports "4:3" video modes even though the monitor is likely to be "16:9", doesn't support refresh rate control, etc).
- PIT and RTC; except the PIT is set to the slowest frequency it can be, and there's no support for things like time zones or local time vs. UTC, or most of the RTC's interrupts.
- Serial ports; but only the first 2, and the BIOS functions are idiotically crappy - they're slow, and they use polling so you lose data as soon as you have to do anything else (e.g. read or write to disk).
- Some power management, but typically only as a protective feature (e.g. "everything runs flat out unless something overheats"). You might be able to use APM to get a little better control of power management, but I'm not too sure if modern machines still support APM.
In addition to that, the device drivers that the BIOS does provide are crap. They're "synchronous single-tasking", which means you can't load data from disk in the background while you're using the boot CPU to do useful work (but have to do nothing while waiting for the disk); and none of them are safe to use from other CPUs (even if you make sure only one CPU uses the BIOS at a time, due to the way IRQs are handled).
In general the BIOS is only useful for boot loaders; and the BIOS provides nothing that is actually useful for a half-decent OS.
Of course then there's the next disadvantage - porting the OS to UEFI won't be easy if you rely on the BIOS after boot, so by the time you finish the OS it'll probably be useless/obsolete and unportable.
Cheers,
Brendan
Re: Real Mode Drivers for hardware
Posted: Thu Dec 29, 2011 11:40 pm
by VolTeK
Thank you. This motivates me to just get into 32 bit instead, where writing drivers are more worth doing in the long run.
Brynet-Inc wrote:Is there a comprehensible question hidden somewhere? because I don't see one.
Im gunna save you some trouble. Dont reply if you cant understand my questions. I know sometimes i have trouble getting the point out there, pointing it out some more wastes your time. Not to be an @$$, but im saving everyone the trouble here when i say that.