Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Just an idea: looking at <a href="https://gna.org/projects/grub4dos/" rel="nofollow noreferrer">GRUB for DOS</a> source (asm.s), the <code>console_checkkey</code> function is using BIOS <code>INT 16H Function 01</code>, and not function 00, as you are trying to do. Maybe you'd want to check if a key is waiting to be input.</p> <p>The <code>console_checkkey</code> code is setting the CPU to real mode in order to use the BIOS, as <a href="https://stackoverflow.com/questions/217731/x86-assembly-keyboard-input#217755">@skizz suggested</a>.</p> <p>You can also try using GRUB functions directly (if still mapped in real mode).</p> <p>A note on reading assembly source: in this version </p> <pre><code>movb $0x1, %ah </code></pre> <p>means move constant byte (0x1) to register <code>%ah</code></p> <p>The <code>console_checkkey</code> from GRUB asm.s:</p> <pre><code>/* * int console_checkkey (void) * if there is a character pending, return it; otherwise return -1 * BIOS call "INT 16H Function 01H" to check whether a character is pending * Call with %ah = 0x1 * Return: * If key waiting to be input: * %ah = keyboard scan code * %al = ASCII character * Zero flag = clear * else * Zero flag = set */ ENTRY(console_checkkey) push %ebp xorl %edx, %edx call EXT_C(prot_to_real) /* enter real mode */ .code16 sti /* checkkey needs interrupt on */ movb $0x1, %ah int $0x16 DATA32 jz notpending movw %ax, %dx //call translate_keycode call remap_ascii_char DATA32 jmp pending notpending: movl $0xFFFFFFFF, %edx pending: DATA32 call EXT_C(real_to_prot) .code32 mov %edx, %eax pop %ebp ret </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload