A user-space device driver can do many of the things that kernel drivers can t, such as perform a long-running computation, block while waiting for an event, or read files from the file system. Unlike kernel drivers, a user-space device driver can use other device drivers--that is, access the network, talk to a serial port, get interactive input from the user, POP up GUI windows, or read from disks. User-space drivers implemented using FUSD can be much easier to debug it is impossible for them to crash the machine, are easily traceable using tools such as gdb, and can be killed and restarted without rebooting even if they become corrupted. FUSD drivers don t have to be in C--Perl, Python, or any other language that knows how to read from and write to a file descriptor can work with FUSD. User-space drivers can be swapped out, whereas kernel drivers lock physical memory.
標簽:
user-space
can
drivers
perform
上傳時間:
2014-01-01
上傳用戶:saharawalker
DATAS SEGMENT
w dw 0
keybuf db 255
db 0
db 255 dup(0) ;定義鍵盤輸入需要的緩沖區
DATAS ENDS
STACKS SEGMENT
db 200 dup(?)
STACKS ENDS
CODES SEGMENT
ASSUME CS:CODES,DS:DATAS,SS:STACKS
START:
MOV AX,DATAS
MOV DS,AX
mov dx,offset keybuf ;用0a號功能,輸入一個字符串
mov ah,0ah ;用回車結束
int 21h
mov dl,0ah ;再進行換行,以便在下一行顯示轉換后的字符串
mov ah,2
int 21h
; push ax
; push dx
; mov dl,cl
; mov ah,02
; int 21h
; POP dx
; POP ax
mov bx,offset keybuf+1 ;取出字符串的字符個數,作為循環的次數
mov cl,[bx]
mov ch,0
mov ax,0
again:
inc bx
mov ax,[w]
push bx
mov bx,16
mul bx
POP bx ;是小寫字母,則轉換為大寫字母
mov [w],ax
mov dl,[bx] ;取出一個字符,
cmp dl,'9'
jbe lab1
cmp dl,'F'
jbe lab2
sub dl,32
lab2: sub dl ,07h
lab1: sub dl,30h
add [w],dx
loop again
mov ax,[w]
mov bx,-1
push bx
mov bx,10
lab3 :mov dx,0
div bx
push dx
cmp ax,0
jnz lab3
lab5: POP dx
cmp dx,-1
jz lab4
add dl,30h
mov ah,02
int 21h
jmp lab5 ;循環,處理完整個字符串
lab4: MOV AH,4CH
INT 21H
CODES ENDS
END START
標簽:
匯編
上傳時間:
2015-04-02
上傳用戶:wcc0310