From ad56eb28f0614db4b7656ade390f1c79b446cbc9 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 10 Jul 2021 15:51:54 +0200 Subject: A20, E820h, Real Mode Emulation --- src/loader/inc/rem.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/loader/inc/rem.h (limited to 'src/loader/inc/rem.h') diff --git a/src/loader/inc/rem.h b/src/loader/inc/rem.h new file mode 100644 index 0000000..61eb30a --- /dev/null +++ b/src/loader/inc/rem.h @@ -0,0 +1,29 @@ +// MIT License, Copyright (c) 2021 Marvin Borner +// Real mode emulation - Implementation by Napalm (see rem.asm) + +#ifndef REM_H +#define REM_H + +#include + +#define EFLAGS_CF (1 << 0) // Carry flag +#define EFLAGS_ZF (1 << 6) // Zero flag + +struct rem_regs { + u16 gs; + u16 fs; + u16 es; + u16 ds; + u32 eflags; + u32 ebp; + u32 edi; + u32 esi; + u32 edx; + u32 ecx; + u32 ebx; + u32 eax; +} PACKED; + +void rem_int(u8 int_num, struct rem_regs *out_regs, struct rem_regs *in_regs); + +#endif -- cgit v1.2.3