From 8a461a14c3ceaf42f1483abe51cda47ac785bfc9 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Tue, 2 May 2017 22:09:40 +0200 Subject: add serial device struct other changes: - change from main() to kmain() in crt0.s and kernel.c - new file devices.h to define all address locations for devices - new data type - register_t as volatile uint8_t for registers in devices - size_t from libc --- sw/z80/kernel/kernel.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'sw/z80/kernel/kernel.c') diff --git a/sw/z80/kernel/kernel.c b/sw/z80/kernel/kernel.c index fe87c3d..3db6579 100644 --- a/sw/z80/kernel/kernel.c +++ b/sw/z80/kernel/kernel.c @@ -1,10 +1,7 @@ #include "types.h" -void main(void) +void kmain(void) { - int i, j = 20; - for (i = 0; i < 10; i++) { - j--; - } + } -- cgit v1.2.1 From 4a7f45ee28ac0799ba1ca93fd1683f7858efc54a Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Fri, 2 Jun 2017 16:22:26 +0200 Subject: add serial interface and a few std library functions changes in usart: - new functions to setup the serial comunication settings such as baudrate, parity and stop bits - init function with most common values - transmit and receive functions each with a wrapper to send data blocks changes in libc: - new file stdio.c with basic implementation of putch, printf still a prototype - new file string.c with memcpy() function --- sw/z80/kernel/kernel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sw/z80/kernel/kernel.c') diff --git a/sw/z80/kernel/kernel.c b/sw/z80/kernel/kernel.c index 3db6579..3d5aeb6 100644 --- a/sw/z80/kernel/kernel.c +++ b/sw/z80/kernel/kernel.c @@ -1,7 +1,7 @@ #include "types.h" - +#include "usart.h" void kmain(void) { - + usart_init(USART_BAUDRATE_9600, USART_PARITY_EVEN, USART_STOP_BITS_1); } -- cgit v1.2.1