Minimal device system, implement terminal device and libterminal
All checks were successful
Build documentation / build-and-deploy (push) Successful in 55s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 55s
This commit is contained in:
28
libterminal/Makefile
Normal file
28
libterminal/Makefile
Normal file
@@ -0,0 +1,28 @@
|
||||
cc := clang
|
||||
o :=
|
||||
c :=
|
||||
cflags := -isystem . -isystem ../libmsl
|
||||
buildtype ?= release
|
||||
|
||||
include src.mk
|
||||
include ../generic/flags.mk
|
||||
include ../$(platform)/flags.mk
|
||||
|
||||
all: build/libterminal.a
|
||||
|
||||
build/libterminal.a: $(o)
|
||||
llvm-ar rcs $@ $^
|
||||
|
||||
%.o: %.c
|
||||
$(cc) -c -o $@ $(cflags) $<
|
||||
|
||||
%.o: %.S
|
||||
$(cc) -c -o $@ $(cflags) $<
|
||||
|
||||
clean:
|
||||
rm -f $(o) build/libterminal.a
|
||||
|
||||
format:
|
||||
clang-format -i $$(git ls-files '*.c' '*.h')
|
||||
|
||||
.PHONY: all clean format
|
||||
1
libterminal/src.mk
Normal file
1
libterminal/src.mk
Normal file
@@ -0,0 +1 @@
|
||||
include terminal/src.mk
|
||||
1
libterminal/terminal/.gitignore
vendored
Normal file
1
libterminal/terminal/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.o
|
||||
8
libterminal/terminal/device.h
Normal file
8
libterminal/terminal/device.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef _LIBTERMINAL_TERMINAL_DEVICE_H
|
||||
#define _LIBTERMINAL_TERMINAL_DEVICE_H
|
||||
|
||||
#define TERMINAL_DEVICE 1
|
||||
|
||||
#include <m/terminal_device.h>
|
||||
|
||||
#endif // _LIBTERMINAL_TERMINAL_DEVICE_H
|
||||
3
libterminal/terminal/src.mk
Normal file
3
libterminal/terminal/src.mk
Normal file
@@ -0,0 +1,3 @@
|
||||
c += terminal/terminal.c
|
||||
|
||||
o += terminal/terminal.o
|
||||
8
libterminal/terminal/terminal.c
Normal file
8
libterminal/terminal/terminal.c
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <stddef.h>
|
||||
#include <terminal/device.h>
|
||||
#include <terminal/terminal.h>
|
||||
#include <m/system.h>
|
||||
|
||||
void terminal_print (const char* string, size_t len) {
|
||||
device_do (TERMINAL_DEVICE, TERMINAL_PUTSTR, (void*)string, &len, NULL, NULL);
|
||||
}
|
||||
8
libterminal/terminal/terminal.h
Normal file
8
libterminal/terminal/terminal.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef _LIBTERMINAL_TERMINAL_TERMINAL_H
|
||||
#define _LIBTERMINAL_TERMINAL_TERMINAL_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
void terminal_print (const char* string, size_t len);
|
||||
|
||||
#endif // _LIBTERMINAL_TERMINAL_TERMINAL_H
|
||||
Reference in New Issue
Block a user