NEWS: document changes in 4.07
[profile/ivi/syslinux.git] / mbr / mbr.S
index 2c3e65a..b71cfb7 100644 (file)
--- a/mbr/mbr.S
+++ b/mbr/mbr.S
@@ -1,6 +1,7 @@
 /* -----------------------------------------------------------------------
  *
  *   Copyright 2007-2009 H. Peter Anvin - All Rights Reserved
+ *   Copyright 2009 Intel Corporation; author: H. Peter Anvin
  *
  *   Permission is hereby granted, free of charge, to any person
  *   obtaining a copy of this software and associated documentation
@@ -25,6 +26,8 @@
  *
  * ----------------------------------------------------------------------- */
 
+#include "adjust.h"
+
        .code16
        .text
 
@@ -36,7 +39,7 @@ secpercyl     = (stack-12)
 
 BIOS_kbdflags  = 0x417
 BIOS_page      = 0x462
-       
+
        /* gas/ld has issues with doing this as absolute addresses... */
        .section ".bootsec", "a", @nobits
        .globl  bootsec
@@ -46,8 +49,8 @@ bootsec:
        .text
        .globl  _start
 _start:
+       .byte   0x33, 0xc0      /* xorw %ax, %ax */
        cli
-       xorw    %ax, %ax
        movw    %ax, %ds
        movw    %ax, %ss
        movw    $stack, %sp
@@ -65,12 +68,8 @@ _start:
 
        ljmpw   $0, $next
 next:
-       
-       /* Escape for the user: if Ctrl is pressed, assume drive hd0 */
-       testb   $0x04, BIOS_kbdflags    /* Ctrl pressed */
-       jz      1f
-       movb    $0x80, %dl
-1:
+
+       ADJUST_DRIVE
        pushw   %dx             /* dl -> drive number */
 
        /* Check to see if we have EBIOS */