Index: Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c
===================================================================
--- Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c	(revision 15676)
+++ Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c	(working copy)
@@ -301,8 +301,8 @@
       //
       Orig                  = MainEditor.ColorAttributes;
       New.Data              = 0;
-      New.Colors.Foreground = Orig.Colors.Background;
-      New.Colors.Background = Orig.Colors.Foreground;
+      New.Colors.Foreground = Orig.Colors.Background & 0xF;
+      New.Colors.Background = Orig.Colors.Foreground & 0x7;
 
       //
       // clear the old mouse position
@@ -343,7 +343,7 @@
       //
       // set the new mouse position
       //
-      gST->ConOut->SetAttribute (gST->ConOut, New.Data);
+      gST->ConOut->SetAttribute (gST->ConOut, New.Data & 0x7F);
 
       //
       // clear the old mouse position
Index: Library/UefiShellDebug1CommandsLib/EditInputBar.c
===================================================================
--- Library/UefiShellDebug1CommandsLib/EditInputBar.c	(revision 15676)
+++ Library/UefiShellDebug1CommandsLib/EditInputBar.c	(working copy)
@@ -1,7 +1,7 @@
 /** @file
   Implements inputbar interface functions.
 
-  Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
+  Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved. <BR>
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
   which accompanies this distribution.  The full text of the license may be found at
@@ -103,7 +103,7 @@
 
 typedef struct {
   UINT32  Foreground : 4;
-  UINT32  Background : 4;
+  UINT32  Background : 3;
 } INPUT_BAR_COLOR_ATTRIBUTES;
 
 typedef union {
@@ -150,10 +150,10 @@
   CursorRow             = gST->ConOut->Mode->CursorRow;
   Orig.Data             = gST->ConOut->Mode->Attribute;
   New.Data              = 0;
-  New.Colors.Foreground = Orig.Colors.Background;
-  New.Colors.Background = Orig.Colors.Foreground;
+  New.Colors.Foreground = Orig.Colors.Background & 0xF;
+  New.Colors.Background = Orig.Colors.Foreground & 0x7;
 
-  gST->ConOut->SetAttribute (gST->ConOut, New.Data);
+  gST->ConOut->SetAttribute (gST->ConOut, New.Data & 0x7F);
 
   //
   // clear input bar
Index: Library/UefiShellDebug1CommandsLib/EditStatusBar.c
===================================================================
--- Library/UefiShellDebug1CommandsLib/EditStatusBar.c	(revision 15676)
+++ Library/UefiShellDebug1CommandsLib/EditStatusBar.c	(working copy)
@@ -1,7 +1,7 @@
 /** @file
   Implements statusbar interface functions.
 
-  Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
+  Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved. <BR>
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
   which accompanies this distribution.  The full text of the license may be found at
@@ -62,7 +62,7 @@
 
 typedef struct {
   UINT32  Foreground : 4;
-  UINT32  Background : 4;
+  UINT32  Background : 3;
 } STATUS_BAR_COLOR_ATTRIBUTES;
 
 typedef union {
@@ -112,11 +112,11 @@
   //
   Orig.Data             = gST->ConOut->Mode->Attribute;
   New.Data              = 0;
-  New.Colors.Foreground = Orig.Colors.Background;
-  New.Colors.Background = Orig.Colors.Foreground;
+  New.Colors.Foreground = Orig.Colors.Background & 0xF;
+  New.Colors.Background = Orig.Colors.Foreground & 0x7;
 
   gST->ConOut->EnableCursor (gST->ConOut, FALSE);
-  gST->ConOut->SetAttribute (gST->ConOut, New.Data);
+  gST->ConOut->SetAttribute (gST->ConOut, New.Data & 0x7F);
 
   //
   // clear status bar
Index: Library/UefiShellDebug1CommandsLib/EditTitleBar.c
===================================================================
--- Library/UefiShellDebug1CommandsLib/EditTitleBar.c	(revision 15676)
+++ Library/UefiShellDebug1CommandsLib/EditTitleBar.c	(working copy)
@@ -2,7 +2,7 @@
   Implements titlebar interface functions.
 
   Copyright (c) 2013, Hewlett-Packard Development Company, L.P.
-  Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
+  Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved. <BR>
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
   which accompanies this distribution.  The full text of the license may be found at
@@ -109,10 +109,10 @@
   //
   Orig.Data             = gST->ConOut->Mode->Attribute;
   New.Data              = 0;
-  New.Colors.Foreground = Orig.Colors.Background;
-  New.Colors.Background = Orig.Colors.Foreground;
+  New.Colors.Foreground = Orig.Colors.Background & 0xF;
+  New.Colors.Background = Orig.Colors.Foreground & 0x7;
 
-  gST->ConOut->SetAttribute (gST->ConOut, New.Data);
+  gST->ConOut->SetAttribute (gST->ConOut, New.Data & 0x7F);
 
   //
   // clear the title line
Index: Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c
===================================================================
--- Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c	(revision 15676)
+++ Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c	(working copy)
@@ -2,7 +2,7 @@
   Defines HBufferImage - the view of the file that is visible at any point,
   as well as the event handlers for editing the file
   
-  Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
+  Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved. <BR>
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
   which accompanies this distribution.  The full text of the license may be found at
@@ -318,9 +318,9 @@
     }
 
     if (BeNewColor) {
-      gST->ConOut->SetAttribute (gST->ConOut, New.Data);
+      gST->ConOut->SetAttribute (gST->ConOut, New.Data & 0x7F);
     } else {
-      gST->ConOut->SetAttribute (gST->ConOut, Orig.Data);
+      gST->ConOut->SetAttribute (gST->ConOut, Orig.Data & 0x7F);
     }
 
     Pos = 10 + (Index * 3);
@@ -337,7 +337,7 @@
 
   }
 
-  gST->ConOut->SetAttribute (gST->ConOut, Orig.Data);
+  gST->ConOut->SetAttribute (gST->ConOut, Orig.Data & 0x7F);
   while (Index < 0x08) {
     Pos = 10 + (Index * 3);
     ShellPrintEx ((INT32)Pos - 1, (INT32)Row - 1, L"    ");
@@ -355,9 +355,9 @@
     }
 
     if (BeNewColor) {
-      gST->ConOut->SetAttribute (gST->ConOut, New.Data);
+      gST->ConOut->SetAttribute (gST->ConOut, New.Data & 0x7F);
     } else {
-      gST->ConOut->SetAttribute (gST->ConOut, Orig.Data);
+      gST->ConOut->SetAttribute (gST->ConOut, Orig.Data & 0x7F);
     }
 
     Pos = 10 + (Index * 3) + 1;
@@ -370,7 +370,7 @@
     Index++;
   }
 
-  gST->ConOut->SetAttribute (gST->ConOut, Orig.Data);
+  gST->ConOut->SetAttribute (gST->ConOut, Orig.Data & 0x7F);
   while (Index < 0x10) {
     Pos = 10 + (Index * 3) + 1;
     ShellPrintEx ((INT32)Pos - 1, (INT32)Row - 1, L"   ");
@@ -379,7 +379,7 @@
   //
   // restore the original color
   //
-  gST->ConOut->SetAttribute (gST->ConOut, Orig.Data);
+  gST->ConOut->SetAttribute (gST->ConOut, Orig.Data & 0x7F);
 
   //
   // PRINT the buffer content
@@ -581,8 +581,8 @@
       //
       Orig                  = HMainEditor.ColorAttributes;
       New.Data              = 0;
-      New.Colors.Foreground = Orig.Colors.Background;
-      New.Colors.Background = Orig.Colors.Foreground;
+      New.Colors.Foreground = Orig.Colors.Background & 0xF;
+      New.Colors.Background = Orig.Colors.Foreground & 0x7;
 
       //
       // if in selected area,
@@ -594,7 +594,7 @@
             )) {
         gST->ConOut->SetAttribute (gST->ConOut, Orig.Data);
       } else {
-        gST->ConOut->SetAttribute (gST->ConOut, New.Data);
+        gST->ConOut->SetAttribute (gST->ConOut, New.Data & 0x7F);
       }
       //
       // clear the old mouse position
@@ -646,7 +646,7 @@
             HBufferImage.MousePosition.Row,
             HBufferImage.MousePosition.Column
             )) {
-        gST->ConOut->SetAttribute (gST->ConOut, New.Data);
+        gST->ConOut->SetAttribute (gST->ConOut, New.Data & 0x7F);
       } else {
         gST->ConOut->SetAttribute (gST->ConOut, Orig.Data);
       }
Index: Library/UefiShellLevel3CommandsLib/Cls.c
===================================================================
--- Library/UefiShellLevel3CommandsLib/Cls.c	(revision 15676)
+++ Library/UefiShellLevel3CommandsLib/Cls.c	(working copy)
@@ -1,7 +1,7 @@
 /** @file
   Main file for attrib shell level 2 function.
 
-  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>
+  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved. <BR>
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
   which accompanies this distribution.  The full text of the license may be found at
@@ -111,7 +111,7 @@
               break;
           }
           ForeColor = (~ShellStrToUintn(Param1)) & 0xF;
-          Status = gST->ConOut->SetAttribute (gST->ConOut, ForeColor | Background);
+          Status = gST->ConOut->SetAttribute (gST->ConOut, (ForeColor | Background) & 0x7F );
           ASSERT_EFI_ERROR(Status);
           Status = gST->ConOut->ClearScreen (gST->ConOut);
           ASSERT_EFI_ERROR(Status);
