{\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fnil\fcharset0 Arial;}{\f1\fswiss\fprq2\fcharset0 Arial;}{\f2\fnil\fcharset0 Times New Roman;}}
\viewkind4\uc1\pard\nowidctlpar\sl240\slmult1\qc\lang1033\kerning28\b\fs44 PCOS Kernel \fs40 Technical Reference\par
versions 1.00 - 1.42\par
\fs24 2007 by Mercury0x000D\par
\par
\par
\par
\par
\page Index\par
\par
\pard\nowidctlpar\sl240\slmult1 section\tab\tab\tab\tab\tab title\par
\fs20 1\tab\tab\tab\tab\tab\tab Version Numbering Scheme\par
2\tab\tab\tab\tab\tab\tab KINT Function Quick Reference\par
3\tab\tab\tab\tab\tab\tab KINT Functions in Detail\par
4\tab\tab\tab\tab\tab\tab Instruction Opcodes (Listed by Instruction Name)\par
5\tab\tab\tab\tab\tab\tab Instruction Opcodes (Listed by Opcode)\par
6\tab\tab\tab\tab\tab\tab Kernel Error Codes\par
7\tab\tab\tab\tab\tab\tab The Kernel Command Prompt\par
8\tab\tab\tab\tab\tab\tab Command Line Switches\par
9\tab\tab\tab\tab\tab\tab Kernel Priority Levels\par
\par
\par
\par
\par
\par
\pard\nowidctlpar\sl240\slmult1\qc Section 1: Version Numbering Scheme\par
\pard\nowidctlpar\sl240\slmult1\par
\b0\tab When programming or using the PCOS Kernel, it is often helpful to understand the version numbering system used. Minor bugfixes and feature additions usually result simply in the kernel's internal revision number being incremented. For more serious bugfixes or when larger features are added, commonly the hundredths place of the version is updated. As enough of these accumulate, naturally, they will roll over into the tenths place, and eventually into the whole version number, but keep in mind that the whole part of the version number is never updated unless a truly major milestone is achieved in its features, algorithims, or underlying design.\b\par
\par
\par
\par
\par
\par
\pard\nowidctlpar\sl240\slmult1\qc Section 2: KINT Functions Quick Reference\par
\pard\nowidctlpar\sl240\slmult1\par
\b0\tab Here's a list of all the kernel interrupt (KINT) functions supported by the PCOS kernel.\par
number\tab\tab description\par
01\tab\tab get address of system data area\par
02\tab\tab get thread number of calling app\par
03\tab\tab position cursor\par
04\tab\tab return timer value\par
05\tab\tab clear screen\par
06\tab\tab set video mode\par
07\tab\tab print pascal string\par
08\tab\tab terminate thread\par
09\tab\tab print value\par
0A\tab\tab copy date to pascal string\par
0B\tab\tab copy time to pascal string\par
0C\tab\tab open file\par
0D\tab\tab close file\par
0E\tab\tab get word from string\par
0F\tab\tab write pascal string to file\par
10\tab\tab get file position\par
11\tab\tab set file position\par
12\tab\tab get input\par
13\tab\tab add function to kernel list\par
14\tab\tab remove function from kernel list\par
15\tab\tab get address of function in kernel list\par
16\tab\tab return register value of other thread\par
17\tab\tab get directory contents (initiate)\par
18\tab\tab plot point on screen (direct screen write for non-VESA modes)\par
19\tab\tab reboot\par
1A\tab\tab get word count of string\par
1B\tab\tab get file data\par
1C\tab\tab string search function\par
1D\tab\tab execute DOS app\par
1E\tab\tab execute PCOS app\par
1F\tab\tab get key press\par
20\tab\tab get cursor position\par
21\tab\tab get directory contentents (continue)\par
22\tab\tab rename file\par
23\tab\tab create directory\par
24\tab\tab create file\par
25\tab\tab delete directory\par
26\tab\tab delete file\par
27\tab\tab add resource\par
28\tab\tab delete resource\par
29\tab\tab set login name\par
2A\tab\tab get login name\par
2B\tab\tab print imbedded string\par
2C\tab\tab get string from number\par
2D\tab\tab get file length\par
2E\tab\tab get APM BIOS version\par
2F\tab\tab activate / deactivate APM\par
30\tab\tab APM power off\par
31\tab\tab draw line - available in version 1.35 and up\par
32\tab\tab set thread pause state - available in version 1.40 and up\par
33\tab\tab set thread priority - available in version 1.40 and up\par
34\tab\tab open / close CD drive door\par
35\tab\tab tone generator\par
\b\par
\par
\par
\par
\par
\pard\nowidctlpar\sl240\slmult1\qc Section 3: KINT Functions in Detail\par
\par
\pard\nowidctlpar\sl240\slmult1\b0\tab The PCOS kernel provides the applications programmer access to a variety of its internal routines for performing various tasks, which are detailed here. To call a kint function, set the number of the desired function in AX, then execute interrupt 0x019. If 'input' is not specified for a particular function, no data is required upon entry into the function for it to execute. Likewise, if 'output' is not specified, no data is returned upon exit from the function. Not all functions are available in all kernel versions, so the version in which a particular routine was added is noted also. Unless otherwise specified, the routine can be assumed to be available in every kernel version.\par
\par
01\tab get address of system data area\par
\tab output:\tab bx = handle of system data area block\par
\tab\tab cx = offset of system data area block\par
\par
02\tab get thread number of calling app\par
\tab input:\tab none\par
\tab output:\tab bx = thread number of the thread which called the interrupt\par
\par
03\tab position cursor\par
\tab input:\tab bx = new vertical position of cursor (0 = leave at current position)\par
\tab\tab cx = new horizontal position of cursor (0 = leave at current position)\par
\par
04\tab return timer value\par
\tab input:\tab none\par
\tab output:\tab bx = decimal part of system timer\par
\tab\tab cx = fractional part of system timer\par
\par
05\tab clear screen\par
\tab input:\tab none\par
\par
06\tab set video mode\par
\tab input:\tab bx = video mode to set\par
\tab output:\tab none\par
\par
07\tab print pascal string\par
\tab input:\tab bx = vertical position to print (0 = leave at current position)\par
\tab\tab cx = horizontal position to print (0 = leave at current position)\par
\tab\tab si = offset of string data to print (cs:si)\par
\par
08\tab terminate thread\par
\tab input:\tab bx = thread number of the thread to be terminated\par
\tab\tab (note: if bx = 0 the thread which called the interrupt will be terminated)\par
\tab output:\tab none\par
\par
09\tab print value\par
\tab input:\tab bx = vertical position to print (0 = leave at current position)\par
\tab\tab cx = horizontal position to print (0 = leave at current position)\tab\par
\tab\tab si = value to print\par
\tab output:\tab none\par
\par
0A\tab copy date to pascal string\par
\tab input:\tab si = offset of 10 byte string to hold date (cs:si)\par
\tab output:\tab none\par
\par
0B\tab copy time to pascal string\par
\tab input:\tab si = offset of 8 byte string to hold time (cs:si)\par
\tab output:\tab none\par
\par
0C\tab open file\par
\tab input:\tab si = offset of string containing filespec (cs:si)\par
\tab output:\tab bx = file number file was opened as\par
\par
0D\tab close file\par
\tab input:\tab bx = file number of file to close\par
\tab output:\tab none\par
\par
0E\tab get word from string\par
\tab input:\tab si = source string\par
\tab\tab di = string to hold word specified\par
\tab\tab bx = word to return\par
\tab\tab cx = ASCII code of separation character\par
\tab output:\tab di = string containing the word specified by ax\par
\par
0F\tab write pascal string to file\par
\tab input:\tab si = source string\par
\tab\tab bx = number of the file to write string to\par
\tab\tab cx = position in file at which to write string (0 = current position)\par
\tab output:\tab di = string containing the word specified by ax\par
\par
10\tab get file position\par
\tab input:\tab bx = number of file of which to return length\par
\tab output:\tab cx = current location in the file specified\par
\par
11\tab set file position\par
\tab input:\tab bx = number of file of which to return length\par
\tab\tab cx = position to which to set the file\par
\tab output:\tab none\par
\par
12\tab get input\par
\tab input:\tab si = address of string to contain user's input\par
\tab output:\tab si = string contains input from the user\par
\par
13\tab add function to kernel list\par
\tab input:\tab si = string containing the name of the function to add to the kernel list\par
\tab\tab es = handle of function for use in far call\par
\tab\tab di = pointer (offset) of function for use in far call\par
\tab output:\tab none\par
\par
14\tab remove function from kernel list\par
\tab input:\tab si = string containing the name of the function to remove from the kernel list\par
\tab\tab es = handle of function for use in far call\par
\tab\tab di = pointer (offset) of function for use in far call\par
\tab output:\tab none\par
\par
15\tab get address of function in kernel list\par
\tab input:\tab si = string containing the name of the function to return an address for\par
\tab output:\tab es = handle of function for use in far call\par
\tab\tab di = pointer (offset) of function for use in far call\par
\par
16\tab return register value of other thread\par
\tab input:\tab bx = numeric code representing register to return\par
\tab\tab cx = thread number of app to get register from\par
\tab output:\tab dx = register value from specified thread\par
\par
17\tab get directory contents (initiate)\par
\tab input:\tab di = string containing filespec to return contents of\par
\tab\tab si = string to hold PCOS long filenames of files in the directory specified\par
\tab\tab bx = mask of attribute bytes to return file types\par
\tab\tab dx = recursion flag (used to control how deep the kernel looks for size info\par
\tab\tab when a directory is found)\par
\tab output:\tab si = address of a string containing the first filenames which matches the\par
\tab\tab path and attributes specified.\par
\tab\tab cx = size of the file returned\par
\tab\tab (Note: This KINT is used to set or change the search criteria.\par
\tab\tab KINT 21h should be used to find the next filename which matches the current\par
\tab\tab search settings.)\par
\par
18\tab plot point on screen (direct screen write for non-VESA modes)\par
\par
19\tab reboot\par
\tab input:\tab none\par
\tab output:\tab none\par
\par
1A\tab get word count of string\par
\tab input:\tab si = source string\par
\tab\tab cx = ASCII code of separation character\par
\tab output:\tab bx = number of words in string\par
\par
1B\tab get file data\par
\tab input:\tab si = filepath string\par
\tab\tab es = string to hold file's date\par
\tab\tab di = string to hold file's time\par
\tab\tab bx = file's attributes\par
\tab\tab cx = file length\par
\tab output:\tab none\par
\par
1C\tab string search function\par
\tab input:\tab bx = character position to begin search in string pointed to by si\par
\tab\tab si = string to search\par
\tab\tab di = string to match\par
\tab output:\tab cx = position at which match string was found in search string\par
\tab\tab (note: cx will be 0 if match string isn't found in search string)\par
\par
1D\tab execute DOS app\par
\tab input:\tab si = string containing path to a DOS EXE or COM file to be run\par
\tab output:\tab none\par
\par
1E\tab execute PCOS app\par
\tab input:\tab si = string containing path to PCOS application to be run\par
\tab output:\tab none\par
\par
1F\tab get key press\par
\tab input:\tab none\par
\tab output:\tab bx = ASCII code of the key pressed\par
\par
20\tab get cursor position\par
\tab input:\tab bx = current vertical position of cursor\par
\tab\tab cx = current horizontal position of cursor\par
\par
21\tab get directory contentents (continue)\par
\tab input:\tab si = address of a string to hold returned filename\par
\tab output:\tab si = address of a string containing the next filename which matches the\par
\tab search criteria set by KINT 17h.\par
\tab\tab cx = size of the file returned\par
\tab\tab dx = recursion flag (used to control how deep the kernel looks for size info\par
\tab\tab when a directory is found)\par
\par
22\tab rename file\par
\tab input:\tab si = address of a string containing filepath to the file to rename\par
\tab\tab di = address of a string containing new name for the file\par
\tab output:\tab none\par
\par
23\tab create directory\par
\tab input:\tab si = address of a string containing the name for the new directory\par
\tab output:\tab none\par
\par
24\tab create file\par
\tab input:\tab si = address of a string containing the name for the new file\par
\tab output:\tab none\par
\par
25\tab delete directory\par
\tab input:\tab si = address of a string containing the name for the new directory\par
\tab output:\tab none\par
\tab\tab (NOTE: Unlike DOS, this function will delete a directory regardless of its\par
\tab\tab contents! The directory will be deleted as well as EVERY FILE IN IT.)\par
\par
26\tab delete file\par
\tab input:\tab si = address of a string containing the name for the new directory\par
\tab output:\tab none\par
\par
27\tab add resource\par
\tab input:\tab bx = number of the file to which the resource will be added\par
\tab\tab cx = number of the new resource\par
\tab\tab si = address of a string containing the name for the new resource\par
\tab\tab di = address of a string containing the contents of the new resource\par
\tab output:\tab none\par
\par
28\tab delete resource\par
\tab input:\tab bx = number of the file to which the resource will be deleted\par
\tab\tab cx = number of the resource to delete\par
\tab\tab si = address of a string containing the name of the resource to delete\par
\tab\tab di = address of a string containing the filepath of the file containing the resource\par
\tab\tab to delete\par
\tab output:\tab none\par
\par
29\tab set login name\par
\tab input:\tab si = address of a string containing the new login name\par
\tab output:\tab none\par
\par
2A\tab get login name\par
\tab input:\tab si = address of a string to containing the retreived login name\par
\tab output:\tab none\par
\par
2B\tab print imbedded string\par
\tab input:\tab si = address of string to print\par
\tab output:\tab none\par
\tab\tab (NOTE: This function pops a value off the stack every time it encounters the\par
\tab\tab "%" symbol, and treats this value as a pointer, printing whatever it finds at\par
\tab\tab that address as part of the string. The string passed in si must be in ASCIIZ\par
\tab\tab format.)\par
\par
2C\tab get string from number\par
\tab input:\tab bx = number\par
\tab\tab si = address of empty string\par
\tab output:\tab note\par
\par
2D\tab get file length\par
\tab input:\tab bx = number of file of which to return length\par
\tab output:\tab cx = length of file specified\par
\par
2E\tab get APM BIOS version\par
\tab input:\tab none\par
\tab output:\tab bx = major version of APM BIOS\par
\tab\tab cx = minor version of APM BIOS\par
\tab\tab dx = current state of APM\par
\tab\tab\tab 0 = APM is currently disabled\par
\tab\tab\tab 1 = APM is currently enabled\par
\par
2F\tab activate / deactivate APM\par
\tab input:\tab bx = activate flag\par
\tab\tab\tab 0 = deactivate\par
\tab\tab\tab 1 = activate\par
\tab output:\tab none\par
\par
30\tab APM power off\par
\tab input:\tab none\par
\tab output:\tab none\par
\par
31\tab draw line - available in version 1.35 and up\par
\tab input:\tab bx = horizontal position of line start\par
\tab\tab cx = vertical position of line start\par
\tab\tab dx = horizontal position of line end\par
\tab\tab ex = vertical position of line end\par
\tab\tab fx = color of line\par
\tab\tab gx = box attribute\par
\tab\tab\tab 0 = line is drawn\par
\tab\tab\tab 1 = rectangle is drawn\par
\tab\tab\tab 2 = filled rectangle is drawn\par
\par
32\tab set thread pause state - available in version 1.40 and up\par
\tab input:\tab bx = thread number (if bx = 0 then the calling thread number will be used)\par
\tab\tab cx = new pause value\par
\tab\tab\tab 0 = not paused\par
\tab\tab\tab 1 = paused\par
\par
\par
33\tab set thread priority - available in version 1.40 and up\par
\tab input:\tab bx = thread number (if bx = 0 then the calling thread number will be used)\par
\tab\tab cx = new priority value\par
\par
\tab\tab\tab NOTE: There are two versions of this function call. The original was\par
\tab\tab\tab only used in kernel 1.40, and takes its input as follows:\f1\par
\tab\tab\tab 0 = one instruction per cycle\par
\tab\tab\tab 1 = \kerning0 timed execution: 16 instructions per second\kerning28\par
\tab\tab\tab 2 = \kerning0 timed execution: 32 instructions per second\kerning28\par
\tab\tab\tab 3 = \kerning0 timed execution: 64 instructions per second\kerning28\par
\tab\tab\tab 4 = \kerning0 timed execution: 16 instructions per minute\kerning28\par
\tab\tab\tab 5 = \kerning0 timed execution: 32 instructions per minute\kerning28\par
\tab\tab\tab 6 = \kerning0 timed execution: 64 instructions per minute\kerning28\par
\tab\tab\tab 7 = \kerning0 16 instructions per cycle\kerning28\par
\tab\tab\tab 8 = \kerning0 32 instructions per cycle\kerning28\par
\tab\tab\tab 9 = 6\kerning0 4 instructions per cycle\par
\par
\tab\tab\tab The kernel versions since 1.40 have redefined the priority levels. The\par
\tab\tab\tab new standard is this:\par
\kerning28\f0\tab\tab\tab 00 = timed execution: 1 instruction per second\par
\tab\tab\tab 01 = timed execution: 32 instructions per second\par
\tab\tab\tab 02 = timed execution: 64 instructions per second\par
\tab\tab\tab 03 = timed execution: 1 instruction per minute\par
\tab\tab\tab 04 = timed execution: 32 instructions per minute\par
\tab\tab\tab 05 = timed execution: 64 instructions per minute\par
\tab\tab\tab 06 = 1 instruction per cycle\par
\tab\tab\tab 07 = 32 instructions per cycle\par
\tab\tab\tab 08 = 64 instructions per cycle\par
\par
34\tab open / close CD drive door\par
\tab input:\tab bx = drive number (A = 1, B = 2, etc.)\par
\tab\tab cx = open / close flag\par
\tab\tab\tab 0 = door is closed\par
\tab\tab\tab 1 = door is opened\f1\par
\f0\par
35\tab tone generator\par
\tab input:\tab bx = pitch of the tone to make in hertz (must be between 37 and 32767)\par
\tab\tab cx = length of tone to make in thousandths of a second\par
\par
\par
\par
\par
\page\pard\nowidctlpar\sl240\slmult1\qc\b Section 4: Instruction Opcodes (Listed by Instruction Name)\par
\par
\pard\nowidctlpar\sl240\slmult1\b0\tab The following table is an alphabetical listing of all the assembly opcodes recognized by the PCOS kernel.\par
\par
Hex Opcode\tab Instruction Name\par
06\tab\tab <unused>\par
A0\tab\tab add\par
01\tab\tab and\par
25\tab\tab brl\par
26\tab\tab brr\par
0A\tab\tab call (num)\par
09\tab\tab call (reg)\par
03\tab\tab dec\par
28\tab\tab dbug\par
2E\tab\tab div\par
3C\tab\tab exp\par
02\tab\tab far call\par
11\tab\tab far ret\par
04\tab\tab in\par
05\tab\tab inc\par
07\tab\tab int (num)\par
24\tab\tab int (reg)\par
08\tab\tab iret (currently unsupported)\par
3D\tab\tab jmp reg\par
1D\tab\tab jmp num\par
40\tab\tab jmpe\par
42\tab\tab jmpg\par
41\tab\tab jmpl\par
43\tab\tab jmpn\par
39\tab\tab mov mem(num)<num\par
1A\tab\tab mov mem(num)<reg\par
17\tab\tab mov mem<reg\par
1C\tab\tab mov reg<mem\par
27\tab\tab mov reg<mem(num)\par
22\tab\tab mov reg<num\par
1F\tab\tab mov reg<reg\par
3A\tab\tab movb mem(num)<num\par
33\tab\tab movb mem(num)<reg\par
2F\tab\tab movb mem<reg\par
30\tab\tab movb reg<mem\par
34\tab\tab movb reg<mem(num)\par
31\tab\tab movb reg<num\par
32\tab\tab movb reg<reg\par
3B\tab\tab movw mem(num)<num\par
37\tab\tab movw mem(num)<reg\par
19\tab\tab movw mem<reg\par
20\tab\tab movw reg<mem\par
38\tab\tab movw reg<mem(num)\par
35\tab\tab movw reg<num\par
36\tab\tab movw reg<reg\par
2D\tab\tab mul\par
00\tab\tab nop\par
0B\tab\tab not\par
0C\tab\tab or\par
0D\tab\tab out\par
0E\tab\tab pop\par
23\tab\tab push (num)\par
10\tab\tab push (reg)\par
0F\tab\tab ret\par
12\tab\tab sie\par
13\tab\tab sig\par
14\tab\tab sil\par
2C\tab\tab sir\par
21\tab\tab sise\par
1E\tab\tab sisg\par
18\tab\tab sisl\par
3F\tab\tab sisn\par
3E\tab\tab sne\par
29\tab\tab stb\par
2A\tab\tab stn\par
2B\tab\tab stw\par
15\tab\tab sub\par
1B\tab\tab test\par
16\tab\tab xor\page\par
\par
\par
\par
\par
\pard\nowidctlpar\sl240\slmult1\qc\b Section 5: Instruction Opcodes (Listed by Opcode)\par
\par
\pard\nowidctlpar\sl240\slmult1\b0\tab The following table is a listing of all the assembly opcodes recognized by the PCOS kernel, this time sorted by opcode name.\par
\par
Hex Opcode\tab\tab Instruction Name\par
00\tab\tab\tab nop\par
01\tab\tab\tab and\par
02\tab\tab\tab far call\par
03\tab\tab\tab dec\par
04\tab\tab\tab in\par
05\tab\tab\tab inc\par
06\tab\tab\tab <unused>\par
07\tab\tab\tab int (num)\par
08\tab\tab\tab iret (currently unsupported)\par
09\tab\tab\tab call (reg)\par
0A\tab\tab\tab call (num)\par
0B\tab\tab\tab not\par
0C\tab\tab\tab or\par
0D\tab\tab\tab out\par
0E\tab\tab\tab pop\par
0F\tab\tab\tab ret\par
10\tab\tab\tab push (reg)\par
11\tab\tab\tab far ret\par
12\tab\tab\tab sie\par
13\tab\tab\tab sig\par
14\tab\tab\tab sil\par
15\tab\tab\tab sub\par
16\tab\tab\tab xor\par
17\tab\tab\tab mov mem<reg\par
18\tab\tab\tab sisl\par
19\tab\tab\tab movw mem<reg\par
1A\tab\tab\tab mov mem[num]<reg\par
1B\tab\tab\tab test\par
1C\tab\tab\tab mov reg<mem\par
1D\tab\tab\tab jmp (num)\par
1E\tab\tab\tab sisg\par
1F\tab\tab\tab mov reg<reg\par
20\tab\tab\tab movw reg<mem\par
21\tab\tab\tab sise\par
22\tab\tab\tab mov reg<num\par
23\tab\tab\tab push (num)\par
24\tab\tab\tab int (reg)\par
25\tab\tab\tab brl\par
26\tab\tab\tab brr\par
27\tab\tab\tab mov reg<mem[num]\par
28\tab\tab\tab dbug\par
29\tab\tab\tab stb\par
2A\tab\tab\tab stn\par
2B\tab\tab\tab stw\par
2C\tab\tab\tab sir\par
2D\tab\tab\tab mul\par
2E\tab\tab\tab div\par
2F\tab\tab\tab movb mem<reg\par
30\tab\tab\tab movb reg<mem\par
31\tab\tab\tab movb reg<num\par
32\tab\tab\tab movb reg<reg\par
33\tab\tab\tab movb mem[num]<reg\par
34\tab\tab\tab movb reg<mem[num]\par
35\tab\tab\tab movw reg<num\par
36\tab\tab\tab movw reg<reg\par
37\tab\tab\tab movw mem[num]<reg\par
38\tab\tab\tab movw reg<mem[num]\par
39\tab\tab\tab mov mem[num]<num\par
3A\tab\tab\tab movb mem[num]<num\par
3B\tab\tab\tab movw mem[num]<num\par
3C\tab\tab\tab exp\par
3D\tab\tab\tab jmp (reg)\par
3E\tab\tab\tab sne\par
3F\tab\tab\tab sisn\par
40\tab\tab\tab jmpe\par
41\tab\tab\tab jmpl\par
42\tab\tab\tab jmpg\par
43\tab\tab\tab jmpn\par
A0\tab\tab\tab add\par
\par
\par
\par
\par
\b\page\pard\nowidctlpar\sl240\slmult1\qc Section 6: Kernel Error Codes\par
\par
\pard\nowidctlpar\sl240\slmult1\b0\tab Errors can crop up in any software. The question is, how does the operating system handle them? PCOS was built upon a solid framework, therefore when a thread causes problems, you can usually just terminate the errant program and continue merrily along your way. If a thread appears to have hung, froze, or locked up, you can always go to the command prompt and use 'thread x stop' to kill the process manually.\par
\par
hex\tab\tab decimal\tab\tab error\par
200\tab\tab 512\tab\tab invalid instruction\par
201\tab\tab 513\tab\tab XMS driver not installed\par
202\tab\tab 514\tab\tab no XMS available\par
203\tab\tab 515\tab\tab invalid XMS address\par
204\tab\tab 516\tab\tab resource not found\par
205\tab\tab 517\tab\tab free thread not available\par
206\tab\tab 518\tab\tab invalid data in call to KINT function\par
207\tab\tab 519\tab\tab XMS error- not implemented\par
208\tab\tab 520\tab\tab XMS error- VDISK detected (no room left for XMS)\par
209\tab\tab 521\tab\tab XMS error- A20 error\par
20A\tab\tab 522\tab\tab XMS error- all allocated\par
20B\tab\tab 523\tab\tab XMS error- all handles used\par
20C\tab\tab 524\tab\tab XMS error- invalid handle\par
20D\tab\tab 525\tab\tab XMS error- invalid source handle\par
20E\tab\tab 526\tab\tab XMS error- invalid source offset\par
20F\tab\tab 527\tab\tab XMS error- invalid dest handle\par
210\tab\tab 528\tab\tab XMS error- invalid dest offset\par
211\tab\tab 529\tab\tab XMS error- invalid length\par
212\tab\tab 530\tab\tab XMS error- overlap of source and dest in copy\par
213\tab\tab 531\tab\tab XMS error- hardware parity error\par
214\tab\tab 532\tab\tab XMS error- block is locked\par
215\tab\tab 533\tab\tab invalid string length in ReadPascalString\par
216\tab\tab 534\tab\tab KINT function not supported\par
217\tab\tab 535\tab\tab Resource already exists\par
218\tab\tab 536\tab\tab Error loading CODE resource\par
219\tab\tab 537\tab\tab XMS access error- data not even\par
21A\tab\tab 538\tab\tab Instruction unsupported\par
21B\tab\tab 539\tab\tab Exception\par
21C\tab\tab 540\tab\tab APM error- APM functionality disabled\par
21D\tab\tab 541\tab\tab APM error- Real mode connection already established\par
21E\tab\tab 542\tab\tab APM error- Interface not connected\par
21F\tab\tab 543\tab\tab APM error- 16-bit protected mode connection already established\par
220\tab\tab 544\tab\tab APM error- 32-bit protected mode connection already established\par
221\tab\tab 545\tab\tab APM error- Unrecognized device ID\par
222\tab\tab 546\tab\tab APM error- Parameter out of range\par
223\tab\tab 547\tab\tab APM error- APM not present\par
224\tab\tab 548\tab\tab thread is locked\par
225\tab\tab 549\tab\tab kernel cannot be reset\page\par
\par
\par
\par
\par
\pard\nowidctlpar\sl240\slmult1\qc\b Section 7: The Kernel Command Prompt\par
\par
\pard\nowidctlpar\sl240\slmult1\b0\tab The PCOS kernel includes a built-in command prompt which can be accessed by pressing the F1 key at any time. The command prompt is a faithful recreation of the traditional DOS command prompt. The commands are as follows:\par
\par
chdir\tab\tab Changes the current directory path for the drive you are currently on. You may also\par
\tab\tab use 'cd'.\par
cls\tab\tab Clears the screen.\par
copy\tab\tab Copies files from one folder to another.\par
debug\tab\tab Toggles debug mode. (Debug mode is not available in kernel 1.34.)\par
delete\tab\tab Or 'del', use to delete files.\par
dir\tab\tab Use to browse through a disk's contents.\par
drives\tab\tab Lists information about all available disk drives.\par
exit\tab\tab Exits the command prompt.\par
help\tab\tab Displays this help information.\par
login\tab\tab Allows you to enter your login information.\par
logout\tab\tab Logs you out of the system.\par
mkdir\tab\tab Use to create a directory. You can also use 'md'.\par
mem\tab\tab Displays memory information.\par
pause\tab\tab Pauses the system until you press a key. For use in batch files.\par
reboot\tab\tab Reboots the computer.\par
rmdir\tab\tab Or 'rd', use to remove a directory.\par
run\tab\tab Used to launch a program. (version 1.33 only)\par
set\tab\tab Used to view or set environment variables.\par
shutdown\tab Turns off an APM enabled computer.\par
thread\tab\tab Use with 'stop' to terminate a thread, or 'switch' to switch to a thread, with 'info' to\par
\tab\tab display information about a thread, with \lquote pause\rquote  to toggle the paused state of a\par
\tab\tab thread or by itself to display a summary of all running threads. As of kernel version\par
\tab\tab 1.40, thread may be used with the 'priority' keyword to set the priority level of a\par
\tab\tab thread manually, as follows: 'thread 4 priority 2'\par
ver\tab\tab Displays kernel version information.\par
quit\tab\tab Ends the kernel session.\par
xms\tab\tab Use with 'release' to dispose of an XMS handle, with 'view' to see the contents of a\par
\tab\tab block of XMS, or use by itself to display information about a handle.\par
\par
\par
\par
\par
\page\pard\nowidctlpar\sl240\slmult1\qc\b Section 8: Command Line Switches\par
\b0\par
\pard\nowidctlpar\sl240\slmult1\tab The following switches can be used when invoking the PCOS kernel:\par
\par
Switch\tab\tab Name / Description\par
/nhp\tab\tab\ldblquote No Handle Probing\rdblquote  Disables handle probing which can cause problems under\par
\tab\tab Windows.\par
\par
\par
\f2\par
\par
\f0\page\pard\nowidctlpar\sl240\slmult1\qc\b Section 9: Kernel Priority Levels\par
\b0\par
\pard\nowidctlpar\sl240\slmult1\tab The PCOS kernel has several priority levels available to a thread. By default, the kernel infinite loop (thread 0) is assigned priority level 6, since it doesn't need any more CPU power than that. Any other threads, whether they are launched by the user or spawned by other threads, are assigned the highest priority, level 8. If a certain thread does not need to use that much of the CPU, it can alter its priority level by calling kint 0x33. This approach is used in the kernel's clock program, so that it only updates its display as needed to save CPU time, not constantly updating the screen thereby wasting CPU cycles unneccessarily. A programmer could, for example, create a GUI which automatically changed the priority level of threads as they ran, reducing the priority of threads in the background, and raising the priority of the thread the user is actually working with.\par
\par
Priority Level\tab\tab\tab\tab Description\par
00\tab\tab\tab\tab\tab timed execution: 1 instruction per second\par
01\tab\tab\tab\tab\tab timed execution: 32 instructions per second\par
02\tab\tab\tab\tab\tab timed execution: 64 instructions per second\par
03\tab\tab\tab\tab\tab timed execution: 1 instruction per minute\par
04\tab\tab\tab\tab\tab timed execution: 32 instructions per minute\par
05\tab\tab\tab\tab\tab timed execution: 64 instructions per minute\par
06\tab\tab\tab\tab\tab 1 instruction per cycle\par
07\tab\tab\tab\tab\tab 32 instructions per cycle\par
08\tab\tab\tab\tab\tab 64 instructions per cycle\par
}
 