From b460825e1f5d6d708717348bb6365e35643616e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 2 Feb 2005 03:15:26 +0000 Subject: [PATCH] Fixed the bug that prevented the boot loader from running on many current systems: good old A20 gate was not properly enabled on all hardware. Even if it's not perfect now, either, it seems to work on many more systems (all I have access to, anyway). Please report if you have any issues with the 0x92 port A20 gate method. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11196 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/boot/platform/bios_ia32/shell.S | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/kernel/boot/platform/bios_ia32/shell.S b/src/kernel/boot/platform/bios_ia32/shell.S index eb1f942986..ae087a3d6d 100644 --- a/src/kernel/boot/platform/bios_ia32/shell.S +++ b/src/kernel/boot/platform/bios_ia32/shell.S @@ -1,7 +1,7 @@ /* -** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. -** Distributed under the terms of the Haiku License. -*/ + * Copyright 2004-2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Distributed under the terms of the MIT License. + */ /** This file contains the boot floppy and BFS boot block entry points for @@ -275,10 +275,23 @@ _protected_code_segment: /** Enables the a20 gate. It will first try to enable it through * the BIOS, and, if that fails, will use the old style AT mechanism * using the keyboard port. + * ToDo: it no longer does this! Now, it just uses the "fast A20" + * mechanism using port 0x92. This does work on all systems + * I have access to. */ enable_a20: - movw $0x2402, %ax // first, query the a20 status + inb $0x92, %al + testb $0x02, %al + jnz _a20_out + orb $0x02, %al + andb $0xfe, %al + outb %al, $0x92 +_a20_out: + ret + +// ToDo: the code below didn't seem to work properly on all machines +/* movw $0x2402, %ax // first, query the a20 status int $0x15 jc _a20_old_method // if that fails, use the old AT method test $0x1, %al @@ -303,6 +316,7 @@ _a20_loop2: loopne _a20_loop2 _a20_done: ret +*/ //--------------------------------------------------------------