Start terminal driver

This commit is contained in:
Byron Lathi
2023-11-28 23:52:27 -08:00
parent e73d8db74c
commit 5b6a4e1442
2 changed files with 54 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
#ifndef _TERMINAL_H
#define _TERMINAL_H
#include <stdint.h>
int8_t terminal_read(uint8_t fd, void* buf, uint8_t nbytes);
int8_t terminal_write(uint8_t fd, const void* buf, uint8_t nbytes);
int8_t terminal_open(const uint8_t* filename);
int8_t terminal_close(uint8_t fd);
#endif /* _TERMINAL_H */

View File

@@ -0,0 +1,41 @@
.MACPACK generic
.autoimport
.export _terminal_read, _terminal_write, _terminal_open, _terminal_close
.data
terminal_buf: .res 128
.code
.proc _terminal_read
.endproc
.proc _terminal_write
.endproc
; terminal_open
; open terminal device
; Inputs: uint8_t* filename
; Outputs: none
; Return Value: 0 on success
; Function: none.
.proc _terminal_open
lda #$0
rts
.endproc
; terminal_close
; close terminal device
; Inputs: int32_t fd
; Outputs: none
; Return Value: 0 on success (but this always failes)
; Function: none.
.proc _terminal_close
lda #$ff ; -1
rts
.endproc