From a3ee7f374084046497f8e27bdff8e9ac9ca02d4c Mon Sep 17 00:00:00 2001 From: "Evgeny Grechnikov (Diamond)" Date: Thu, 13 Dec 2007 18:45:44 +0000 Subject: [PATCH] shutdown code now correctly handles >128 Kb file kernel.mnt git-svn-id: svn://kolibrios.org@681 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/boot/shutdown.inc | 28 +++++++++++++++++----------- kernel/trunk/kernel.asm | 4 ++-- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/kernel/trunk/boot/shutdown.inc b/kernel/trunk/boot/shutdown.inc index 8db542d881..87b39c79ec 100644 --- a/kernel/trunk/boot/shutdown.inc +++ b/kernel/trunk/boot/shutdown.inc @@ -233,19 +233,25 @@ restart_kernel_4000: cli push ds - pop es - mov cx, 0x8000 + pop es + mov cx, 0x8000 push cx - mov ds, cx - xor si, si - xor di, di - rep movsw - push 0x9000 - pop ds + push 0x7000 + pop ds + xor si, si + xor di, di + rep movsw + pop cx + mov ds, cx push 0x2000 - pop es - pop cx - rep movsw + pop es + rep movsw + push 0x9000 + pop ds + push 0x3000 + pop es + mov cx, 0xE000/2 + rep movsw wbinvd ; write and invalidate cache diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index 155c96ad9a..b1fda24726 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -5203,12 +5203,12 @@ system_shutdown: ; shut down the system yes_shutdown_param: cli - mov eax, kernel_file ; load kernel.mnt to 0x8000:0 + mov eax, kernel_file ; load kernel.mnt to 0x7000:0 push 12 pop esi xor ebx,ebx or ecx,-1 - mov edx, OS_BASE+0x80000 + mov edx, OS_BASE+0x70000 call fileread mov esi, restart_kernel_4000+OS_BASE+0x10000 ; move kernel re-starter to 0x4000:0