Don't use unreserved memory in BIOS.
Patch by Gleb Natapov
This commit is contained in:
parent
4bc2d5b4e9
commit
dcf68cca6d
Binary file not shown.
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: rombios.c,v 1.218 2008-12-04 18:44:14 sshwarts Exp $
|
||||
// $Id: rombios.c,v 1.219 2008-12-04 18:46:55 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -940,7 +940,7 @@ Bit16u cdrom_boot();
|
||||
|
||||
#endif // BX_ELTORITO_BOOT
|
||||
|
||||
static char bios_cvs_version_string[] = "$Revision: 1.218 $ $Date: 2008-12-04 18:44:14 $";
|
||||
static char bios_cvs_version_string[] = "$Revision: 1.219 $ $Date: 2008-12-04 18:46:55 $";
|
||||
|
||||
#define BIOS_COPYRIGHT_STRING "(c) 2002 MandrakeSoft S.A. Written by Kevin Lawton & the Bochs team."
|
||||
|
||||
@ -4548,7 +4548,7 @@ ASM_END
|
||||
{
|
||||
case 0:
|
||||
set_e820_range(ES, regs.u.r16.di,
|
||||
0x0000000L, 0x0009fc00L, 1);
|
||||
0x0000000L, 0x0009f000L, 1);
|
||||
regs.u.r32.ebx = 1;
|
||||
regs.u.r32.eax = 0x534D4150;
|
||||
regs.u.r32.ecx = 0x14;
|
||||
@ -4557,7 +4557,7 @@ ASM_END
|
||||
break;
|
||||
case 1:
|
||||
set_e820_range(ES, regs.u.r16.di,
|
||||
0x0009fc00L, 0x000a0000L, 2);
|
||||
0x0009f000L, 0x000a0000L, 2);
|
||||
regs.u.r32.ebx = 2;
|
||||
regs.u.r32.eax = 0x534D4150;
|
||||
regs.u.r32.ecx = 0x14;
|
||||
@ -10036,8 +10036,11 @@ rombios32_05:
|
||||
mov gs, ax
|
||||
cld
|
||||
|
||||
;; init the stack pointer
|
||||
mov esp, #0x00080000
|
||||
;; init the stack pointer to point below EBDA
|
||||
mov ax, [0x040e]
|
||||
shl eax, #4
|
||||
mov esp, #-0x10
|
||||
add esp, eax
|
||||
|
||||
;; pass pointer to s3_resume_flag and s3_resume_vector to rombios32
|
||||
push #0x04b0
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: rombios.h,v 1.6 2008-01-26 09:15:27 sshwarts Exp $
|
||||
// $Id: rombios.h,v 1.7 2008-12-04 18:46:55 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2006 Volker Ruppert
|
||||
@ -56,7 +56,6 @@
|
||||
#define ACPI_DATA_SIZE 0x00010000L
|
||||
#define PM_IO_BASE 0xb000
|
||||
#define SMB_IO_BASE 0xb100
|
||||
#define CPU_COUNT_ADDR 0xf000
|
||||
|
||||
// Define the application NAME
|
||||
#if defined(BX_QEMU)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: rombios32.c,v 1.37 2008-12-04 18:44:14 sshwarts Exp $
|
||||
// $Id: rombios32.c,v 1.38 2008-12-04 18:46:55 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 32 bit Bochs BIOS init code
|
||||
@ -57,7 +57,7 @@ typedef unsigned long long uint64_t;
|
||||
|
||||
#define APIC_ENABLED 0x0100
|
||||
|
||||
#define AP_BOOT_ADDR 0x10000
|
||||
#define AP_BOOT_ADDR 0x9f000
|
||||
|
||||
#define MPTABLE_MAX_SIZE 0x00002000
|
||||
#define SMI_CMD_IO_ADDR 0xb2
|
||||
@ -392,7 +392,7 @@ void delay_ms(int n)
|
||||
}
|
||||
}
|
||||
|
||||
int smp_cpus;
|
||||
uint16_t smp_cpus;
|
||||
uint32_t cpuid_signature;
|
||||
uint32_t cpuid_features;
|
||||
uint32_t cpuid_ext_features;
|
||||
@ -495,7 +495,7 @@ void smp_probe(void)
|
||||
{
|
||||
uint32_t val, sipi_vector;
|
||||
|
||||
smp_cpus = 1;
|
||||
writew(&smp_cpus, 1);
|
||||
if (cpuid_features & CPUID_APIC) {
|
||||
|
||||
/* enable local APIC */
|
||||
@ -503,7 +503,6 @@ void smp_probe(void)
|
||||
val |= APIC_ENABLED;
|
||||
writel(APIC_BASE + APIC_SVR, val);
|
||||
|
||||
writew((void *)CPU_COUNT_ADDR, 1);
|
||||
/* copy AP boot code */
|
||||
memcpy((void *)AP_BOOT_ADDR, &smp_ap_boot_code_start,
|
||||
&smp_ap_boot_code_end - &smp_ap_boot_code_start);
|
||||
@ -514,10 +513,8 @@ void smp_probe(void)
|
||||
writel(APIC_BASE + APIC_ICR_LOW, 0x000C4600 | sipi_vector);
|
||||
|
||||
delay_ms(10);
|
||||
|
||||
smp_cpus = readw((void *)CPU_COUNT_ADDR);
|
||||
}
|
||||
BX_INFO("Found %d cpu(s)\n", smp_cpus);
|
||||
BX_INFO("Found %d cpu(s)\n", readw(&smp_cpus));
|
||||
}
|
||||
|
||||
/****************************************************/
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: rombios32start.S,v 1.6 2008-12-04 18:44:14 sshwarts Exp $
|
||||
// $Id: rombios32start.S,v 1.7 2008-12-04 18:46:55 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 32 bit Bochs BIOS init code
|
||||
@ -49,7 +49,7 @@ _start:
|
||||
smp_ap_boot_code_start:
|
||||
xor %ax, %ax
|
||||
mov %ax, %ds
|
||||
lock incw CPU_COUNT_ADDR
|
||||
lock incw smp_cpus
|
||||
1:
|
||||
hlt
|
||||
jmp 1b
|
||||
|
Loading…
Reference in New Issue
Block a user