aboutsummaryrefslogtreecommitdiff
path: root/src/romlayout.S
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-05-17 10:31:34 -0400
committerKevin O'Connor <kevin@koconnor.net>2009-05-17 10:31:34 -0400
commit49553a4bdc31c75331fc1ba602ab440937ddab97 (patch)
treed9aa85633f42129bd55b35ccee20da7009b950a5 /src/romlayout.S
parent99e08b7fc3a6c5279a0d2d23c7d485698190ac50 (diff)
downloadseabios-hppa-49553a4bdc31c75331fc1ba602ab440937ddab97.zip
seabios-hppa-49553a4bdc31c75331fc1ba602ab440937ddab97.tar.gz
seabios-hppa-49553a4bdc31c75331fc1ba602ab440937ddab97.tar.bz2
Verify ebda segment looks sane before using during resume.
Diffstat (limited to 'src/romlayout.S')
-rw-r--r--src/romlayout.S9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/romlayout.S b/src/romlayout.S
index eca4240..9fe5c71 100644
--- a/src/romlayout.S
+++ b/src/romlayout.S
@@ -251,8 +251,13 @@ entry_post:
movw $SEG_BDA, %ax
movw %ax, %ds
movw BDA_ebda_seg, %ax
- // XXX - should verify ebda_seg looks sane.
- movw %ax, %ds
+
+ cmpw $EBDA_SEGMENT_START, %ax
+ jle 2f
+ // EBDA segment doesn't look valid - use startup value.
+ movw $EBDA_SEGMENT_START, %ax
+
+2: movw %ax, %ds
movw %ax, %ss
movl $EBDA_OFFSET_TOP_STACK, %esp