diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/ints.txt | 26 | ||||
-rw-r--r-- | doc/keys.txt | 73 |
2 files changed, 82 insertions, 17 deletions
diff --git a/doc/ints.txt b/doc/ints.txt index cd91f60..dd47d81 100644 --- a/doc/ints.txt +++ b/doc/ints.txt @@ -9,31 +9,33 @@ syscall is int 0x30 system call number in eax args in ebx, ecx, edx, esi, edi result in eax - note: do not assume eax is unmodified if there is no value to be returned modifies ecx, edx +modifies eax even if no value is returned see table 1 file system calls have units of bytes unless otherwise specified functions returning handles or pointers use 0 to indicate error functions returning "success" use 1 for success and 0 for failure see keys.txt for the return type of the "get key" system call +the edx register of "start task" is a pointer to a null-terminated string. + a pointer to a readonly copy of this string is put into the new task's edx. invalid system call numbers change eax to -1, and have no other effect. table 1: - function | eax | eax out | ebx | ecx | edx | esi | edi ----------------|-----|---------------|---------------|-------------|-------|--------|----- - open file | 0x0 | handle | drive number | path | | | - close file | 0x1 | | handle | | | | - file read | 0x2 | read | handle | file offset | count | buffer | - get file size | 0x3 | size | handle | | | | - start task | 0x4 | success | drive number | path | | | - log string | 0x5 | | sz string | | | | - get key | 0x6 | keycode | | | | | - allocate ram | 0x7 | start pointer | pages | | | | - memory info | 0x8 | see table 2 | see table 2 | | | | + function | eax | eax out | ebx | ecx | edx | esi | edi +---------------|-----|---------------|---------------|-------------|-----------|--------|----- + open file | 0x0 | handle | drive number | path | | | + close file | 0x1 | | handle | | | | + file read | 0x2 | read | handle | file offset | count | buffer | + get file size | 0x3 | size | handle | | | | + start task | 0x4 | success | drive number | path | passed sz | | + log string | 0x5 | | sz string | | | | + get key | 0x6 | keycode | | | | | + allocate ram | 0x7 | start pointer | pages | | | | + memory info | 0x8 | see table 2 | see table 2 | | | | table 2: diff --git a/doc/keys.txt b/doc/keys.txt index a083eba..8deb480 100644 --- a/doc/keys.txt +++ b/doc/keys.txt @@ -2,7 +2,7 @@ keycodes are 32-bit integers. the low byte indicates the key itself. for printable characters (and keys with reasonable translations to ascii control codes), this is the ascii code. for -other ones, something in the range of 0x80 to 0xff is used, seen in table 1. +other ones, something in the range of 0x80 to 0xef is used, seen in table 1. the top 24 bits indicate several flags. these are seen in table 2, where bit 0 is the lowest bit of the second lowest byte of the keycode, and bit 23 is the @@ -18,10 +18,73 @@ user.c of the "knob" library for an example of this. table 1: code | key -------|----- - 0x80 | - .... | - 0xff | +------|--------------- + 0x80 | caps lock + 0x81 | insert + 0x82 | num lock + 0x83 | scroll lock + 0x84 | left shift + 0x85 | right shift + 0x86 | left alt + 0x87 | right alt + 0x88 | left control + 0x89 | right control + 0x8a | left meta + 0x8b | right meta + 0x8c | reserved + .... | reserved + 0x97 | reserved + 0x98 | unassigned + .... | unassigned + 0x9f | unassigned + 0xa0 | F1 + 0xa1 | F2 + 0xa2 | F3 + 0xa3 | F4 + 0xa4 | F5 + 0xa5 | F6 + 0xa6 | F7 + 0xa7 | F8 + 0xa8 | F9 + 0xa9 | F10 + 0xaa | F11 + 0xab | F12 + 0xac | unassigned + .... | unassigned + 0xaf | unassigned + 0xb0 | numpad 0 + 0xb1 | numpad 1 + 0xb2 | numpad 2 + 0xb3 | numpad 3 + 0xb4 | numpad 4 + 0xb5 | numpad 5 + 0xb6 | numpad 6 + 0xb7 | numpad 7 + 0xb8 | numpad 8 + 0xb9 | numpad 9 + 0xba | numpad * + 0xbb | numpad + + 0xbc | numpad Enter + 0xbd | numpad - + 0xbe | numpad . + 0xbf | numpad / + 0xc0 | unassigned + 0xc1 | delete + 0xc2 | home + 0xc3 | end + 0xc4 | page up + 0xc5 | page down + 0xc6 | up + 0xc7 | down + 0xc8 | left + 0xc9 | right + 0xca | escape + 0xcb | menu + 0xcc | pause + 0xcd | print screen + 0xce | unassigned + .... | unassigned + 0xef | unassigned table 2: |