summaryrefslogtreecommitdiff
path: root/Core/EM/Sredir/SredirBootFail.asm
diff options
context:
space:
mode:
authorraywu <raywu0301@gmail.com>2018-06-15 00:00:50 +0800
committerraywu <raywu0301@gmail.com>2018-06-15 00:00:50 +0800
commitb7c51c9cf4864df6aabb99a1ae843becd577237c (patch)
treeeebe9b0d0ca03062955223097e57da84dd618b9a /Core/EM/Sredir/SredirBootFail.asm
downloadzprj-b7c51c9cf4864df6aabb99a1ae843becd577237c.tar.xz
init. 1AQQW051HEADmaster
Diffstat (limited to 'Core/EM/Sredir/SredirBootFail.asm')
-rw-r--r--Core/EM/Sredir/SredirBootFail.asm179
1 files changed, 179 insertions, 0 deletions
diff --git a/Core/EM/Sredir/SredirBootFail.asm b/Core/EM/Sredir/SredirBootFail.asm
new file mode 100644
index 0000000..b8433b9
--- /dev/null
+++ b/Core/EM/Sredir/SredirBootFail.asm
@@ -0,0 +1,179 @@
+;**********************************************************************
+;**********************************************************************
+;** **
+;** (C)Copyright 1985-2014, American Megatrends, Inc. **
+;** **
+;** All Rights Reserved. **
+;** **
+;** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+;** **
+;** Phone: (770)-246-8600 **
+;** **
+;**********************************************************************
+;**********************************************************************
+
+;**********************************************************************
+; $Header: /Alaska/SOURCE/Modules/Legacy Serial Redirection/SredirBootFail.asm 3 6/16/14 7:40a Divyac $
+;
+; $Revision: 3 $
+;
+; $Date: 6/16/14 7:40a $
+;**********************************************************************
+; Revision History
+; ----------------
+; $Log: /Alaska/SOURCE/Modules/Legacy Serial Redirection/SredirBootFail.asm $
+;
+; 3 6/16/14 7:40a Divyac
+; [TAG] EIP172120
+; [Category] Bug Fix
+; [Severity] Important
+; [Symptom] Redirection After BIOS POST feature is not working.
+; [RootCause] The flag Indicating whether redirection can happen or not
+; is not updated.
+; 1)The way of Defining signatures and Comparing Signatures are
+; different.
+; 2)The variables defined in CSM16 files( SreDirBin_Base_Segadd,
+; SreDirBin_Base_Offadd, Flag ) are accessed wrongly.
+;
+; [Solution] a) The pointer used to check for signatures must be
+; UINT32* or we should define signatures byte by byte (db
+; '$','S','B','F', db '$','S','B','C'). so changed the way of defining
+; Signatures in CSM16 files from dd '$SBF' to db '$','S','B','F'.
+; b) Variables should be accessed using OFFSET Keyword.
+; [Files] SerialBootCall.asm, SerialBootFail.asm
+;
+; 2 5/29/13 8:54a Srikantakumarp
+; [TAG] EIP122394
+; [Category] Bug Fix
+; [Severity] Normal
+; [Symptom] 0xE0000~0xEFFFF was overwrite by Legacy Serial Redirection
+; module.
+; [RootCause] LegacySerialRedirection driver assumed that
+; SerialBootcall.asm will be the first entry in CsmOem16Functions which
+; was wrong.
+; [Solution] Added a Signature check code for SerialBootCall.asm and
+; SredirBootFail.asm before it writes to the memory location
+; 0xE0000~0xEFFFF.
+; [Files] LegacySredir.c, SerialBootCall.asm, SredirBootFail.asm
+;
+; 1 2/27/12 5:58a Jittenkumarp
+; [TAG] EIP81401
+; [Category] New Feature
+; [Description] Select Redirection After BIOS POST as BootLoader in
+; serial redirection, the behaviour is made same as Core8.
+; [Files] LegacySredir.c, LegacySredir.mak, LegacySredir.sdl,
+; LegacySredir_Setup.c, LegacySredir.h ,SerialBootCall.asm,
+; SredirBootFail.asm,GRAPHREDIR.ASM, INT10REDIR.ASM, OR_MOD.EQU,
+; SREDIR.ASM
+;
+;**********************************************************************
+;<AMI_FHDR_START>
+;
+; Name: SredirBootFail.asm
+;
+; Description: Call Back function registered for CSM16_OEM_ON_BOOT_FAIL
+;
+;<AMI_FHDR_END>
+;**********************************************************************
+
+
+;----------------------------------------------------------------------------
+; INCLUDE FILES
+;----------------------------------------------------------------------------
+
+ include token.equ
+
+;----------------------------------------------------------------------------
+; EXTERNS USED
+;----------------------------------------------------------------------------
+
+.586p
+OEM16_CSEG SEGMENT PARA PUBLIC 'CODE' USE16
+ ASSUME cs:OEM16_CSEG, ds:OEM16_CSEG
+;-------------------------------------------------------------------------
+ PUBLIC EnableLegcaySredirModuleStart
+EnableLegcaySredirModuleStart LABEL BYTE
+ jmp SHORT EnableLegcaySredirCsm16Api
+ db '$','S','B','F'
+SreDirBin_Base_Segadd dw 0000h ;SreDirBin Segement Address
+SreDirBin_Base_Offadd dw 0000h ;SreDirbin offset Address
+Flag dw 0000h
+
+
+;----------------------------------------------------------------------------
+; IMPORTANT: Do not put any OEM/CHIPSET code above this, the above code and
+; and data are at fixed locations.
+;----------------------------------------------------------------------------
+
+;-------------------------------------------------------------------------
+; LEGACYSREDIR_CSM16_API_Start
+;----------------------------------------------------------------------------
+; This routine is implementation of the CSM16 API #6.
+; Input: BX - SreDirBin Segment add
+; BX - SreDirBin Offset add
+; AX - Flag offset value
+;
+; Output: None
+;
+; Register Usage: Do not destroy any register
+;
+;----------------------------------------------------------------------------
+
+EnableLegcaySredirCsm16Api PROC FAR PUBLIC
+; Adjust current IP so that the data offsets are valid
+
+ call $+3 ; Push curent IP
+ pop bx ; Get current IP in BX
+ shr bx, 4
+ mov ax, cs ; Always x000h
+ add ax, bx ; New CS
+ push ax
+ push newOffset-EnableLegcaySredirModuleStart
+ retf ; Execute from new CS:IP
+
+newOffset:
+
+ push bx
+ push si
+ push ax
+ push es
+ push 0
+ pop es
+ mov si, offset SreDirBin_Base_Segadd
+ mov bx, word ptr cs:[si]
+ mov es, bx
+ mov si, offset SreDirBin_Base_Offadd
+ mov bx, word ptr cs:[si]
+ mov si, offset Flag
+ mov ax, word ptr cs:[si]
+ mov si, ax
+ add si, bx
+ mov al, 00h
+ mov byte ptr es:[si], al
+
+ pop es
+ pop ax
+ pop si
+ pop bx
+
+ retf
+
+EnableLegcaySredirCsm16Api ENDP
+
+OEM16_CSEG ENDS
+
+END
+
+;**********************************************************************
+;**********************************************************************
+;** **
+;** (C)Copyright 1985-2014, American Megatrends, Inc. **
+;** **
+;** All Rights Reserved. **
+;** **
+;** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+;** **
+;** Phone: (770)-246-8600 **
+;** **
+;**********************************************************************
+;********************************************************************** \ No newline at end of file