From a5fb7d49544742df422eac598b6cbc6c137e684f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 22 Jun 2004 23:40:50 +0000 Subject: [PATCH] call_bios() can now also be called without having paging enabled (it now recognizes this and doesn't enable paging after entering the protected mode again). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8135 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/boot/platform/bios_ia32/bios.S | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/kernel/boot/platform/bios_ia32/bios.S b/src/kernel/boot/platform/bios_ia32/bios.S index f72424b56e..1bd0d324fc 100644 --- a/src/kernel/boot/platform/bios_ia32/bios.S +++ b/src/kernel/boot/platform/bios_ia32/bios.S @@ -1,6 +1,6 @@ /* ** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. -** Distributed under the terms of the OpenBeOS License. +** Distributed under the terms of the Haiku License. */ @@ -16,6 +16,7 @@ #define REAL_MODE_STACK 0x9000 // the location of the stack in real mode + #define SAVED_ESP 0x10000 #define SAVED_CR3 0x10004 #define SAVED_EAX 0x10008 @@ -56,12 +57,16 @@ _protected_code_segment: // turn on paging again movl SAVED_CR3, %eax // restore the saved page directory + orl %eax, %eax // is there a paging directory at all? + jz _no_paging; + movl %eax, %cr3 movl %cr0, %eax // set the PG bit (31) to enable paging orl $0x80000000, %eax movl %eax, %cr0 +_no_paging: // save the return address so that we can pick it up again later movl (%esp), %eax movl %eax, REAL_MODE_STACK