Subject: Re: is it boot or is it me?
To: Marc Recht <marc@informatik.uni-bremen.de>
From: David Laight <david@l8s.co.uk>
List: port-i386
Date: 02/05/2003 13:39:22
>
> The patch below might fix it.
Closer inspection shows I missed one of those files when doing
the .code12/32 change - so the change was wrong....
Try this one:
David
Index: lib/biosmemps2.S
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/stand/lib/biosmemps2.S,v
retrieving revision 1.1
diff -u -r1.1 biosmemps2.S
--- lib/biosmemps2.S 2003/01/23 21:22:25 1.1
+++ lib/biosmemps2.S 2003/02/05 13:32:49
@@ -38,9 +38,6 @@
#include <machine/asm.h>
-#define addr32 .byte 0x67
-#define data32 .byte 0x66
-
.text
/* int getextmemp2(void buffer)
@@ -49,6 +46,7 @@
buffer: filled with memory-map table structure
*/
ENTRY(getextmemps2)
+ .code32
pushl %ebp
movl %esp,%ebp
pushl %ebx
@@ -60,6 +58,7 @@
movl 8(%ebp), %edx # parameter
call _C_LABEL(prot_to_real)
+ .code16
# do int15, function 0xc0 call to discover if C7h is supported
movb $0xc0, %ah
@@ -68,8 +67,7 @@
jc out # 0xc0 not supported if carry set
# check feature byte 2, bit 4 to see if return memory map is supported
- addr32
- movb %es:6(%ebx), %al
+ movb %es:6(%bx), %al
andb $0x10, %al
jnz getmem # 0xc7 supported
@@ -79,8 +77,12 @@
getmem:
# move the parameter to right register
- data32
movl %edx, %esi
+ andl $0xf, %esi
+ shrl $4, %edx
+ mov %ds, %ax
+ add %dx, %ax
+ mov %ax, %ds
# actually call int15, function 0xc7 now
movb $0xc7, %ah
@@ -88,8 +90,8 @@
setc %bl # save carry
out:
- data32
- call _C_LABEL(real_to_prot)
+ calll _C_LABEL(real_to_prot)
+ .code32
xorl %eax, %eax
movb %bl, %al # return value in %ax
Index: lib/biosmemx.S
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/stand/lib/biosmemx.S,v
retrieving revision 1.3
diff -u -r1.3 biosmemx.S
--- lib/biosmemx.S 2003/02/01 14:48:18 1.3
+++ lib/biosmemx.S 2003/02/05 13:32:49
@@ -108,6 +108,14 @@
call _C_LABEL(prot_to_real)
.code16
+ push %di
+ shrl $4, %edi
+ mov %ds, %ax
+ add %di, %ax
+ mov %ax, %ds
+ pop %di
+ and $0xf, %di
+
movw $0xe820, %ax
int $0x15
--
David Laight: david@l8s.co.uk