diff --git a/linker.script b/linker.script index 875bfc95..91a7a72a 100644 --- a/linker.script +++ b/linker.script @@ -2,7 +2,7 @@ ENTRY(loader) SECTIONS { . = 0xC0100000; - + kernel_start = .; .text : AT(ADDR(.text) - 0xC0000000) { text = .; _text = .; __text = .; @@ -33,4 +33,5 @@ SECTIONS . = ALIGN(4096); } end = .; _end = .; __end = .; + kernel_end = .; } diff --git a/src/include/system.pas b/src/include/system.pas index dd4354a0..977ddead 100644 --- a/src/include/system.pas +++ b/src/include/system.pas @@ -143,6 +143,22 @@ type PText = ^Text; +var + AK_START : uint32; external name 'kernel_start'; + AK_END : uint32; external name 'kernel_end'; + ASURO_KERNEL_START : uint32; + ASURO_KERNEL_END : uint32; + ASURO_KERNEL_SIZE : uint32; + +procedure init(); + implementation +procedure init(); +begin + ASURO_KERNEL_START := uint32(@AK_START); + ASURO_KERNEL_END := uint32(@AK_END); + ASURO_KERNEL_SIZE:= ASURO_KERNEL_END - ASURO_KERNEL_START; +end; + end. diff --git a/src/kernel.pas b/src/kernel.pas index 9b40accc..ace9f2a1 100644 --- a/src/kernel.pas +++ b/src/kernel.pas @@ -125,6 +125,9 @@ var HM : PHashMap; begin + { Init the base system unit } + System.init(); + { Serial Init } serial.init();