Add default page fault exception handler, bump version to 0.3.3
This commit is contained in:
parent
594284cd0c
commit
f307c55bdd
9
exception.asm
Normal file
9
exception.asm
Normal file
|
@ -0,0 +1,9 @@
|
|||
; exception handling routines
|
||||
|
||||
; called if a page fault occurs
|
||||
; does not return, calls panic
|
||||
system_page_fault_handler:
|
||||
mov r0, system_page_fault_str
|
||||
pop r1
|
||||
jmp panic
|
||||
system_page_fault_str: data.str "Page fault at virtual address r1" data.8 10 data.8 0
|
12
main.asm
12
main.asm
|
@ -4,7 +4,7 @@
|
|||
|
||||
const FOX32ROM_VERSION_MAJOR: 0
|
||||
const FOX32ROM_VERSION_MINOR: 3
|
||||
const FOX32ROM_VERSION_PATCH: 2
|
||||
const FOX32ROM_VERSION_PATCH: 3
|
||||
|
||||
const SYSTEM_STACK: 0x01FFF800
|
||||
const BACKGROUND_COLOR: 0xFF674764
|
||||
|
@ -12,6 +12,10 @@ const TEXT_COLOR: 0xFFFFFFFF
|
|||
|
||||
; initialization code
|
||||
entry:
|
||||
; disable the MMU
|
||||
mcl
|
||||
|
||||
; set the stack pointer
|
||||
mov rsp, SYSTEM_STACK
|
||||
|
||||
; disable audio playback
|
||||
|
@ -34,6 +38,11 @@ entry_seed_done:
|
|||
|
||||
; set the interrupt vector for interrupt 0xFF - vsync
|
||||
mov [0x000003FC], system_vsync_handler
|
||||
|
||||
; set the exception vector for exception 0x02 - page fault
|
||||
mov [0x00000408], system_page_fault_handler
|
||||
|
||||
; enable interrupts
|
||||
ise
|
||||
|
||||
; clear the interrupt vector for interrupt 0xFE - audio buffer switch
|
||||
|
@ -138,6 +147,7 @@ get_rom_version:
|
|||
#include "draw_text.asm"
|
||||
#include "draw_tile.asm"
|
||||
#include "event.asm"
|
||||
#include "exception.asm"
|
||||
#include "integer.asm"
|
||||
#include "keyboard.asm"
|
||||
#include "memory.asm"
|
||||
|
|
Loading…
Reference in New Issue
Block a user