Revert "This patch adds the BIOS support for SMP, ACPI, PCI, SMM, SMBIOS."
authorKevin O'Connor <kevin@koconnor.net>
Sat, 8 Mar 2008 18:17:16 +0000 (13:17 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Sat, 8 Mar 2008 18:17:16 +0000 (13:17 -0500)
This reverts commit 3d029417164e9a6dffee491fb061de3de6d85595.

Conflicts:

src/post.c

Makefile
src/config.h
src/post.c
src/system.c
src/types.h
src/util.h

index 7b9caed676ba0ae2fa0d32b3a10c0f13e1b080ce..bb078f457e66e897b0c40d2e119b04f5aebcf601 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,19 +4,13 @@
 #
 # This file may be distributed under the terms of the GNU GPLv3 license.
 
-# Don't compile ACPI DSDT by default
-# Uncomment the below line in case you want to compile DSDT yourself.
-# Note: "iasl" package is required to compile.
-#BUILD_ACPI = 1
-BUILD_ACPI = 0
-
 # Output directory
 OUT=out/
 
 # Source files
 SRC16=floppy.c disk.c system.c clock.c serial.c kbd.c mouse.c output.c \
       boot.c ata.c cdrom.c apm.c
-SRC32=post.c output.c smbios.c acpi.c smm.c smp.c pci.c
+SRC32=post.c output.c
 TABLESRC=font.c cbt.c floppy_dbt.c
 
 cc-option = $(shell if test -z "`$(1) $(2) -S -o /dev/null -xc \
@@ -34,7 +28,6 @@ CFLAGS16INC = $(COMMONCFLAGS) -DMODE16 -fno-jump-tables
 CFLAGS16 = $(CFLAGS16INC) -g
 
 TABLETMP=$(addprefix $(OUT), $(patsubst %.c,%.16.s,$(TABLESRC)))
-
 all: $(OUT) $(OUT)rom.bin $(TABLETMP)
 
 # Run with "make V=1" to see the actual compile commands
@@ -106,15 +99,7 @@ $(OUT)rom16.bin: $(OUT)rom16.o
        @echo "  Extracting binary $@"
        $(Q)objcopy -O binary $< $@
 
-$(OUT)romlayout32.o: $(OUT)acpi-dsdt.hex $(OUT)rom16.offset.auto.h ; $(call whole-compile, $(CFLAGS), $(addprefix src/, $(SRC32)),$@)
-
-ifeq ($(BUILD_ACPI), 1)
-$(OUT)acpi-dsdt.hex: src/acpi-dsdt.dsl
-       iasl -tc -p $@ $<
-else
-$(OUT)acpi-dsdt.hex: src/acpi-dsdt.hex
-       cp src/acpi-dsdt.hex $(OUT)
-endif
+$(OUT)romlayout32.o: $(OUT)rom16.offset.auto.h ; $(call whole-compile, $(CFLAGS), $(addprefix src/, $(SRC32)),$@)
 
 $(OUT)rom32.o: $(OUT)romlayout32.o $(OUT)rombios32.lds
        @echo "  Linking $@"
@@ -125,7 +110,6 @@ $(OUT)rom.bin: $(OUT)rom16.bin $(OUT)rom32.bin $(OUT)rom16.offset.auto.h $(OUT)r
        $(Q)./tools/buildrom.py
 
 ####### Generic rules
-.PHONY : clean
 clean:
        rm -rf $(OUT)
 
index e896cebb784efac400133d9bdacd590f3ead044b..199627e2151a67a577f0210c11c67f959b883cf1 100644 (file)
@@ -2,14 +2,6 @@
 #define __CONFIG_H
 // Configuration definitions.
 
-//#define QEMU_SUPPORT
-
-#ifdef QEMU_SUPPORT
-#define CONFIG_BIOS_NAME "QEMU"
-#else
-#define CONFIG_BIOS_NAME "Bochs"
-#endif
-
 #define CONFIG_FLOPPY_SUPPORT 1
 #define CONFIG_PS2_MOUSE 1
 #define CONFIG_ATA 1
 #define CONFIG_SUBMODEL_ID   0x00
 #define CONFIG_BIOS_REVISION 0x01
 
-/* define it if the (emulated) hardware supports SMM mode */
-#define CONFIG_SMM 1
-
-/* if true, put the MP float table and ACPI RSDT in EBDA and the MP
-   table in RAM. Unfortunately, Linux has bugs with that, so we prefer
-   to modify the BIOS in shadow RAM */
-#define CONFIG_USE_EBDA_TABLES 0
-
 #endif // config.h
index bf4583d01946ba146bdf2b8c21edb2c5aa4ec09a..aecb2e30906edfd8c3d722c3e75d3717ab7094d6 100644 (file)
 #include "util.h" // memset
 #include "biosvar.h" // struct bios_data_area_s
 
-#include "acpi.h"
-#include "smbios.h"
-#include "smp.h"
-#include "pci.h"
-
-u32 cpuid_signature;
-u32 cpuid_features;
-u32 cpuid_ext_features;
-unsigned long ram_size;
-unsigned long bios_table_cur_addr;
-unsigned long bios_table_end_addr;
-
-#ifdef CONFIG_USE_EBDA_TABLES
-unsigned long ebda_cur_addr;
-#endif
-
-#define cpuid(index, eax, ebx, ecx, edx) \
-  asm volatile ("cpuid" \
-                : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) \
-                : "0" (index))
-
 #define bda ((struct bios_data_area_s *)0)
 #define ebda ((struct extended_bios_data_area_s *)(EBDA_SEG<<4))
 #define ipl ((struct ipl_s *)(IPL_SEG<<4))
@@ -524,32 +503,6 @@ rom_scan(u32 start, u32 end)
     }
 }
 
