Skip to content

Commit

Permalink
simple80: fixes to get simple80 up with the new compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
EtchedPixels committed Nov 2, 2023
1 parent 0e1e3ce commit 0a9320d
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 104 deletions.
19 changes: 18 additions & 1 deletion Kernel/platform/platform-simple80/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,23 @@ clean:
rm -f $(OBJS) $(JUNK) core *~ loader.tmp loader.bin fuzix.com

image: loader.bin
$(CROSS_LD) -b -C 0x0100 -S 0xF000 -f CLDBbXSs -o fuzix.bin \
crt0.o commonmem.o simple80.o ../../start.o \
../../version.o ../../cpu-z80u/lowlevel-z80u-thunked.o \
../../usermem.o usermem.o tricks.o main.o discard.o \
../../timer.o ../../kdata.o devices.o ../../devio.o \
../../filesys.o ../../blk512.o ../../process.o \
../../inode.o ../../syscall_exec.o ../../syscall_exec16.o \
../../syscall_fs.o ../../syscall_fs2.o ../../syscall_fs3.o \
../../syscall_proc.o ../../syscall_other.o ../../syscall_net.o \
../../network.o ../../tty.o ../../mm.o ../../mm/memalloc_none.o \
../../swap.o ../../mm/simple.o ../../devsys.o \
devtty.o ../../dev/tinydisk.o ../../dev/tinydisk_discard.o \
../../dev/tinyide.o ../../dev/tinyide_discard.o ide.o \
../../dev/ds1302_rcbusu.o ../../dev/ds1302.o ../../dev/ds1302_discard.o \
/opt/ccz80/lib/libz80.a -m fuzix.tmpmap
perl -lpe '$$_=hex' fuzix.tmpmap | paste -d" " - fuzix.tmpmap | sort -n | cut -d" " -f 2- >../../fuzix.map
../../tools/pack85 <../../fuzix.map fuzix.bin ../../fuzix.bin

loader.bin: loader.S
asz80 loader.S
Expand All @@ -65,6 +82,6 @@ diskimage: image
# Loader
dd if=loader.bin of=$(IMAGES)/disk.img bs=512 seek=1 conv=notrunc
# Add the kernel
dd if=../../fuzix.bin of=$(IMAGES)/disk.img bs=512 seek=2 conv=notrunc
dd if=../../fuzix.bin of=$(IMAGES)/disk.img bs=256 skip=1 seek=4 conv=notrunc
# Make an emulator image of it
cat $(FUZIX_ROOT)/Standalone/filesystem-src/idehdr.40M $(IMAGES)/disk.img > $(IMAGES)/emu-ide.img
14 changes: 8 additions & 6 deletions Kernel/platform/platform-simple80/ide.S
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ _devide_read_data:
push hl
push de
push bc
ld bc, IDE_REG_DATA ; port and count
ld a, (_td_raw)
or a
jr z, read_k
Expand All @@ -22,12 +21,14 @@ _devide_read_data:
ld a,(bits_to_user + 1)
out (c),a
read_k:
inir ; transfer first 256 bytes
inir ; transfer second 256 bytes
ld bc, IDE_REG_DATA ; port and count
inir ; transfer first 256 bytes
inir ; transfer second 256 bytes
ld bc,(sio_reg)
out (c),b
ld a,(bits_to_user)
out (c),a
pop bc
ld a,(_int_disabled)
or a
ret z
Expand All @@ -40,7 +41,6 @@ _devide_write_data:
push hl
push de
push bc
ld bc, IDE_REG_DATA ; port and count
ld a, (_td_raw)
or a
jr z, write_k
Expand All @@ -50,12 +50,14 @@ _devide_write_data:
ld a,(bits_to_user + 1)
out (c),a
write_k:
otir ; transfer first 256 bytes
otir ; transfer second 256 bytes
ld bc, IDE_REG_DATA ; port and count
otir ; transfer first 256 bytes
otir ; transfer second 256 bytes
ld bc,(sio_reg)
out (c),b
ld a,(bits_to_user)
out (c),a
pop bc
ld a,(_int_disabled)
or a
ret z
Expand Down
79 changes: 0 additions & 79 deletions Kernel/platform/platform-simple80/ide.c

