Sharing data between nasm, gcc and ld script's code
Posted: Sun Apr 17, 2005 5:31 am
Hello !
I would like to have my kernel's memory organization to be entirely configurable...
In order to do that, I would like to share some definitions between my nasm code, my c code, and my linker script !
For example, the following variables are necessary in the 3 cases :
; // Kernel addresses
%define KERNEL_PADDR 0x100000
%define KERNEL_VADDR 0xC0000000
; // Paging constants
%define PAGE_SHIFT 12
%define PAGE_SIZE 0x1000
%define PAGE_PRESENT 0x1
%define PAGE_RW 0x2
%define PAGE_4M 0x80
...
Someone knows a solution ?
Thanks !
I would like to have my kernel's memory organization to be entirely configurable...
In order to do that, I would like to share some definitions between my nasm code, my c code, and my linker script !
For example, the following variables are necessary in the 3 cases :
; // Kernel addresses
%define KERNEL_PADDR 0x100000
%define KERNEL_VADDR 0xC0000000
; // Paging constants
%define PAGE_SHIFT 12
%define PAGE_SIZE 0x1000
%define PAGE_PRESENT 0x1
%define PAGE_RW 0x2
%define PAGE_4M 0x80
...
Someone knows a solution ?
Thanks !