iPXE
Data Structures | Defines | Functions | Variables
comboot.h File Reference

SYSLINUX COMBOOT. More...

#include <stdint.h>
#include <rmsetjmp.h>
#include <ipxe/in.h>

Go to the source code of this file.

Data Structures

union  com32_reg32_t
struct  com32sys_t
struct  syslinux_pm_regs
struct  syslinux_rm_regs
struct  comboot_shuffle_descriptor

Defines

#define COMBOOT_PSP_SEG   0x07C0
 Segment used for COMBOOT PSP and image.
#define COM32_START_PHYS   0x101000
 Entry point address of COM32 images.
#define COM32_BOUNCE_SEG   0x07C0
 COM32 bounce buffer segment.
#define COMBOOT_FILE_BLOCKSZ   512
 Size of SYSLINUX file block in bytes.
#define COMBOOT_FEATURE_LOCAL_BOOT   (1 << 0)
 COMBOOT feature flags (INT 22h AX=15h)
#define COMBOOT_FEATURE_IDLE_LOOP   (1 << 1)
#define COMBOOT_MAX_SHUFFLE_DESCRIPTORS   682
 Maximum number of shuffle descriptors for shuffle and boot functions (INT 22h AX=0012h, 001Ah, 001Bh)
#define COMBOOT_EXIT   1
#define COMBOOT_EXIT_RUN_KERNEL   2
#define COMBOOT_EXIT_COMMAND   3
#define COMBOOT_VIDEO_GRAPHICS   0x01
#define COMBOOT_VIDEO_NONSTANDARD   0x02
#define COMBOOT_VIDEO_VESA   0x04
#define COMBOOT_VIDEO_NOTEXT   0x08

Functions

 FILE_LICENCE (GPL2_OR_LATER)
void hook_comboot_interrupts ()
 Hook BIOS interrupts related to COMBOOT API (INT 20h, 21h, 22h)
void unhook_comboot_interrupts ()
 Unhook BIOS interrupts related to COMBOOT API (INT 20h, 21h, 22h)
void com32_intcall_wrapper ()
void com32_farcall_wrapper ()
void com32_cfarcall_wrapper ()
int comboot_resolv (const char *name, struct in_addr *address)
void comboot_force_text_mode (void)
 Set default text mode.

Variables

typedef __attribute__
 Initialise completion queue.
rmjmp_buf comboot_return

Detailed Description

SYSLINUX COMBOOT.

Definition in file comboot.h.


Define Documentation

#define COMBOOT_PSP_SEG   0x07C0

Segment used for COMBOOT PSP and image.

Definition at line 17 of file comboot.h.

Referenced by comboot_exec_loop(), and comboot_prepare_segment().

#define COM32_START_PHYS   0x101000

Entry point address of COM32 images.

Definition at line 20 of file comboot.h.

Referenced by com32_exec_loop(), and com32_load_image().

#define COM32_BOUNCE_SEG   0x07C0

COM32 bounce buffer segment.

Definition at line 23 of file comboot.h.

Referenced by com32_exec_loop(), and com32_prepare_bounce_buffer().

#define COMBOOT_FILE_BLOCKSZ   512

Size of SYSLINUX file block in bytes.

Definition at line 26 of file comboot.h.

Referenced by int22().

#define COMBOOT_FEATURE_LOCAL_BOOT   (1 << 0)

COMBOOT feature flags (INT 22h AX=15h)

Definition at line 29 of file comboot.h.

#define COMBOOT_FEATURE_IDLE_LOOP   (1 << 1)

Definition at line 30 of file comboot.h.

Maximum number of shuffle descriptors for shuffle and boot functions (INT 22h AX=0012h, 001Ah, 001Bh)

Definition at line 36 of file comboot.h.

Referenced by int22(), and shuffle().

#define COMBOOT_EXIT   1

Definition at line 119 of file comboot.h.

Referenced by com32_exec_loop(), comboot_exec_loop(), int20(), and int21().

#define COMBOOT_EXIT_RUN_KERNEL   2

Definition at line 120 of file comboot.h.

Referenced by com32_exec_loop(), comboot_exec_loop(), and int22().

