RTEMS  5.0.0
Data Structures | Macros | Functions
realmode_int.c File Reference

Real mode interrupt call implementation. More...

#include <bsp/realmode_int.h>
#include <string.h>
#include <rtems/score/cpu.h>

Data Structures

struct  RTEMS_PACKED
 Used for passing and retrieving registers content to/from real mode interrupt call. More...
 
struct  RTEMS_PACKED
 Used for passing and retrieving registers content to/from real mode interrupt call. More...
 

Macros

#define IR_EAX_OFF   "0x00"
 
#define IR_EBX_OFF   "0x04"
 
#define IR_ECX_OFF   "0x08"
 
#define IR_EDX_OFF   "0x0C"
 
#define IR_ESI_OFF   "0x10"
 
#define IR_EDI_OFF   "0x14"
 
#define IR_DS_OFF   "0x18"
 
#define IR_ES_OFF   "0x1A"
 
#define IR_FS_OFF   "0x1C"
 
#define IR_GS_OFF   "0x1E"
 
#define BKP_ESP_OFF   "0x20"
 
#define BKP_SS_OFF   "0x24"
 
#define BKP_DS_OFF   "0x26"
 
#define RM_ENTRY   "0x28"
 
#define PM_ENTRY   "0x2C"
 
#define BKP_IDTR_LIM   "0x00"
 
#define BKP_IDTR_BASE   "0x02"
 
#define BKP_ES_OFF   "0x06"
 
#define BKP_FS_OFF   "0x08"
 
#define BKP_GS_OFF   "0x0A"
 
#define RML_ENTRY   "0x0C"
 
#define RML_D_SEL   "0x12"
 
#define RM_SS   "0x14"
 
#define RM_SP   "0x16"
 
#define RM_DS   "0x18"
 
#define REAL_MODE_SPOT   0x12000
 
#define DEFAULT_BUFFER_SIZE   512
 
#define STACK_SIZE   8192
 
#define INT_STACK_TOP   REAL_MODE_SPOT
 
#define __DP_TYPE   uint8_t
 
#define __DP_YES   ((__DP_TYPE)1)
 
#define __DP_NO   ((__DP_TYPE)-1)
 
#define __DP_FAIL   ((__DP_TYPE)0)
 
#define rml_limit   0xFFFF
 

Functions

void * i386_get_default_rm_buffer (uint16_t *size)
 Returns buffer and its size usable with real mode interrupt call. More...
 
int i386_real_interrupt_call (uint8_t interrupt_number, i386_realmode_interrupt_registers *ir)
 Call to real mode interrupt with specified int NO and processor registers. More...
 

Detailed Description

Real mode interrupt call implementation.

Function Documentation

◆ i386_get_default_rm_buffer()

void* i386_get_default_rm_buffer ( uint16_t *  size)

Returns buffer and its size usable with real mode interrupt call.

Provides position to real mode buffer. It is buffer accessible from real mode context - it is located below address ~0x100000 in order for it to be accessible This buffer is meant to be pointed to by segReg:GenPurpReg and through this get bigger portion of an information to/from interrupt service routine than just by using register.

Parameters
[out]sizepointer to variable, where the size of buffer will be filled
Return values
pointerto buffer

◆ i386_real_interrupt_call()

int i386_real_interrupt_call ( uint8_t  interrupt_number,
i386_realmode_interrupt_registers *  ir 
)

Call to real mode interrupt with specified int NO and processor registers.

This function allows calling interrupts in real mode and to set processor registers as desired before interrupt call is made and to retrieve the registers content after call was made.

Parameters
[in]interrupt_numberinterrupt number to be called
[in]irpointer to structure containing registers to be passed to interrupt and to retrieve register content after call was made.
Return values
0call failed (GDT too small or pagin is on)
1call successful