Fix shift used for converting KiB to paragraphs
The old code was essentially a no-op due to x86 taking shifts mod 32. This lead DOS to believe that it had 10KiB of memory, which is not enough to contain io.sys, the DOS kernel, and command.com. This causes command.com to overwrite the DOS kernel when it goes to relocate itself at the end of the memory, leading to system crash.
This commit is contained in:
parent
2cab8ae6cf
commit
1967c06b85
4
io.asm
4
io.asm
|
@ -60,8 +60,8 @@ init:
|
||||||
; AX = memory size in kilobytes
|
; AX = memory size in kilobytes
|
||||||
; We want it in paragraphs
|
; We want it in paragraphs
|
||||||
; There are 64 paragraphs in a kilobyte
|
; There are 64 paragraphs in a kilobyte
|
||||||
mov cx, 64
|
mov cx, 6
|
||||||
shl al, cl
|
shl ax, cl
|
||||||
; Memory size is passed in dx
|
; Memory size is passed in dx
|
||||||
mov dx, ax
|
mov dx, ax
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue