Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ DOS = \
dos/cmd_keys.asm \
dos/cmd_exec.asm \
dos/cmd_wifi.asm \
dos/cmd_external.asm \
dos/strings.asm \
dos/display.asm \
dos/readline.asm \
dos/reader.asm \
kernel/api.asm
kernel/api.asm \
kernel/keys.asm

COPT = -C -Wall -Werror -Wno-shadow -x --verbose-list -I .

Expand Down
76 changes: 74 additions & 2 deletions dos/cmd.asm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cmd .namespace
.mkstr nolist, "No drives found."
.mkstr unknown, "Unknown command."
.mkstr failed, "Command failed."
.mkstr help, "Enter 'help' for help."
.mkstr help, "Enter 'help' for help, 'about' for information about this software."
.mkstr bad_drive, "Drive number must be in [0..7]."
.mkstr no_drive, "Drive not found."

Expand All @@ -38,6 +38,7 @@ words .namespace
.align 256
base .null "" ; So offset zero is invalid
help .null "help"
about .null "about"
ls .null "ls"
dir .null "dir"
read .null "read"
Expand All @@ -58,6 +59,7 @@ wifi .null "wifi"

commands
.word words.help, help
.word words.about, about
.word words.ls, dir.cmd
.word words.dir, dir.cmd
.word words.read, read.cmd
Expand All @@ -76,6 +78,66 @@ commands
.word words.wifi, wifi.cmd
.word 0

about
jsr hardware
jsr ukernel
jsr fat32
rts
hardware
phx

lda #>_msg
ldx #<_msg
jsr strings.puts_zero

plx
rts
_msg
.text $0a
.text "Foenix F256 by Stefany Allaire", $0a
.text "https://c256foenix.com/f256-jr",$0a
.text $0a, $00

ukernel
phx

lda #>_msg
ldx #<_msg
jsr strings.puts_zero

lda #$E0
ldx #$08
jsr strings.puts_zero

jsr put_cr
jsr put_cr

plx
rts
_msg
.text "TinyCore MicroKernel", $0a
.text "Copyright 2022 Jessie Oberreuter", $0a
.text "Gadget@HackwrenchLabs.com",$0a
.text "Built/revision: ",0

fat32
phx

ldx #<_msg
lda #>_msg
jsr strings.puts_zero

plx
rts

_msg
.text "Fat32 from https://github.com/commanderx16/x16-rom", $0a
.text "Copyright 2020 Frank van den Hoef and Michael Steil", $0a
.text $0a
.text "Simple DOS Shell, built ", DATE_STR, $0a
.byte $0


help
lda #<_msg
sta tmp+0
Expand Down Expand Up @@ -110,7 +172,8 @@ _msg
.text "keys Demonstrates key status tracking.", $0a
.text "exec <$hex> JSR to a program in memory (try $a015).", $0a
.text "help Prints this text.", $0a
.text "wifi <ssid> <pass> Configures the wifi access point."
.text "about Information about the software and hardware.", $0a
.text "wifi <ssid> <pass> Configures the wifi access point.", $0a
.byte $0

start
Expand Down Expand Up @@ -261,6 +324,8 @@ _next
inx
bra _cmd
_fail
; Set up argument array for user programs
jsr readline.populate_arguments
.if true
; See if it's the name of a binary
stz kernel.args.buf+0
Expand All @@ -272,6 +337,13 @@ _fail
lda #0
sta (kernel.args.buf),y
jsr kernel.RunNamed
.endif
.if true
; Try to load an external user program on disk, kernel.args.buf is already initialized
jsr external.cmd
bcs _unknown_cmd
rts
_unknown_cmd
.endif
; If the chain failed, unknown command.
lda #unknown_str
Expand Down
25 changes: 3 additions & 22 deletions dos/cmd_dir.asm
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ cmd
stz stop

; Set the drive
lda #1 ; Token #1
jsr readline.parse_drive
sta kernel.args.directory.open.drive

Expand Down Expand Up @@ -218,34 +219,14 @@ print_ext
; TODO: overlay the appropriate struct and read the members.

lda buf+1
jsr print_hex
jsr display.print_hex

lda buf+0
jsr print_hex
jsr display.print_hex

rts


print_hex
pha
lsr a
lsr a
lsr a
lsr a
jsr _digit
pla
and #$0f
jsr _digit
rts
_digit
phy
tay
lda _digits,y
ply
jmp putc
_digits
.text "0123456789abcdef"

.send
.endn

22 changes: 1 addition & 21 deletions dos/cmd_dump.asm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ cmd
jmp reader.read_file

print
jsr print_hex
jsr display.print_hex
jsr print_space
dec count
bne _done
Expand All @@ -39,26 +39,6 @@ print_space
lda #' '
jmp putc

print_hex
pha
lsr a
lsr a
lsr a
lsr a
jsr _digit
pla
and #$0f
jsr _digit
rts
_digit
phy
tay
lda _digits,y
ply
jmp putc
_digits
.text "0123456789abcdef"

.send
.endn

2 changes: 0 additions & 2 deletions dos/cmd_exec.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

exec .namespace

.mkstr desc, "This program shows the held status of keys. Press <ENTER> to quite."

.section dp
addr .word ?
.send
Expand Down
Loading