diff --git a/config/kernel.scm b/config/kernel.scm index 35cf3ef..69f41ab 100755 --- a/config/kernel.scm +++ b/config/kernel.scm @@ -2,6 +2,7 @@ (memory RAM (address (#x000200 . #x001FFF)) + (type RAM) (section zhuge) (section znear) (section zdata) @@ -18,6 +19,7 @@ (memory ROM (address (#xC00000 . #xC0FFFF)) + (type ROM) (section (low_rom #xC08000)) (section code) (section farcode) diff --git a/src/kernel/boot.s b/src/kernel/boot.s index 10af067..10e46b4 100755 --- a/src/kernel/boot.s +++ b/src/kernel/boot.s @@ -42,5 +42,17 @@ delay_y // Disable the on-CPU RAM w65c265s_sram_off + ; Set P5.4 and P5.5 as output + lda #0b00110000 + trb PDD5 + tsb PDD5 + trb PD5 + + ; Set P6.1 as output + lda #0b00000010 + trb PDD6 + tsb PDD6 + trb PD6 + // And we are booted enough to jump to high ROM. jmp long:__program_root_section \ No newline at end of file diff --git a/src/kernel/cstartup.s b/src/kernel/cstartup.s index ebe3dd2..72a758a 100755 --- a/src/kernel/cstartup.s +++ b/src/kernel/cstartup.s @@ -18,12 +18,15 @@ #endif #include "macros.h" +#include "65c816.h" +#include "w65c265s.h" ;;; *************************************************************************** ;;; ;;; __program_start - actual start point of the program ;;; -;;; Set up CPU stack, initialize sections and call main(). +;;; Set up CPU stack, ini +#include "65c816.h"tialize sections and call main(). ;;; You can override this with your own routine, or tailor it as needed. ;;; The easiest way to make custom initialization is to provide your own ;;; __low_level_init which gets called after stacks have been initialized. @@ -90,7 +93,7 @@ __call_heap_initialize: ldx ##.word2 (.sectionSize heap) lda ##.word0 (.sectionSize heap) jsl long:__heap_initialize - + wdm #0x81 .section code, root, noreorder diff --git a/src/kernel/main.c b/src/kernel/main.c index 0213029..80aa5da 100755 --- a/src/kernel/main.c +++ b/src/kernel/main.c @@ -6,6 +6,5 @@ // Copyright © 2024 Kyle J Cardoza void main(void) { - for (;;) {} }