Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Burger::MSDos Namespace Reference

Functions specific to MS/DOS. More...

Classes

struct  Regs16_t
 Structure to contain all the registers for calling 80x86 assembly. More...
 

Functions

BURGER_INLINE uint8_t * zero_base (void) BURGER_NOEXCEPT
 Obtain the base pointer to the real memory.
 
uint32_t BURGER_API set_video_mode_int10h (uint32_t uMode) BURGER_NOEXCEPT
 Call interrupt 10H with AL set to the passed value.
 
uint32_t BURGER_API init_serial_port_int14h (uint32_t uPortFlags, uint32_t uPortNumber) BURGER_NOEXCEPT
 Call interrupt 14H with AL and DX set to the passed values.
 
uint32_t BURGER_API printer_port_int17h (uint32_t uPrinterCommand, uint32_t uPrinterNumber=0) BURGER_NOEXCEPT
 Call interrupt 17H with AL/AH and DL/DH set to the passed values.
 
int32_t BURGER_API real_mode_interrupt (uint32_t uInterrupt, const Regs16_t *pInput, Regs16_t *pOutput) BURGER_NOEXCEPT
 Call a MSDOS software interrupt.
 
int BURGER_API x32_call_real_proc (uint32_t pAddress, const Regs16_t *pInput, Regs16_t *pOutput) BURGER_NOEXCEPT
 Call a real mode function (16 bit)
 
void *BURGER_API real_to_protected (uint32_t pReal) BURGER_NOEXCEPT
 Convert a real mode address to a flat address.
 
uint32_t BURGER_API alloc_real (uint32_t uSize) BURGER_NOEXCEPT
 Allocate a chunk of real mode memory.
 
void BURGER_API free_real (uint32_t pReal) BURGER_NOEXCEPT
 Release real mode memory back to DOS.
 
uint32_t BURGER_API get_temp_real_buffer (void) BURGER_NOEXCEPT
 Return pointer to shared real buffer.
 
void *BURGER_API get_temp_protected_buffer (void) BURGER_NOEXCEPT
 Get the pointer to the shared protected memory buffer.
 
void far *BURGER_API get_interrupt_protected (uint32_t uInterrupt) BURGER_NOEXCEPT
 Call the dos extender to get the current protected mode IRQ vector.
 
void BURGER_API set_interrupt_protected (uint32_t uInterrupt, void far *pCode) BURGER_NOEXCEPT
 Intercept the protected IRQ vector.
 
uint32_t BURGER_API get_interrupt_real (uint32_t uInterrupt) BURGER_NOEXCEPT
 Call the dos extender to get the current real mode IRQ vector.
 
void BURGER_API set_interrupt_real (uint32_t uInterrupt, uint32_t pCode) BURGER_NOEXCEPT
 Intercept the real mode IRQ vector.
 
void BURGER_API set_interrupt_both (uint32_t uInterrupt, void far *pCode) BURGER_NOEXCEPT
 Intercept both the real the protected IRQ vectors.
 
void *BURGER_API map_physical_address (void *pInput, uint32_t uLength) BURGER_NOEXCEPT
 Map memory from a device into protected mode.
 

Detailed Description

Functions specific to MS/DOS.


Functions and structures that exist in this namespace are only available on the MS/DOS version of Burgerlib. They should only be used on MS/DOS applications.

Note
This is only available on MS/DOS

Function Documentation

◆ alloc_real()

uint32_t BURGER_API Burger::MSDos::alloc_real ( uint32_t uSize)
extern

Allocate a chunk of real mode memory.


Memory is extremely limited in real mode, keep allocations to a minimum and in small sizes

Note
This is only available on MS/DOS
Parameters
uSizeNumber of bytes to allocate
Returns
Segment:Offset of real mode memory or 0 on failure
See also
free_real(uint32_t)

◆ free_real()

void BURGER_API Burger::MSDos::free_real ( uint32_t pReal)
extern

Release real mode memory back to DOS.


Note
This is only available on MS/DOS
Parameters
pRealSegment:Offset of allocated memory. Zero performs no action
See also
alloc_real(uint32_t)

◆ get_interrupt_protected()

void far *BURGER_API Burger::MSDos::get_interrupt_protected ( uint32_t uInterrupt)
extern

