exit
5. Create ROM image:
-dd if=fuzix.rom of=fuzix_48k.rom bs=48k count=1 conv=syn
+dd if=fuzix.rom of=fuzix_48k.rom bs=48k count=1 conv=sync
cat fuzix_48k.rom zeta_v2_rootfs.img > fuzix_zeta_v2_bootfs.rom
6. Program the image (fuzix_zeta_v2_bootfs.rom) to the Flash ROM using an
EPROM programmer
-7. Power on the the system. Enter device number 256 to boot from the RAM disk.
+7. Power on the the system. At bootdev: prompt enter either or device number 256 to boot from the RAM disk.
/* We need a tidier way to do this from the loader */
#define CMDLINE NULL /* Location of root dev name */
-#define BOOTDEVICENAMES "fd,hd#"
+#define BOOTDEVICENAMES "fd,rd"
//#define SWAPDEV (256 + 1) /* Device for swapping */
#define NBUFS 10 /* Number of block buffers */
#ifdef DEBUG
kprintf("page_cpy(src_page=%x, src_offset=%x, dst_page=%x, dst_offset=%x, cpy_count=%x)\n", src_page, src_offset, dst_page, dst_offset, cpy_count);
#endif
- __critical {
- page_copy();
- }
+ page_copy();
xfer_count -= cpy_count;
buffer_addr += cpy_count;
rd_addr += cpy_count;
.module devrd_hw
; imported symbols - from zeta-v2.s
- .globl map_table
+ .globl map_kernel,mpgsel_cache
; exported symbols (used by devrd.c)
.globl _page_copy
; _dst_page - page number of the destination page (uint8_t)
; _dst_offset - offset in the destination page (uint16_t)
; _cpy_count - number of bytes to copy (uint16_t)
-; map_table - current page register values, used to restore paging registers
; Outputs:
; Data copied
; Destroys AF, BC, DE, HL
;=========================================================================
_page_copy:
ld a,(_src_page)
+ ld (mpgsel_cache+1),a ; save the mapping
out (MPGSEL_1),a ; map source page to bank #1
ld a,(_dst_page)
+ ld (mpgsel_cache+2),a ; save the mapping
out (MPGSEL_2),a ; map destination page to bank #2
ld hl,(_src_offset) ; load offset in source page
ld a,#0x40 ; add bank #1 offset - 0x4000
ld d,a
ld bc,(_cpy_count) ; bytes to copy
ldir ; do the copy
- ld a,(map_table+1)
- out (MPGSEL_1),a ; restore the mapping of bank #1
- ld a,(map_table+2)
- out (MPGSEL_2),a ; restore the mapping of bank #2
+ call map_kernel ; map the kernel
ret
; variables
.globl interrupt_handler
.globl map_kernel
.globl _ramtop
+ .globl mpgsel_cache
; imported debug symbols
.globl outstring, outde, outhl, outbc, outnewline, outchar, outcharhex
call map_kernel ; put the maps back so we can look in p_tab
djnz fork_next
ld a, c
+ ld (mpgsel_cache+3),a ; cache the page number
out (MPGSEL_3), a ; our last bank repeats up to common
; --- we are now on the stack copy, parent stack is locked away ---
ret ; this stack is copied so safe to return on
.globl map_restore
.globl _kernel_flag
.globl _irqvector
- .globl platform_interrupt_all
- .globl map_table
+ .globl platform_interrupt_all
+ .globl mpgsel_cache
.globl _kernel_pages
; imported symbols
map_process_2:
push de
push af
- ld de,#map_table ; paging registers are write only
+ ld de,#mpgsel_cache ; paging registers are write only
; so cache their content in RAM
ld a,(hl) ; memory page number for bank #0
ld (de),a
ret
;=========================================================================
-; map_save - save the current page mapping
+; map_save - save the current page mapping to map_savearea
; Inputs: none
; Outputs: none
;=========================================================================
map_save:
push hl
- ld hl,(map_table)
+ ld hl,(mpgsel_cache)
ld (map_savearea),hl
- ld hl,(map_table+2)
+ ld hl,(mpgsel_cache+2)
ld (map_savearea+2),hl
pop hl
ret
-map_table:
- .db 32,33,34,35
+; MPGSEL registers are read only, so their content is cached here
+mpgsel_cache:
+ .db 0,0,0,0
+
+; kernel page mapping
_kernel_pages:
.db 32,33,34,35
+
+; memory page mapping save area for map_save/map_restore
map_savearea:
- .db 32,33,34,35
+ .db 0,0,0,0
; has to live in common
_kernel_flag: