aboutsummaryrefslogtreecommitdiffstats
path: root/core/diskstart.inc
diff options
context:
space:
mode:
Diffstat (limited to 'core/diskstart.inc')
-rw-r--r--core/diskstart.inc5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/diskstart.inc b/core/diskstart.inc
index c0301d4b..3fc20e2b 100644
--- a/core/diskstart.inc
+++ b/core/diskstart.inc
@@ -180,8 +180,11 @@ harddisk:
mov dx,[di-76-10] ; Original DS
mov si,[di-76-12] ; Original SI
shr si,4
+ jz .no_partition ; SI == 0 -> assume no partition
add dx,si
- cmp dx,PartInfo >> 4
+ cmp dx,1024 ; DS:SI < 1K (inside the IVT)?
+ jb .no_partition
+ cmp dx,PartInfo >> 4 ; DS:SI in overwritten memory?
jae .no_partition
test byte [di-76],7Fh ; Sanity check: "active flag" should
jnz .no_partition ; be 00 or 80