Not
Bu sayfaya erişim yetkilendirme gerektiriyor. Oturum açmayı veya dizinleri değiştirmeyi deneyebilirsiniz.
Bu sayfaya erişim yetkilendirme gerektiriyor. Dizinleri değiştirmeyi deneyebilirsiniz.
The I/O manager usually (except for FSDs) creates an associated device queue object when a driver calls IoCreateDevice. It also provides IoStartPacket and IoStartNextPacket, which drivers can call to have the I/O manager insert IRPs into the associated device queue or call their StartIo routines.
Bu nedenle, bir sürücünün IP'ler için kendi cihaz kuyruğu nesnelerini ayarlaması nadiren gerekli veya yararlıdır. Büyük olasılıkla adaylar, tek bir denetleyici veya veri yolu bağdaştırıcısı aracılığıyla hizmet veren heterojen cihazlar için bir dizi yakın bağlı sınıf sürücüsünden gelen IP'leri koordine etmesi gereken sürücülerdir. Bu tür bir sürücüye örnek olarak SCSI bağlantı noktası sürücüsü yer alır.
Başka bir deyişle, disk dizisi denetleyicisinin sürücüsünün sürücü tarafından oluşturulan denetleyici nesnesini kullanma olasılığı, ek cihaz kuyruğu nesnelerini ayarlamaktan daha olasıdır; eklenti veri yolu bağdaştırıcısının ve sınıf sürücüsü kümesinin sürücüsünün ek cihaz kuyruklarını kullanma olasılığı biraz daha yüksektir.
StartIo Rutin İle Ek Cihaz Kuyruklarını Kullanma
By calling IoStartPacket and IoStartNextPacket, a driver's Dispatch and DpcForIsr (or CustomDpc) routines synchronize calls to its StartIo routine using the device queue that the I/O manager created when the driver created the device object. For a port driver with a StartIo routine, IoStartPacket and IoStartNextPacket insert and remove IRPs in the device queue for the port driver's shared device controller/adapter. If the port driver also sets up supplemental device queues to hold requests coming in from closely coupled higher-level class drivers, it must "sort" incoming IRPs into its supplemental device queues, usually in its StartIo routine.
Bağlantı noktası sürücüsünün, IRP'yi uygun kuyruğa eklemeye çalışmadan önce her IRP'nin hangi ek cihaz kuyruğuna ait olduğunu belirlemesi gerekir. IRP ile hedef cihaz nesnesine bir işaretçi, sürücünün Dispatch rutinine iletilir. Sürücü, gelen IRP'leri "sıralama"da kullanmak üzere işaretçiyi kaydetmelidir. The device object pointer passed to the StartIo routine is the driver's own device object, which represents the device controller/adapter, so it can't be used for this purpose.
Sürücü tüm IP'leri kuyruğa aldıktan sonra, isteği gerçekleştirmek için paylaşılan denetleyicisini/bağdaştırıcısını programlar. Thus, the port driver can process incoming requests for all devices on a first-come, first-served basis until a call to KeInsertDeviceQueue puts an IRP into a particular class driver's device queue.
By using its own device queue for all IRPs to be processed through its StartIo routine, the underlying port driver serializes operations through the shared device (or bus) controller/adapter to all attached devices. Bazen, desteklenen her cihaz için IRP'leri ayrı bir cihaz kuyruğunda tutarak, bu port sürücüsü, hâlihazırda meşgul olan bir cihaz için IRP'lerin işlenmesini durdurur ve ortak donanım üzerinden G/Ç yapan diğer tüm cihazlar için G/Ç aktarım hızını artırır.
In response to the call to IoStartPacket from the port driver's Dispatch routine, the I/O manager either calls that driver's StartIo routine immediately or puts the IRP into the device queue associated with the device object for the port driver's shared controller/adapter.
Bağlantı noktası sürücüsü, paylaşılan cihaz denetleyicisi/bağdaştırıcı aracılığıyla hizmet verdiği her heterojen cihaz hakkında kendi durum bilgilerini tutmalıdır.
Ek cihaz kuyruklarıyla sınıf/bağlantı noktası sürücüleri tasarlarken aşağıdaki noktaları göz önünde bulundurun:
Sürücü, cihaz yığınının en üstündeki cihaz nesnesi dışında, kendisi üzerinde katmanlanmış herhangi bir sürücü tarafından oluşturulan bir cihaz nesnesine kolayca işaretçi alamaz.
Tasarım gereği G/Ç yöneticisi böyle bir işaretçiyi almak için bir destek yordamı sağlamaz. Ayrıca, sürücülerin yüklenme sırası, düşük sürücülerin daha üst düzey sürücülerin cihaz nesneleri için işaretçiler almalarını imkansız hale getirir. Bu, henüz herhangi bir alt düzey sürücü cihazını eklerken oluşturulmamıştır.
Although IoGetAttachedDeviceReference returns a pointer to the highest-level device object in a driver's stack, a driver should use this pointer only to designate a target for I/O requests to its stack. Sürücü, cihaz nesnesini okumaya veya yazmaya çalışmamalıdır.
Bir sürücü, kendi cihaz yığınının en üstüne istek göndermek dışında, kendisi üzerinde katmanlanmış herhangi bir sürücü tarafından oluşturulan bir cihaz nesnesine yönelik bir işaretçi kullanamaz.
Tek bir cihaz nesnesine (ve onun cihaz uzantısına) erişimi iki sürücü arasında çok işlemcili güvenli bir şekilde eşitlemenin hiçbir yolu yoktur. Hiçbir sürücü, diğer sürücünün şu anda yaptığı G/Ç işlemiyle ilgili herhangi bir varsayımda bulunamıyor.
Even for closely coupled class/port drivers, each class driver should use the pointer to the port driver's device objects only to pass on IRPs using IoCallDriver. Temel alınan bağlantı noktası sürücüsünün, büyük olasılıkla bağlantı noktası sürücüsünün cihaz uzantısında, yakın bağlantılı sınıf sürücülerinin cihazları için işlediği istekler hakkında kendi durumunu koruması gerekir.
Sürücü Yordamları Arasında Tamamlayıcı Cihaz Kuyruklarını Yönetme
IRP'leri tamamlayıcı cihaz kuyruklarında, birbirine bağlı bir sınıf sürücüsü kümesi için kuyruğa alan herhangi bir port sürücüsü de aşağıdaki durumu verimli bir şekilde ele almalıdır:
Dağıtım yordamları, belirli bir cihaz için IRP'leri ilgili cihaz için sürücü tarafından oluşturulan cihaz kuyruğuna ekler.
IRPs for other devices continue to come in, to be queued to the driver's StartIo routine with IoStartPacket, and to be processed through the shared device controller.
The device controller doesn't become idle, but each IRP held in the driver-created device queue also must be queued to the driver's StartIo routine as soon as possible.
So, the port driver's DpcForIsr routine must attempt to transfer an IRP from the driver's internal device queue for a particular device into the device queue for the shared adapter/controller whenever the port driver completes an IRP, as follows:
The DpcForIsr routine calls IoStartNextPacket to have the StartIo routine begin processing the next IRP queued to the shared device controller.
The DpcForIsr routine calls KeRemoveDeviceQueue to dequeue the next IRP (if any) that it's holding in its internal device queue for the device on whose behalf it's about to complete an IRP.
If KeRemoveDeviceQueue returns a non-NULL pointer, the DpcForIsr routine calls IoStartPacket with the dequeued IRP to have it queued to the shared device controller/adapter. Otherwise, the call to KeRemoveDeviceQueue simply resets the state of the device queue object to Not-Busy, and the DpcForIsr routine omits the call to IoStartPacket.
Then, the DpcForIsr routine calls IoCompleteRequest with the input IRP for which the port driver has just completed I/O processing, either by setting the I/O status block with an error or by satisfying the I/O request.
The preceding sequence implies that the DpcForIsr routine also must determine the device for which it's completing the current (input) IRP in order to manage internal queuing of IRPs efficiently.
Bağlantı noktası sürücüsü, ek cihaz kuyruklarında tutulan IRP'leri sıralamadan önce paylaşılan denetleyicisi/bağdaştırıcısı boşta kalana kadar beklemeye çalışırsa sürücü, geçerli G/Ç talebinin aslında çok daha az olduğu diğer tüm cihazlara hemen hizmet verirken yoğun G/Ç talebi olan bir cihazı aç bırakabilir.