-static void
-ram_probe(void)
-{
-    if (inb_cmos(CMOS_MEM_EXTMEM2_LOW) | inb_cmos(CMOS_MEM_EXTMEM2_HIGH))
-        ram_size = (inb_cmos(CMOS_MEM_EXTMEM2_LOW) | (inb_cmos(CMOS_MEM_EXTMEM2_HIGH) << 8)) *
-                          64 * 1024 + 16 * 1024 * 1024;
-    else
-        ram_size = (inb_cmos(CMOS_MEM_BASE_LOW) | (inb_cmos(CMOS_MEM_BASE_HIGH) << 8)) * 1024;
-#ifdef CONFIG_USE_EBDA_TABLES
-    ebda_cur_addr = ((*(u16 *)(0x40e)) << 4) + 0x380;
-#endif
-
-    BX_INFO("ram_size=0x%08lx\n", ram_size);
-}
-
-static void
-cpu_probe(void)
-{
-    u32 eax, ebx, ecx, edx;
-
-    cpuid(1, eax, ebx, ecx, edx);
-    cpuid_signature = eax;
-    cpuid_features = edx;
-    cpuid_ext_features = ecx;
-}
-
 static void
 post()
 {
@@ -582,26 +535,6 @@ post()
     init_boot_vectors();
     rom_scan(0xc8000, 0xe0000);
 
-    ram_probe();
-    cpu_probe();
-    smp_probe();
-    //pci_bios_init();
-
-    if (bios_table_cur_addr != 0) {
-        mptable_init();
-
-        smbios_init();
-
-        if (acpi_enabled)
-            acpi_bios_init();
-
-        bios_lock_shadow_ram();
-
-        BX_INFO("bios_table_cur_addr: 0x%08lx\n", bios_table_cur_addr);
-        if (bios_table_cur_addr > bios_table_end_addr)
-            BX_PANIC("bios_table_end_addr overflow!\n");
-    }
-
     callrom(SEG_BIOS, OFFSET_begin_boot);
 }
 
index 79f7dc8696d11d2abfc9f9cd7ca536d31521434e..f4b13f8d41091bf8e245415f2247f12e20d7913a 100644 (file)
@@ -5,7 +5,6 @@
 //
 // This file may be distributed under the terms of the GNU GPLv3 license.
 
-#include "acpi.h"
 #include "util.h" // irq_restore
 #include "biosvar.h" // CONFIG_BIOS_TABLE
 #include "ioport.h" // inb
@@ -289,6 +288,8 @@ handle_15e801(struct bregs *regs)
     set_cf(regs, 0);
 }
 
+#define ACPI_DATA_SIZE    0x00010000L
+
 static void
 set_e820_range(u16 DI, u32 start, u32 end, u16 type)
 {
index 197bb95e05ad40f7ccd45d4a1e41c860e6427872..3bd76c583fcea75d33b773ed646ce92b5c6b9ef5 100644 (file)
@@ -13,7 +13,6 @@ typedef signed short s16;
 typedef unsigned int u32;
 typedef signed int s32;
 typedef u32 size_t;
-typedef unsigned long long u64;
 
 #define __VISIBLE __attribute__((externally_visible))
 #ifdef MODE16
index ab530741ea0de1b215ae953b95f16e6b2ba49c89..2b35721dc8435fcc0e4ebbd3afa300f725c3028d 100644 (file)
@@ -52,15 +52,6 @@ memset(void *s, int c, size_t n)
         ((char *)s)[--n] = c;
 }
 
-static inline void
-memcpy(void *d, void *s, size_t n)
-{
-    while (n) {
-        ((char *)d)[n-1] = ((char *)s)[n-1];
-               n--;
-       }
-}
-
 static inline void
 eoi_master_pic()
 {
@@ -147,10 +138,4 @@ handle_ret(struct bregs *regs, u8 code)
     set_cf(regs, code);
 }
 
-unsigned long
-align(unsigned long addr, unsigned long v)
-{
-    return (addr + v - 1) & ~(v - 1);
-}
-
 #endif // util.h