diff options
Diffstat (limited to 'kernel/include/arch')
-rw-r--r-- | kernel/include/arch/i686/acpi.h | 4 | ||||
-rw-r--r-- | kernel/include/arch/i686/mboot.h | 8 | ||||
-rw-r--r-- | kernel/include/arch/i686/paging.h | 33 |
3 files changed, 39 insertions, 6 deletions
diff --git a/kernel/include/arch/i686/acpi.h b/kernel/include/arch/i686/acpi.h index bb35010..47bcc88 100644 --- a/kernel/include/arch/i686/acpi.h +++ b/kernel/include/arch/i686/acpi.h @@ -102,5 +102,5 @@ struct FixedACPIDescriptionTable { struct GenericAddressStructure x_gpe1_block; }; -void acpi_init(void *rsdp); -void acpi_poweroff(void); +extern void acpi_init(void); +extern void acpi_poweroff(void); diff --git a/kernel/include/arch/i686/mboot.h b/kernel/include/arch/i686/mboot.h index 394071f..2ebc983 100644 --- a/kernel/include/arch/i686/mboot.h +++ b/kernel/include/arch/i686/mboot.h @@ -12,7 +12,7 @@ struct BootTag { uint32_t type; uint32_t size; union { - char cmdline[CMDLINE_MAX]; + char cmdline[CMDLINE_MAX + 1]; struct MemoryMap *memory_map; struct RootSystemDescriptionPointer *rsdp; } data; @@ -26,9 +26,9 @@ struct BootInfo { enum BootTagID { ID_CMDLINE = 0, - iD_MEMORYMAP = 6, + ID_MEMORYMAP = 6, ID_RSDP = 14 }; -void load_boot_info(void* boot_info); -bool get_boot_tag(enum BootTagID id, struct BootTag **tag); +extern void load_boot_info(void* boot_info); +extern bool get_boot_tag(enum BootTagID id, struct BootTag **tag); diff --git a/kernel/include/arch/i686/paging.h b/kernel/include/arch/i686/paging.h new file mode 100644 index 0000000..3c0c335 --- /dev/null +++ b/kernel/include/arch/i686/paging.h @@ -0,0 +1,33 @@ +#pragma once + +#include <stddef.h> + +struct page_directory_t { // 32 bits + unsigned int present : 1; + unsigned int rw_flag : 1; + unsigned int access_lvl : 1; //0 is for only ring0. 1 is for anybody. + unsigned int write_through : 1; + unsigned int cache_off : 1; + unsigned int accessed : 1; + unsigned int zero : 1; + unsigned int page_size : 1; + unsigned int unused : 4; + unsigned int tbl_addr : 20; +}; + +struct page_table_t { // 32 bits + unsigned int present : 1; + unsigned int rw_flag : 1; + unsigned int access_lvl : 1; //0 is for only ring0. 1 is for anybody. + unsigned int write_through : 1; + unsigned int cache_off : 1; + unsigned int accessed : 1; + unsigned int dirty : 1; + unsigned int zero : 1; + unsigned int global : 1; + unsigned int reserved : 3; + unsigned int phys_addr : 20; +}; + +extern void ident_map_addr(void *addr, size_t len); +extern void ident_unmap_addr(void *addr, size_t len); |