diff --git a/.gitignore b/.gitignore index 4a04ee78..db912203 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ cscope.* *.debug Makeconf.local .DS_Store +*.swp drivers/acpi/acpica/source/ third-party/libpfm/COPYING third-party/libpfm/Makefile diff --git a/Makefile b/Makefile index 1ed62668..0f0db4a1 100644 --- a/Makefile +++ b/Makefile @@ -122,7 +122,7 @@ COMMON_FLAGS += -DKTF_ACPICA endif AFLAGS := $(COMMON_FLAGS) -D__ASSEMBLY__ -nostdlib -nostdinc -CFLAGS := $(COMMON_FLAGS) -std=gnu99 -O3 -g -Wall -Wextra -ffreestanding -nostdlib -nostdinc +CFLAGS := $(COMMON_FLAGS) -std=gnu99 -O2 -g -Wall -Wextra -ffreestanding -nostdlib -nostdinc CFLAGS += -mno-red-zone -mno-mmx -mno-sse -mno-sse2 CFLAGS += -fno-stack-protector -fno-exceptions -fno-builtin -fomit-frame-pointer -fcf-protection="none" CFLAGS += -mcmodel=kernel -fno-pic -fno-asynchronous-unwind-tables -fno-unwind-tables diff --git a/arch/x86/apic.c b/arch/x86/apic.c index f3a6d66c..89bb6088 100644 --- a/arch/x86/apic.c +++ b/arch/x86/apic.c @@ -153,7 +153,7 @@ void init_apic(unsigned int cpu, apic_mode_t mode) { * X2APIC uses MSRs for accesses, so no mapping needed. */ if (apic_mode == APIC_MODE_XAPIC) - vmap_4k(apic_get_base(apic_base), apic_base.base, L1_PROT); + vmap_4k(apic_get_base(apic_base), apic_base.base, L1_PROT_NOCACHE); spiv.reg = apic_read(APIC_SPIV); spiv.vector = 0xFF; diff --git a/arch/x86/ioapic.c b/arch/x86/ioapic.c index 3b73da42..776d1142 100644 --- a/arch/x86/ioapic.c +++ b/arch/x86/ioapic.c @@ -218,7 +218,7 @@ ioapic_t *add_ioapic(uint8_t id, uint8_t version, bool enabled, uint64_t base_ad ioapic->gsi_base = gsi_base; ioapic->virt_address = vmap_4k(paddr_to_virt(ioapic->base_address), - paddr_to_mfn(ioapic->base_address), L1_PROT); + paddr_to_mfn(ioapic->base_address), L1_PROT_NOCACHE); BUG_ON(!ioapic->virt_address); return ioapic; diff --git a/drivers/hpet.c b/drivers/hpet.c index 828c2e00..6a1a92f7 100644 --- a/drivers/hpet.c +++ b/drivers/hpet.c @@ -59,7 +59,7 @@ bool init_hpet(uint8_t dst_cpus) { #endif hpet_base_mfn = paddr_to_mfn(address); - vmap_4k(_ptr(address), hpet_base_mfn, L1_PROT); + vmap_4k(_ptr(address), hpet_base_mfn, L1_PROT_NOCACHE); config = (acpi_hpet_timer_t *) (address + HPET_OFFSET_TIMER_0_CONFIG_CAP_REG); general = (acpi_hpet_general_t *) (address + HPET_OFFSET_GENERAL_CAP_REG); main_counter = (uint64_t *) (address + HPET_OFFSET_GENERAL_MAIN_COUNTER_REG); diff --git a/drivers/vga.c b/drivers/vga.c index 24efb224..12c54092 100644 --- a/drivers/vga.c +++ b/drivers/vga.c @@ -83,7 +83,7 @@ void vga_write(void *vga_memory, const char *buf, size_t len, vga_color_t color) void map_vga_area(void) { for (mfn_t vga_mfn = paddr_to_mfn(VGA_START_ADDR); vga_mfn < paddr_to_mfn(VGA_END_ADDR); vga_mfn++) { - vmap_4k(mfn_to_virt(vga_mfn), vga_mfn, L1_PROT); - kmap_4k(vga_mfn, L1_PROT); + vmap_4k(mfn_to_virt(vga_mfn), vga_mfn, L1_PROT_NOCACHE); + kmap_4k(vga_mfn, L1_PROT_NOCACHE); } -} \ No newline at end of file +} diff --git a/include/mm/regions.h b/include/mm/regions.h index df860ff0..e1f47237 100644 --- a/include/mm/regions.h +++ b/include/mm/regions.h @@ -32,7 +32,7 @@ #define EBDA_ADDR_ENTRY 0x40E #define BIOS_ACPI_ROM_START 0xE0000 -#define BIOS_ACPI_ROM_STOP 0xFFFFF +#define BIOS_ACPI_ROM_STOP 0x100000 #define BIOS_ROM_ADDR_START 0xF0000 diff --git a/include/sched.h b/include/sched.h index 3a142ae1..be808587 100644 --- a/include/sched.h +++ b/include/sched.h @@ -64,7 +64,7 @@ struct task { void *arg; unsigned long result; -} __aligned(PAGE_SIZE); +}; typedef struct task task_t; /* External declarations */