delorie.com/djgpp/doc/libc/libc_451.html | search |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
#include <go32.h> extern __Go32_Info_Block _go32_info_block; |
The go32 information block is a mechanism for `go32' to pass information to the application. Some of this information is generally useful, such as the pid or the transfer buffer, while some is used internally to `libc.a' only.
The structure has this format:
typedef struct { unsigned long size_of_this_structure_in_bytes; unsigned long linear_address_of_primary_screen; unsigned long linear_address_of_secondary_screen; unsigned long linear_address_of_transfer_buffer; unsigned long size_of_transfer_buffer; unsigned long pid; unsigned char master_interrupt_controller_base; unsigned char slave_interrupt_controller_base; unsigned short selector_for_linear_memory; unsigned long linear_address_of_stub_info_structure; unsigned long linear_address_of_original_psp; unsigned short run_mode; unsigned short run_mode_info; } Go32_Info_Block; |
The linear address fields provide values that are suitable for
dosmemget
, dosmemput
, and movedata
. The
selector_for_linear_memory is suitable for <sys/farptr.h>
selector parameters.
Due to the length of these fields, and their popularity, the following macros are available:
_dos_ds
This expands to _go32_info_block.selector_for_linear_memory
__tb
This expands to _go32_info_block.linear_address_of_transfer_buffer
__tb_size
This expands to _go32_info_block.size_of_transfer_buffer
The run_mode
field indicates the mode that the program is running
in. The following modes are defined:
_GO32_RUN_MODE_UNDEF
This indicates that the extender did not (or could not) determine or provide the mode information. The most probable reason is that it's an older extender that does not support this field. The program should not assume anything about the run mode if it is this value.
_GO32_RUN_MODE_RAW
This indicates that no CPU manager is being used, and no XMS manager is present. The CPU is being managed directly from the extender, and memory was allocated from the extended memory pool.
_GO32_RUN_MODE_XMS
This indicates that the extender is managing the CPU, but an XMS driver is managing the memory pool.
_GO32_RUN_MODE_VCPI
This indicates that a VCPI server (like emm386
or qemm
) is
managing both the CPU and the memory.
_GO32_RUN_MODE_DPMI
This indicates that a DPMI server (like qdpmi
or Windows) is
managing both the CPU and memory. Programs may rely on this value
to determine if it is safe to use DPMI 0.9 functions.
If this value is set, the run_mode_info
field has the DPMI
specification version, in hex, shifted eight bits. For example, DPMI
0.9 has 0x005A in the run_mode_info
field.
Note that the program should not assume that the value will be one of the listed values. If the program is running with an extender that provides some other mode (say, a newly released extender) then the program should be able to handle that case gracefully.
ANSI/ISO C | No |
POSIX | No |
dosmemget(_go32_info_block.linear_address_of_primary_screen, 80*25*2, buf); |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
webmaster | delorie software privacy |
Copyright © 2004 | Updated Apr 2004 |