5 1 外設 字元裝置鍵盤

2021-10-04 22:55:36 字數 1229 閱讀 2106

當按下鍵盤時會產生鍵盤中斷,進入keyboard_interrupt:處理函式中

keyboard_interrupt:

call key_table(,

%eax,

4)

在key_table裡會找每個案件對應的處理函式,大部分都是do_self

key_table:

.long none,do_self,do_self,do_self /* 00-03 s0 esc 1 2 */

.long do_self,do_self,do_self,do_self /* 04-07 3 4 5 6 */

do_self裡會通過key_map得到相應的ascii碼,然後放入讀佇列中

do_self:

lea alt_map,

%ebx

lea key_map,

%ebx

call put_queue

最後呼叫tty的中斷

call do_tty_interrupt
喚醒等待佇列

void

do_tty_interrupt

(int tty)

copy_to_cooked

(tty_table+tty)

;wake_up

(&tty->secondary.proc_list)

;

喚醒tty讀函式

int

tty_read

(unsigned channel,

char

* buf,

int nr)

sleep_if_empty

(struct tty_queue * queue)

while

(!current->signal &&

empty

(*queue)

)interruptible_sleep_on

(&queue->proc_list)

;

最後將佇列中的資料放到使用者空間就可以列印輸出了

do

}while

(nr>0&&

!empty

(tty->secondary)

);

日本推出可打電話的無線鍵盤外設

當需要接打 時,它會接管手機或平板的通話功能。通常情況下,這些移動裝置在通話狀態下會關閉螢幕,有了這個小工具,你可以在打 的同時繼續進行你的編輯操作。同時它還帶有來電震動提醒,oled螢幕也會顯示來去電號碼,不到70克的重量能讓你煲粥時毫無壓力。電源方面,它使用了一塊600mah的可充電鋰離子電池,...

初始化 鍵盤裝置

1 bool initinput hwnd hwnd 216 第二步 建立裝置,滑鼠,鍵盤等。17 res pinput createdevice 18 guid syskeyboard,裝置的guid,這裡使用定義好的 19 pkeyboard,裝置指標 20null 21if succeeded...

HC小區管理系統對外裝置相關介面

文件說明裝置相關介面協議 hc小區管理系統原始碼獲取 說明 查詢業主可以開門裝置 請求方式 get 請求引數 名稱型別 是否必填 示例值描述 memberid string 是772020123183100051 業主id communityid string 是2020122471920846 小...