So I got IRQ1 working correctly but it turns out that it prints the scan code read from port 0x60. I know I have to convert these to the actual characters but I can't seem to get my head around it. I am trying to do this in nasm. I know I can use key maps but it raises questions about make or break codes (which should I use and what should I do with the other?). Is there no mathematical formula to convert them to ASCII? I already read a lot about it online but it didn't help much. Any help as to how convert scan codes to character in nasm is appreciated.
Convert Scancodes to ASCII
3.9k Views Asked by Klaus Maria At
1
There are 1 best solutions below
Related Questions in X86
- Why do we need AX instead of MOV DS, data directly with a segment?
- Drawing circles of increasing radius
- Assembly print on screen using pop ecx
- How to add values from vector to each other
- Intel x64 instructions CMPSB/CMPSW/CMPSD/CMPSQ
- Compact implementation of logical AND in x86 assembly
- Can feenableexcept hurt a program performance?
- How do I display the result and remainder in ax and dx in Assembly (tasm)
- ASM : Trouble using int21h on real machine
- jmp instruction *%eax
- What steps are needed to load a second stage bootloader by name on a FAT32 file system in x86 Assembly?
- Assembly code to print a new line string
- Write System Call Argument Registers
- How to jump to an address saved in a register in intel assembly?
- Find middle value of a list
Related Questions in KEYBOARD
- Layout not shifting up when keyboard is open
- Unity3d - Input.GetKey returns true more than once
- Android: how to prevent jumping/flashing of views when trying to replace keyboard with a view
- Objective c keyboard opens unwillingly
- How to add scrollview to keyboardView in android
- C# - SendInput() - Hold Key Down?
- How to change keyboard language programmatically in windows 8
- Dismiss the Keyboard in Swift via hitTest
- How to convert VK scan codes to appropriate character for language selected
- How to get keystrokes with java outside of frames
- del key on a PC keyboard with MAC mini
- How to find which key is pressed, not which character it will be?
- Android soft keyboard in Chinese languages
- Is this Possible to add Keyboard Predictive option in UISearchBar keyboard
- Xcode Changing Keyboard
Related Questions in NASM
- (x64 Nasm) Writeline function on Linux
- Assembly print on screen using pop ecx
- Print a number in NASM - building an x86 Bootsector
- nasm: jump when input is NULL
- NASM: Makefile for library
- NASM issue on OSX 64-bit
- In NASM, does one usually use %define for typedefs?
- puts implementation in assembly with nasm x86-64
- assembly - How to boot kernel that is appended end of kernel?
- given hex input should be convert to decimal
- ASM, declaring float variables
- Understanding NASM Macro
- NASM convert Binary number to Decimal
- NASM memory not being accessed correctly?
- Truncation of nasm function returning value
Related Questions in OSDEV
- Rustc/LLVM generates faulty code for aarch64 with opt-level=0
- MinGW's ld cannot perform PE operations on non PE output file
- GCC 5.1.0-4 cross compiler build fail
- Link object files from header files in real mode when using GCC -m16 option?
- Constant reboot after setting up the Global Descriptor Table and protected mode
- Can't load flat binary file into kernel
- Linear addressing and the GDT
- How do you find the PCI memory hole on x86?
- Extended ASCII characters are printed in yellow instead of white - OSDev
- The Kernel starts behaving abnormally when the kernel code gets a little bigger
- LD errors while linking 16-bit real mode code into a Multiboot compliant ELF executable
- How can I provide a reliable callback functionality?
- Can HDD emulation be used to allow me to use my own bootable file system on a CD?
- Is it bad that a process should self create an own stack?
- OS development - converting logical block format to Cylinder-Head-Sector
Related Questions in SCANCODES
- How to convert VK scan codes to appropriate character for language selected
- Dvorak vs QWERTY scancodes
- How to convert X11 KeyCode or KeySym to scan code
- Linux asm - int 16h analogue to read raw keyboard scancodes
- Scancode when I press a key is different. Is Microsoft specification wrong?
- Why do winapi functions need scan code although there is a keyboard driver?
- Get scan code from WM_CHAR message
- osx mavericks keyboard scancodes map to the same characters independent of language map
- Windows scancodes for F11 and F12 are different. Why?
- How to translate Ordinary scancodes to ascii charcters
- C++ (Windows): Convert a virtual key code string representation ("VK_F6") to hexadecimal (0x75)
- How to generate a keyboard interrupt in assembly 8086
- Are linux/input.h keycodes layout independent?
- autohotkey scancode in combination
- What is the difference between an SDL physical key code and an SDL virtual key code?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
There is no such mathematical formula. In fact, the mapping differs a bit between keyboard layouts. This is a pretty hard problem. Usually you'd provide a way for users to select their keyboard layout and load a map based on that. So to answer your question: I'd suggest you to make an array mapping each scancode to the correct character. I assume you run it in qemu or another emulator, and the keymap in that is pretty constant for all intents and purposes. Then once your kernel gets farther in development, you provide multiple of these keymapping arrays that can be swapped out by the user. Though I'd put that pretty low on the list of tasks that need to be implemented in your os.
An example of such an array (for a standard US keyboard layout like you get in qemu):
Please note that this map is not entirely complete, won't work for all keyboards, and you might want to redefine the mapping for modifier keys like control, alt and shift. You will need to do some testing for that.