10.07.2015 Views

DTJ Number 3 September 1987 - Digital Technical Journals

DTJ Number 3 September 1987 - Digital Technical Journals

DTJ Number 3 September 1987 - Digital Technical Journals

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The DECnet-DOS Systemthat CCB, which will be placed in the workqueue of the routing layer. This layer, when run,will process the buffer pointed to by the CCB. Iffurther processing is necessary, this layer willplace the CCB in the work queue of another networkprocess.This scheme would work perfectly well if theCPU scheduler were designed to scan the workqueues both at periodic intervals and after controllerinterrupts. Then the scheduler would dispatchthe network tasks to empty the workqueues. And all these actions must happen sothat they are transparent to the current foregroundapplication.To fulfill those requirements, we designed amemory-resident scheduler that performs allthose actions by using a technique called interruptshelling. To shell an interrupt, the schedulerfirst records the address of the currentinterrupt handler, then replaces it with thescheduler's own address. Thus when the interruptoccurs, the CPU state and the interruptreturn address are saved, and the scheduler,instead of the original interrupt handler, is calleddirectly.Upon entry for an interrupt, the schedulersaves the current context of the system and simulatesan interrupt to the original interrupt handler.When the interrupt processing completes,the interrupt handler will return to the scheduler- not the foreground task. Therefore, thescheduler now gains control. The interrupt processingis now complete and the time-criticalprocessing has finished. The scheduler can nowenable interrupts and examine all work queuesfor tasks that need to be run. After all tasks havebeen run, the scheduler finally returns to theinterrupted foreground task.Two examples will help to make this processmore clear.First, consider an interrupt from an Ethernetcontroller that signals the successful reception ofa message from some other node in the network.When the controller causes the interrupt, thescheduler gains control with interrupts disabled.The scheduler saves the return address and stateand dispatches to the "real" interrupt handler ofthe Ethernet controller. The interrupt handlerperforms the following series of actions:1. Analyzes the interrupt2. Determines that a message has beenreceived3. Allocates a receive buffer4. Copies the message from the Ethernetcontroller to the receive buffer5. Resets the controller to receive anothermessage6. Calls a subroutine to insert a CCB pointingto the message onto the work queue inthe background network processThe Ethernet interrupt controller then dismissesthe interrupt, and control returns to the scheduler.The scheduler now enables interrupts andscans the work queues for additional work.The CCB containing the received message isfound on the work queues and the routing layeris called to completely process the message.When all work queues with immediate work areempty, the scheduler finally returns to the originallyinterrupted code in the user's applicationprogram.The second example deals with handling aninterrupt from the clock. In this case exactly thesame code path as the one in the first example isfollowed. The clock interrupts and the schedulergains control with interrupts disabled. It savesthe return address and state and dispatches tothe "real" clock interrupt handler. This handlerwill update the date and time and dismiss theinterrupt. Control now returns to the scheduler,which enables the interrupts, scans the timerqueues, and dispatches any process whose timerhas expired. When all such processes havebeen completed, the scheduler returns to theoriginally interrupted code in the applicationprogram. ·Using the scheduler to handle interrupts andcontext switching allows network processing tobe performed in the background while an MS­DOS application is running in the foreground.The interrupt shell ensures that a minimumamount of code runs with interrupts disabled.The background process scheduling ensuresthere is no network performance loss due to apause between message receipt and message processing.Overview of the DNA ArchitetureTable 1 lists the layers of the ISO model for datacommunications, along with the correspondingDNA layers and the appropriate DECnet-DOScomponents within each layer.110<strong>Digital</strong> TecbnicaiJournalNo. 3 <strong>September</strong> 1986

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!