Call the dos extender to get the current protected mode IRQ vector.


Call the dos extender to retrieve the protected mode IRQ vector

Note
This is only available on MS/DOS
Parameters
uInterruptInterrupt to intercept
Returns
Pointer to the function that is called when the interrupt is tripped
See also
set_interrupt_both(), set_interrupt_protected(), set_interrupt_real() and get_interrupt_real()

◆ get_interrupt_real()

uint32_t BURGER_API Burger::MSDos::get_interrupt_real ( uint32_t uInterrupt)
extern

Call the dos extender to get the current real mode IRQ vector.


Call the dos extender to retrieve the real mode IRQ vector

Note
This is only available on MS/DOS
Parameters
uInterruptInterrupt to intercept
Returns
Real mode (SEGMENT:OFFSET) pointer to the function that is called when the interrupt is tripped
See also
set_interrupt_both(), set_interrupt_protected(), set_interrupt_real() and get_interrupt_protected()

◆ get_temp_protected_buffer()

void *BURGER_API Burger::MSDos::get_temp_protected_buffer ( void )
extern

Get the pointer to the shared protected memory buffer.


Allocate an 8K buffer in real memory for use in DOS calls. Return the pointer in protected memory.

If the memory allocation fails, the function will return nullptr

Note
This is only available on MS/DOS
Returns
Protected mode pointer to the 8K shared real mode buffer
See also
get_temp_real_buffer() and real_to_protected()

◆ get_temp_real_buffer()

uint32_t BURGER_API Burger::MSDos::get_temp_real_buffer ( void )
extern

Return pointer to shared real buffer.


Allocate an 8K buffer in real memory for use in DOS calls. Return the pointer in SEGMENT:OFFSET format

Note
This is only available on MS/DOS
Returns
0 if buffer allocation failed, or SEGMENT:OFFSET of the buffer
See also
get_temp_protected_buffer()

◆ init_serial_port_int14h()

uint32_t BURGER_API Burger::MSDos::init_serial_port_int14h ( uint32_t uPortFlags,
uint32_t uPortNumber )
extern

Call interrupt 14H with AL and DX set to the passed values.


Interrupt 14H is used to call the serial BIOS, AH is set to zero.

http://www.ctyme.com/intr/rb-0811.htm

Note
This is only available on MS/DOS
Parameters
uPortFlagsValue to set AL/AH
uPortNumberValue to set DL/DH
Returns
Value of the AX register on return
See also
set_video_mode_int10h(uint32_t), printer_port_int17h(uint32_t, uint32_t), real_mode_interrupt() and x32_call_real_proc()

◆ map_physical_address()

void *BURGER_API Burger::MSDos::map_physical_address ( void * pInput,
uint32_t uLength )
extern

Map memory from a device into protected mode.


Call the dos extender to remap extended memory to protected mode

Note
This is only available on MS/DOS
Parameters
pInputPointer to extended memory
uLengthLength in bytes of the extended memory chunk
Returns
Protected mode pointer to the extended memory
See also
real_to_protected()

◆ printer_port_int17h()

uint32_t BURGER_API Burger::MSDos::printer_port_int17h ( uint32_t uPrinterCommand,
uint32_t uPrinterNumber = 0 )
extern

Call interrupt 17H with AL/AH and DL/DH set to the passed values.


Interrupt 17H is used to call the printer BIOS

http://www.ctyme.com/intr/int-17.htm

Note
This is only available on MS/DOS
Parameters
uPrinterCommandValue to set AL/AH
uPrinterNumberValue to set DL/DH
Returns
Value of the AX register on return
See also
set_video_mode_int10h(uint32_t), init_serial_port_int14h(uint32_t, uint32_t), real_mode_interrupt() and x32_call_real_proc()

◆ real_mode_interrupt()

int32_t BURGER_API Burger::MSDos::real_mode_interrupt ( uint32_t uInterrupt,
const Regs16_t * pInput,
Regs16_t * pOutput )
extern

Call a MSDOS software interrupt.


Call a software interrupt with a set of register and return the state of the 80x86 after the call

The pInput and pOutput pointers can point to the same buffer

http://www.delorie.com/djgpp/doc/rbinter/ix/

