why we need ro write a device driver ?!
why we need ro write a device driver ?!
i mean when i want to write a code to use the VGA in text mode i put the data in b800:0000 and when i want to put data in graphic mode i put it in 0a00:0000, i used this device without any device driver !
so why i need it ?
so why i need it ?
Re: why we need ro write a device driver ?!
If your routine does every hardware operation directly then you don't need a device driver...mohammed wrote:i mean when i want to write a code to use the VGA in text mode i put the data in b800:0000 and when i want to put data in graphic mode i put it in 0a00:0000, i used this device without any device driver !
so why i need it ?
Some would even argue that the routine becomes the de facto device driver...
Conversely, if your program is entirely stand alone (i.e. if it is able to drive all the hardware it needs directly), then it doesn't need an OS for anything!
An OS isn't a so undispensable thing...
JJ
what is the real task of device driver?
and why in windows 98 we can't use the true colors unless we instal the vga driver ?
and why in windows 98 we can't use the true colors unless we instal the vga driver ?
sure it suppose to do that because it suppose to be an OS!if your program is entirely stand alone (i.e. if it is able to drive all the hardware it needs directly), then it doesn't need an OS for anything!
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
The VGA may be a de-facto standard, but they do not cover 100% of all desktops. Also, the VGA is limited to a few modes, far less than what most modern video cards can do.
The main reason for the existence of device drivers is that of abstraction. Given a setpixel and setmode routine for each video card, you can do virtually anything with your screen. So people write drivers for each card in order to always be able to provide these functions, in effect always being able to display things on the screen.
Take a look at your BIOS. It provides several standard functions that abstract the hardware for us. Basically, the BIOS is a driver for the chipset. Similarly the VGA Bios can be seen as a driver for your video card.
The main reason for the existence of device drivers is that of abstraction. Given a setpixel and setmode routine for each video card, you can do virtually anything with your screen. So people write drivers for each card in order to always be able to provide these functions, in effect always being able to display things on the screen.
Take a look at your BIOS. It provides several standard functions that abstract the hardware for us. Basically, the BIOS is a driver for the chipset. Similarly the VGA Bios can be seen as a driver for your video card.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
You may actually not need to.mohammed wrote:if that is true ..the bios call is a kind of driver so WHY WE NEED TO WRITE A NEW ONE?we have it already!
However, Bios calls...
- Run in 16 bit mode
- Assume full control over the system
- May not interoperate with whatever you do outside of its knowledge
- Use a dated interface that does not support the capabilities of modern hardware
- May be buggy or limited
- Were not written by you
Perhaps you should learn a lot more before starting OS Development. It comes apparent why you have to write drivers for different devices within minutes of reading anything related to OS development and devices.mohammed wrote:if that is true ..the bios call is a kind of driver so WHY WE NEED TO WRITE A NEW ONE?we have it already!
Like Combuster said, the real task of a device driver is to abstract the hardware and take care of mutual exclusion (i.e. only one program is accessing the device each time)... Take Linux (or any Unix) as an example...mohammed wrote:what is the real task of device driver?
On Unix, everything is a file... So, from the prespective of the application, writting data to a file or writting data directly to the hard disk is exactly the same thing (in fact it's not exactly the same, as some operations that are supported in files aren't supported in block devices, but you get the idea: the hard disk is seen as a file)...
That's not true... Windows 98 comes with a Standard VGA driver and some more graphics drivers that will drive some special features of *some* cards (though, they are still generic, and you won't be able to do 3D acceleration with them)... if you don't have a card that is supported by one of these "special" drivers (which are usually able to use high resolutions), it will fall-back to tha VGA driver...and why in windows 98 we can't use the true colors unless we instal the vga driver?
Given that the VGA hardware has many color depth and resolution limitations, you can't benefit from resolutions highter than 320x200@256 or 640x480@16 (for a complete list of VGA modes see http://www.osdev.org/osfaq2/index.php/H ... %20mode%3F)
No, no, no, no! You can write a text editor that works without any OS...sure it suppose to do that because it suppose to be an OS!if your program is entirely stand alone (i.e. if it is able to drive all the hardware it needs directly), then it doesn't need an OS for anything!
And... by definition, it's not as OS! It's a text editor!
An OS has a *kernel* that provides services for *applications*. If you don't have such a separation, then you don't have an OS...
Playstation games are not operating systems!
Anyway, it's just a naming issue... parhaps, you will find people that define OS in a different way...
JJ
Last edited by JJeronimo on Fri Dec 22, 2006 8:05 pm, edited 1 time in total.
emacs is both
@mohammed: well if someone changes everything and to write to vga you have to xor the value with something and write it to b700:0000(or something) insted of changing every line of code that wrote to vga, just make a driver,
your code:
old vga driver:
new driver:
it is just hardware abstraction
@mohammed: well if someone changes everything and to write to vga you have to xor the value with something and write it to b700:0000(or something) insted of changing every line of code that wrote to vga, just make a driver,
your code:
Code: Select all
putchar("w");
Code: Select all
void putchar(char x);
{
0xB8000 = x;
}
Code: Select all
void putchar(char x);
{
0xB7000 = x ^ 13;
}
i realy started to understand finaly ! the device driver is a thing that help to make things easier like any built-in libraries
i found this
http://www.answers.com/topic/device-driver-1
but (realy) again i was stupid when i stopped to visit this great forum
thank you guys and god bless all of you
i found this
http://www.answers.com/topic/device-driver-1
but (realy) again i was stupid when i stopped to visit this great forum
thank you guys and god bless all of you