From db87be2aeab310b4740c0a6c556f667d43dd342e Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Mon, 10 Jan 2011 17:54:21 +0100 Subject: [PATCH] * grub-core/kern/i386/pc/init.c (grub_get_conv_memsize): Removed. (grub_machine_init): Don't check amount of low memory as reportedly INT 12h can be broken and if low memory is too low we wouldn't have gotten into grub_machine_init anyway. --- ChangeLog | 7 +++++++ grub-core/kern/i386/pc/init.c | 23 +++++++---------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 34703b81d..a1d948151 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-01-10 Vladimir Serbinenko + + * grub-core/kern/i386/pc/init.c (grub_get_conv_memsize): Removed. + (grub_machine_init): Don't check amount of low memory as reportedly + INT 12h can be broken and if low memory is too low we wouldn't have + gotten into grub_machine_init anyway. + 2011-01-10 Vladimir Serbinenko * grub-core/kern/i386/pc/mmap.c (grub_get_conv_memsize): New function. diff --git a/grub-core/kern/i386/pc/init.c b/grub-core/kern/i386/pc/init.c index 122c2c556..d8c337bde 100644 --- a/grub-core/kern/i386/pc/init.c +++ b/grub-core/kern/i386/pc/init.c @@ -140,36 +140,27 @@ compact_mem_regions (void) } } -/* - * - * grub_get_conv_memsize(i) : return the conventional memory size in KB. - * BIOS call "INT 12H" to get conventional memory size - * The return value in AX. - */ -static inline grub_uint16_t -grub_get_conv_memsize (void) -{ - struct grub_bios_int_registers regs; - - regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; - grub_bios_interrupt (0x12, ®s); - return regs.eax & 0xffff; -} - void grub_machine_init (void) { int i; +#if 0 int grub_lower_mem; +#endif /* Initialize the console as early as possible. */ grub_console_init (); + /* This sanity check is useless since top of GRUB_MEMORY_MACHINE_RESERVED_END + is used for stack and if it's unavailable we wouldn't have gotten so far. + */ +#if 0 grub_lower_mem = grub_get_conv_memsize () << 10; /* Sanity check. */ if (grub_lower_mem < GRUB_MEMORY_MACHINE_RESERVED_END) grub_fatal ("too small memory"); +#endif /* FIXME: This prevents loader/i386/linux.c from using low memory. When our heap implements support for requesting a chunk in low memory, this should