-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor driver/device files and handling
- Loading branch information
1 parent
e9ca64f
commit aab4e37
Showing
28 changed files
with
219 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
db $18,$04,"FEX",0 | ||
ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
fs_root_dir_data: | ||
db "bin ", $14, $0C,$00, $00,$03 | ||
db "bin ", $14, $10,$00, $00,$01 | ||
db "dev ", $14, $0C,$00, $00,$01 | ||
db "lib ", $14, $08,$00, $00,$01 | ||
db "sbin ", $14, $04,$00, $00,$01 | ||
.len:=$-. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
; BOS device routines | ||
|
||
include 'drv/InitDevice.asm' | ||
include 'drv/GetDMA.asm' | ||
include 'drv/GetChar.asm' | ||
include 'drv/PutChar.asm' | ||
include 'drv/Read.asm' | ||
include 'drv/Write.asm' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
;@DOES Read a character from a device file given a descriptor | ||
;@INPUT int drv_GetChar(void* fd); | ||
;@OUTPUT Data (usually a character) read from device. | ||
drv_GetChar: | ||
pop bc,hl | ||
push hl,bc | ||
.entryhl: | ||
ld bc,device_JumpRead | ||
add hl,bc | ||
ld a,(hl) | ||
cp a,$C3 | ||
ret nz | ||
ld de,0 | ||
push de ; push stack memory to read into | ||
push de ; offset 0 | ||
inc e | ||
push de ; length 1 | ||
ex hl,de | ||
ld hl,6 | ||
add hl,sp | ||
push hl ; push pointer to stack memory to read into | ||
ex hl,de | ||
call sys_jphl | ||
pop bc,bc,bc,hl | ||
ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
;@DOES Return a pointer to a device's physical memory address | ||
;@INPUT void *drv_GetDMA(void* fd); | ||
;@OUTPUT pointer to address, 0 if not applicable. | ||
drv_GetDMA: | ||
pop bc,hl | ||
push hl,bc | ||
.entryhl: | ||
ld bc,device_JumpGetDMA | ||
drv.common_no_args: | ||
add hl,bc | ||
ld a,(hl) | ||
cp a,$C3 | ||
ret nz | ||
jp (hl) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.