This file was deleted.

10 changes: 4 additions & 6 deletions Kernel/platform/platform-simple80/simple80.S
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

; exported symbols
.export init_hardware
.export interrupt_handler
.export _program_vectors
.export _kernel_flag
.export map_page_low
Expand Down Expand Up @@ -84,8 +83,8 @@ init_hardware:
ld hl, 60 ; We lose 4K to common space
ld (_procmem), hl

ld hl, s__COMMONMEM
ld de, l__COMMONMEM
ld hl, __common
ld de, __common_size

; Modified board drives the RAM A16 differently
ld a,(0xfffe)
Expand Down Expand Up @@ -258,7 +257,6 @@ _plt_halt:
;
; A little SIO helper
;
.export _sio_r
.export _sio2_otir

_sio2_otir:
Expand Down Expand Up @@ -404,7 +402,7 @@ modified_mem:
ld (banknum),a
ld hl, 0xeae8
ld (bits_from_user),hl
ld hl, 0x0503 ; SIOB R 5
ld hl, 0x0503 ; SIOB R 5
ld (sio_reg),hl
ld a, 0xea
ld a,l ; get the register
Expand Down Expand Up @@ -433,7 +431,7 @@ far_ldir_1:
inc hl
out (c),b
out (c),d
ld (ix),a
ld (ix + 0),a
inc ix
exx
dec bc
Expand Down
14 changes: 6 additions & 8 deletions Kernel/platform/platform-simple80/simple80.s
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

; exported symbols
.export init_hardware
.export interrupt_handler
.export _program_vectors
.export _kernel_flag
.export map_page_low
Expand Down Expand Up @@ -61,9 +60,9 @@ NBUFS .equ 4

HIGHPAGE .equ 0 ; We only have 1 page byte and the low page
; isn't used
# 26 "simple80.S" 2
# 25 "simple80.S" 2
# 1 "../../cpu-z80u/kernel-z80.def" 1
# 27 "simple80.S" 2
# 26 "simple80.S" 2


; Base address of SIO/2 chip 0x80
Expand Down Expand Up @@ -124,8 +123,8 @@ init_hardware:
ld hl, 60 ; We lose 4K to common space
ld (_procmem), hl

ld hl, s__COMMONMEM
ld de, l__COMMONMEM
ld hl, __common
ld de, __common_size

; Modified board drives the RAM A16 differently
ld a,(0xfffe)
Expand Down Expand Up @@ -298,7 +297,6 @@ _plt_halt:
;
; A little SIO helper
;
.export _sio_r
.export _sio2_otir

_sio2_otir:
Expand Down Expand Up @@ -444,7 +442,7 @@ modified_mem:
ld (banknum),a
ld hl, 0xeae8
ld (bits_from_user),hl
ld hl, 0x0503 ; SIOB R 5
ld hl, 0x0503 ; SIOB R 5
ld (sio_reg),hl
ld a, 0xea
ld a,l ; get the register
Expand Down Expand Up @@ -473,7 +471,7 @@ far_ldir_1:
inc hl
out (c),b
out (c),d
ld (ix),a
ld (ix + 0),a
inc ix
exx
dec bc
Expand Down
4 changes: 2 additions & 2 deletions Kernel/platform/platform-simple80/usermem.S
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ __uput:
; logic
;
__uzero:
ld hl,4
ld hl,5
add hl,sp
ld d,(hl)
dec hl
ld d,(hl)
ld e,(hl)
dec hl
ld a,(hl)
dec hl
Expand Down
4 changes: 2 additions & 2 deletions Kernel/platform/platform-simple80/usermem.s
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ __uput:
; logic
;
__uzero:
ld hl,4
ld hl,5
add hl,sp
ld d,(hl)
dec hl
ld d,(hl)
ld e,(hl)
dec hl
ld a,(hl)
dec hl
Expand Down

0 comments on commit 0a9320d

Please sign in to comment.