Hi,
axilmar wrote:Thanks a lot for the input. My question was due to the following reasons:
1) In order to know how to structure the interfaces/protocols of the devices, I need to know what capabilities the hardware has, at least the basic ones.
No!
For this purpose, your interface/protocols need to be able to handle the capabilities of the most complex devices, not just the capabilities of the most basic devices.
For example, for video you might want to consider 2D/3D acceleration, SLI and stereoscopic/3D monitors. Even for 2D graphics you might want the interface to handle depth, so that icons are little closer to the user than the background/desktop and window borders are raised slightly (if the hardware supports it).
For playing digitized sound, software might tell the sound card where the sound is positioned (e.g. behind the user, to the left of the user, etc). If the sound is meant to come from behind the user but the hardware is stereo and not surround sound, then the driver might just ignore the front/back information (but the interface/protocol still needs it).
For hard disks, you might want an asynchronous interface that can take advantage of Native Command Queuing that modern SATA (and SCSI) drives support (even though a synchronous interface might be fine for basic hardware). There's also SMART (or
Self-Monitoring, Analysis, and Reporting Technology), noise/performance controls and security features.
axilmar wrote:2) I need to write some basic drivers for testing purposes/reference implementations.
Yes, but you need hardware to test these drivers on. For example, SoundBlaster is/was a very popular sound card but I don't have any of them here and couldn't test it, so I'd choose AC'97 or ESS AudioDrive instead. The ESS AudioDrive cards I have contain sound, joystick and a non-IDE (Sony/Panasonic/Creative?) CD-ROM interface, so I couldn't say I support these cards unless the device driver supports joystick and CD too. For this reason I'd probably start with an AC'97 driver instead, but I've heard there's differences between different AC'97 chipsets so it might be a "Intel 945 chipset AC'97 sound driver".
axilmar wrote:3) I need to know what hardware devices must be initialized so as that the computer can work.
How do you define "work"? If I want to run a headless server, then the computer works fine without any keyboard, mouse or video drivers. If I want to run a diskless X client, then the computer works fine without any hard disk or CD-ROM drivers. If I only want to play single-player games, then the OS would work without networking, printers, scanners, modems, etc. None of the hardware is actually needed by everyone.
Once you've got a working kernel (and support for gateA20, PIC and/or I/O APICs, RAM and some sort of timer for the scheduler, and maybe multi-CPU), you'll hopefully start thinking about auto-detection (e.g. scanning the PCI bus).
After that you'll choose pieces you want to do next (e.g. video, keyboard, disk drives or networking), design the device driver interface for whatever you chose (see #1 above), and then write a device driver for whatever you chose (see #2 above). You'll repeat this forever.
What you're probably after is a list of generic drivers that you could use when you don't have complete drivers. For example, a "generic VGA" driver that someone might be able to use until there's a proper driver for their fancy Nvidia card.
For this purpose, for video you could setup a default video mode during boot and use a "framebuffer" video driver, use BIOS/VBE (e.g. with virtual8086 mode), and/or have a "VGA only" driver.
For hard disk and CD-ROM you could do generic ATA/ATAPI (which won't help for SCSI and might not support bus mastering, NCQ, SMART, RAID, etc).
For network cards AFAIK you're mostly screwed (you need something designed for the card).
For keyboard use PS/2 (for USB keyboards the BIOS emulates PS/2 for backwards compatability).
For sound I wouldn't bother with generic driver/s (sound isn't important - if there isn't a driver designed for the card, then give them silence).
Serial ports, parallel ports and floppy are standard (no need for generic drivers).
For USB controllers, AFAIK there's only 3 standards and all USB controllers comply with one of those standards. For USB devices there's standards for some device types - one standard for all human interface devices (e.g. keyboard), one standard for all storage devices (e.g. hard disks, flash memory), etc. These standards cover basic functionality (not full functionality), so you may eventually need drivers designed for specific devices.
Modems are mostly all compatible with the Hayes AT command set, but I don't know much about how fax modems or voice modems work.
For scanners and printers, I have no idea - I think most printers will still print raw ASCII in black & white (like they used to in the good old "type foo.txt > lpt1" days).
Cheers,
Brendan