Question about device stacks

Why do you need multiple drivers to handle io requests? Why do you need filter drivers? Can’t one driver handle the entire IRP?

It’s basic good software design. It allows you to reuse driver functionality in multiple places without having to repeat the code. Several small drivers are much easier to maintain than one monolithic driver. In addition, filter drivers allow us to add value for work around a hardware problem, while still using a standard driver.

Why do you need multiple drivers to handle io requests? Why do you need filter drivers? Can’t one driver handle the entire IRP?

This is a philosophical question with no easy answers to it…

If you happen to be a simpleton with no system-level experience you may easily get enough with the answer that Mr.Roberts
gave to you - after all, it all looks so perfectly reasonable, at least on the surface, don’t you think. However, if you happen to be
an intelligent being with critical thinking capabilities who comes from the UNIX/Linux background you are immediately
going to ask "if device stacks are as beneficial as you claim them to be, how come that no other major OSes in existence has a concept of them??? " Surely their drivers can call one another and form the logical stacks, but none of them has a concept of a stack with well-defined global rules that are compulsory to any driver in existence. Furthermore, you are going to point out that driver development and maintainance under these OSes is, in actuality, SIGNIFICANTLY easier, compared to Windows.

If you go even further than that you may point out that the very concept of a stack with well-defined rules that are compulsory to any stack in existence very obviously lumps policies and mechanisms together, which is generally a bad idea.

In other words, the answers to your question are not necessarily as simple as they may seem to be at the first glance…

Anton Bassov