_dw_operation:
pshs y
+ ldd 6,x ; test for kernel/usr mapping
+ beq kern@ ; is zero, so must be a kernel xfer.
+ jsr map_process_always
; get parameters from C, X points to cmd packet
- ldy 4,s ; driveptr
- lda ,y ; for now, contains minor = drive number directly
+kern@ lda 5,x ; minor = drive number
ldb ,x ; write flag
; buffer location into Y
ldy 3,x
@done bcs @err
bne @err
ldx #0
-@ret puls y,pc
+@ret jsr map_kernel
+ puls y,pc
@err ldx #0xFFFF
bra @ret
ldy #$0005
lbsr DWWrite
puls a
- ldx 4,s get read buffer pointer
- ldy #256 read 256 bytes
- ldd #133*1 1 second timeout
+ ldx 4,s ; get read buffer pointer
+ ldy #256 ; read 256 bytes
+ ldd #133*1 ; 1 second timeout
bsr DWRead
bcs ReadEx
bne ReadEx
BAUD38400 equ 0
; These files are copied almost as-is from HDB-DOS
+ *PRAGMA nonewsource
include "dw.def"
include "dwread.s"
include "dwwrite.s"
;; set up the map1 registers (MAPSEL=8..f) to use pages 0-7
;; ..to match the pre-existing setup of map0.
;; _krn_mmu_map is set up with the required values.
- ;; while doing this, were careful to keep MMUADR_MAP1 *clear* because we are using
+ ;; while doing this, keep TR=0 because we are using
;; map0 and don't want to switch the map yet.
lda #(MMU_MAP0|8) ; stay in map0, select 1st mapping register for map1
ldx #MMUADR
atmap1:
- ;; Multicomp09 has RAM up at the hardware vector positions
- ;; so we can write the addresses directly, 2 bytes per vector;
+ ;; Multicomp09 has RAM at the hardware vector positions
+ ;; so we can write the addresses directly; 2 bytes per vector:
;; no need for a jump op-code.
ldx #0xfff2 ; address of SWI3 vector
ldy #badswi_handler
ldx #MMUADR
ldb ,y+ ; page from usr_mmu_map
- std ,x ; Write A to MMUADR to set MAPSEL=8, then write B to MMUDAT
+ std ,x ; Write A to MMUADR to set MAPSEL=0, then write B to MMUDAT
inca ; next mapsel
ldb ,y+ ; next page from usr_mmu_map
- std ,x ; Write A to MMUADR to set MAPSEL=9, then write B to MMUDAT
+ std ,x ; Write A to MMUADR to set MAPSEL=1, then write B to MMUDAT
inca ; next mapsel
ldb ,y+ ; next page from usr_mmu_map
- std ,x ; Write A to MMUADR to set MAPSEL=a, then write B to MMUDAT
+ std ,x ; Write A to MMUADR to set MAPSEL=2, then write B to MMUDAT
inca ; next mapsel
ldb ,y+ ; next page from usr_mmu_map
- std ,x ; Write A to MMUADR to set MAPSEL=b, then write B to MMUDAT
+ std ,x ; Write A to MMUADR to set MAPSEL=3, then write B to MMUDAT
inca ; next mapsel
ldb ,y+ ; next page from usr_mmu_map
- std ,x ; Write A to MMUADR to set MAPSEL=c, then write B to MMUDAT
+ std ,x ; Write A to MMUADR to set MAPSEL=4, then write B to MMUDAT
inca ; next mapsel
ldb ,y+ ; next page from usr_mmu_map
- std ,x ; Write A to MMUADR to set MAPSEL=d, then write B to MMUDAT
+ std ,x ; Write A to MMUADR to set MAPSEL=5, then write B to MMUDAT
inca ; next mapsel
ldb ,y+ ; next page from usr_mmu_map
- std ,x ; Write A to MMUADR to set MAPSEL=e, then write B to MMUDAT
+ std ,x ; Write A to MMUADR to set MAPSEL=6, then write B to MMUDAT
lda #MMU_MAP0
sta ,x ; new mapping goes live here
;;; uses low 32Kbyte of kernel address space as the "window" for this
;;; use map 8,9 (0x0000-0x3fff) for dest, map 10,11 (0x4000-0x7fff) for source
copybank
- pshs d,x,u,y ; changing this will affect "ldb 1,s" below
+ pshs d,x,u,y ; changing this will affect "ldb 0,s" below
;; map in dest
ldx #MMUADR ; for storing
lda #(MMU_MAP1+8) ; mapsel=8, for dest, in B