Tcl for Embedded Applications |
These are some ugly S.O.B.'s from the early days of the PC that are usually always present on any DOS or embedded DOS system that has PC-like hardware, even if it's a ruggedized handheld, or whatever.
bios_memsize - returns the memory size according to the BIOS.
This value does not change as memory is being allocated and freed. (Use memfree and stackfree for that.)
bios_memsize usually returns in the vicinity of 550,000 bytes on a PC compatible with 640K directly addressable, depending on the drivers loaded, etc. On Windows, it returns a much lower number but Windows can dynamically grow the memory a DOS window is using. On Windows you can also mess with the MS-DOS prompt properties, leave it on auto or set it to an explicit size, which should affect what
bios_memsize reports.
bios_equiplist - return the equipment list according to the BIOS
This is a very primitive command, probably dating back to the original PC. You can't find out much, and it's all packed into the word that's returned. If you really need this data, this code should be expanded to unpack it for you. We have not included documentation on what the bits mean... sorry.
com - interface to BIOS serial communications
Port 0 is COM1, port 1 is COM2, etc.
com init
port [data]
#define _COM_CHR7 0x02 /* 7 data bits */ #define _COM_CHR8 0x03 /* 8 data bits */ #define _COM_STOP1 0x00 /* 1 stop bit */ #define _COM_STOP2 0x04 /* 2 stop bits */ #define _COM_NOPARITY 0x00 /* no parity */ #define _COM_EVENPARITY 0x18 /* even parity */ #define _COM_ODDPARITY 0x08 /* odd parity */ #define _COM_110 0x00 /* 110 baud */ #define _COM_150 0x20 /* 150 baud */ #define _COM_300 0x40 /* 300 baud */ #define _COM_600 0x60 /* 600 baud */ #define _COM_1200 0x80 /* 1200 baud */ #define _COM_2400 0xa0 /* 2400 baud */ #define _COM_4800 0xc0 /* 4800 baud */ #define _COM_9600 0xe0 /* 9600 baud */
com send
port data - Emits data to the specified port. com receive
port - Returns zero or more bytes read so far from the specified port. com status
port - Returns the status of the port. See also DOS commands and DOS video commands.