Note
This is only available on MS/DOS
Parameters
uInterruptInterrupt to call
pInputPointer to registers to use when issuing the call
pOutputPointer to registers returned after issuing the call
Returns
Contents of the AX register on return from the real mode call
See also
set_video_mode_int10h(uint32_t), init_serial_port_int14h(uint32_t, uint32_t), printer_port_int17h(uint32_t, uint32_t), and x32_call_real_proc()

◆ real_to_protected()

void *BURGER_API Burger::MSDos::real_to_protected ( uint32_t pReal)
extern

Convert a real mode address to a flat address.


Convert an encoded real mode address (16:16) (Segment:Offset) into a protected mode pointer. The protected pointer allows the 32 bit flat code to access the memory.

Note
This is only available on MS/DOS
Parameters
pRealReal memory pointer (Segment/Offset)
Returns
Protected mode pointer that points to the same memory
See also
get_temp_protected_buffer() or get_temp_real_buffer()

◆ set_interrupt_both()

void BURGER_API Burger::MSDos::set_interrupt_both ( uint32_t uInterrupt,
void far * pCode )
extern

Intercept both the real the protected IRQ vectors.


Call the dos extender to intercept both the real and protected IRQ vector and route it through a protected mode IRQ

Note
This is only available on MS/DOS
Parameters
uInterruptInterrupt to intercept
pCodePointer to the function to call when the interrupt is tripped
See also
set_interrupt_protected(), set_interrupt_real(), get_interrupt_protected() and get_interrupt_real()

◆ set_interrupt_protected()

void BURGER_API Burger::MSDos::set_interrupt_protected ( uint32_t uInterrupt,
void far * pCode )
extern

Intercept the protected IRQ vector.


Call the dos extender to intercept the protected IRQ vector and route it through a protected mode IRQ

Note
This is only available on MS/DOS
Parameters
uInterruptInterrupt to intercept
pCodePointer to the function to call when the interrupt is tripped
See also
set_interrupt_both(), set_interrupt_real(), get_interrupt_protected() and get_interrupt_real()

◆ set_interrupt_real()

void BURGER_API Burger::MSDos::set_interrupt_real ( uint32_t uInterrupt,
uint32_t pCode )
extern

Intercept the real mode IRQ vector.


Call the dos extender to intercept the real mode IRQ vector and route it through a real mode IRQ

Note
This is only available on MS/DOS
Parameters
uInterruptInterrupt to intercept
pCodePointer to the function to call when the interrupt is tripped
See also
set_interrupt_both(), set_interrupt_protected(), get_interrupt_protected() and get_interrupt_real()

◆ set_video_mode_int10h()

uint32_t BURGER_API Burger::MSDos::set_video_mode_int10h ( uint32_t uMode)
extern

Call interrupt 10H with AL set to the passed value.


Interrupt 10H is used to set the video display mode to CGA/EGA/VGA. AH is set to zero. The value returned by the interrupt is returned.

http://www.ctyme.com/intr/rb-0069.htm

Note
This is only available on MS/DOS
See also
init_serial_port_int14h(uint32_t, uint32_t), printer_port_int17h(uint32_t, uint32_t), real_mode_interrupt() and x32_call_real_proc()

◆ x32_call_real_proc()

int BURGER_API Burger::MSDos::x32_call_real_proc ( uint32_t pAddress,
const Regs16_t * pInput,
Regs16_t * pOutput )
extern

Call a real mode function (16 bit)


This routine will allow a DOS application to call a real mode procedure routine via the X32 DOS extender.

The input and output pointers can be the same value.

http://www.delorie.com/djgpp/doc/rbinter/id/27/26.html

Note
This is only available on MS/DOS
and with the X32 dos extender and it is NOT reentrant
Parameters
pAddressPointer to real memory to call (Segment/Offset)
pInputPointer to register set to use as input
pOutputPointer tp register set to use as output
Returns
Value returned in the AX register after issuing the call to the real mode code
See also
MSDos::real_mode_interrupt()

◆ zero_base()

BURGER_INLINE uint8_t * Burger::MSDos::zero_base ( void )

Obtain the base pointer to the real memory.


Note
This is only available on MS/DOS
Returns
uint8_t * where the real memory is mapped to
See also
_x32_zero_base_ptr or _x32_zero_base_selector