/* functions in common memory */
/* debug functions */
-extern void trap_monitor(void);
extern void idump(void);
/* platform/device.c */
extern int pagemap_realloc(usize_t c, usize_t d, usize_t s);
extern usize_t pagemap_mem_used(void);
extern void map_init(void);
+
+/* Platform interfaces */
+
#ifndef platform_discard
extern void platform_discard(void);
#endif
extern void platform_idle(void);
-extern uint8_t rtc_secs(void);
-extern void trap_reboot(void);
+extern uint8_t platform_rtc_secs(void);
+extern int platform_rtc_read(void);
+extern int platform_rtc_write(void);
+extern void platform_reboot(void);
+extern void platform_monitor(void);
extern uint8_t platform_param(char *p);
extern void platform_switchout(void);
+extern void platform_interrupt(void);
extern irqflags_t __hard_di(void);
extern void __hard_irqrestore(irqflags_t f);
extern void __hard_ei(void);
-extern int platform_rtc_read(void);
-extern int platform_rtc_write(void);
#ifndef CONFIG_SOFT_IRQ
#define di __hard_di
/* Will need a uptr_t eventually */
extern uaddr_t ramtop; /* Note: ramtop must be in common in some cases */
-extern void platform_interrupt(void);
extern void invalidate_cache(uint16_t page);
extern void flush_cache(ptptr p);
.globl _newproc
.globl _chksigs
.globl _getproc
- .globl _trap_monitor
+ .globl _platform_monitor
.globl trap_illegal
.globl _platform_switchout
.globl _switchin
call _switchin
; we should never get here
- call _trap_monitor
+ call _platform_monitor
badswitchmsg: .ascii "_switchin: FAIL"
.db 13, 10, 0
ld hl, #badswitchmsg
call outstring
; something went wrong and we didn't switch in what we asked for
- jp _trap_monitor
+ jp _platform_monitor
fork_proc_ptr: .dw 0 ; (C type is struct p_tab *) -- address of child process p_tab entry
.import platform_doexec
.import _inint
.import CTemp
- .import _trap_monitor
+ .import _platform_monitor
.include "platform/zeropage.inc"
.include "platform/kernel.def"
lda #<nmi_trap
jsr outstring
nmi_stop:
- jmp _trap_monitor
+ jmp _platform_monitor
nmi_trap:
.byte "NMI!", 0
.import _platform_interrupt
.import platform_doexec
.import _inint
- .import _trap_monitor
+ .import _platform_monitor
.import _switchout
.import push0
ldx #>itrap_msg
outfail:
jsr outstring
- jmp _trap_monitor
+ jmp _platform_monitor
itrap_msg:
.byte "itrap!", 0
lda #<nmi_trap
jsr outstring
nmi_stop:
- jmp _trap_monitor
+ jmp _platform_monitor
nmi_trap:
.byte "NMI!", 0
ldx #>emu_trap
lda #<emu_trap
jsr outstring
- jmp _trap_monitor
+ jmp _platform_monitor
emu_trap:
.byte "EM!", 0
.globl interrupt_handler
; imported symbols
- .globl _trap_monitor
+ .globl _platform_monitor
.globl _unix_syscall
.globl outstring
.globl kstack_top
trap_illegal:
ldx #illegalmsg
jsr outstring
- jsr _trap_monitor
+ jsr _platform_monitor
dpsmsg: .ascii "[dispsig]"
.db 13,10,0
jsr map_kernel
ldx #nmimsg
jsr outstring
- jsr _trap_monitor
+ jsr _platform_monitor
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
div0:
ldx #div0msg
jsr outstring
- jsr _trap_monitor
+ jsr _platform_monitor
div0msg .ascii 'Divby0'
.db 13,10,0
;
jsr map_kernel
ldx #nmimsg
jsr outstring
- jsr trap_monitor
+ jsr platform_monitor
nmimsg:
.ascii "[NMI]"
/* FIXME */
abort:
- jmp trap_monitor
+ jmp platform_monitor
.data
.globl _out
; imported symbols
- .globl _trap_monitor
+ .globl _platform_monitor
.globl _unix_syscall
.globl outstring
.globl kstack_top
trap_illegal:
ld hl, #illegalmsg
call outstring
- call _trap_monitor
+ call _platform_monitor
dpsmsg: .ascii "[dispsig]"
.db 13, 10, 0
call map_kernel
ld hl, #nmimsg
call outstring
- jp _trap_monitor
+ jp _platform_monitor
;
; Interrupt handler. Not quite the same as syscalls, we need to
.globl mmu_irq_ret
; imported symbols
- .globl _trap_monitor
+ .globl _platform_monitor
.globl _unix_syscall
.globl outstring
.globl kstack_top
ld hl, #illegalmsg
traphl:
call outstring
- call _trap_monitor
+ call _platform_monitor
nmimsg: .ascii "[NMI]"
.db 13,10,0
.globl outchar
; exported debugging tools
- .globl trap_monitor
- .globl trap_reboot
+ .globl platform_monitor
+ .globl platform_reboot
include "cpu.def"
include "eeprom.def"
.word 0
.sect .text
-trap_monitor:
+platform_monitor:
sei
- bra trap_monitor
+ bra platform_monitor
-trap_reboot:
+platform_reboot:
jmp reboot
outchar:
; If this returns we should probably do an exit call or something
; FIXME
;
- jmp trap_monitor
+ jmp platform_monitor
;
.globl newproc
.globl chksigs
.globl getproc
- .globl trap_monitor
+ .globl platform_monitor
.globl inint
.globl platform_switchout
.globl switchin
jsr getproc
jsr switchin
; we should never get here
- jsr trap_monitor
+ jsr platform_monitor
badswitchmsg:
.ascii "switchin: FAIL"
ldx #badswitchmsg
jsr outstring
; something went wrong and we didn't switch in what we asked for
- jmp trap_monitor
+ jmp platform_monitor
fork_proc_ptr: .word 0 ; (C type is struct p_tab *) -- address of child process p_tab entry
.export _hd_map
; exported debugging tools
- .export _trap_monitor
- .export _trap_reboot
+ .export _platform_monitor
+ .export _platform_reboot
.export outchar
.export ___hard_di
.export ___hard_ei
;
; Fixme - can we get back to the AppleII monitor ?
;
-_trap_monitor:
- jmp _trap_monitor
+_platform_monitor:
+ jmp _platform_monitor
-_trap_reboot:
- jmp _trap_reboot ; FIXME: original ROM map and jmp
+_platform_reboot:
+ jmp _platform_reboot ; FIXME: original ROM map and jmp
___hard_di:
php
.export _ramtop
.import _chksigs
- .import _trap_monitor
+ .import _platform_monitor
.import map_kernel
.import _swapper
jsr _getproc
jsr _switchin
; we should never get here
- jsr _trap_monitor
+ jsr _platform_monitor
badswitchmsg: .byte "_switchin: FAIL"
.byte 13, 10, 0
ldx #>badswitchmsg
jsr outstring
; something went wrong and we didn't switch in what we asked for
- jmp _trap_monitor
+ jmp _platform_monitor
;
* We need pretty much nothing here as we don't do page mapping.
*/
- .globl _trap_reboot
.globl init_early
.globl init_hardware
.globl _program_vectors
.globl outchar
- .globl _trap_reboot,_trap_monitor
+ .globl _platform_reboot,_platform_monitor
.globl _scroll_down,_scroll_up,_plot_char,_clear_lines
.globl _clear_across,_cursor_on,_cursor_off
.globl _fontdata_8x8, _screenbase
.globl _uarea_block
.mri 1
-_trap_reboot:
-_trap_monitor:
+_platform_reboot:
+_platform_monitor:
or #0700,sr
- bra _trap_monitor
+ bra _platform_monitor
init_early:
lea.l _uarea_block,a5 ; udata ptr
rts
bsr _switchin
; we should never get here
- bra _trap_monitor
+ bra _platform_monitor
badswitchmsg: ascii "_switchin: FAIL"
byte 13,10,0
lea badswitchmsg,a0
bsr outstring
; something went wrong and we didn't switch in what we asked for
- bra _trap_monitor
+ bra _platform_monitor
.globl _vtoutput
; exported debugging tools
- .globl _trap_monitor
- .globl _trap_reboot
+ .globl _platform_monitor
+ .globl _platform_reboot
.globl outchar
.globl ___hard_di
.globl ___hard_ei
.area .common
-_trap_reboot:
+_platform_reboot:
orcc #0x10
clr 0xFFBE
lda #0x7e
sta 0x0071 ; in case IRQ left it looking valid
jmp [0xFFFE]
-_trap_monitor:
+_platform_monitor:
orcc #0x10
- bra _trap_monitor
+ bra _platform_monitor
___hard_di:
tfr cc,b ; return the old irq state
.globl _newproc
.globl _chksigs
.globl _getproc
- .globl _trap_monitor
+ .globl _platform_monitor
.globl _inint
.globl map_kernel
.globl map_process
jsr _getproc
jsr _switchin
; we should never get here
- jsr _trap_monitor
+ jsr _platform_monitor
badswitchmsg:
.ascii "_switchin: FAIL"
ldx #badswitchmsg
jsr outstring
; something went wrong and we didn't switch in what we asked for
- jmp _trap_monitor
+ jmp _platform_monitor
.area .data
.globl ___hard_irqrestore
; exported debugging tools
- .globl _trap_monitor
- .globl _trap_reboot
+ .globl _platform_monitor
+ .globl _platform_reboot
.globl outchar
include "kernel.def"
.area .common
-_trap_reboot:
+_platform_reboot:
orcc #0x10
clr 0xFFBE
lda #0x7e
sta 0x0071 ; in case IRQ left it looking valid
jmp [0xFFFE]
-_trap_monitor:
+_platform_monitor:
orcc #0x10
- bra _trap_monitor
+ bra _platform_monitor
___hard_di:
tfr cc,b ; return the old irq state
.globl _newproc
.globl _chksigs
.globl _getproc
- .globl _trap_monitor
+ .globl _platform_monitor
.globl _inint
.globl map_kernel
.globl map_process
jsr _getproc
jsr _switchin
; we should never get here
- jsr _trap_monitor
+ jsr _platform_monitor
badswitchmsg:
.ascii "_switchin: FAIL"
ldx #badswitchmsg
jsr outstring
; something went wrong and we didn't switch in what we asked for
- jmp _trap_monitor
+ jmp _platform_monitor
.area .data
.globl blkdev_unrawflg
; exported debugging tools
- .globl _trap_monitor
- .globl _trap_reboot
+ .globl _platform_monitor
+ .globl _platform_reboot
.globl outchar
.globl ___hard_di
.globl ___hard_ei
.db 0 ; scheduler flag
-_trap_monitor:
+_platform_monitor:
orcc #0x10
- bra _trap_monitor
+ bra _platform_monitor
-_trap_reboot:
+_platform_reboot:
orcc #0x10 ; turn off interrupts
lda #0x38 ; put RAM block in memory
sta 0xffa8 ;
.globl _newproc
.globl _chksigs
.globl _getproc
- .globl _trap_monitor
+ .globl _platform_monitor
.globl _get_common
.globl _swap_finish
jsr _getproc ; X = next process ptr
jsr _switchin ; and switch it in
; we should never get here
- jsr _trap_monitor
+ jsr _platform_monitor
badswitchmsg:
ldx #badswitchmsg
jsr outstring
;; something went wrong and we didn't switch in what we asked for
- jmp _trap_monitor
+ jmp _platform_monitor
;;;
.globl _vtoutput
; exported debugging tools
- .globl _trap_monitor
- .globl _trap_reboot
+ .globl _platform_monitor
+ .globl _platform_reboot
.globl outchar
.globl ___hard_di
.globl ___hard_ei
.area .common
-_trap_reboot:
+_platform_reboot:
orcc #0x10
clr 0xFFBE
clr 0x0071
jmp [0xFFFE]
-_trap_monitor:
+_platform_monitor:
orcc #0x10
- bra _trap_monitor
+ bra _platform_monitor
___hard_di:
tfr cc,b ; return the old irq state
.globl _newproc
.globl _chksigs
.globl _getproc
- .globl _trap_monitor
+ .globl _platform_monitor
.globl _inint
.globl map_kernel
.globl map_process
jsr _getproc
jsr _switchin
; we should never get here
- jsr _trap_monitor
+ jsr _platform_monitor
badswitchmsg: .ascii "_switchin: FAIL"
.db 13
ldx #badswitchmsg
jsr outstring
; something went wrong and we didn't switch in what we asked for
- jmp _trap_monitor
+ jmp _platform_monitor
.area .data
.globl _need_resched
; exported debugging tools
- .globl _trap_monitor
- .globl _trap_reboot
+ .globl _platform_monitor
+ .globl _platform_reboot
.globl outchar
.globl ___hard_di
.globl ___hard_ei
.area .common
-_trap_reboot:
-_trap_monitor:
+_platform_reboot:
+_platform_monitor:
cwai #0
- bra _trap_monitor
+ bra _platform_monitor
___hard_di:
tfr cc,b ; return the old irq state
.globl _newproc
.globl _chksigs
.globl _getproc
- .globl _trap_monitor
+ .globl _platform_monitor
.globl _inint
.globl _switchout
.globl _switchin
jsr _getproc
jsr _switchin
; we should never get here
- jsr _trap_monitor
+ jsr _platform_monitor
badswitchmsg: .ascii "_switchin: FAIL"
.db 13
ldx #badswitchmsg
jsr outstring
; something went wrong and we didn't switch in what we asked for
- jmp _trap_monitor
+ jmp _platform_monitor
.area .data
fork_proc_ptr: .dw 0 ; (C type is struct p_tab *) -- address of child process p_tab entry
.global init_early
.global init_hardware
.global program_vectors
- .global trap_monitor
- .global trap_reboot
+ .global platform_monitor
+ .global platform_reboot
.global kernel_ds
.global bioshd_param
ret
program_vectors:
ret
-trap_monitor:
-trap_reboot:
- jmp trap_monitor
+platform_monitor:
+platform_reboot:
+ jmp platform_monitor
/*
* Interrupt and trap handlers. The 8086 doesn't have real protection
call getproc
push %ax
call switchin
- jmp trap_monitor
+ jmp platform_monitor
switchin:
/* We can trash registers here because we'll restore them
call outaxhex
mov $badswitchmsg,ax
calloutstring
- jmp _trap_monitor
+ jmp _platform_monitor
dofork:
pushw %bp
movw %sp,%bp
.globl _newproc
.globl _chksigs
.globl _getproc
- .globl _trap_monitor
+ .globl _platform_monitor
.globl trap_illegal
.globl _platform_switchout
.globl _switchin
call _switchin
; we should never get here
- call _trap_monitor
+ call _platform_monitor
badswitchmsg: .ascii "_switchin: FAIL"
.db 13, 10, 0
ld hl, #badswitchmsg
call outstring
; something went wrong and we didn't switch in what we asked for
- jp _trap_monitor
+ jp _platform_monitor
fork_proc_ptr: .dw 0 ; (C type is struct p_tab *) -- address of child process p_tab entry
.globl _curbank
; exported debugging tools
- .globl _trap_monitor
- .globl _trap_reboot
+ .globl _platform_monitor
+ .globl _platform_reboot
.globl outchar
; imported symbols
; -----------------------------------------------------------------------------
.area _COMMONMEM
-_trap_monitor:
+_platform_monitor:
ld a, #128
out (29), a
platform_interrupt_all:
ret
-_trap_reboot:
+_platform_reboot:
ld a, #1
out (29), a
.globl init_early
.globl init_hardware
-.globl trap_reboot
-.globl trap_monitor
+.globl platform_reboot
+.globl platform_monitor
proc poweron
mov.w #(WDTPW | WDTHOLD), &WDTCTL ; Disable watchdog
-trap_reboot:
-trap_monitor:
+platform_reboot:
+platform_monitor:
dint
; Copy the startup code out of high rom and into its execution address.
jnz 1b
; Go to the real startup code.
- br #trap_reboot_high
+ br #platform_reboot_high
-proc trap_reboot_high
+proc platform_reboot_high
mov.b #CSKEY>>8, &CSCTL0_H ; Unlock clock registers
mov.w #DCOFSEL_3 | DCORSEL, &CSCTL1 ; DCO to 8MHz
; ACLK = VLO; SMCLK = MCLK = DCO
.globl _vtinit
; exported debugging tools
- .globl _trap_monitor
+ .globl _platform_monitor
.globl outchar
; imported symbols
.globl _tty_inproc
.globl unix_syscall_entry
- .globl _trap_reboot
+ .globl _platform_reboot
.globl nmi_handler
.globl null_handler
tm_stack_top:
; Ideally return to any debugger/monitor
-_trap_monitor:
+_platform_monitor:
di
halt
-_trap_reboot:
+_platform_reboot:
;FIXME: TODO
di
halt
.globl _newproc
.globl _chksigs
.globl _getproc
- .globl _trap_monitor
+ .globl _platform_monitor
.globl trap_illegal
.globl _platform_switchout
.globl _switchin
call _switchin
; we should never get here
- call _trap_monitor
+ call _platform_monitor
badswitchmsg: .ascii "_switchin: FAIL"
.db 13, 10, 0
ld hl, #badswitchmsg
call outstring
; something went wrong and we didn't switch in what we asked for
- jp _trap_monitor
+ jp _platform_monitor
fork_proc_ptr: .dw 0 ; (C type is struct p_tab *) -- address of child process p_tab entry
.globl _vtinit
; exported debugging tools
- .globl _trap_monitor
+ .globl _platform_monitor
.globl outchar
.globl _tty_inproc
.globl unix_syscall_entry
- .globl _trap_reboot
+ .globl _platform_reboot
.globl nmi_handler
.globl null_handler
.area _COMMONMEM
; Ideally return to any debugger/monitor
-_trap_monitor:
+_platform_monitor:
di
halt
-_trap_reboot:
+_platform_reboot:
;FIXME: TODO
di
halt
.globl _newproc
.globl _chksigs
.globl _getproc
- .globl _trap_monitor
+ .globl _platform_monitor
.globl trap_illegal
.globl _platform_switchout
.globl _switchin
call _switchin
; we should never get here
- call _trap_monitor
+ call _platform_monitor
badswitchmsg: .ascii "_switchin: FAIL"
.db 13, 10, 0
ld hl, #badswitchmsg
call outstring
; something went wrong and we didn't switch in what we asked for
- jp _trap_monitor
+ jp _platform_monitor
fork_proc_ptr: .dw 0 ; (C type is struct p_tab *) -- address of child process p_tab entry
.globl _irqvector
; exported debugging tools
- .globl _trap_monitor
- .globl _trap_reboot
+ .globl _platform_monitor
+ .globl _platform_reboot
.globl outchar
; imported symbols
.dw trace_int ; can be used for CPU tracing etc
.dw serial_int ; we don't use the vector mod functions
-_trap_monitor:
+_platform_monitor:
di
halt
-_trap_reboot:
+_platform_reboot:
di
xor a
out (0),a ; ROM mode, we are in common so survive
.globl curr_tr
; exported debugging tools
- .globl _trap_monitor
- .globl _trap_reboot
+ .globl _platform_monitor
+ .globl _platform_reboot
.globl outchar
.globl ___hard_di
.globl ___hard_ei
.db 0,1,2,3,4,5,6,7 ; mmu registers 0-7
-_trap_monitor:
+_platform_monitor:
orcc #0x10
- bra _trap_monitor
+ bra _platform_monitor
-_trap_reboot:
+_platform_reboot:
orcc #0x10 ; turn off interrupts
- bra _trap_reboot ; [NAC HACK 2016May07] endless loop
+ bra _platform_reboot ; [NAC HACK 2016May07] endless loop
lda #0x38 ; put RAM block in memory
.globl _newproc
.globl _chksigs
.globl _getproc
- .globl _trap_monitor
+ .globl _platform_monitor
.globl _krn_mmu_map
.globl _usr_mmu_map
.globl curr_tr
jsr _getproc ; X = next process ptr
jsr _switchin ; and switch it in
; we should never get here
- jsr _trap_monitor
+ jsr _platform_monitor
badswitchmsg:
ldx #badswitchmsg
jsr outstring
;; something went wrong and we didn't switch in what we asked for
- jmp _trap_monitor
+ jmp _platform_monitor
;;;
.module monitor
.include "kernel.def"
- .globl _trap_monitor
- .globl _trap_reboot
+ .globl _platform_monitor
+ .globl _platform_reboot
.globl map_kernel
; -----------------------------------------------------------------------------
.include "../lib/monitor-z80.s"
.area _COMMONMEM ; just a stub goes in common memory
-_trap_monitor:
+_platform_monitor:
di
call map_kernel
jp monitor_entry
.globl outhl
.area _COMMONMEM
-_trap_monitor: di
+_platform_monitor: di
call outnewline
; just dump a few words from the stack
ld b, #50
halt
.endif
-_trap_reboot: ; TODO
- jr _trap_monitor
+_platform_reboot: ; TODO
+ jr _platform_monitor
;
-; Boot blocks for UZI+ on the NC100
+; Boot blocks for FUZIX on the NC100
;
;
; FIXME: we need a valid NMI vector in the low 0x100 at all times
.globl _vtattr_notify
; exported debugging tools
- .globl _trap_monitor
- .globl _trap_reboot
+ .globl _platform_monitor
+ .globl _platform_reboot
.globl outchar
; imported symbols
; -----------------------------------------------------------------------------
.area _COMMONMEM
-_trap_monitor:
+_platform_monitor:
di
halt
- jr _trap_monitor
+ jr _platform_monitor
-_trap_reboot:
+_platform_reboot:
xor a
out (0x70), a
.globl _newproc
.globl _chksigs
.globl _getproc
- .globl _trap_monitor
- .globl trap_illegal
+ .globl _platform_monitor
+ .globl platform_illegal
.globl _platform_switchout
.globl _switchin
.globl _doexec
call _switchin
; we should never get here
- call _trap_monitor
+ call _platform_monitor
badswitchmsg: .ascii "_switchin: FAIL"
.db 13, 10, 0
ld hl, #badswitchmsg
call outstring
; something went wrong and we didn't switch in what we asked for
- jp _trap_monitor
+ jp _platform_monitor
fork_proc_ptr: .dw 0 ; (C type is struct p_tab *) -- address of child process p_tab entry
.module monitor
.include "kernel.def"
- .globl _trap_monitor
+ .globl _platform_monitor
.globl map_kernel
; -----------------------------------------------------------------------------
.include "../lib/monitor-z80.s"
.area _COMMONMEM ; just a stub goes in common memory
-_trap_monitor:
+_platform_monitor:
di
call map_kernel
jp monitor_entry
.globl outhl
.area _COMMONMEM
-_trap_monitor: di
+_platform_monitor: di
call outnewline
; just dump a few words from the stack
ld b, #50
.globl outstring
.globl outcharhex
.globl platform_interrupt_all
- .globl _trap_reboot
+ .globl _platform_reboot
.globl _bufpool
; imported symbols
in0 a, (ESCC_DATA_A)
ret
-_trap_reboot:
+_platform_reboot:
in0 a, (Z182_SYSCONFIG)
res 3, a ; re-enable the ROM select line
out0 (Z182_SYSCONFIG), a
.globl platform_interrupt_all
; exported debugging tools
- .globl _trap_monitor
- .globl _trap_reboot
+ .globl _platform_monitor
+ .globl _platform_reboot
.globl outchar
.globl _bugout
;
; Ask the controller to reboot
;
-_trap_reboot:
+_platform_reboot:
ld a, #0x01
out (0xF8), a
; should never get here
-_trap_monitor:
+_platform_monitor:
di
halt
- jr _trap_monitor
+ jr _platform_monitor
platform_interrupt_all:
ret
.globl _newproc
.globl _chksigs
.globl _getproc
- .globl _trap_monitor
+ .globl _platform_monitor
.globl trap_illegal
.globl _inint
.globl _platform_switchout
call _switchin
; we should never get here
- call _trap_monitor
+ call _platform_monitor
badswitchmsg: .ascii "_switchin: FAIL"
.db 13, 10, 0
ld hl, #badswitchmsg
call outstring
; something went wrong and we didn't switch in what we asked for
- jp _trap_monitor
+ jp _platform_monitor
fork_proc_ptr: .dw 0 ; (C type is struct p_tab *) -- address of child process p_tab entry
.text
.globl _program_vectors
- .globl _trap_monitor
- .globl _trap_reboot
+ .globl _platform_monitor
+ .globl _platform_reboot
.globl outchar
.globl init_hardware
.globl init_early
_program_vectors:
rts pc
-_trap_monitor:
-_trap_reboot:
- jmp _trap_reboot
+_platform_monitor:
+_platform_reboot:
+ jmp _platform_reboot
/* .data FOR now */
.even
jsr pc,_getproc
mov r0,-(sp)
jsr pc,_switchin
- jmp _trap_monitor
+ jmp _platform_monitor
/* Simple swap based to begin with */
_switchin:
jsr pc,outr0hex
mov $badswitchmsg,r0
jsr pc,outstring
- jmp _trap_monitor
+ jmp _platform_monitor
_dofork:
mov 2(sp),r0
.globl port_map
; exported debugging tools
- .globl _trap_monitor
- .globl _trap_reboot
+ .globl _platform_monitor
+ .globl _platform_reboot
.globl outchar
; imported symbols
; -----------------------------------------------------------------------------
.area _COMMONMEM
-_trap_monitor:
+_platform_monitor:
;
; Not so much a monitor as wait for space
;
ld a, #0x7F
in a, (0xFE)
rra
- jr c, _trap_monitor
+ jr c, _platform_monitor
-_trap_reboot:
+_platform_reboot:
di
im 1
ld bc, #0x7ffd
.globl _newproc
.globl _chksigs
.globl _getproc
- .globl _trap_monitor
+ .globl _platform_monitor
.globl trap_illegal
.globl _inint
.globl _platform_switchout
call _switchin
; we should never get here
- call _trap_monitor
+ call _platform_monitor
badswitchmsg: .ascii "_switchin: FAIL"
.db 13, 10, 0
ld hl, #badswitchmsg
call outstring
; something went wrong and we didn't switch in what we asked for
- jp _trap_monitor
+ jp _platform_monitor
fork_proc_ptr: .dw 0 ; (C type is struct p_tab *) -- address of child process p_tab entry
.globl platform_interrupt_all
; exported debugging tools
- .globl _trap_monitor
- .globl _trap_reboot
+ .globl _platform_monitor
+ .globl _platform_reboot
.globl outchar
; imported symbols
.area _COMMONMEM
; FIXME: figure out how to reboot into CP/M
-_trap_monitor:
-_trap_reboot:
+_platform_monitor:
+_platform_reboot:
di
halt
platform_interrupt_all:
.globl _newproc
.globl _chksigs
.globl _getproc
- .globl _trap_monitor
+ .globl _platform_monitor
.globl trap_illegal
.globl _inint
.globl _platform_switchout
pop af
; we should never get here
- call _trap_monitor
+ call _platform_monitor
badswitchmsg: .ascii "_switchin: FAIL"
.db 13, 10, 0
ld hl, #badswitchmsg
call outstring
; something went wrong and we didn't switch in what we asked for
- jp _trap_monitor
+ jp _platform_monitor
fork_proc_ptr: .dw 0 ; (C type is struct p_tab *) -- address of child process p_tab entry
.globl s__DATA
.globl l__DATA
.globl kstack_top
- .globl _trap_monitor
+ .globl _platform_monitor
; startup code
.area _CODE
; main shouldn't return, but if it does...
di
- jp _trap_monitor
+ jp _platform_monitor
.globl _irqwork
; exported debugging tools
- .globl _trap_monitor
- .globl _trap_reboot
+ .globl _platform_monitor
+ .globl _platform_reboot
.globl outchar
; imported symbols
tm_stack_top:
; For now both hit monitor
-_trap_reboot:
-_trap_monitor:
+_platform_reboot:
+_platform_monitor:
; stash SP
ld (tm_user_sp), sp
; switch to temporary stack
jr z, uart0wr
cp #2
jr z, uart1wr
- call _trap_monitor
+ call _platform_monitor
ret ; not a console we recognise
uart1wr: in a, (UART1_STATUS)
jr testready
.globl _newproc
.globl _chksigs
.globl _getproc
- .globl _trap_monitor
+ .globl _platform_monitor
.globl trap_illegal
.globl _inint
.globl _platform_switchout
call _switchin
; we should never get here
- call _trap_monitor
+ call _platform_monitor
_switchin:
di
ld hl, #badswitchmsg
call outstring
; something went wrong and we didn't switch in what we asked for
- jp _trap_monitor
+ jp _platform_monitor
_dofork:
.export platform_doexec
; exported debugging tools
- .export _trap_monitor
- .export _trap_reboot
+ .export _platform_monitor
+ .export _platform_reboot
.export outchar
.export ___hard_di
.export ___hard_ei
; -----------------------------------------------------------------------------
.segment "COMMONMEM"
-_trap_monitor:
+_platform_monitor:
;
; Put the ROM back as it was at entry including the second 8K bank we
; only use for vectors, then jump to $E000 which should enter whatever
stx $FF91 ; $E000
jmp $E000
-_trap_reboot:
- jmp _trap_reboot ; FIXME: original ROM map and jmp
+_platform_reboot:
+ jmp _platform_reboot ; FIXME: original ROM map and jmp
___hard_di:
php
.export _ramtop
.import _chksigs
- .import _trap_monitor
+ .import _platform_monitor
.import map_kernel
jsr _getproc
jsr _switchin
; we should never get here
- jsr _trap_monitor
+ jsr _platform_monitor
badswitchmsg: .byte "_switchin: FAIL"
.byte 13, 10, 0
ldx #>badswitchmsg
jsr outstring
; something went wrong and we didn't switch in what we asked for
- jmp _trap_monitor
+ jmp _platform_monitor
; Must not put this in ZP ?
;
.globl _video_exg
; exported debugging tools
- .globl _trap_monitor
- .globl _trap_reboot
+ .globl _platform_monitor
+ .globl _platform_reboot
.globl outchar
; imported symbols
.globl istack_top
.globl istack_switched_sp
.globl unix_syscall_entry
- .globl trap_illegal
+ .globl platform_illegal
.globl outcharhex
.globl fd_nmi_handler
.globl null_handler
; -----------------------------------------------------------------------------
.area _COMMONMEM
-_trap_monitor:
+_platform_monitor:
di
halt
in a,(0xef)
ret
-_trap_reboot:
+_platform_reboot:
di
halt
.globl _hd_page
; exported debugging tools
- .globl _trap_monitor
- .globl _trap_reboot
+ .globl _platform_monitor
+ .globl _platform_reboot
.globl outchar
; imported symbols
; -----------------------------------------------------------------------------
.area _COMMONMEM
-_trap_monitor:
+_platform_monitor:
di
call map_kernel
jp to_monitor
in a,(0xef)
ret
-_trap_reboot:
+_platform_reboot:
di
call map_kernel
jp to_reboot
.export _create_init_common
.import _chksigs
- .import _trap_monitor
+ .import _platform_monitor
.import map_kernel
jsr _getproc
jsr _switchin
; we should never get here
- jsr _trap_monitor
+ jsr _platform_monitor
badswitchmsg: .byte "_switchin: FAIL"
.byte 13, 10, 0
ldx #>badswitchmsg
jsr outstring
; something went wrong and we didn't switch in what we asked for
- jmp _trap_monitor
+ jmp _platform_monitor
; Must not put this in ZP ?
;
.export platform_doexec
; exported debugging tools
- .export _trap_monitor
- .export _trap_reboot
+ .export _platform_monitor
+ .export _platform_reboot
.export outchar
.export ___hard_di
.export ___hard_ei
; -----------------------------------------------------------------------------
.segment "COMMONMEM"
-_trap_monitor:
- jmp _trap_monitor
+_platform_monitor:
+ jmp _platform_monitor
-_trap_reboot:
+_platform_reboot:
lda #$A5
sta $FE40 ; Off
- jmp _trap_reboot ; FIXME: original ROM map and jmp
+ jmp _platform_reboot ; FIXME: original ROM map and jmp
___hard_di:
php
.export _program_vectors
; exported debugging tools
- .export _trap_monitor
- .export _trap_reboot
+ .export _platform_monitor
+ .export _platform_reboot
.export outchar
.export ___hard_di
.export ___hard_ei
.code
-_trap_monitor:
- jmp _trap_monitor
+_platform_monitor:
+ jmp _platform_monitor
-_trap_reboot:
+_platform_reboot:
sep #$30
.a8
.i8
lda #$A5
sta $FE40 ; Off
- jmp _trap_reboot ; FIXME: original ROM map and jmp
+ jmp _platform_reboot ; FIXME: original ROM map and jmp
___hard_di:
php
.export _program_vectors
; exported debugging tools
- .export _trap_monitor
- .export _trap_reboot
+ .export _platform_monitor
+ .export _platform_reboot
.export outchar
.export ___hard_di
.export ___hard_ei
.code
-_trap_monitor:
- jmp _trap_monitor
+_platform_monitor:
+ jmp _platform_monitor
-_trap_reboot:
+_platform_reboot:
sep #$30
.a8
.i8
lda #$A5
sta $FE40 ; Off
- jmp _trap_reboot ; FIXME: original ROM map and jmp
+ jmp _platform_reboot ; FIXME: original ROM map and jmp
___hard_di:
php
* Lots left to fill in
*/
- .globl trap_reboot
+ .globl platform_reboot
.globl init_early
.globl init_hardware
.globl program_vectors
.globl outchar
- .globl trap_monitor
+ .globl platform_monitor
.globl udata_block
.globl devide_read_data
.globl devide_write_data
.globl vdso
.mri 1
-trap_reboot:
-trap_monitor:
+platform_reboot:
+platform_monitor:
or #0700,sr
- bra trap_monitor
+ bra platform_monitor
init_early:
lea.l udata_block,a5 ; udata ptr
bsr switchin
; we should never get here
- bra trap_monitor
+ bra platform_monitor
switchin:
or #$0700,sr
lea badswitchmsg,a0
bsr outstring
; something went wrong and we didn't switch in what we asked for
- bra trap_monitor
+ bra platform_monitor
;
; this gets exciting on the 68000 because our udata is not always in
* Lots left to fill in
*/
- .globl trap_reboot
+ .globl platform_reboot
.globl init_early
.globl init_hardware
.globl program_vectors
.globl outchar
- .globl trap_monitor
+ .globl platform_monitor
.globl udata_block
.globl devide_read_data
.globl devide_write_data
.globl vdso
.mri 1
-trap_reboot:
-trap_monitor:
+platform_reboot:
+platform_monitor:
or #0700,sr
- bra trap_monitor
+ bra platform_monitor
init_early:
lea.l udata_block,a5 ; udata ptr
bsr switchin
; we should never get here
- bra trap_monitor
+ bra platform_monitor
switchin:
or #$0700,sr
lea badswitchmsg,a0
bsr outstring
; something went wrong and we didn't switch in what we asked for
- bra trap_monitor
+ bra platform_monitor
;
; this gets exciting on the 68000 because our udata is not in a
* Lots left to fill in
*/
- .globl trap_reboot
+ .globl platform_reboot
.globl init_early
.globl init_hardware
.globl program_vectors
.globl outchar
- .globl trap_monitor
+ .globl platform_monitor
.globl udata_block
.globl devide_read_data
.globl devide_write_data
.globl vdso
.mri 1
-trap_reboot:
-trap_monitor:
+platform_reboot:
+platform_monitor:
or #0700,sr
- bra trap_monitor
+ bra platform_monitor
init_early:
lea.l udata_block,a5 ; udata ptr
bsr switchin
; we should never get here
- bra trap_monitor
+ bra platform_monitor
switchin:
or #$0700,sr
lea badswitchmsg,a0
bsr outstring
; something went wrong and we didn't switch in what we asked for
- bra trap_monitor
+ bra platform_monitor
;
; this gets exciting on the 68000 because our udata is not in a
.globl _newproc
.globl _chksigs
.globl _getproc
- .globl _trap_monitor
+ .globl _platform_monitor
.globl trap_illegal
.globl _platform_switchout
.globl _switchin
call _switchin
; we should never get here
- call _trap_monitor
+ call _platform_monitor
badswitchmsg: .ascii "_switchin: FAIL"
.db 13, 10, 0
ld hl, #badswitchmsg
call outstring
; something went wrong and we didn't switch in what we asked for
- jp _trap_monitor
+ jp _platform_monitor
fork_proc_ptr: .dw 0 ; (C type is struct p_tab *) -- address of child process p_tab entry
.globl _need_resched
; exported debugging tools
- .globl _trap_monitor
- .globl _trap_reboot
+ .globl _platform_monitor
+ .globl _platform_reboot
.globl outchar
; imported symbols
; -----------------------------------------------------------------------------
.area _COMMONMEM
-_trap_monitor:
+_platform_monitor:
ld a, #128
out (29), a
platform_interrupt_all:
ret
-_trap_reboot:
+_platform_reboot:
ld a, #1
out (29), a
.globl _fd_bankcmd
- .globl _trap_reboot
+ .globl _platform_reboot
; exported debugging tools
- .globl _trap_monitor
+ .globl _platform_monitor
.globl outchar
; imported symbols
; -----------------------------------------------------------------------------
.area _COMMONMEM
-_trap_monitor:
+_platform_monitor:
ld a, #128
out (29), a
platform_interrupt_all:
ret
-_trap_reboot:
+_platform_reboot:
ld a, #1
out (29), a
.globl _newproc
.globl _chksigs
.globl _getproc
- .globl _trap_monitor
+ .globl _platform_monitor
.globl trap_illegal
.globl _inint
.globl _platform_switchout
call _switchin
; we should never get here
- call _trap_monitor
+ call _platform_monitor
badswitchmsg: .ascii "_switchin: FAIL"
.db 13, 10, 0
ld hl, #badswitchmsg
call outstring
; something went wrong and we didn't switch in what we asked for
- jp _trap_monitor
+ jp _platform_monitor
; (hl) points to cached page ptr, a is desired page
update_cache:
.globl _kernel_flag
; exported debugging tools
- .globl _trap_monitor
+ .globl _platform_monitor
.globl outchar
; imported symbols
; -----------------------------------------------------------------------------
.area _COMMONMEM
-_trap_monitor:
+_platform_monitor:
ld a, #128
out (29), a
platform_interrupt_all:
ret
-_trap_reboot:
+_platform_reboot:
ld a, #1
out (29), a
.module monitor
.include "kernel.def"
- .globl _trap_monitor
+ .globl _platform_monitor
.globl map_kernel
; -----------------------------------------------------------------------------
.include "../lib/monitor-z80.s"
.area _COMMONMEM ; just a stub goes in common memory
-_trap_monitor:
+_platform_monitor:
di
call map_kernel
jp monitor_entry
.globl outhl
.area _COMMONMEM
-_trap_monitor: di
+_platform_monitor: di
call outnewline
; just dump a few words from the stack
ld b, #50
.globl _newproc
.globl _chksigs
.globl _getproc
- .globl _trap_monitor
+ .globl _platform_monitor
.globl trap_illegal
.globl _platform_switchout
.globl _switchin
call _switchin
; we should never get here
- call _trap_monitor
+ call _platform_monitor
badswitchmsg: .ascii "_switchin: FAIL"
.db 13, 10, 0
ld hl, #badswitchmsg
call outstring
; something went wrong and we didn't switch in what we asked for
- jp _trap_monitor
+ jp _platform_monitor
fork_proc_ptr: .dw 0 ; (C type is struct p_tab *) -- address of child process p_tab entry
.globl platform_interrupt_all
.globl mpgsel_cache
.globl _kernel_pages
- .globl _trap_reboot
+ .globl _platform_reboot
.globl _bufpool
; imported symbols
;=========================================================================
.area _CODE
-_trap_reboot:
+_platform_reboot:
; We need to map the ROM back in -- ideally into every page.
; This little trick based on a clever suggestion from John Coffman.
di
.globl _ptab_alloc
.globl _newproc
.globl _getproc
- .globl _trap_monitor
+ .globl _platform_monitor
.globl trap_illegal
.globl _platform_switchout
.globl _switchin
call _switchin
; we should never get here
- call _trap_monitor
+ call _platform_monitor
badswitchmsg: .ascii "_switchin: FAIL"
.db 13, 10, 0
ld hl, #badswitchmsg
call outstring
; something went wrong and we didn't switch in what we asked for
- jp _trap_monitor
+ jp _platform_monitor
; Interrupts should be off when this is called
_dup_low_page:
.globl _need_resched
; exported debugging tools
- .globl _trap_monitor
- .globl _trap_reboot
+ .globl _platform_monitor
+ .globl _platform_reboot
.globl outchar
; imported symbols
; -----------------------------------------------------------------------------
.area _COMMONMEM
-_trap_monitor:
+_platform_monitor:
;
; Not so much a monitor as wait for space
;
ld a, #0x7F
in a, (0xFE)
rra
- jr c, _trap_monitor
+ jr c, _platform_monitor
-_trap_reboot:
+_platform_reboot:
di
im 1
ld bc, #0x7ffd
{
kputs("\r\npanic: ");
kputs(deathcry);
- trap_monitor();
+ platform_monitor();
}
/* We put this here so that we can blow the start.c code away on exec
sync();
/* Wants moving into machine specific files */
if (cmd == A_SHUTDOWN || cmd == A_DUMP)
- trap_monitor();
+ platform_monitor();
if (cmd == A_REBOOT)
- trap_reboot();
+ platform_reboot();
/* We don't do SWAPCTL yet */
udata.u_error = EINVAL;
#endif
#ifdef CONFIG_MONITOR
if (c == 0x01) /* ^A */
- trap_monitor();
+ platform_monitor();
#endif
if (c == '\r' ){