minios: set text and rodata read-only, free unused pages 0 and 1
PATCH 1/1 minios: set text and rodata read-only, free unused pages 0 and 1
minios: set text and rodata read-only, free unused pages 0 and 1
Signed-off-by Samuel Thibault <[email protected]>
extras/mini-os/Makefile +1 -1
@@ -53,7 +53,7 @@ include minios.mk # Define some default flags for linking. LDLIBS := LDARCHLIB := -L$(TARGET_ARCH_DIR) -l$(ARCH_LIB_NAME) -LDFLAGS_FINAL := -N -T $(TARGET_ARCH_DIR)/minios-$(TARGET_ARCH).lds +LDFLAGS_FINAL := -T $(TARGET_ARCH_DIR)/minios-$(TARGET_ARCH).lds # Prefix for global API names. All other symbols are localised before # linking with EXTRA_OBJS.
extras/mini-os/arch/x86/minios-x86_32.lds +2 -0
@@ -13,6 +13,8 @@ SECTIONS _etext = .; /* End of text section */ .rodata : { *(.rodata) *(.rodata.*) } + . = ALIGN(4096); + _erodata = .; .data : { /* Data */ *(.data)
extras/mini-os/arch/x86/minios-x86_64.lds +2 -0
@@ -13,6 +13,8 @@ SECTIONS _etext = .; /* End of text section */ .rodata : { *(.rodata) *(.rodata.*) } + . = ALIGN(4096); + _erodata = .; .data : { /* Data */ *(.data)
extras/mini-os/arch/x86/mm.c +85 -4
123 lines not on this page · raw message
extras/mini-os/include/x86/arch_mm.h +1 -1
@@ -189,7 +189,7 @@ typedef unsigned long maddr_t;#endif extern unsigned long *phys_to_machine_mapping; -extern char _text, _etext, _edata, _end; +extern char _text, _etext, _erodata, _edata, _end;#define pfn_to_mfn (_pfn) (phys_to_machine_mapping[(_pfn)])static __inline__maddr_t phys_to_machine (paddr_t phys) {