Write Your Own Operating System Tutorial(5) (轉)
All of this printing stuff to the screen is fun, but no operating system would be any good at all if it did not prov any interactivity. Let’s make it read input from the keyboard. Again we will be using calls to a function in to read the keyboard.
We are going to be using function 0, interrupt 0x16. This is done easily with the following two instructions.
xor ah, ah ; we want function zero:namespace prefix = o ns = "urn:schemas--com::office" />
int 0x16 ; wait for a keypress
This function causes the computer to pause and does not return until a key is pressed. This can be used in a “Press any key to continue” situation, or also if you want to get input from the user. The scan code of the key pressed will be returned in register AH, and the ASCII code is returned in AL.
Your assignment for this lesson is to write a simple boot program that demonstrates a bit of interactivity. Perhaps it could print a message each time a key is pressed. Or maybe allow the user to type at the keyboard and echo each character to the screen as it is typed.
If you get stuck, here is an of my own. But it's no fair peeking until you’ve tried by yourself!
In the next lesson we will learn how to make our operating system larger than the single sector of the Boot Record.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10752043/viewspace-993854/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Write Your Own Operating System Tutorial(1) (轉)
- Write Your Own Operating System Tutorial(2) (轉)
- Write Your Own Operating System Tutorial(4) (轉)
- Write Your Own Operating System Tutorial(3) (轉)
- Write Your Own Operating System Tutorial(6) (轉)
- Write Your Own Operating System Tutorial(7) (轉)
- Write Your Own Operating System Tutorial(中文版) (轉)
- Write Your Own Operating System Tutorial(中文版) 簡介 (轉)
- Write Your Own Operating System Tutorial(中文版) 簡介
- Build Your Own Cas Service - ProUI
- operating-system structuresStruct
- Checking operating system version FailedAI
- Backup your Linux SystemLinux
- Checking operating system version Failed 續AI
- The Database Administrator's Operating System Account (25)Database
- Can one execute an operating system command from PL/SQL?SQL
- 【build your own xxx】實現你自己的bind函式UI函式
- mysql 啟動錯誤(InnoDB: Operating system error number 13 )MySqlError
- MYSQL-Operating System Error Codes(錯誤程式碼)MySqlError
- 【build your own xxx】實現你自己的call和applyUIAPP
- redhat your system appears to have shut down uncleanlyRedhatAPP
- 作業系統-Operating-System第一章:概述作業系統
- 安裝 ESXi 出現錯誤 ERROR 1962: No operating system foundError
- Protecting Your Database: Specifying Passwords for Users SYS and SYSTEM (70)Database
- 使用oracle的作業系統認證(Operating System Authentication)的方法Oracle作業系統
- Microsoft Agent Tutorial Chapter 1 (轉)ROSAPT
- Microsoft Agent Tutorial Chapter 2 (轉)ROSAPT
- Discover Your Missed ASM Disks(轉)ASM
- 【OEL】Oracle Enterprise Linux Operating System下載方法及安裝體驗OracleLinux
- Entity Framework Tutorial Basics(5):Create Entity Data ModelFramework
- Tutorial: Hello World with Ant(轉,來自apache)Apache
- She Got her ownGo
- 轉載:System:System.arraycopy方法詳解
- Pytorch | Tutorial-03 資料轉換PyTorch
- Win10系統無法開機提示“error loading operating system”怎麼解決Win10Error
- 升級windows10顯示Missing Operating System無法進入系統如何解決Windows
- 【Exception】:own error messageExceptionError
- Your default context=root:system_r:unconfined_t:SystemLow-SystemHighContext