Working on issue #76

This commit is contained in:
Adrien Bourmault 2019-12-30 01:25:59 +01:00
commit c857d51239
4 changed files with 36 additions and 2 deletions

View File

@ -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 = .;
}

View File

@ -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)
{

View File

@ -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 };
//

View File

@ -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"},