File:  [GnuMach] / Gnu-Mach / i386 / pc / i16 / i16_raw_test_a20.S
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed Sep 2 04:36:58 2020 UTC (5 years, 11 months ago) by root
Branches: MAIN, GNU
CVS tags: HEAD, GNUMach130, GNUMach120, GNUMach113, GNUMach112, GNUMach100
GNU Mach 1.0


#include <mach/machine/asm.h>

	.text
	.code16

/*
 * Test the A20 address line; return true if it is enabled.
 */
ENTRY(i16_raw_test_a20)
	xorw	%ax,%ax
	movw	%ax,%fs
	notw	%ax
	movw	%ax,%gs

	/* See if the values in already in the corresponding locations
	   are the same.  */
	movw	%fs:0,%ax
	cmpw	%gs:16,%ax
	jnz	1f

	/* Yes; try changing one and see if they're still the same.  */
	movw	%ax,%dx
	notw	%ax
	movw	%ax,%fs:0
	cmpw	%gs:16,%ax
	movw	%dx,%fs:0
	jnz	1f

	xorl	%eax,%eax
	ret
1:
	movl	$1,%eax
	ret


unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.