diff --git a/build/kernel.ld b/build/kernel.ld index 0840bf2..bcc86e2 100644 --- a/build/kernel.ld +++ b/build/kernel.ld @@ -38,13 +38,16 @@ SECTIONS { .text ALIGN (0x1000) : { + _text = .; *(.text) + _text_end = .; } .data ALIGN (0x1000) : { _data = .; *(.data) + _data_end = .; } .eh_frame ALIGN (0x1000) : @@ -55,7 +58,9 @@ SECTIONS { .rodata ALIGN (0x1000) : { + _rodata = .; *(.rodata) + _rodata_end = .; } .bss ALIGN (0x1000) : @@ -70,5 +75,3 @@ SECTIONS { kernelEnd = .; } - - diff --git a/kaleid/kernel/ke/pit.c b/kaleid/kernel/ke/pit.c index db3bfda..a9d961c 100644 --- a/kaleid/kernel/ke/pit.c +++ b/kaleid/kernel/ke/pit.c @@ -37,6 +37,9 @@ static char TimeFmtBuf[22] = { 0 }; // // ISR handler for the Programmable Interval Timer // + +#pragma GCC push_options +#pragma GCC optimize ("O0") static void HandlePIT(ISRFrame_t *regs) { Ticks++; @@ -52,6 +55,7 @@ static void HandlePIT(ISRFrame_t *regs) KeSendEOItoPIC(0x28); } } +#pragma GCC pop_options static Timer_t* KeFindTimerBlock(void) { @@ -63,6 +67,8 @@ static Timer_t* KeFindTimerBlock(void) return NULL; } +#pragma GCC push_options +#pragma GCC optimize ("O0") void KeSleep(uint delay) { Timer_t *timerBlock; @@ -77,7 +83,10 @@ void KeSleep(uint delay) } timerBlock->sema = 0; } +#pragma GCC pop_options +#pragma GCC push_options +#pragma GCC optimize ("O0") Timer_t *KeSetTimer(uint delay) { Timer_t *timerBlock; @@ -89,6 +98,7 @@ Timer_t *KeSetTimer(uint delay) return timerBlock; } +#pragma GCC pop_options int KeGetTimer(Timer_t *timerBlock) { diff --git a/kaleid/kernel/mm/paging.c b/kaleid/kernel/mm/paging.c index 2ace42a..843aa87 100644 --- a/kaleid/kernel/mm/paging.c +++ b/kaleid/kernel/mm/paging.c @@ -33,6 +33,13 @@ volatile pde_t MmPD[512 * RAM_MAX] __attribute__((__aligned__(KPAGESIZE)));; volatile pte_t MmPT[512 * NB_4K] __attribute__((__aligned__(KPAGESIZE)));; +extern ulong _text; +extern ulong _text_end; +extern ulong _rodata; +extern ulong _rodata_end; +extern ulong _data; +extern ulong _data_end; + ulong MmStackGuards[2] = { 0 }; // diff --git a/kaleid/kernel/sh/testcmds.c b/kaleid/kernel/sh/testcmds.c index 70ca0ac..8b9cb66 100644 --- a/kaleid/kernel/sh/testcmds.c +++ b/kaleid/kernel/sh/testcmds.c @@ -55,6 +55,19 @@ error_t CmdArgs(int argc, char **argv, char *cmdline) return EOK; } +error_t CmdAtoi(int argc, char **argv, char *cmdline) +{ + int i; + + KernLog("cmdline: '%s'\nargc: %d\n", cmdline, argc); + + for (i = 0; i < argc; i++) { + KernLog("argv[%d]: '%u'\n", i, atoi(argv[i])); + } + + return EOK; +} + error_t CmdDumpATASect(int argc, char **argv, char *cmdline) { char sector[512] = {0}; @@ -193,6 +206,7 @@ error_t CmdTimerTest(int argc, char **argv, char *cmdline) static Command_t testcmdtable[] = { { "args", CmdArgs, "Print command line" }, + { "atoi", CmdAtoi, "Print command line atoised" }, { "dmpsec", CmdDumpATASect, "Dump an ATA sector on screen" }, { "help", CmdHelpTest, "Show this message" }, { "div", CmdFloatDiv, "Float div. Usage : div a b. Returns a/b"},