File tree Expand file tree Collapse file tree 3 files changed +19
-5
lines changed Expand file tree Collapse file tree 3 files changed +19
-5
lines changed Original file line number Diff line number Diff line change 33
33
#include <percpu.h>
34
34
#include <string.h>
35
35
36
- #define ACPI_RSDP_BIOS_ROM_START 0xE0000
37
- #define ACPI_RSDP_BIOS_ROM_STOP 0xFFFFF
38
-
39
36
acpi_table_t * acpi_tables [128 ];
40
37
unsigned max_acpi_tables ;
41
38
@@ -109,8 +106,8 @@ static rsdp_rev1_t *acpi_find_rsdp(void) {
109
106
if (rsdp )
110
107
return rsdp ;
111
108
112
- rsdp = find_rsdp (paddr_to_virt_kern (ACPI_RSDP_BIOS_ROM_START ),
113
- paddr_to_virt_kern (ACPI_RSDP_BIOS_ROM_STOP ));
109
+ rsdp = find_rsdp (paddr_to_virt_kern (BIOS_ACPI_ROM_START ),
110
+ paddr_to_virt_kern (BIOS_ACPI_ROM_STOP ));
114
111
if (rsdp )
115
112
return rsdp ;
116
113
Original file line number Diff line number Diff line change @@ -179,6 +179,19 @@ void zap_boot_mappings(void) {
179
179
}
180
180
}
181
181
182
+ static void map_bios_area (void ) {
183
+ vmap_4k (paddr_to_virt (BDA_ADDR_START ), paddr_to_mfn (BDA_ADDR_START ), L1_PROT_RO );
184
+ kmap_4k (paddr_to_mfn (BDA_ADDR_START ), L1_PROT_RO );
185
+
186
+ uint32_t ebda_addr = get_bios_ebda_addr ();
187
+ vmap_4k (paddr_to_virt (ebda_addr ), paddr_to_mfn (ebda_addr ), L1_PROT_RO );
188
+ kmap_4k (paddr_to_mfn (ebda_addr ), L1_PROT_RO );
189
+
190
+ for (mfn_t bios_mfn = paddr_to_mfn (BIOS_ACPI_ROM_START );
191
+ bios_mfn < paddr_to_mfn (BIOS_ACPI_ROM_STOP ); bios_mfn ++ )
192
+ kmap_4k (bios_mfn , L1_PROT_RO );
193
+ }
194
+
182
195
void __noreturn __text_init kernel_start (uint32_t multiboot_magic ,
183
196
multiboot_info_t * mbi ) {
184
197
/* Zero-out BSS sections */
@@ -220,6 +233,7 @@ void __noreturn __text_init kernel_start(uint32_t multiboot_magic,
220
233
init_pagetables ();
221
234
222
235
map_multiboot_areas ();
236
+ map_bios_area ();
223
237
224
238
write_cr3 (cr3 .paddr );
225
239
WRITE_SP (get_free_pages_top (PAGE_ORDER_2M , GFP_KERNEL ));
Original file line number Diff line number Diff line change 31
31
#define BDA_COM_PORTS_ENTRY 0x400
32
32
#define EBDA_ADDR_ENTRY 0x40E
33
33
34
+ #define BIOS_ACPI_ROM_START 0xE0000
35
+ #define BIOS_ACPI_ROM_STOP 0xFFFFF
36
+
34
37
#define BIOS_ROM_ADDR_START 0xF0000
35
38
36
39
#ifndef __ASSEMBLY__
You can’t perform that action at this time.
0 commit comments