

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Professor: Franklin; Class: COMPTR ORGANIZATN; Subject: Electrical & Computer Engineering; University: University of Maryland; Term: Fall 2006;
Typology: Assignments
1 / 2
This page cannot be seen from the preview
Don't miss anything!


Write a MIPS-I assembly language device driver that can be used to initiate a DMA operation. This device driver is called with 4 parameters: $a0 contains the operation (0 for read; 1 for write); $a1 contains the starting address in memory; $a2 contains the sector number in the disk; and $a contains the number of bytes to be transfered. Assume that the return address is present in $ra.
.ktext busy_wait: # Check if DMA controller is ready to accept a new command lw $t0, DMA_status li $t1, 0x and $t2, $t0, $t beq $t2, $zero, busy_wait
la $t2, DMA_data sw $a1, 0($t2) sw $a2, 4($t2) sw $a3, 8($t2)
li $t3, 30 sll $t3, $a0, $t li $t4, 0x3fffffff and $t0, $t0, $t or $t0, $t0, $t
jr $ra