Question about "intcall" function
From: Alexandre
Date: Fri Sep 18 2026 - 14:51:09 EST
How can a 32 bit C code call 16 bit code functions without any mode switch (CR0)
arch/x86/boot/bioscall.S:
.code16
.section ".inittext","ax"
.globl intcall
.type intcall, @function
intcall:
/* Self-modify the INT instruction. Ugly, but works. */
cmpb %al, 3f
...
arch/x86/boot/video-bios.c:
static int set_bios_mode(u8 mode)
{
struct biosregs ireg, oreg;
u8 new_mode;
initregs(&ireg);
ireg.al = mode; /* AH=0x00 Set Video Mode */
intcall(0x10, &ireg, NULL);
...
Kind regards,
Alexandre Ramos