#define COMBOOT_EXIT_COMMAND   3

Definition at line 121 of file comboot.h.

Referenced by com32_exec_loop(), comboot_exec_loop(), and int22().

#define COMBOOT_VIDEO_GRAPHICS   0x01

Definition at line 125 of file comboot.h.

Referenced by comboot_force_text_mode().

#define COMBOOT_VIDEO_NONSTANDARD   0x02

Definition at line 126 of file comboot.h.

#define COMBOOT_VIDEO_VESA   0x04

Definition at line 127 of file comboot.h.

Referenced by comboot_force_text_mode().

#define COMBOOT_VIDEO_NOTEXT   0x08

Definition at line 128 of file comboot.h.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER  )

Hook BIOS interrupts related to COMBOOT API (INT 20h, 21h, 22h)

Definition at line 659 of file comboot_call.c.

References __asm__(), hook_bios_interrupt(), int20(), int20_vector, int20_wrapper(), int21(), int21_vector, int21_wrapper(), int22(), int22_vector, int22_wrapper(), TEXT16_CODE, and VIRT_CALL.

Referenced by com32_exec_loop(), and comboot_exec_loop().

                                 {

        __asm__ __volatile__ (
                TEXT16_CODE ( "\nint20_wrapper:\n\t"
                              VIRT_CALL ( int20 )
                              "clc\n\t"
                              "call patch_cf\n\t"
                              "iret\n\t" ) : );

        hook_bios_interrupt ( 0x20, ( intptr_t ) int20_wrapper, &int20_vector );

        __asm__ __volatile__ (
                TEXT16_CODE ( "\nint21_wrapper:\n\t"
                              VIRT_CALL ( int21 )
                              "clc\n\t"
                              "call patch_cf\n\t"
                              "iret\n\t" ) : );

        hook_bios_interrupt ( 0x21, ( intptr_t ) int21_wrapper, &int21_vector );

        __asm__  __volatile__ (
                TEXT16_CODE ( "\nint22_wrapper:\n\t"
                              VIRT_CALL ( int22 )
                              "clc\n\t"
                              "call patch_cf\n\t"
                              "iret\n\t" ) : );

        hook_bios_interrupt ( 0x22, ( intptr_t ) int22_wrapper, &int22_vector );
}

Unhook BIOS interrupts related to COMBOOT API (INT 20h, 21h, 22h)

Definition at line 692 of file comboot_call.c.

References int20_vector, int20_wrapper(), int21_vector, int21_wrapper(), int22_vector, int22_wrapper(), and unhook_bios_interrupt().

Referenced by com32_exec_loop(), and comboot_exec_loop().

Referenced by com32_exec_loop().

Referenced by com32_exec_loop().

Referenced by com32_exec_loop().

int comboot_resolv ( const char *  name,
struct in_addr address 
)
void comboot_force_text_mode ( void  )

Set default text mode.

Definition at line 140 of file comboot_call.c.

References __asm__(), comboot_graphics_mode, COMBOOT_VIDEO_GRAPHICS, COMBOOT_VIDEO_VESA, and REAL_CODE.

Referenced by com32_exec_loop(), comboot_exec_loop(), and int22().

                                      {
        if ( comboot_graphics_mode & COMBOOT_VIDEO_VESA ) {
                /* Set VGA mode 3 via VESA VBE mode set */
                __asm__ __volatile__ (
                        REAL_CODE (
                                "mov $0x4F02, %%ax\n\t"
                                "mov $0x03, %%bx\n\t"
                                "int $0x10\n\t"
                        )
                : : );
        } else if ( comboot_graphics_mode & COMBOOT_VIDEO_GRAPHICS ) {
                /* Set VGA mode 3 via standard VGA mode set */
                __asm__ __volatile__ (
                        REAL_CODE (
                                "mov $0x03, %%ax\n\t"
                                "int $0x10\n\t"
                        )
                : : );
        }

        comboot_graphics_mode = 0;
}

Variable Documentation

Definition at line 82 of file comboot_call.c.

Referenced by com32_exec_loop(), and comboot_exec_loop().