Author: tkreuzer
Date: Sat Jun 18 09:40:44 2011
New Revision: 52327
URL:
http://svn.reactos.org/svn/reactos?rev=52327&view=rev
Log:
[ASM]
- Use .586P for 16 bit code to allow privileged instructions, like lidt/lgdt. Found by
ThFabba
- Add a 0 byte at the end to make ML fill the file up to the required length
Modified:
trunk/reactos/boot/freeldr/freeldr/arch/realmode/i386.S
trunk/reactos/include/asm/asm.inc
Modified: trunk/reactos/boot/freeldr/freeldr/arch/realmode/i386.S
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/realmode/i386.S [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/realmode/i386.S [iso-8859-1] Sat Jun 18
09:40:44 2011
@@ -88,8 +88,7 @@
/* Load IDTR with real mode value */
#ifdef _USE_ML
- DB 0Fh, 01h, 1Eh
- DW rmode_idtptr
+ lidt fword ptr rmode_idtptr
#else
lidt rmode_idtptr
#endif
@@ -114,8 +113,7 @@
/* Load the GDT */
#ifdef _USE_ML
- DB 0Fh, 01h, 16h
- DW gdtptr
+ lgdt fword ptr gdtptr
#else
lgdt gdtptr
#endif
@@ -195,7 +193,7 @@
#include "pnp.inc"
#include "helpers.inc"
-.org (FREELDR_PE_BASE - FREELDR_BASE)
+.org (FREELDR_PE_BASE - FREELDR_BASE - 1)
+.byte 0
.endcode16
-
END
Modified: trunk/reactos/include/asm/asm.inc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/asm/asm.inc?rev=52…
==============================================================================
--- trunk/reactos/include/asm/asm.inc [iso-8859-1] (original)
+++ trunk/reactos/include/asm/asm.inc [iso-8859-1] Sat Jun 18 09:40:44 2011
@@ -73,7 +73,7 @@
.code16 MACRO
ASSUME nothing
.text SEGMENT use16
- .586
+ .586P
ENDM
.endcode16 MACRO