diff --git a/src/libsys/boards/denano/board.c b/src/libsys/boards/denano/board.c index e3237f7..092eb2b 100644 --- a/src/libsys/boards/denano/board.c +++ b/src/libsys/boards/denano/board.c @@ -6,6 +6,8 @@ #include +#include "board.h" + #include "../../uart.h" #include "../../console.h" @@ -23,3 +25,22 @@ con_if_t con_if = { con_if_entry, ARRAYSIZE(con_if_entry) }; + +void board_init(void) +{ + uint32_t volatile *pITIM_ctrl = (uint32_t*)SYS_ITIM_CTRL; + + // Disable timers + *pITIM_ctrl = 0; + + // Initialzie syscall support + syscalls_init(); + + // Initialzie interrupt support + interrupt_init(); + + // Initalize debugger + dbg_init(); + + // Do some initializations here +} \ No newline at end of file diff --git a/src/libsys/boards/ml402/board.c b/src/libsys/boards/ml402/board.c index 6e7ff6b..3a9b454 100644 --- a/src/libsys/boards/ml402/board.c +++ b/src/libsys/boards/ml402/board.c @@ -6,6 +6,8 @@ #include +#include "board.h" + #include "../../mips_ps2.h" #include "../../screen.h" #include "../../uart.h" @@ -30,3 +32,31 @@ con_if_t con_if = { con_if_entry, ARRAYSIZE(con_if_entry) }; + +void board_init(void) +{ + uint32_t volatile *pITIM_ctrl = (uint32_t*)SYS_ITIM_CTRL; + +// Screen_clr(); + + // Disable timers + *pITIM_ctrl = 0; + + // Disable all VGA stuff +// *pVGA_ctrl = 0; + + // Initialzie syscall support + syscalls_init(); + + // Initialzie interrupt support + interrupt_init(); + + // Initalize debugger + dbg_init(); + + // flush stdin +// flush(con_getPort(0)); + + // Do some initializations here + +} diff --git a/src/libsys/libsys.c b/src/libsys/libsys.c index 7f179af..8bb7ec8 100644 --- a/src/libsys/libsys.c +++ b/src/libsys/libsys.c @@ -9,37 +9,6 @@ #include "libsys.h" -// --------------------------------------------------------------------------------- -// Types -// --------------------------------------------------------------------------------- -void libsys_init(void) -{ - uint32_t volatile *pITIM_ctrl = (uint32_t*)SYS_ITIM_CTRL; - -// Screen_clr(); - - // Disable timers - *pITIM_ctrl = 0; - - // Disable all VGA stuff -// *pVGA_ctrl = 0; - - // Initialzie syscall support - syscalls_init(); - - // Initialzie interrupt support - interrupt_init(); - - // Initalize debugger - dbg_init(); - - // flush stdin -// flush(con_getPort(0)); - - // Do some initializations here - -} - #define CALC_BAUD(b) \ ((uint32_t)((float)CPU_FREQ_HZ/(16*b) + 0.5f) - 1); diff --git a/src/libsys/startup.S b/src/libsys/startup.S index d92b4b2..a441060 100644 --- a/src/libsys/startup.S +++ b/src/libsys/startup.S @@ -8,7 +8,7 @@ argv: .word argv0 .text .section .start, "ax" .extern _init - .extern libsys_init + .extern board_init .extern _exc_vect_start .extern _xcpt_handler .align 2 @@ -51,8 +51,8 @@ $install: lw $v0, 0($t1) jalr $k0 nop - # Call libsys_init - la $k0, libsys_init + # Call board_init + la $k0, board_init jalr $k0 nop