Start terminal driver
This commit is contained in:
13
sw/kernel/devices/terminal.h
Normal file
13
sw/kernel/devices/terminal.h
Normal 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 */
|
||||
|
||||
41
sw/kernel/devices/terminal.s
Normal file
41
sw/kernel/devices/terminal.s
Normal 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
|
||||
Reference in New Issue
Block a user