From 876df2125f4f24803d5471894e5308e7425ebfd2 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 12 Oct 2019 23:28:01 +0200 Subject: Paging and heap rewrite VESA drawing causes a Page fault because it tries to use a pointer to the framebuffer which was created before the paging has been initialized. If the resolution is set after the paging has been initialized the CPU throws a triple fault because the int32 call can not happen with paging turned on. To be fixed soon! --- src/kernel/interact.asm | 33 ++++----------------------------- 1 file changed, 4 insertions(+), 29 deletions(-) (limited to 'src/kernel/interact.asm') diff --git a/src/kernel/interact.asm b/src/kernel/interact.asm index 8a3e91e..eaad82e 100644 --- a/src/kernel/interact.asm +++ b/src/kernel/interact.asm @@ -1,33 +1,5 @@ -; -; Protected Mode BIOS Call Functionailty v2.0 - by Napalm -; ------------------------------------------------------- -; -; This is code shows how its POSSIBLE to execute BIOS interrupts -; by switch out to real-mode and then back into protected mode. -; -; If you wish to use all or part of this code you must agree -; to the license at the following URL. -; +; Protected Mode BIOS Call Functionality v2.0 - by Napalm ; License: http://creativecommons.org/licenses/by-sa/2.0/uk/ -; -; Notes: This file is in NASM syntax. -; Turn off paging before calling these functions. -; int32() resets all selectors. -; -; C Prototype: -; void _cdelc int32(unsigned char intnum, regs16_t *regs); -; -; Example of usage: -; regs.ax = 0x0013; -; int32(0x10, ®s); -; memset((char *)0xA0000, 1, (320*200)); -; memset((char *)0xA0000 + (100*320+80), 14, 80); -; regs.ax = 0x0000; -; int32(0x16, ®s); -; regs.ax = 0x0003; -; int32(0x10, ®s); -; -; [bits 32] global int32, _int32 @@ -60,6 +32,9 @@ endstruc section .text int32: use32 ; by Napalm + mov edx, cr0 + and edx, 0x7fffffff + mov cr0, edx _int32: cli ; disable interrupts pusha ; save register state to 32bit stack -- cgit v1.2.3